/* ==========================================================================
   Innoviable — main stylesheet (v2)
   Light ("pearl") and dark ("midnight") themes via [data-theme] on <html>.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --blue: #0098da;  /* exact logo blue */
  --green: #00a859; /* exact logo green */
  --ink: #2c4e6b;   /* steel blue: headings, labels, links; 7:1+ on light surfaces (brighter in dark theme) */
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  --gutter-sm: clamp(8px, 1.2vw, 16px);
  --maxw: 1360px;
  --radius: 24px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --header-h: 72px;

  --fs-hero: clamp(2.75rem, 5.4vw, 5.25rem);
  --fs-h2: clamp(2rem, 3.4vw, 3.25rem);
  --fs-h3: clamp(1.375rem, 1.9vw, 1.75rem);
  --fs-lead: clamp(1.0625rem, 1.25vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-label: .75rem;

  --plus-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M5.5 0v11M0 5.5h11' stroke='%23111217' stroke-opacity='.5'/%3E%3C/svg%3E");
  --plus-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M5.5 0v11M0 5.5h11' stroke='%23f2f2f5' stroke-opacity='.5'/%3E%3C/svg%3E");
}

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f3f7;
  --bg-2: #ecebf2;
  --surface: #ffffff;
  --surface-2: #f9f8fb;
  --fg: #111217;
  --fg-2: #3c3f48;
  --muted: #676b75;
  --line: rgba(17, 18, 23, .1);
  --line-strong: rgba(17, 18, 23, .2);
  --blue-t: #0074a8;
  --green-t: #007c3e;
  /* Brand colours as text and fills: the darker -t pair keeps AA contrast on light surfaces */
  --word-blue: var(--blue-t);
  --word-green: var(--green-t);
  --fill: linear-gradient(90deg, var(--blue-t), var(--green-t));
  --on-fill: #fff;
  --error: #c62828;
  --plus: var(--plus-dark);
  --hero-grad: linear-gradient(180deg, #e8e6f3 0%, #f0ebe8 60%, #f4f3f7 100%);
  --belief-grad: linear-gradient(120deg, #dcedfa 0%, #e0f4e8 30%, #e9e4fb 62%, #fbebe1 100%);
  --shadow-1: 0 1px 2px rgba(17, 18, 23, .04), 0 18px 40px -18px rgba(17, 18, 23, .18);
  --tile-1: linear-gradient(150deg, #d7ecfa, #e9e4fb);
  --tile-2: linear-gradient(150deg, #dff3e8, #d9edf9);
  --tile-3: linear-gradient(150deg, #e9e4fb, #fae7dc);
  --tile-4: linear-gradient(150deg, #ddf2ee, #e4e1fa);
  --tile-5: linear-gradient(150deg, #fae8dd, #dcedfa);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090c;
  --bg-2: #0e1015;
  --surface: #12141a;
  --surface-2: #171a21;
  --fg: #f2f2f5;
  --fg-2: #c4c7cf;
  --muted: #8f949e;
  --line: rgba(242, 242, 245, .1);
  --line-strong: rgba(242, 242, 245, .2);
  --blue-t: #45b9f0;
  --green-t: #33d17e;
  --ink: #bcd3e7; /* brighter steel blue, a step above --fg-2, so headings lead over grey body text */
  /* Exact logo colours read well on dark; fills carry dark text (6:1+) */
  --word-blue: var(--blue);
  --word-green: var(--green);
  --fill: linear-gradient(90deg, var(--blue), var(--green));
  --on-fill: var(--bg);
  --error: #ff7b7b;
  --plus: var(--plus-light);
  --hero-grad:
    radial-gradient(60vmax 46vmax at 72% 42%, rgba(0, 152, 216, .16), transparent 62%),
    radial-gradient(44vmax 36vmax at 86% 78%, rgba(0, 168, 88, .12), transparent 62%),
    linear-gradient(180deg, #0c0d13 0%, #08090c 100%);
  --belief-grad: linear-gradient(120deg, #0b2131 0%, #0a251b 30%, #191530 62%, #23170f 100%);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
  --tile-1: linear-gradient(150deg, #0f2535, #1b1834);
  --tile-2: linear-gradient(150deg, #0e2a20, #0f2333);
  --tile-3: linear-gradient(150deg, #1b1834, #2a1a12);
  --tile-4: linear-gradient(150deg, #0d2826, #1b1934);
  --tile-5: linear-gradient(150deg, #2a1a12, #0f2535);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
::selection { background: var(--green-t); color: var(--on-fill); }
:focus-visible { outline: 2px solid var(--blue-t); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.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; }
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200; padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); text-decoration: none; font-weight: 500; transition: top .2s;
}
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }

/* ---------- Type helpers ---------- */
.label {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0;
  font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; line-height: 1.3;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.label .num { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
.label .num::after { content: ""; width: 22px; height: 1px; background: var(--line-strong); }
.mono { font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); }
.badge {
  padding: 4px 8px; border-radius: 999px; font-weight: 600; letter-spacing: .06em; color: var(--on-fill);
  background: var(--fill);
}
.h2 { margin: 0; color: var(--ink); font-size: var(--fs-h2); font-weight: 500; line-height: 1.08; letter-spacing: -.032em; max-width: 21ch; text-wrap: balance; }
.h3 { margin: 0; color: var(--ink); font-size: var(--fs-h3); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.lead { margin: 20px 0 0; font-size: var(--fs-lead); line-height: 1.6; color: var(--fg-2); max-width: 56ch; text-wrap: pretty; }

/* ---------- Rules and frames (hairlines with + marks) ---------- */
.rule { position: relative; height: 1px; margin-inline: 5px; background: var(--line-strong); }
.rule::before, .rule::after {
  content: ""; position: absolute; top: -5px; width: 11px; height: 11px;
  background: var(--plus) center / 11px no-repeat;
}
.rule::before { left: -10px; }
.rule::after { right: -10px; }
.frame {
  position: relative; padding: 12px;
  background:
    var(--plus) 0 0 / 11px no-repeat,
    var(--plus) 100% 0 / 11px no-repeat,
    var(--plus) 0 100% / 11px no-repeat,
    var(--plus) 100% 100% / 11px no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-size: 15px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color .35s, box-shadow .35s, transform .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--fill);
  transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover { color: var(--on-fill); }
.btn:hover::before { transform: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost::before { background: var(--fg); }
.btn--ghost:hover { color: var(--bg); }
.btn--sm { --h: 40px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.circle-btn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--fg); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.circle-btn:hover { background: var(--fg); color: var(--bg); box-shadow: none; }
.circle-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.circle-btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--header-h);
  transition: transform .5s var(--ease), background-color .4s, box-shadow .4s;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-hidden:focus-within { transform: none; } /* keyboard focus brings it back */
.menu-open .site-header { transform: none; background: var(--bg); box-shadow: none; }
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; line-height: 0; border-radius: 6px; flex: none; }
.logo { height: 34px; width: auto; }
[data-theme="light"] .logo--dark,
[data-theme="dark"] .logo--light { display: none; }

.nav {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.nav a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none;
  transition: color .25s, background-color .25s;
}
.nav a:hover { color: var(--fg); background: var(--line); }
.nav a.is-active { color: var(--bg); background: var(--fg); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  position: relative; overflow: hidden;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .3s;
}
.theme-toggle:hover { background: var(--line); }
.ti {
  position: absolute; width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .55s var(--ease), opacity .3s;
}
[data-theme="light"] .ti-sun { transform: translateY(150%) rotate(40deg); opacity: 0; }
[data-theme="dark"] .ti-moon { transform: translateY(-150%) rotate(-40deg); opacity: 0; }

.menu-btn {
  display: none; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); cursor: pointer;
}
.menu-btn span { position: relative; width: 16px; height: 10px; }
.menu-btn i { position: absolute; left: 0; right: 0; height: 1.6px; border-radius: 2px; background: currentColor; transition: transform .45s var(--ease), top .45s var(--ease); }
.menu-btn i:first-child { top: 1px; }
.menu-btn i:last-child { top: 8px; }
.menu-open .menu-btn i:first-child { top: 4.5px; transform: rotate(45deg); }
.menu-open .menu-btn i:last-child { top: 4.5px; transform: rotate(-45deg); }

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 55;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: calc(var(--header-h) + 16px) var(--gutter) 32px;
  background: var(--bg); overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu__nav a {
  display: flex; align-items: baseline; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.75rem, 7vw, 2.5rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.1;
  color: var(--ink); text-decoration: none;
}
.menu__foot { display: flex; flex-direction: column; gap: 8px; }
.menu__foot a { color: var(--fg-2); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: var(--header-h);
}
.hero__bg { position: absolute; inset: 0; z-index: -3; background: var(--hero-grad); }
.hero__orb {
  display: none; position: absolute; z-index: -2;
  right: 8vw; top: 50%; width: min(40vw, 560px); aspect-ratio: 1; border-radius: 50%;
  transform: translateY(-55%);
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #d8edfa 22%, #b6e5d0 48%, #c8bff2 72%, #f2dacd 100%);
  box-shadow: inset -30px -40px 80px rgba(0, 0, 0, .1);
}
[data-theme="dark"] .hero__orb {
  background: radial-gradient(circle at 32% 28%, #d9eefb 0%, #4aa3d6 16%, #17607f 40%, #12383a 62%, #1a1630 100%);
  box-shadow: inset -30px -40px 80px rgba(0, 0, 0, .45), 0 0 120px rgba(0, 152, 216, .18);
}
.no-webgl .hero__orb, .no-gl-hero .hero__orb { display: block; } /* no WebGL, or the context was lost */
.hero__canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); }
.hero__canvas.is-on { opacity: 1; }
.hero__body { flex: 1; display: flex; align-items: center; padding-block: 40px; }
.hero__copy { position: relative; max-width: 640px; }
.js:not(.anim-ready) .hero__copy { opacity: 0; animation: unhide 0s 2s forwards; } /* shows anyway if main.js fails */
@keyframes unhide { to { opacity: 1; } }
.hero__label { margin-bottom: 28px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--green)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }
.hero__title { margin: 0; color: var(--ink); font-size: var(--fs-hero); font-weight: 500; line-height: 1.02; letter-spacing: -.042em; }
.hero__line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.hero__line > span { display: block; }
.rotator { position: relative; display: block; height: 1.14em; overflow: hidden; }
.rotator__word {
  position: absolute; left: 0; top: 0; white-space: nowrap; padding-bottom: .12em;
  color: var(--word-blue);
  opacity: 0;
}
/* Flat logo colours, alternating; "viable." stays green like "Viable" in the logo.
   Light theme uses the darker -t pair so the words stay legible on the pale hero. */
.rotator__word:nth-child(even), .rotator__word:last-child { color: var(--word-green); }
.rotator__word.is-active { opacity: 1; }
.hero__lead { margin: 28px 0 0; max-width: 46ch; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); line-height: 1.6; color: var(--fg-2); text-wrap: pretty; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero__foot { padding-bottom: 22px; }
.hero__meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; }
.hero__scroll { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); text-decoration: none; }
.hero__scroll svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: nudge 2s var(--ease) infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: clamp(88px, 11vw, 160px); }
.section-head { margin-bottom: clamp(40px, 5vw, 72px); }
.section-head--split { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 32px; align-items: start; }
.section-head--split .label { padding-top: .9em; }
.section-head--row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head--row .label { margin-bottom: 24px; }
.section-head--row .lead { margin-top: 14px; }

/* ---------- 01 About ---------- */
.about .section-head { margin-bottom: 32px; }
.statement {
  margin: 0 0 clamp(56px, 7vw, 96px); max-width: 1100px;
  font-size: clamp(1.5rem, 2.7vw, 2.5rem); font-weight: 450; line-height: 1.28; letter-spacing: -.026em;
  color: var(--ink); text-wrap: pretty;
}
.about__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.about__text p { color: var(--fg-2); line-height: 1.7; max-width: 54ch; }
.chips { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 3vw, 48px); }
.value { padding: 22px 0 28px; border-top: 1px solid var(--line-strong); }
.value h3 { margin: 14px 0 8px; color: var(--ink); font-size: 1.25rem; font-weight: 500; letter-spacing: -.015em; }
.value p { margin: 0; font-size: var(--fs-small); line-height: 1.6; color: var(--fg-2); }

/* Platforms strip */
.platforms { padding-block: clamp(36px, 4.5vw, 56px); border-block: 1px solid var(--line); }
.platforms .label { margin-bottom: 22px; }
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.marquee__track { display: inline-flex; white-space: nowrap; will-change: transform; }
html:not(.js) .marquee, .marquee.is-static { -webkit-mask-image: none; mask-image: none; }
html:not(.js) .marquee__track, .marquee.is-static .marquee__track {
  display: flex; flex-wrap: wrap; justify-content: center; row-gap: 14px;
  white-space: normal; will-change: auto; padding-inline: var(--gutter);
}
.marquee__track span { display: inline-flex; align-items: center; font-size: clamp(1.25rem, 2.1vw, 1.875rem); font-weight: 500; letter-spacing: -.02em; color: var(--fg-2); }
.marquee__track span::after { content: ""; width: 11px; height: 11px; margin: 0 clamp(20px, 3vw, 44px); background: var(--plus) center / 11px no-repeat; }

/* ---------- 02 AI (storytelling panel; follows the theme) ---------- */
.panel {
  margin-inline: var(--gutter-sm);
  border-radius: 32px;
  color: var(--fg);
  background:
    radial-gradient(60% 40% at 88% 0%, rgba(0, 152, 216, .12), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(0, 168, 88, .1), transparent 70%),
    var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
[data-theme="dark"] .panel {
  background:
    radial-gradient(60% 40% at 88% 0%, rgba(0, 152, 216, .2), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, rgba(0, 168, 88, .14), transparent 70%),
    #0c0e13;
}
.ai__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 88px); }
.ai__visual { position: relative; }
.ai__stage { position: sticky; top: calc(var(--header-h) + 24px); height: min(72vh, 640px); }
.ai__fallback { display: none; position: absolute; inset: 0; pointer-events: none; }
.no-webgl .ai__fallback, .no-gl-ai .ai__fallback {
  display: block;
  background:
    radial-gradient(circle, var(--green-t) 1.3px, transparent 1.8px) 7px 7px / 14px 14px,
    radial-gradient(circle, var(--blue-t) 1.3px, transparent 1.8px) 0 0 / 14px 14px;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 0, #000 16%, transparent 38%);
  mask-image: radial-gradient(circle at 50% 46%, #000 0, #000 16%, transparent 38%);
  opacity: .75;
}
.ai__canvas {
  display: block; width: 100%; height: 100%; border-radius: 18px;
  background:
    radial-gradient(circle at 42% 40%, rgba(0, 152, 216, .1), transparent 45%),
    radial-gradient(circle at 60% 60%, rgba(0, 168, 88, .08), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(108, 77, 255, .04), transparent 65%),
    var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  transition: background-color .4s;
}
[data-theme="dark"] .ai__canvas {
  background: radial-gradient(circle at 50% 46%, rgba(69, 185, 240, .07), transparent 62%), rgba(255, 255, 255, .015);
  box-shadow: inset 0 0 0 1px var(--line);
}
.ai__hud { position: absolute; left: 32px; right: 32px; bottom: 30px; display: flex; justify-content: space-between; pointer-events: none; }
.ai__count b { color: var(--ink); font-weight: 500; }
.ai__name { color: var(--ink); }
.pillar { scroll-margin-top: calc(var(--header-h) + 24px); min-height: min(72vh, 640px); display: flex; flex-direction: column; justify-content: center; padding-block: 48px; border-top: 1px solid var(--line); transition: opacity .6s var(--ease); }
.pillar:first-child { border-top: 0; }
.js .ai--story .pillar { opacity: .35; }
.js .ai--story .pillar.is-active { opacity: 1; }
.pillar__num { margin-bottom: 18px; }
.pillar .h3 { margin-bottom: 16px; font-size: clamp(1.625rem, 2.4vw, 2.25rem); letter-spacing: -.025em; }
.pillar p { color: var(--fg-2); line-height: 1.7; max-width: 52ch; }
.ticks { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.ticks li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.ticks li::before { content: ""; width: 11px; height: 11px; flex: none; background: var(--plus) center / 11px no-repeat; }

/* ---------- 03 Process ---------- */
.steps-wrap { position: relative; }
.steps__line { position: absolute; left: 0; right: 0; top: 5px; height: 1px; background: var(--line-strong); }
.steps__line i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); transform-origin: left; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 44px); }
.step { position: relative; padding-top: 34px; }
.step__dot { position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--fg); transition: background-color .4s; }
.step.is-on .step__dot { background: var(--green); box-shadow: none; }
.step h3 { margin: 14px 0 10px; color: var(--ink); font-size: 1.375rem; font-weight: 500; letter-spacing: -.02em; }
.step p { margin: 0; font-size: var(--fs-small); line-height: 1.65; color: var(--fg-2); }

/* ---------- 04 Services ---------- */
.services { padding-top: 0; scroll-margin-top: calc(var(--header-h) + 24px); }
.services > .wrap > .rule { margin-bottom: clamp(56px, 7vw, 96px); }
.services__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.services__intro { position: sticky; top: calc(var(--header-h) + 32px); }
.services__intro .label { margin-bottom: 24px; }
.services__intro p { margin: 20px 0 28px; max-width: 46ch; line-height: 1.7; color: var(--fg-2); }
.svc { border-top: 1px solid var(--line-strong); }
.svc:last-child { border-bottom: 1px solid var(--line-strong); }
.svc summary {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 30px; align-items: center; gap: 12px;
  padding: 24px 0; cursor: pointer; list-style: none; border-radius: 4px;
}
.svc summary::-webkit-details-marker { display: none; }
.svc__title { color: var(--ink); font-size: clamp(1.25rem, 1.9vw, 1.625rem); font-weight: 500; letter-spacing: -.02em; transition: transform .45s var(--ease); }
.svc summary:hover .svc__title { transform: translateX(6px); }
.svc__icon { position: relative; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-strong); transition: background-color .3s; }
.svc__icon::before, .svc__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -.75px 0 0 -5px;
  background: var(--fg); transition: transform .4s var(--ease), background-color .3s;
}
.svc__icon::after { transform: rotate(90deg); }
.svc[open] .svc__icon { background: var(--fg); box-shadow: none; }
.svc[open] .svc__icon::before, .svc[open] .svc__icon::after { background: var(--bg); }
.svc[open] .svc__icon::after { transform: rotate(0deg); }
.svc__body p { margin: 0; padding: 0 44px 28px 60px; max-width: 64ch; line-height: 1.7; color: var(--fg-2); }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .svc::details-content { height: 0; overflow: clip; transition: height .5s var(--ease), content-visibility .5s allow-discrete; }
  .svc[open]::details-content { height: auto; }
}
.stack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin: clamp(64px, 8vw, 112px) 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.stack dt { font-family: var(--mono); font-size: var(--fs-label); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.stack dd { margin: 10px 0 0; font-size: var(--fs-small); line-height: 1.55; }

/* ---------- Belief ---------- */
.belief { padding-bottom: clamp(88px, 11vw, 160px); }
.belief__panel {
  padding: clamp(40px, 7vw, 112px) clamp(28px, 6vw, 96px); border-radius: var(--radius);
  background: var(--belief-grad); background-size: 220% 220%; background-position: 0% 0%;
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { background-position: 100% 100%; } }
.belief__quote { margin: 24px 0 0; color: var(--ink); max-width: 26ch; font-size: clamp(1.75rem, 3.4vw, 3rem); font-weight: 450; line-height: 1.18; letter-spacing: -.03em; text-wrap: balance; }

/* ---------- 05 Work ---------- */
.work { padding-top: 0; scroll-margin-top: calc(var(--header-h) + 24px); }
.carousel-nav { display: flex; gap: 10px; flex: none; }
.work__track {
  display: flex; gap: clamp(16px, 2vw, 28px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 8px max(var(--gutter), calc((100vw - var(--maxw)) / 2)) 24px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2));
}
.work__track::-webkit-scrollbar { display: none; }
.case { flex: 0 0 auto; width: clamp(260px, 27vw, 380px); margin: 0; scroll-snap-align: start; perspective: 900px; }
.case__media {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5;
  padding: 0; border: 0; border-radius: 22px; overflow: hidden; cursor: zoom-in;
  background: var(--tile, var(--tile-1)); box-shadow: var(--shadow-1);
  transform-style: preserve-3d; transition: transform .7s var(--ease);
}
.case:nth-child(1) { --tile: var(--tile-1); }
.case:nth-child(2) { --tile: var(--tile-2); }
.case:nth-child(3) { --tile: var(--tile-3); }
.case:nth-child(4) { --tile: var(--tile-4); }
.case:nth-child(5) { --tile: var(--tile-5); }
.device {
  width: 54%; aspect-ratio: 10 / 17; padding: 6px; border-radius: 24px; background: #0c0d10;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 30px 60px -22px rgba(0, 0, 0, .5);
  transform: translateZ(30px); transition: transform .7s var(--ease);
}
.device img { width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 19px; background: #fff; }
.case__media:hover .device { transform: translateZ(50px) translateY(-6px); }
.case__glare {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .5), transparent 55%);
  mix-blend-mode: soft-light;
}
.case__media:hover .case__glare { opacity: 1; }
.case figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 16px; }
.case__client { color: var(--ink); font-weight: 500; font-size: 1.0625rem; }
.case__type { font-size: var(--fs-small); color: var(--muted); }

