/* ============================================
   THYNKIA 2026: site styles (light theme)
   Every page shares this file: tokens, frame, nav, footer, components.
   ============================================ */

/* Fonts are served from this site (no third-party request blocks the first paint). Latin subset, covers Spanish. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2'); }
/* Until Inter arrives, Arial is resized to Inter's proportions so the text does not jump when it swaps. */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'); size-adjust: 107.06%; ascent-override: 90.49%; descent-override: 22.56%; line-gap-override: 0%; }

:root {
  --frame: #ebebe8;          /* outer page frame */
  --ground: #f4f4f1;         /* section ground */
  --surface: #ffffff;        /* windows and panels */
  --tint: #efeeea;           /* one tone step below surface */
  --ink: #0b0f1a;
  --ink-2: #2b3040;
  --muted: #5b6070;
  --accent: #5b45e0;         /* Thynkia purple: white text on it passes AA */
  --accent-soft: #e9e5fc;
  --ok: #0f7a55;
  --ok-soft: #e3f3ec;
  --warn: #a45c00;
  --sky: #cfe2f3;

  --sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;

  --r-xl: 28px;
  --r-l: 20px;
  --r-m: 14px;
  --gutter: clamp(16px, 3vw, 32px);
  --maxw: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 110px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--frame);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

.skip { position: absolute; left: 16px; top: -80px; z-index: 300; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.skip:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Type ---------- */
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.h-display { font-size: clamp(40px, 5.4vw, 84px); line-height: 1.02; font-weight: 500; letter-spacing: -.035em; text-wrap: balance; }
.h-section { font-size: clamp(34px, 4.2vw, 64px); line-height: 1.03; font-weight: 500; letter-spacing: -.032em; text-wrap: balance; }
.h-card { font-size: clamp(21px, 1.7vw, 26px); line-height: 1.15; font-weight: 500; letter-spacing: -.02em; }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.small { font-size: 14px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Frame: every section is a window inside the grey frame ---------- */
.frame { padding: 14px; }
.window { position: relative; border-radius: var(--r-xl); overflow: hidden; }
.window + .window, .window + .band, .band + .window { margin-top: 14px; }
.w-white { background: var(--surface); }
.w-ink { background: var(--ink); color: #f3f3f0; }
.band { padding: clamp(80px, 9vw, 150px) 0; }
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.pad { padding: clamp(72px, 8.5vw, 140px) 0; }
/* heading first, its subtitle underneath, both left-aligned (same reading order as How we work) */
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; justify-items: start; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head .lead { max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 12px; border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: transform .25s var(--ease), background-color .25s, box-shadow .25s; }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: #fff; padding: 8px 8px 8px 24px; }
.btn-ink .dot, .btn-accent .dot { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; transition: transform .25s var(--ease); }
.btn-ink:hover .dot, .btn-accent:hover .dot { transform: translateX(3px); }
.btn-ink:hover { background: #1c2233; }
.btn-accent { background: var(--accent); color: #fff; padding: 6px 6px 6px 18px; }
.btn-accent:hover { background: #4a35c9; }
.btn-soft { background: var(--surface); color: var(--ink); padding: 14px 24px; }
.btn-soft:hover { background: #f7f7f5; }
.btn-line { color: var(--ink); padding: 13px 22px; background: transparent; box-shadow: inset 0 0 0 1.5px rgba(11,15,26,.18); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; color: var(--ink); }
.link-arrow span { transition: transform .25s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }
.chev { width: 14px; height: 14px; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 18px; letter-spacing: -.025em; }
.brand img { width: 34px; height: 34px; flex: none; border-radius: 50%; }

/* ---------- Navigation (floating, glass once the page scrolls) ---------- */
.nav-shell { position: fixed; z-index: 100; top: 28px; left: 0; right: 0; display: flex; justify-content: center; padding-inline: 28px; pointer-events: none; transition: top .35s var(--ease); }
.nav { pointer-events: auto; width: 100%; max-width: 900px; display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 18px; border-radius: 999px; background: rgba(255,255,255,.86); box-shadow: 0 1px 2px rgba(11,15,26,.06); transition: background-color .35s, box-shadow .35s; }
.nav-shell.scrolled { top: 14px; }
.nav-shell.scrolled .nav { background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 30px -12px rgba(11,15,26,.25), inset 0 0 0 1px rgba(255,255,255,.7); }
.nav-links { display: flex; gap: 2px; margin-left: 18px; }
.nav-links a { padding: 8px 13px; border-radius: 999px; font-size: 14.5px; color: var(--ink-2); text-decoration: none; transition: background-color .2s, color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(11,15,26,.06); color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lang { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color .2s; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: rgba(11,15,26,.06); }
.lang-btn svg { width: 16px; height: 16px; }
.lang-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 168px; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 18px 40px -12px rgba(11,15,26,.28), 0 0 0 1px rgba(11,15,26,.06); list-style: none; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s var(--ease), visibility .2s; }
.lang-menu.open { opacity: 1; visibility: visible; transform: none; }
.lang-menu button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; text-align: left; }
.lang-menu button:hover { background: var(--ground); }
.lang-menu button[aria-checked="true"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav-burger { display: none; width: 42px; height: 42px; border-radius: 50%; place-items: center; }
.nav-burger:hover { background: rgba(11,15,26,.06); }
.nav-burger svg { width: 20px; height: 20px; }
.nav-panel { display: none; }

@media (max-width: 900px) {
  .nav-shell { top: 22px; padding-inline: 16px; }
  .nav { padding-left: 14px; }
  .nav-links, .nav .lang { display: none; }
  .nav-burger { display: grid; }
  .nav .btn-accent { font-size: 13.5px; padding: 9px 14px; }
  .nav .btn-accent .dot { display: none; }
  .nav-panel { display: block; position: absolute; left: 16px; right: 16px; top: calc(100% + 10px); padding: 10px; border-radius: 22px; background: #fff; box-shadow: 0 24px 50px -16px rgba(11,15,26,.35); pointer-events: auto; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
  .nav-panel.open { opacity: 1; visibility: visible; transform: none; }
  .nav-panel a { display: block; padding: 14px 16px; border-radius: 14px; font-size: 18px; text-decoration: none; }
  .nav-panel a:hover { background: var(--ground); }
  .nav-panel .lang-row { display: flex; gap: 8px; padding: 12px 16px 6px; }
  .nav-panel .lang-row button { padding: 8px 16px; border-radius: 999px; background: var(--ground); font-size: 14px; font-weight: 500; }
  .nav-panel .lang-row button[aria-checked="true"] { background: var(--ink); color: #fff; }
}

/* ---------- Sub-page header (same window, shorter, sky poster) ---------- */
.page-head { min-height: 62vh; display: flex; align-items: flex-end; background: var(--sky) url('/media/hero-sky-poster.webp') center 30% / cover; }
.page-head::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.18); }
.page-head .wrap { position: relative; padding-top: 170px; padding-bottom: clamp(48px, 6vw, 88px); }
.page-head h1 { max-width: 16ch; }
.page-head .lead { margin-top: 22px; }

/* ---------- Footer ---------- */
.footer { padding: clamp(64px, 7vw, 110px) 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 40px 32px; }
.foot-grid h2 { font-size: 14px; font-weight: 500; color: #9aa0ad; margin-bottom: 16px; }
.foot-grid ul { list-style: none; display: grid; gap: 10px; }
.foot-grid a, .foot-grid button { color: #e9e9e4; text-decoration: none; font-size: 15.5px; transition: color .2s; }
.foot-grid a:hover, .foot-grid button:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.foot-grid .btn, .foot-grid .btn:hover { color: #fff; text-decoration: none; }
.foot-intro p { color: #b9bdc7; font-size: 16px; max-width: 32ch; margin-top: 18px; }
.foot-intro .brand { color: #fff; }
.foot-intro .btn { margin-top: 26px; }
/* Footer wordmark: drawn as particles by site.js (the text is the fallback without script) */
.foot-mark { position: relative; margin-top: clamp(48px, 6vw, 90px); height: clamp(90px, 13vw, 210px); user-select: none; }
.foot-mark canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.foot-mark-text { pointer-events: none; display: block; font-size: clamp(80px, 14vw, 230px); line-height: .9; font-weight: 600; letter-spacing: -.06em; color: #f3f3f0; }
.foot-mark-text span { color: var(--accent); }
.js .foot-mark.drawn .foot-mark-text { visibility: hidden; }
.foot-base { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; padding: 22px 0 28px; color: #9aa0ad; font-size: 13.5px; }
.foot-base a, .foot-base button { color: #c9ccd4; text-decoration: none; font-size: 13.5px; }
.foot-base a:hover, .foot-base button:hover { color: #fff; }
@media (max-width: 1000px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-intro { grid-column: 1 / -1; } }

/* ---------- Cookie banner ---------- */
.ck-banner { position: fixed; z-index: 200; left: 16px; right: 16px; bottom: 16px; max-width: 720px; margin-inline: auto; display: flex; gap: 16px 22px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px -18px rgba(11,15,26,.4), 0 0 0 1px rgba(11,15,26,.05); }
.ck-banner p { flex: 1 1 300px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.ck-banner a { color: var(--ink); }
.ck-actions { display: flex; gap: 8px; }
.ck-btn { padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.ck-accept { background: var(--ink); color: #fff; }
.ck-reject { box-shadow: inset 0 0 0 1.5px rgba(11,15,26,.18); }

/* ---------- Entrance motion (content stays visible without script) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 75ms); }
  .js .rise.in { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .frame { padding: 8px; }
  .window { border-radius: 22px; }
  .window + .window, .window + .band, .band + .window { margin-top: 8px; }
}

/* Animated sections run only while on screen (site.js adds .vis) */
.js [data-anim-zone]:not(.vis), .js [data-anim-zone]:not(.vis) * { animation-play-state: paused !important; }