/* Lightbox */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent); color: var(--fg);
}
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; justify-self: center; }
.lightbox img { max-height: 82vh; width: auto; border-radius: 18px; box-shadow: var(--shadow-1); }
.lightbox figcaption { font-size: var(--fs-small); color: var(--fg-2); }
.lightbox .circle-btn { margin: 16px; background: var(--surface); }
.lightbox__close { position: absolute; top: 8px; right: 8px; }

/* ---------- 06 Contact ---------- */
.cta { padding-bottom: clamp(48px, 6vw, 80px); margin-bottom: clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.cta .label { margin-bottom: 28px; }
.cta__title { margin: 0; color: var(--ink); max-width: 16ch; font-size: clamp(2.5rem, 5.6vw, 5rem); font-weight: 500; line-height: 1.02; letter-spacing: -.042em; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; border: 0; }
.topics legend { padding: 0; color: var(--ink); margin-bottom: 14px; font-size: var(--fs-small); font-weight: 500; }
.topics label { position: relative; cursor: pointer; }
.topics input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.topics label span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.topics label:hover span { box-shadow: inset 0 0 0 1px var(--fg); color: var(--fg); }
.topics input:checked + span { background: var(--fg); color: var(--bg); box-shadow: none; }
.topics input:focus-visible + span { outline: 2px solid var(--blue-t); outline-offset: 2px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; color: var(--ink); margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.field input, .field textarea {
  display: block; width: 100%; padding: 13px 16px; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--fg); font: 400 1rem/1.5 var(--font);
  box-shadow: inset 0 0 0 1px var(--line-strong); outline: none;
  transition: box-shadow .25s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--fg), 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.field.is-invalid input, .field.is-invalid textarea { box-shadow: inset 0 0 0 1.5px var(--error); }
.field.is-invalid label { color: var(--error); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-top: 8px; }
.form-status { flex: 1 1 240px; margin: 0; min-height: 1.5em; font-size: var(--fs-small); color: var(--muted); }
.form-status.is-success { color: var(--green-t); }
.form-status.is-error { color: var(--error); }
.contact__info { display: flex; flex-direction: column; gap: 28px; padding: 28px; border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.info-block .label { margin-bottom: 10px; }
.info-block address, .info-block a { font-style: normal; font-size: 1.125rem; line-height: 1.5; color: var(--ink); text-decoration: none; }
.info-block a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Footer ---------- */
.site-footer { padding-bottom: 28px; }
.footer__grid { display: grid; grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.4fr)); gap: 32px; padding-block: 56px; }
.footer__brand .logo { height: 36px; margin-bottom: 18px; }
.footer__brand p { margin: 0 0 6px; font-size: var(--fs-small); }
.footer__brand a { color: var(--ink); }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: var(--fs-small); }
.footer__col .label { margin-bottom: 6px; }
.footer__col a { color: var(--ink); text-decoration: none; transition: color .25s; }
.footer__col a:hover { color: var(--fg); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.footer__bottom a { color: inherit; text-decoration: none; }
.footer__bottom a:hover { color: var(--fg); }

/* Theme switch: circular reveal (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .section-head--split, .about__grid, .ai__layout, .services__grid, .contact__grid { grid-template-columns: 1fr; }
  .section-head--split .label { padding-top: 0; }
  .services__intro { position: static; }
  .ai__stage { position: relative; top: auto; height: 360px; }
  .pillar { min-height: 0; padding-block: 36px; }
  .js .ai--story .pillar { opacity: 1; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps__line { display: none; }
}
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .logo { height: 30px; }
  .header-cta { display: none; }
  .hide-sm { display: none; }
  /* One-screen hero: copy at the bottom, the glass form (or fallback orb) in the space above.
     The padding is only the minimum room kept for the form on very short screens. */
  .hero__body { align-items: flex-end; padding-top: 16px; padding-bottom: 20px; }
  .hero__copy { padding-top: clamp(112px, 16svh, 200px); }
  .hero__lead { margin-top: 20px; }
  .hero__ctas { gap: 8px; margin-top: 24px; }
  .hero__ctas .btn { --h: 44px; padding: 0 16px; font-size: 14px; }
  .hero__orb { top: calc(var(--header-h) + 2svh); right: 50%; width: min(46vw, 17svh); transform: translateX(50%); }
  .values, .steps, .field-row { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .section-head--row { flex-direction: column; align-items: flex-start; }
  .svc summary { grid-template-columns: 36px minmax(0, 1fr) 30px; }
  .svc__body p { padding: 0 0 24px 48px; }
  .lightbox[open] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; padding: 64px 16px 0; }
  .lightbox img { max-height: 70vh; }
  .lightbox__prev { grid-row: 2; justify-self: start; }
  .lightbox__next { grid-row: 2; justify-self: end; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .js:not(.anim-ready) .hero__copy { opacity: 1; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
