/* =========================================================
   Mizan Adlani — portfolio
   Fluid design system: clamp() type & space, intrinsic grids,
   container queries for components, svh-safe heights.
   ========================================================= */

/* ---------- Fonts (self-hosted, Latin subset, variable) ---------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-500-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-400-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  /* Root size grows gently on very large monitors so ultrawide
     layouts scale up instead of floating tiny in the middle. */
  font-size: clamp(100%, 0.25vw + 0.75rem, 125%);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Fluid type scale */
  --step--2: clamp(0.72rem, 0.7rem + 0.1vw, 0.8rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.92rem);
  --step-0: clamp(0.98rem, 0.94rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.12rem, 1.04rem + 0.4vw, 1.35rem);
  --step-2: clamp(1.35rem, 1.18rem + 0.85vw, 1.9rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.75vw, 3rem);
  --step-4: clamp(2.1rem, 1.5rem + 3vw, 4.25rem);

  /* Fluid space scale */
  --space-2xs: clamp(0.25rem, 0.23rem + 0.1vw, 0.35rem);
  --space-xs: clamp(0.5rem, 0.46rem + 0.2vw, 0.65rem);
  --space-s: clamp(0.75rem, 0.69rem + 0.3vw, 1rem);
  --space-m: clamp(1rem, 0.9rem + 0.5vw, 1.4rem);
  --space-l: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --space-xl: clamp(2rem, 1.6rem + 2vw, 3.5rem);
  --space-2xl: clamp(3rem, 2.2rem + 4vw, 6rem);
  --section-y: clamp(4rem, 2.5rem + 7vw, 9rem);

  --gutter: clamp(1rem, 0.5rem + 3vw, 3rem);
  --max: 82rem;          /* standard content */
  --max-wide: 96rem;     /* hero & bands */
  --measure: 62ch;       /* readable line length */

  --radius-s: 0.6rem;
  --radius-m: 1rem;
  --radius-l: clamp(1.1rem, 0.9rem + 1vw, 1.75rem);
  --header-h: 4.25rem;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Light theme */
  --bg: #f5f4ef;
  --bg-2: #eceae2;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --text: #121317;
  --text-2: #33363e;
  --muted: #5c606b;
  --line: rgba(18, 19, 23, 0.1);
  --line-strong: rgba(18, 19, 23, 0.2);
  --accent: #3d6b00;          /* accent used as text / lines on bg */
  --accent-fill: #c6f35a;     /* accent used as a fill */
  --on-accent: #0f1406;
  --accent-2: #4f5bd5;
  --accent-soft: rgba(110, 170, 0, 0.14);
  --glow-a: rgba(198, 243, 90, 0.45);
  --glow-b: rgba(120, 132, 255, 0.28);
  --grid-line: rgba(18, 19, 23, 0.045);
  --shadow: 0 1px 2px rgba(18, 19, 23, 0.06), 0 12px 32px -12px rgba(18, 19, 23, 0.18);
  --header-bg: rgba(245, 244, 239, 0.78);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f;
    --bg-2: #101217;
    --surface: #14161c;
    --surface-2: #191c23;
    --text: #eef0f4;
    --text-2: #c9cdd6;
    --muted: #9aa0ad;
    --line: rgba(238, 240, 244, 0.09);
    --line-strong: rgba(238, 240, 244, 0.18);
    --accent: #c6f35a;
    --accent-fill: #c6f35a;
    --on-accent: #0f1406;
    --accent-2: #9aa4ff;
    --accent-soft: rgba(198, 243, 90, 0.12);
    --glow-a: rgba(198, 243, 90, 0.16);
    --glow-b: rgba(120, 132, 255, 0.2);
    --grid-line: rgba(238, 240, 244, 0.035);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(11, 12, 15, 0.72);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --bg-2: #101217;
  --surface: #14161c;
  --surface-2: #191c23;
  --text: #eef0f4;
  --text-2: #c9cdd6;
  --muted: #9aa0ad;
  --line: rgba(238, 240, 244, 0.09);
  --line-strong: rgba(238, 240, 244, 0.18);
  --accent: #c6f35a;
  --accent-fill: #c6f35a;
  --on-accent: #0f1406;
  --accent-2: #9aa4ff;
  --accent-soft: rgba(198, 243, 90, 0.12);
  --glow-a: rgba(198, 243, 90, 0.16);
  --glow-b: rgba(120, 132, 255, 0.2);
  --grid-line: rgba(238, 240, 244, 0.035);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(11, 12, 15, 0.72);
  color-scheme: dark;
}

/* Ultrawide (≈2800px+): scale the whole composition one more step
   and widen containers so the page fills the screen intentionally. */
@media (min-width: 175em) {
  :root { font-size: 137.5%; --max: 86rem; --max-wide: 100rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top) + 1rem);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  /* Guard only; QA verifies no element actually crosses the viewport edge. */
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
button { font: inherit; color: inherit; }
strong { font-weight: 650; color: var(--text); }
em { font-style: normal; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: -0.01em; }

.skip-link {
  position: fixed; z-index: 200;
  top: calc(env(safe-area-inset-top) + 0.5rem); left: 0.5rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-s);
  background: var(--accent-fill); color: var(--on-accent); font-weight: 600;
  transform: translateY(-200%); transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}
.container--wide { max-width: calc(var(--max-wide) + var(--gutter) * 2); }

.section { padding-block: var(--section-y); position: relative; }
.section + .section { padding-top: calc(var(--section-y) * 0.7); }

.section-head { display: grid; gap: var(--space-s); margin-bottom: var(--space-xl); max-width: 48rem; }
.kicker {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-mono); font-size: var(--step--1);
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.kicker span {
  display: inline-grid; place-items: center;
  min-width: 2.2em; padding: 0.15em 0.45em; border-radius: 99px;
  border: 1px solid var(--line-strong); color: var(--accent);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700; line-height: 1.02; letter-spacing: -0.035em;
  text-wrap: balance;
}
.section-lede { color: var(--muted); font-size: var(--step-1); max-width: var(--measure); text-wrap: pretty; line-height: 1.55; }

/* ---------- Background decoration ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: clamp(48px, 4vw, 96px) clamp(48px, 4vw, 96px);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.bg-glow--a { width: 60vmax; height: 40vmax; top: -18vmax; right: -12vmax; background: var(--glow-a); }
.bg-glow--b { width: 50vmax; height: 36vmax; top: 10vmax; left: -22vmax; background: var(--glow-b); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 44px; padding: 0.7em 1.25em;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: var(--step-0); line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 8px 24px -10px var(--glow-a); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-sm { min-height: 44px; padding: 0.5em 1em; font-size: var(--step--1); }
.btn-lg { min-height: 52px; padding: 0.85em 1.5em; }
.btn:active { transform: translateY(1px) scale(0.99); }
@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px var(--glow-a); }
  .btn-ghost:hover { border-color: var(--text); }
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
@media (hover: hover) { .icon-btn:hover { border-color: var(--text); } }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-s);
  min-height: var(--header-h);
  max-width: calc(var(--max-wide) + var(--gutter) * 2);
}

.brand { display: inline-flex; flex: none; align-items: center; gap: 0.65rem; text-decoration: none; min-width: 44px; min-height: 44px; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 2.5rem; height: 2.5rem; border-radius: 0.8rem;
  background: var(--text); color: var(--bg);
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: -0.04em;
}
.brand-photo {
  display: block; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  object-fit: cover; box-shadow: 0 0 0 2px var(--accent-fill), 0 4px 12px -4px rgba(0,0,0,.5);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; letter-spacing: -0.02em; white-space: nowrap; }

.nav-links { display: none; flex: none; gap: clamp(0.1rem, 0.6vw, 0.6rem); }
.nav-links a { white-space: nowrap; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding-inline: 0.8rem; border-radius: 999px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: var(--step--1);
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a[aria-current="true"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) { .nav-links a:hover { color: var(--text); } }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }

.cmdk-trigger {
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 44px; min-width: 44px; padding: 0 0.75rem;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); cursor: pointer;
  font-size: var(--step--1);
}
.cmdk-trigger .icon { color: var(--text); }
.cmdk-trigger__kbd, .nav-cta { display: none; }
/* Label stays in the accessibility tree when visually hidden */
.cmdk-trigger__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cmdk-trigger__kbd {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 0.15rem 0.4rem; border-radius: 0.35rem; border: 1px solid var(--line-strong); color: var(--muted);
}
@media (hover: hover) { .cmdk-trigger:hover { border-color: var(--text); } }

/* Background music toggle: note icon when off, animated equaliser when playing */
.music-toggle { position: relative; }
.music-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.music-eq i { display: block; width: 3px; height: 30%; border-radius: 2px; background: var(--accent); animation: music-eq 0.9s ease-in-out infinite alternate; }
.music-eq i:nth-child(2) { animation-delay: .25s; } .music-eq i:nth-child(3) { animation-delay: .5s; }
@keyframes music-eq { to { height: 100%; } }
.music-toggle.is-playing .icon-note { display: none; }
.music-toggle.is-playing .music-eq { display: inline-flex; }
.music-toggle.is-playing { border-color: var(--accent); }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 22px; height: 2px; border-radius: 2px; background: var(--muted); transform: rotate(-45deg); }
.music-toggle[hidden] { display: none; }
/* Narrow phones: Quick jump lives in the menu, freeing header room for the music toggle */
@media (max-width: 29.99em) { .cmdk-trigger { display: none; } }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.menu-toggle__bars { display: grid; gap: 5px; width: 18px; }
.menu-toggle__bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.3s var(--ease); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Very narrow phones: keep the mark, drop the wordmark. */
/* Keep the accessible name, just hide the wordmark visually */
@media (max-width: 22.4em) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Room for the command-palette label */
@media (min-width: 40em) {
  .cmdk-trigger__kbd { display: inline-block; }
  .nav-cta { display: inline-flex; }
}

/* Full navigation once the six links genuinely fit (JS refines this
   by measuring; see main.js "fitNav"). */
@media (min-width: 64em) {
  .nav-links { display: flex; }
  .menu-toggle { display: none; }
}
@media (min-width: 64em) and (max-width: 74.99em) { .nav-cta { display: none; } }
@media (min-width: 88em) { .cmdk-trigger__label { position: static; width: auto; height: auto; overflow: visible; clip: auto; } }

/* JS measured overflow → force compact nav regardless of width */
.nav.is-compact .nav-links { display: none; }
.nav.is-compact .menu-toggle { display: inline-grid; }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 40;
  padding: calc(var(--header-h) + env(safe-area-inset-top) + var(--space-m))
           max(var(--gutter), env(safe-area-inset-right))
           calc(var(--space-l) + env(safe-area-inset-bottom))
           max(var(--gutter), env(safe-area-inset-left));
  background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain;
  animation: menu-in 0.35s var(--ease);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__inner { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-l); min-height: 100%; max-width: 40rem; margin-inline: auto; }
.mobile-menu__links { display: grid; }
.mobile-menu__links a {
  display: flex; align-items: baseline; gap: 1rem;
  min-height: 44px; padding-block: 0.55rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.5rem, 1rem + 3.5vw, 2.4rem); letter-spacing: -0.03em;
  text-decoration: none;
}
/* Short landscape phones: two columns so links stay reachable */
@media (max-height: 30em) and (orientation: landscape) {
  .mobile-menu__links { grid-template-columns: 1fr 1fr; column-gap: var(--space-l); }
  .mobile-menu__links a { font-size: 1.25rem; padding-block: 0.35rem; }
}
.mobile-menu__links span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); letter-spacing: 0; }
.mobile-menu__foot { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.mobile-menu__foot .btn { flex: 1 1 10rem; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(2rem, 1rem + 5vw, 6rem) clamp(3rem, 2rem + 5vw, 7rem);
  /* Height is content-driven; svh keeps it tidy on tall screens
     without forcing overflow on short/landscape ones. */
  min-height: min(calc(100svh - var(--header-h)), 62rem);
  display: grid; align-items: center;
}
.hero__grid {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}
.hero__copy { container-type: inline-size; isolation: isolate; display: grid; gap: var(--space-m); min-width: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem; justify-self: start;
  padding: 0.4rem 0.85rem 0.4rem 0.65rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--step--1); color: var(--text-2); font-weight: 500;
  max-width: 100%;
}
.pulse { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #3fcf6a; flex: none; box-shadow: 0 0 0 0 rgba(63, 207, 106, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 0.55rem rgba(63, 207, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 207, 106, 0); } }

.hero__title {
  font-family: var(--font-display);
  /* Scales with its own column, not the viewport */
  font-size: clamp(2.2rem, 11.5cqi, 6.5rem);
  font-weight: 750; line-height: 0.98; letter-spacing: -0.045em;
  text-wrap: balance;
}
.hero__title em {
  position: relative; white-space: nowrap;
  background: linear-gradient(100deg, var(--text) 0%, var(--accent-2) 120%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero__title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.12em;
  background: var(--accent-fill); border-radius: 99px; z-index: -1; opacity: 0.9;
}
.hero__lede { font-size: var(--step-1); color: var(--muted); max-width: 40rem; line-height: 1.55; text-wrap: pretty; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero__kpis {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-s);
  padding-top: var(--space-m); margin-top: var(--space-2xs);
  border-top: 1px solid var(--line);
  max-width: 34rem;
}
.hero__kpis dt { font-size: var(--step--2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hero__kpis dd { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.03em; }

/* Phones: full-width CTAs are easier to tap */
@container (max-width: 26rem) {
  .hero__cta .btn { flex: 1 1 100%; }
}

.hero__visual {
  position: relative; min-width: 0;
  width: 100%; max-width: 30rem; justify-self: center;
  /* Leave inner room for the floating cards so they never exceed the viewport */
  padding: 1.25rem 0.5rem 2.75rem;
}
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.portrait::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  background: linear-gradient(to top, rgba(0,0,0,0.25), transparent 35%);
}
.portrait picture, .photo picture { display: block; width: 100%; height: 100%; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }

.float-card {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 0.6rem;
  max-width: min(17rem, 78%);
  padding: 0.6rem 0.85rem;
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: var(--step--1); line-height: 1.3; color: var(--text-2);
}
.float-card strong { font-family: var(--font-display); font-size: 1.1em; }
.float-card__icon {
  display: grid; place-items: center; flex: none;
  width: 2rem; height: 2rem; border-radius: 0.6rem;
  background: var(--accent-soft); color: var(--accent);
}
.float-card__icon--up { background: rgba(120, 132, 255, 0.16); color: var(--accent-2); }
.float-card--a { left: 0; bottom: 0.5rem; }
.float-card--b { right: 0; top: 0; }
.float-card--c { right: 0; bottom: 4.5rem; display: none; }

/* Stacked tablet (e.g. 600–900 portrait): a wide landscape crop
   reads better than a tall narrow portrait under the copy. */
@media (min-width: 36em) and (max-width: 51.99em) {
  .hero__visual { max-width: 44rem; }
  .portrait { aspect-ratio: 16 / 10; }
  .portrait img { object-position: 50% 38%; }
  .float-card--c { display: flex; }
}

/* Side-by-side from ~832px. Mobile landscape (e.g. 844×390) also lands here. */
@media (min-width: 52em) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: var(--space-xl); }
  .hero__visual { max-width: 34rem; padding: 2rem 0.5rem 3rem; }
  .float-card--c { display: none; }
}
@media (min-width: 72em) {
  .hero__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--space-2xl); }
  .hero__visual { padding: 2rem 1rem 3rem; }
  .float-card--c { display: flex; }
}
/* Big screens: cards may break out of the frame, there is room */
@media (min-width: 72em) {
  .float-card--a { left: -2rem; }
  .float-card--b { right: -1.5rem; }
  .float-card--c { right: -2.5rem; }
}
/* Ultrawide: bigger composition, still a controlled measure */
@media (min-width: 150em) {
  .hero__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .hero__visual { max-width: 40rem; }
}
/* Short landscape viewports: don't force a tall hero */
@media (max-height: 34em) and (orientation: landscape) {
  .hero { min-height: 0; }
  .hero__visual { max-width: 20rem; }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface-2);
  padding-block: var(--space-m);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track, .marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee__list { display: flex; flex: none; }
.marquee__list li {
  display: inline-flex; align-items: center; gap: clamp(1.5rem, 3vw, 3rem);
  padding-right: clamp(1.5rem, 3vw, 3rem);
  font-family: var(--font-display); font-weight: 650;
  font-size: var(--step-2); letter-spacing: -0.02em; color: var(--muted); white-space: nowrap;
}
.marquee__list li::after { content: "✦"; font-size: 0.55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Stats ---------- */
.stats-wrap { container-type: inline-size; }
.stats { display: grid; gap: clamp(0.6rem, 0.4rem + 0.8vw, 1.1rem); grid-template-columns: 1fr; }
@container (min-width: 19rem) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 48rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.stat {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 0.35rem;
  padding: clamp(0.9rem, 0.7rem + 1vw, 1.6rem);
  border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line);
  min-width: 0;
  transition: transform 0.3s var(--ease), border-color 0.3s;
}
.stat:first-child { background: var(--accent-fill); border-color: transparent; }
.stat:first-child .stat__value, .stat:first-child .stat__label { color: var(--on-accent); }
.stat:first-child .stat__meta { color: rgba(15, 20, 6, 0.7); }
.stat__value {
  font-family: var(--font-display); font-weight: 750;
  font-size: clamp(1.55rem, 19cqi, 3.4rem);
  line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
  margin-bottom: auto; padding-bottom: 0.9rem;
  white-space: nowrap;
}
.stat__label { font-weight: 600; line-height: 1.3; font-size: var(--step-0); }
.stat__meta { color: var(--muted); font-size: var(--step--1); line-height: 1.4; }
@media (hover: hover) { .stat:hover { transform: translateY(-3px); border-color: var(--line-strong); } }

/* ---------- Timeline ---------- */
.timeline-wrap { container-type: inline-size; }
.timeline { position: relative; display: grid; gap: var(--space-s); }
.timeline::before {
  content: ""; position: absolute; top: 0.6rem; bottom: 0.6rem; left: 0.45rem; width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--line-strong) 30%, var(--line));
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding-left: 2rem;
  gap: 0.4rem;
}
.tl-dot {
  position: absolute; left: 0; top: 0.35rem;
  width: calc(0.9rem + 2px); height: calc(0.9rem + 2px); border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.tl-dot--live { background: var(--accent-fill); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-dot--muted { border-color: var(--line-strong); }
.tl-date { white-space: nowrap; font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); line-height: 1.6; }

.tl-card {
  border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.25s, box-shadow 0.25s;
  min-width: 0;
}
.tl-card[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.tl-card summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 44px; padding: clamp(0.9rem, 0.7rem + 0.8vw, 1.35rem);
  cursor: pointer; list-style: none; border-radius: inherit;
}
.tl-card summary::-webkit-details-marker { display: none; }
.tl-card__head { display: grid; gap: 0.2rem; min-width: 0; }
.tl-role { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.tl-company { color: var(--muted); font-size: var(--step--1); }
.tl-chevron {
  flex: none; display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: transform 0.3s var(--ease), background-color 0.2s;
}
.tl-chevron::before { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.tl-card[open] .tl-chevron { transform: rotate(180deg); background: var(--surface-2); }
@media (hover: hover) { .tl-card:not([open]):hover { border-color: var(--line-strong); } }

.tl-body { display: grid; gap: var(--space-m); padding: 0 clamp(0.9rem, 0.7rem + 0.8vw, 1.35rem) clamp(0.9rem, 0.7rem + 0.8vw, 1.35rem); color: var(--text-2); }
.tl-body > ul:not(.tags) { display: grid; gap: 0.5rem; padding-left: 1.1rem; max-width: var(--measure); }
.tl-body > ul:not(.tags) li::marker { color: var(--accent); }
.tl-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0.6rem; }
.tl-results p {
  padding: 0.75rem 0.9rem; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--step--1); line-height: 1.4; color: var(--muted);
}
.tl-results strong { display: block; font-family: var(--font-display); font-size: var(--step-1); letter-spacing: -0.02em; color: var(--text); }

/* Roomy containers: dates move to their own column */
@container (min-width: 46rem) {
  .timeline::before { left: calc(11rem + 1.5rem + 0.45rem); }
  .tl-item { grid-template-columns: 11rem minmax(0, 1fr); column-gap: 3.5rem; padding-left: 0; }
  .tl-dot { left: calc(11rem + 1.5rem); top: 1.55rem; }
  .tl-date { text-align: right; padding-top: 1.25rem; }
}

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  padding: 0.25rem 0.65rem; border-radius: 999px;
  font-size: var(--step--2); font-weight: 500; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
}

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--space-l); }
.chip {
  min-height: 44px; padding: 0.4rem 1.1rem;
  border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer; font-weight: 500; font-size: var(--step--1);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
@media (hover: hover) { .chip:not(.is-active):hover { border-color: var(--text); } }

.projects-wrap { container-type: inline-size; }
.projects {
  display: grid;
  gap: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
  grid-template-columns: 1fr;
  grid-auto-flow: dense;
}
@container (min-width: 36rem) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 60rem) { .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 36rem) { .project--featured { grid-column: span 2; } }
.project.is-hidden { display: none; }

.project { container-type: inline-size; min-width: 0; }
.project__inner {
  height: 100%;
  display: flex; flex-direction: column; gap: var(--space-m);
  padding: clamp(1.1rem, 0.8rem + 1.2vw, 1.75rem);
  border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
@media (hover: hover) {
  .project__inner:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
}
.project--featured .project__inner {
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
}
.project__top { display: grid; gap: 0.5rem; }
.project__sector { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
.project__title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.project--featured .project__title { font-size: var(--step-3); }
.project__desc { color: var(--muted); font-size: var(--step--1); line-height: 1.55; max-width: 52ch; }
.project__metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.5rem), 1fr));
  gap: 0.6rem; margin-top: auto;
  padding-top: var(--space-m); border-top: 1px dashed var(--line-strong);
}
.project__metrics dt { font-size: var(--step--2); color: var(--muted); }
.project__metrics dd { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; white-space: nowrap; }
.project--featured .project__metrics dd { font-size: var(--step-2); }

/* Wide featured card: copy left, metrics right */
@container (min-width: 40rem) {
  .project--featured .project__inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: 1fr auto; column-gap: var(--space-l); }
  .project--featured .project__metrics { grid-row: 1 / span 2; grid-column: 2; grid-template-columns: 1fr; align-content: end; border-top: 0; border-left: 1px dashed var(--line-strong); padding: 0 0 0 var(--space-l); margin: 0; }
  .project--featured .tags { align-self: end; }
}

/* ---------- AI Search ---------- */
.section--band {
  background:
    radial-gradient(60% 80% at 85% 20%, var(--glow-b), transparent 70%),
    var(--bg-2);
  border-block: 1px solid var(--line);
}
.section--band + .section { padding-top: var(--section-y); }
.ai-grid { display: grid; gap: var(--space-xl); align-items: start; }
.ai-grid .section-head { margin-bottom: 0; }
@media (min-width: 60em) { .ai-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; } }

.aeo-steps { display: grid; gap: var(--space-s); margin-top: var(--space-s); }
.aeo-steps li { display: flex; gap: 0.9rem; align-items: flex-start; }
.aeo-steps .mono { flex: none; color: var(--accent); padding-top: 0.2rem; }
.aeo-steps p { color: var(--muted); font-size: var(--step--1); }

.ai-panel {
  container-type: inline-size;
  border-radius: var(--radius-l);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden; min-width: 0;
}
.ai-panel__bar {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--muted);
  background: var(--surface-2);
}
.dots { display: inline-flex; gap: 0.35rem; }
.dots i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--line-strong); }
.dots i:first-child { background: #ff6b5f; } .dots i:nth-child(2) { background: #ffbd2e; } .dots i:last-child { background: #28c840; }

.ai-tabs { display: flex; gap: 0.35rem; padding: 0.9rem 1.1rem 0; overflow-x: auto; scrollbar-width: none; }
.ai-tabs::-webkit-scrollbar { display: none; }
.ai-tabs [role="tab"] {
  flex: 1 0 auto; min-height: 44px; padding: 0.45rem 1rem;
  border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-weight: 600; font-size: var(--step--1); color: var(--muted); cursor: pointer;
  transition: all 0.2s;
}
.ai-tabs [aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.ai-chart { padding: clamp(1rem, 0.8rem + 1vw, 1.75rem) 1.1rem clamp(1rem, 0.8rem + 1vw, 1.5rem); display: grid; gap: var(--space-m); }
.ai-chart__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; color: var(--muted); font-size: var(--step--1); }
.ai-chart__total [data-ai-total] { font-family: var(--font-display); font-size: var(--step-4); font-weight: 750; letter-spacing: -0.04em; color: var(--text); line-height: 1; }
.ai-bars { display: grid; gap: 0.9rem; }
.ai-bars li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name val" "track track"; gap: 0.35rem 0.75rem; align-items: center; }
.ai-bars__name { grid-area: name; font-weight: 600; font-size: var(--step--1); }
.ai-bars__val { grid-area: val; font-family: var(--font-mono); font-weight: 600; font-size: var(--step--1); color: var(--text); }
.ai-bars__track { grid-area: track; height: 0.7rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.ai-bars__fill {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-fill));
  transition: width 0.9s var(--ease);
}
.ai-chart__note { font-size: var(--step--2); color: var(--muted); }
@container (min-width: 30rem) {
  .ai-bars li { grid-template-columns: 11rem minmax(0, 1fr) 4rem; grid-template-areas: "name track val"; }
  .ai-bars__val { text-align: right; }
  .ai-tabs [role="tab"] { flex: 0 0 auto; }
}

/* ---------- Automation workflow ---------- */
.workflow-wrap { container-type: inline-size; display: grid; gap: var(--space-m); margin-bottom: var(--space-xl); }
.workflow {
  display: flex; flex-direction: column; align-items: stretch; gap: 0.35rem;
}
.wf-node {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 0.9rem;
  min-height: 56px; padding: 0.8rem 1rem;
  border-radius: var(--radius-m); border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.wf-node__step { color: var(--muted); }
.wf-node__name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; }
.wf-node__sub { font-size: var(--step--2); color: var(--muted); text-align: right; }
.wf-node[aria-selected="true"] { background: var(--accent-fill); border-color: transparent; color: var(--on-accent); box-shadow: 0 10px 30px -12px var(--glow-a); }
.wf-node[aria-selected="true"] .wf-node__step,
.wf-node[aria-selected="true"] .wf-node__sub { color: rgba(15, 20, 6, 0.72); }
@media (hover: hover) { .wf-node:not([aria-selected="true"]):hover { border-color: var(--text); } }

.wf-arrow { align-self: center; width: 2px; height: 1.1rem; background: linear-gradient(var(--line-strong), var(--accent)); position: relative; }
.wf-arrow::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; width: 0.45rem; height: 0.45rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateX(-50%) rotate(45deg);
}

/* Horizontal pipeline when there is room for all five stages */
@container (min-width: 50rem) {
  .workflow { flex-direction: row; align-items: stretch; gap: 0; }
  .wf-node { flex: 1 1 0; min-width: 0; grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 0.35rem; padding: 1.1rem; min-height: 8.5rem; align-content: start; }
  .wf-node__sub { text-align: left; }
  .wf-arrow { width: clamp(1rem, 2.5cqi, 2.75rem); height: 2px; align-self: center; flex: none; background: linear-gradient(90deg, var(--line-strong), var(--accent)); }
  .wf-arrow::after { left: auto; right: -1px; bottom: 50%; transform: translateY(50%) rotate(-45deg); }
}

.wf-panel {
  display: grid; gap: 0.5rem;
  padding: clamp(1.1rem, 0.8rem + 1.2vw, 1.75rem);
  border-radius: var(--radius-l);
  background: var(--surface-2); border: 1px dashed var(--line-strong);
}
.wf-panel__title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; letter-spacing: -0.02em; }
.wf-panel__text { color: var(--muted); max-width: var(--measure); }

.agents {
  --agents-gap: clamp(0.6rem, 0.4rem + 0.8vw, 1rem);
  display: grid; gap: var(--agents-gap);
  /* Fluid, but capped at 3 columns so six agents land 3 + 3 */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(17rem, (100% - 2 * var(--agents-gap)) / 3)), 1fr));
}
.agent {
  display: flex; gap: 0.9rem; align-items: flex-start;
  padding: clamp(0.9rem, 0.7rem + 0.8vw, 1.3rem);
  border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line);
}
.agent__icon {
  display: grid; place-items: center; flex: none;
  width: 2.6rem; height: 2.6rem; border-radius: 0.8rem;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem;
}
.agent h3 { font-size: var(--step-0); font-weight: 650; line-height: 1.3; }
.agent p { color: var(--muted); font-size: var(--step--1); line-height: 1.45; margin-top: 0.2rem; }

/* ---------- Demo reel ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.reel { container-type: inline-size; display: grid; gap: var(--space-s); }
.reel__screen {
  container-type: inline-size;
  border-radius: var(--radius-l); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.reel__chrome {
  display: flex; align-items: center; gap: 0.8rem; min-width: 0;
  padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted);
}
.reel__address {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0.3rem 0.8rem; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--step--2); text-align: center;
}
.reel__live { display: inline-flex; align-items: center; gap: 0.45rem; font-size: var(--step--2); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.reel:not(.is-playing) .reel__live .pulse { animation: none; background: var(--muted); box-shadow: none; }

.reel__stage {
  display: grid; position: relative;
  aspect-ratio: 2 / 1; /* grows if a scene needs more room */
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
}
@container (max-width: 44rem) { .reel__stage { aspect-ratio: auto; } }

.scene {
  grid-area: 1 / 1; min-width: 0;
  display: grid; gap: clamp(0.75rem, 2.2cqi, 1.75rem); align-content: center; align-items: center;
  padding: clamp(1rem, 3.2cqi, 2.5rem);
  font-size: clamp(0.92rem, 0.66rem + 0.7cqi, 1.15rem);
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}
.scene.is-active { opacity: 1; visibility: visible; transition: opacity 0.5s var(--ease); }
.scene.no-anim, .scene.no-anim * { transition: none !important; }

/* Timed elements fade/slide in when their moment arrives */
.scene .fx { opacity: 0; transform: translateY(0.4em); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
.scene .fx.on { opacity: 1; transform: none; }
.typed.is-typing::after, .serp__query .typed:empty::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px;
  vertical-align: -0.15em; background: currentColor; animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.sk { display: block; height: 0.5em; width: var(--w, 60%); border-radius: 99px; background: var(--line-strong); }

/* Scene 1 · SEO */
.scene--seo { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 44rem) { .scene--seo { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.seo-panel { display: grid; gap: 0.8em; min-width: 0; }
.seo-metrics { display: grid; gap: 0.55em; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.2em), 1fr)); }
.seo-metric { min-width: 0; padding: 0.65em 0.8em; border-radius: 0.8em; background: var(--surface); border: 1px solid var(--line); }
.seo-metric span { display: block; font-size: 0.8em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-metric strong { display: block; font-family: var(--font-display); font-size: 1.4em; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seo-metric em { font-size: 0.8em; font-weight: 700; color: var(--accent); }
.seo-graph {
  position: relative; overflow: hidden;
  height: clamp(5.5rem, 20cqi, 13rem);
  border-radius: 0.8em; border: 1px solid var(--line); background: var(--surface);
  color: var(--accent-2);
}
.seo-graph svg { position: absolute; inset: 0.8em 0 0; width: 100%; height: calc(100% - 0.8em); display: block; }
.seo-graph__area { fill: url(#seo-fill); }
.seo-graph__line { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; }
/* Wipe reveals the line left → right */
.seo-graph::after {
  content: ""; position: absolute; inset: 0; background: var(--surface);
  transform-origin: right; transition: transform 3.2s cubic-bezier(0.45, 0, 0.2, 1);
}
.seo-graph.on::after { transform: scaleX(0); }
.seo-graph__label { position: absolute; z-index: 1; left: 0.8em; top: 0.55em; font-size: 0.8em; color: var(--muted); }

.serp { display: grid; gap: 0.65em; min-width: 0; }
.serp__query {
  display: flex; align-items: center; gap: 0.6em; min-width: 0; min-height: 2.6em;
  padding: 0.5em 1em; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line-strong);
  white-space: nowrap; overflow: hidden;
}
.serp__query .icon { color: var(--muted); }
.serp__ai {
  display: grid; gap: 0.45em; padding: 0.75em 0.95em; border-radius: 0.9em;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--line);
}
.serp__ai-head { font-size: 0.85em; font-weight: 700; }
.serp__ai-head span { color: var(--accent-2); }
.serp__cite { justify-self: start; margin-top: 0.2em; padding: 0.2em 0.65em; border-radius: 99px; font-size: 0.8em; font-weight: 700; background: var(--accent-fill); color: var(--on-accent); }
.serp__list { position: relative; list-style: none; margin: 0; padding: 0; height: calc(5 * 2.75em - 0.35em); }
.serp__item {
  position: absolute; inset: 0 0 auto 0; height: 2.4em;
  display: flex; align-items: center; gap: 0.65em; min-width: 0;
  padding: 0 0.85em; border-radius: 0.7em;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.85em;
  transform: translateY(calc(var(--p0) * 2.75em / 0.85));
  transition: transform 0.9s var(--ease), background-color 0.4s, color 0.4s, border-color 0.4s;
}
.serp__list.done .serp__item { transform: translateY(calc(var(--p1) * 2.75em / 0.85)); }
.serp__item .sk { flex: 1 1 auto; max-width: var(--w); margin-left: auto; }
.serp__fav { width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--line-strong); flex: none; }
.serp__dom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); min-width: 0; }
.serp__item--you { z-index: 1; border-color: var(--accent); }
.serp__item--you .serp__dom { color: var(--text); font-weight: 650; }
.serp__list.done .serp__item--you { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 22px -10px var(--glow-a); }
.serp__list.done .serp__item--you .serp__dom { color: var(--on-accent); }
.serp__list.done .serp__item--you .sk { background: rgba(15, 20, 6, 0.25); }
.serp__rank { font-family: var(--font-mono); font-weight: 700; font-size: 0.95em; flex: none; }
.serp__rank-b, .serp__list.done .serp__rank-a { display: none; }
.serp__list.done .serp__rank-b { display: inline; }

/* Scene 2 · n8n */
.scene--n8n { grid-template-columns: minmax(0, 1fr); }
.flow { display: flex; flex-direction: column; align-items: stretch; min-width: 0; }
.flow__node {
  position: relative; min-width: 0;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.1em 0.7em;
  padding: 0.6em 0.8em; border-radius: 0.85em;
  background: var(--surface); border: 1px solid var(--line-strong);
}
.flow__node.on:not(.done) { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.flow__node.done { border-color: color-mix(in srgb, #3fcf6a 55%, var(--line-strong)); }
.flow__icon {
  grid-row: 1 / span 2; display: grid; place-items: center;
  width: 2.1em; height: 2.1em; border-radius: 0.6em;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 0.9em; font-weight: 700;
}
.flow__node b { font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow__node small { grid-column: 2; font-size: 0.8em; color: var(--muted); line-height: 1.3; }
.flow__ok {
  grid-column: 3; grid-row: 1 / span 2; display: grid; place-items: center;
  width: 1.45em; height: 1.45em; border-radius: 50%;
  font-style: normal; font-size: 0.82em; font-weight: 800;
  background: var(--line); color: transparent; transition: background-color 0.3s, color 0.3s;
}
.flow__node.done .flow__ok { background: #3fcf6a; color: #06130a; }
.flow__node--agent { background: linear-gradient(135deg, rgba(120, 132, 255, 0.16), transparent 70%), var(--surface); }
.flow__tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.35em; margin-top: 0.45em; }
.flow__tools span { padding: 0.12em 0.55em; border-radius: 99px; font-size: 0.8em; border: 1px dashed var(--line-strong); color: var(--text-2); }
.flow__edge { position: relative; align-self: center; width: 2px; height: 0.9em; background: var(--line-strong); overflow: hidden; flex: none; }
.flow__edge::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform 0.35s linear; }
.flow__edge.on::after { transform: none; }
@container (min-width: 50rem) {
  .scene--n8n { gap: clamp(1rem, 3cqi, 2rem); }
  .flow { flex-direction: row; align-items: flex-start; }
  .flow__node { flex: 1 1 0; grid-template-columns: auto minmax(0, 1fr); padding: 0.75em; }
  .flow__node small { grid-column: 1 / -1; margin-top: 0.4em; }
  .flow__icon { grid-row: auto; }
  .flow__ok { position: absolute; top: -0.55em; right: -0.55em; }
  .flow__node--agent { flex-grow: 1.35; }
  .flow__edge { width: clamp(0.6rem, 2cqi, 1.75rem); height: 2px; margin-top: 1.9em; }
  .flow__edge::after { transform: scaleX(0); transform-origin: left; }
}

.term {
  display: grid; align-content: start; gap: 0.3em; min-width: 0;
  padding: 0.9em 1.05em; border-radius: 0.85em;
  background: #0c0e12; color: #d7dce4; border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8em; line-height: 1.55; overflow-wrap: anywhere;
}
.term .t-acc { color: #c6f35a; }
.term .t-ok { color: #7ee2a0; }
.term .t-dim { color: #8a93a3; }
.term .t-bul { color: #9aa4ff; margin-right: 0.2em; }
.term__prompt { margin: 0.3em 0; padding: 0.55em 0.7em; border-radius: 0.55em; border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; }
.term--log { font-size: 0.8em; }

/* Scene 3 · Claude Code → internal link recommender */
.scene--code { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
@container (min-width: 44rem) { .scene--code { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.ilr {
  display: grid; gap: 0.75em; align-content: start; min-width: 0;
  padding: 0.9em; border-radius: 0.85em;
  background: var(--surface); border: 1px solid var(--line-strong);
}
.ilr__app {
  display: flex; align-items: center; gap: 0.6em; min-width: 0;
  padding-bottom: 0.7em; border-bottom: 1px solid var(--line);
}
.ilr__logo {
  display: grid; place-items: center; flex: none;
  width: 1.9em; height: 1.9em; border-radius: 0.55em;
  background: var(--accent-fill); color: var(--on-accent); font-weight: 800;
}
.ilr__appname { font-weight: 700; font-size: 0.9em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilr__status {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.2em 0.65em; border-radius: 99px; font-size: 0.8em; font-weight: 650;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
}
.ilr__status-dot { width: 0.5em; height: 0.5em; border-radius: 50%; background: #ffbd2e; animation: blink 1s steps(1) infinite; }
.ilr__status-b, .ilr__status.on .ilr__status-a { display: none; }
.ilr__status.on .ilr__status-b { display: inline; }
.ilr__status.on .ilr__status-dot { background: #3fcf6a; animation: none; }
.ilr__kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45em; }
.ilr__kpi { min-width: 0; padding: 0.5em 0.65em; border-radius: 0.65em; background: var(--surface-2); border: 1px solid var(--line); }
.ilr__kpi span { display: block; font-size: 0.8em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ilr__kpi strong { display: block; font-family: var(--font-display); font-size: 1.25em; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ilr__kpi:last-child strong { color: var(--accent); }
.ilr__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2em 0.8em; }
.ilr__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05em; letter-spacing: -0.02em; }
.ilr__url { font-size: 0.8em; color: var(--muted); overflow-wrap: anywhere; }
.ilr__copy {
  padding: 0.7em 0.85em; border-radius: 0.7em;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: 0.9em; line-height: 1.65;
}
.ilr__mark {
  color: inherit; background: transparent; border-radius: 0.25em; padding: 0 0.1em;
  box-shadow: inset 0 -0.12em 0 transparent;
  transition: background-color 0.4s, box-shadow 0.4s, color 0.4s;
}
.ilr__mark.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 -0.14em 0 var(--accent); }
.ilr__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45em; }
.ilr__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "anchor ok" "target ok" "score ok";
  align-items: center; gap: 0.15em 0.7em;
  padding: 0.55em 0.75em; border-radius: 0.7em;
  background: var(--surface-2); border: 1px solid var(--line);
  transition: border-color 0.3s, opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.ilr__row.done { border-color: color-mix(in srgb, #3fcf6a 55%, var(--line-strong)); }
.ilr__anchor { grid-area: anchor; font-weight: 650; font-size: 0.9em; }
.ilr__target { grid-area: target; font-size: 0.8em; color: var(--muted); overflow-wrap: anywhere; }
.ilr__score { grid-area: score; display: flex; align-items: center; gap: 0.5em; font-size: 0.8em; color: var(--text-2); }
.ilr__score .mono { font-size: 1em; }
.ilr__bar { position: relative; flex: 1; max-width: 9em; height: 0.4em; border-radius: 99px; background: var(--line-strong); overflow: hidden; }
.ilr__bar::after {
  content: ""; position: absolute; inset: 0; width: var(--s); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform 0.8s var(--ease) 0.15s;
}
.ilr__row.on .ilr__bar::after { transform: none; }
.ilr__ok {
  grid-area: ok; display: grid; place-items: center;
  width: 1.5em; height: 1.5em; border-radius: 50%;
  font-size: 0.82em; font-weight: 800; background: var(--line); color: transparent;
  transition: background-color 0.3s, color 0.3s;
}
.ilr__row.done .ilr__ok { background: #3fcf6a; color: #06130a; }
@container (min-width: 60rem) {
  .ilr__row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "anchor score ok" "target score ok"; }
  .ilr__score { min-width: 8.5em; }
}
/* Controls */
.reel__bar { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.reel__play { flex: none; }
.reel__play .icon-play { display: none; }
.reel:not(.is-playing) .reel__play .icon-play { display: block; }
.reel:not(.is-playing) .reel__play .icon-pause { display: none; }
.reel__tabs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.reel__tabs [role="tab"] {
  display: grid; gap: 0.4rem; align-content: center; min-width: 0; min-height: 44px;
  padding: 0.5rem 0.7rem; border-radius: 0.8rem; text-align: left;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.reel__tabs [aria-selected="true"] { border-color: var(--line-strong); background: var(--surface-2); }
@media (hover: hover) { .reel__tabs [role="tab"]:hover { border-color: var(--text); } }
.reel__prog { display: block; height: 3px; border-radius: 99px; background: var(--line-strong); overflow: hidden; }
.reel__prog i { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; }
.reel__tabs [role="tab"] { --p: 0; }
.reel__tab-label { display: grid; min-width: 0; }
.reel__tab-label b { font-size: var(--step--1); font-weight: 650; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel__tab-label small { font-size: var(--step--2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel__time { flex: none; font-size: var(--step--2); color: var(--muted); font-variant-numeric: tabular-nums; }
.reel__note { font-size: var(--step--1); color: var(--muted); max-width: var(--measure); }
.reel__tab-label .s { display: none; }
@container (max-width: 34rem) {
  .reel__tab-label small, .reel__time { display: none; }
  .reel__tabs [role="tab"] { padding-inline: 0.45rem; }
  .reel__tabs { display: flex; gap: 0.35rem; }
  .reel__tabs [role="tab"] { flex: 1 1 auto; }
}
@container (max-width: 21rem) {
  .reel__tab-label .l { display: none; }
  .reel__tab-label .s { display: inline; }
}

/* ---------- Stack ---------- */
.stack { display: grid; gap: clamp(0.75rem, 0.5rem + 1vw, 1.25rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.stack-card {
  display: grid; align-content: start; gap: var(--space-s);
  padding: clamp(1.1rem, 0.8rem + 1.2vw, 1.75rem);
  border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line);
}
.stack-card h3 { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; letter-spacing: -0.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chips li {
  padding: 0.4rem 0.8rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--step--1); font-weight: 500;
}
.edu { display: grid; gap: 0.7rem; }
.edu li { display: grid; gap: 0.05rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.edu li:last-child { border-bottom: 0; padding-bottom: 0; }
.edu strong { font-size: var(--step--1); line-height: 1.35; }
.edu span { font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; gap: var(--space-xl); align-items: center; }
.about__copy { display: grid; gap: var(--space-s); max-width: 40rem; }
.about__copy > p:not(.kicker) { color: var(--text-2); font-size: var(--step-1); line-height: 1.6; text-wrap: pretty; }
.about__photos {
  display: grid; gap: clamp(0.5rem, 0.3rem + 0.8vw, 1rem);
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 5 / 4.4;
  max-width: 40rem; width: 100%;
}
.photo { border-radius: var(--radius-l); overflow: hidden; background: var(--bg-2); min-height: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo--main { grid-row: 1 / span 2; }
.photo--main img { object-position: 50% 60%; }
.photo--a img { object-position: 50% 30%; }
.photo--b img { object-position: 50% 35%; }
@media (min-width: 52em) {
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2xl); }
}

/* ---------- Live visitors ---------- */
.live {
  --chart: #3d6b00;                                   /* validated for light surfaces */
  container-type: inline-size;
  position: relative; isolation: isolate;
  display: grid; gap: var(--space-l);
  padding: clamp(1.25rem, 0.8rem + 2.5vw, 3rem);
  border-radius: calc(var(--radius-l) * 1.2);
  background: radial-gradient(120% 90% at 100% 0%, var(--accent-soft), transparent 55%), var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .live { --chart: #7aa51f; } }
:root[data-theme="dark"] .live { --chart: #7aa51f; }         /* validated for dark surfaces */
.live::before {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 60%; aspect-ratio: 1; z-index: -1;
  border-radius: 50%; background: var(--glow-b); filter: blur(90px); opacity: .6;
}
.live__head { display: grid; gap: var(--space-s); max-width: 46rem; }
.live__head .section-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem); }
.live__status {
  justify-self: start; display: inline-flex; align-items: center; gap: .6rem;
  padding: .4rem .9rem .4rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--step--1); font-weight: 600; color: var(--text-2);
}
.live__dot { position: relative; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); flex: none; }
[data-live-state="ok"] .live__dot { background: #3fcf6a; }
[data-live-state="ok"] .live__dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #3fcf6a; animation: live-ping 1.8s ease-out infinite; }
[data-live-state="error"] .live__dot { background: #ff8a3d; }
@keyframes live-ping { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }

.live__stats { display: grid; gap: clamp(.6rem, .4rem + .8vw, 1rem); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@container (min-width: 44rem) { .live__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.live-stat {
  container-type: inline-size; min-width: 0;
  display: grid; gap: .25rem; align-content: start;
  padding: clamp(.9rem, .7rem + 1vw, 1.5rem); border-radius: var(--radius-m);
  background: var(--surface-2); border: 1px solid var(--line);
}
.live-stat--hero { background: var(--accent-fill); border-color: transparent; }
.live-stat__label { font-family: var(--font-mono); font-size: var(--step--2); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.live-stat--hero .live-stat__label, .live-stat--hero .live-stat__sub { color: rgba(15, 20, 6, .7); }
.live-stat__num {
  font-family: var(--font-display); font-weight: 750; letter-spacing: -.04em; line-height: 1.05;
  font-size: clamp(1.9rem, 22cqi, 3.4rem); font-variant-numeric: tabular-nums; color: var(--text);
}
.live-stat--hero .live-stat__num { color: var(--on-accent); }
.live-stat__sub { font-size: var(--step--1); color: var(--muted); }
/* shimmer while loading */
.live:not(.is-ready):not(.is-offline) .live-stat__num { color: transparent; border-radius: .4rem; background: linear-gradient(90deg, var(--line) 25%, var(--line-strong) 50%, var(--line) 75%); background-size: 200% 100%; animation: live-shimmer 1.4s linear infinite; }
.live:not(.is-ready):not(.is-offline) .live-stat--hero .live-stat__num { background: linear-gradient(90deg, rgba(15,20,6,.12) 25%, rgba(15,20,6,.22) 50%, rgba(15,20,6,.12) 75%); background-size: 200% 100%; }
@keyframes live-shimmer { to { background-position: -200% 0; } }

.live__chart { display: grid; gap: .6rem; margin: 0; }
.live__chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: var(--step--1); color: var(--muted); }
.live__peak { color: var(--text-2); font-weight: 600; }
.spark { position: relative; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; align-items: end; height: clamp(6rem, 4rem + 8vw, 9.5rem); border-bottom: 1px solid var(--line-strong); }
.spark__bar { position: relative; height: 100%; min-width: 0; padding: 0; border: 0; background: transparent; cursor: default; display: flex; align-items: flex-end; }
.spark__bar:focus-visible { outline-offset: 2px; }
.spark__fill { display: block; width: 100%; height: var(--h); min-height: 2px; border-radius: 4px 4px 0 0; background: var(--chart); opacity: .55; transition: opacity .2s, height .8s var(--ease); }
.spark__bar.is-today .spark__fill { opacity: 1; }
.spark__bar:hover .spark__fill, .spark__bar:focus-visible .spark__fill { opacity: 1; }
.spark__val { position: absolute; left: 50%; bottom: calc(var(--h) + 4px); transform: translateX(-50%); font-family: var(--font-mono); font-size: var(--step--2); font-weight: 600; color: var(--text); white-space: nowrap; }
.spark__tip {
  position: absolute; left: 50%; bottom: calc(var(--h) + 1.9rem); transform: translate(-50%, 4px); z-index: 3;
  padding: .35rem .6rem; border-radius: .5rem; background: var(--text); color: var(--bg);
  font-size: var(--step--2); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s;
}
.spark__tip b { color: inherit; }
.spark__bar:first-child .spark__tip { left: 0; transform: translate(0, 4px); }
.spark__bar:last-child .spark__tip { left: auto; right: 0; transform: translate(0, 4px); }
.spark__bar:hover .spark__tip, .spark__bar:focus-visible .spark__tip { opacity: 1; transform: translate(-50%, 0); }
.spark__bar:first-child:hover .spark__tip, .spark__bar:first-child:focus-visible .spark__tip,
.spark__bar:last-child:hover .spark__tip, .spark__bar:last-child:focus-visible .spark__tip { transform: translate(0, 0); }
.spark__axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: var(--step--2); color: var(--muted); }
.live.is-offline .spark { opacity: .35; }
.live__you { font-size: var(--step-0); color: var(--text-2); }
.live__you b { font-family: var(--font-display); font-size: 1.1em; color: var(--text); }
/* ---------- Contact ---------- */
.contact { padding-bottom: var(--space-2xl); }
.contact__card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: var(--space-m); justify-items: start;
  padding: clamp(1.5rem, 0.8rem + 4vw, 5rem);
  border-radius: calc(var(--radius-l) * 1.3);
  --c-bg: #101114; --c-fg: #f3f4f6;
  background: var(--c-bg); color: var(--c-fg);
  border: 1px solid var(--line-strong);
}
.contact__card::before {
  content: ""; position: absolute; z-index: -1;
  width: min(70%, 40rem); aspect-ratio: 1; right: -12%; top: -45%;
  border-radius: 50%; background: radial-gradient(closest-side, var(--accent-fill), transparent);
  filter: blur(40px); opacity: 0.22;
}
.contact__card .kicker { color: color-mix(in srgb, var(--c-fg) 65%, transparent); }
.contact__card strong { color: inherit; }
.contact__card .kicker span { border-color: color-mix(in srgb, var(--c-fg) 30%, transparent); color: var(--accent-fill); }
.contact__title {
  font-family: var(--font-display); font-weight: 750;
  font-size: clamp(2rem, 1.2rem + 4.2vw, 5.5rem);
  line-height: 1; letter-spacing: -0.045em;
  max-width: 16ch; text-wrap: balance;
}
.contact__lede { color: color-mix(in srgb, var(--c-fg) 70%, transparent); font-size: var(--step-1); max-width: 46ch; }
.contact__email { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; max-width: 100%; }
.contact__email-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.15rem, 0.8rem + 2.2vw, 2.4rem); letter-spacing: -0.03em;
  text-decoration: underline; text-decoration-color: var(--accent-fill); text-decoration-thickness: 2px;
  overflow-wrap: anywhere;
}
.contact__email .btn { color: var(--c-fg); border-color: color-mix(in srgb, var(--c-fg) 35%, transparent); }
.contact__links { display: grid; gap: 0.6rem; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-top: var(--space-s); }
.contact-link {
  display: grid; gap: 0.1rem; min-height: 44px;
  padding: 0.9rem 1.1rem; border-radius: var(--radius-m);
  border: 1px solid color-mix(in srgb, var(--c-fg) 18%, transparent);
  text-decoration: none; transition: border-color 0.2s, background-color 0.2s;
}
.contact-link__label { font-family: var(--font-mono); font-size: var(--step--2); text-transform: uppercase; letter-spacing: 0.08em; color: color-mix(in srgb, var(--c-fg) 60%, transparent); }
.contact-link__value { font-weight: 600; overflow-wrap: anywhere; }
@media (hover: hover) { .contact-link:hover { border-color: var(--accent-fill); background: color-mix(in srgb, var(--c-fg) 6%, transparent); } }
.contact__card :focus-visible { outline-color: var(--accent-fill); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding-block: var(--space-l); color: var(--muted); font-size: var(--step--1);
}
.to-top { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; color: var(--text); }

/* ---------- Command palette ---------- */
.cmdk {
  width: min(40rem, calc(100% - 2rem));
  max-height: min(34rem, calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  margin: max(10vh, calc(env(safe-area-inset-top) + 1rem)) auto auto;
  padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-l);
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
  overflow: hidden;
}
.cmdk[open] { display: flex; animation: menu-in 0.25s var(--ease); }
.cmdk::backdrop { background: rgba(5, 6, 8, 0.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cmdk__box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.cmdk__search { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem 0.5rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk__input {
  flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: max(16px, var(--step-0)); /* ≥16px prevents iOS zoom */ color: var(--text);
}
.cmdk__esc { min-height: 44px; min-width: 44px; padding: 0 0.6rem; border-radius: 0.4rem; border: 1px solid var(--line-strong); background: var(--surface-2); font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; }
.cmdk__list { list-style: none; margin: 0; padding: 0.5rem; overflow-y: auto; overscroll-behavior: contain; }
.cmdk__group { padding: 0.6rem 0.75rem 0.3rem; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cmdk__item {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 46px; padding: 0.5rem 0.75rem; border-radius: 0.7rem; cursor: pointer;
}
.cmdk__item-icon { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 0.5rem; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.85rem; flex: none; }
.cmdk__item-hint { margin-left: auto; font-size: var(--step--2); color: var(--muted); font-family: var(--font-mono); }
.cmdk__item[aria-selected="true"] { background: var(--accent-soft); }
.cmdk__item[aria-selected="true"] .cmdk__item-icon { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
.cmdk__empty { padding: 1.5rem; text-align: center; color: var(--muted); }

/* ---------- "Tap for sound" pill ---------- */
.sound-pill {
  position: fixed; z-index: 34;
  left: max(1rem, env(safe-area-inset-left)); bottom: max(1.1rem, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem 1.05rem .55rem .8rem;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent-fill); color: var(--on-accent); font-weight: 700; font-size: var(--step--1);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6), 0 0 0 0 rgba(198, 243, 90, .55);
  opacity: 0; transform: translateY(12px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.sound-pill.is-in { opacity: 1; transform: none; animation: sound-pulse 2s ease-out infinite; }
.sound-pill[hidden] { display: none; }
@keyframes sound-pulse { 0% { box-shadow: 0 12px 30px -10px rgba(0,0,0,.6), 0 0 0 0 rgba(198,243,90,.55); } 70% { box-shadow: 0 12px 30px -10px rgba(0,0,0,.6), 0 0 0 14px rgba(198,243,90,0); } 100% { box-shadow: 0 12px 30px -10px rgba(0,0,0,.6), 0 0 0 0 rgba(198,243,90,0); } }
body.menu-open .sound-pill { display: none; }
@media print { .sound-pill { display: none; } }
/* ---------- Hello widget ---------- */
.hello {
  --hello-size: clamp(3.5rem, 3.1rem + 1vw, 4.25rem);
  --hello-gap: max(1rem, env(safe-area-inset-right));
  position: fixed; z-index: 35;
  right: var(--hello-gap);
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem;
  pointer-events: none; /* only the children below are interactive */
}
.hello > * { pointer-events: auto; }
body.menu-open .hello { display: none; }
@media print { .hello { display: none; } }

/* Launcher: the face */
.hello__launcher {
  position: relative; flex: none;
  width: var(--hello-size); height: var(--hello-size);
  padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  transform: scale(0); opacity: 0;
}
.hello.is-in .hello__launcher { animation: hello-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes hello-pop { 0% { transform: scale(0) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.08) rotate(4deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
.hello__avatar {
  position: relative; display: block; width: 100%; height: 100%;
  border-radius: 50%; overflow: hidden; isolation: isolate;
  background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-fill), 0 12px 30px -8px rgba(0, 0, 0, 0.55);
}
.hello__avatar img { width: 100%; height: 100%; object-fit: cover; }
.hello__avatar--sm { flex: none; width: 2.75rem; height: 2.75rem; box-shadow: 0 0 0 2px var(--accent-fill); }
@media (hover: hover) {
  .hello__launcher:hover .hello__avatar { transform: scale(1.05); }
}
.hello__launcher .hello__avatar { transition: transform 0.25s var(--ease); }

/* "Talking": head bob, voice rings and an equaliser while speaking */
.hello__ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent-fill); opacity: 0; pointer-events: none;
}
.is-speaking .hello__ring { animation: hello-ring 1.6s ease-out infinite; }
.is-speaking .hello__ring--2 { animation-delay: 0.8s; }
@keyframes hello-ring { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }
.is-speaking [data-hello-face] { animation: hello-talk 0.42s ease-in-out infinite alternate; }
@keyframes hello-talk { 0% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-1.5deg); } 100% { transform: translateY(0.5px) rotate(1.5deg); } }
.hello__eq {
  position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 2px; height: 22%;
  padding: 2px 4px; border-radius: 99px; background: rgba(11, 12, 15, 0.7);
  opacity: 0; transition: opacity 0.25s;
}
.hello__eq i { display: block; width: 3px; height: 30%; border-radius: 2px; background: var(--accent-fill); }
.is-speaking .hello__eq { opacity: 1; }
.is-speaking .hello__eq i { animation: hello-eq 0.5s ease-in-out infinite alternate; }
.is-speaking .hello__eq i:nth-child(2) { animation-delay: 0.15s; }
.is-speaking .hello__eq i:nth-child(3) { animation-delay: 0.3s; }
.is-speaking .hello__eq i:nth-child(4) { animation-delay: 0.08s; }
@keyframes hello-eq { to { height: 100%; } }

.hello__badge {
  position: absolute; top: -2px; right: -2px;
  display: grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 0.3rem;
  border-radius: 99px; background: #ff5a4f; color: #fff; font-size: 0.75rem; font-weight: 800;
  box-shadow: 0 0 0 2px var(--bg); transform: scale(0); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hello.has-unread .hello__badge { transform: scale(1); }

/* Teaser speech bubble */
.hello__teaser {
  position: relative; display: flex; align-items: flex-start;
  max-width: min(17rem, calc(100vw - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin-right: calc(var(--hello-size) * 0.35);
  animation: hello-bubble 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
.hello__teaser[hidden] { display: none; }
@keyframes hello-bubble { from { transform: scale(0.6) translateY(10px); opacity: 0; } }
.hello__teaser-body {
  display: block; min-height: 44px; min-width: 4.5rem; text-align: left; cursor: pointer;
  padding: 0.8rem 2.4rem 0.8rem 1rem;
  border-radius: 1.1rem 1.1rem 0.3rem 1.1rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: var(--step-0); font-weight: 600; line-height: 1.4;
}
.hello__teaser-body::after {
  content: ""; position: absolute; right: 0.6rem; bottom: -0.45rem; width: 0.9rem; height: 0.9rem;
  background: var(--surface); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg); border-bottom-right-radius: 3px;
}
.hello__teaser-x {
  position: absolute; top: 0; right: 0;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 50%;
}
.hello__teaser-x .icon { width: 1rem; height: 1rem; }
@media (hover: hover) { .hello__teaser-x:hover { color: var(--text); } }
.hello__typing { display: inline-flex; gap: 4px; padding: 0.35rem 0; }
.hello__typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: hello-dots 1s ease-in-out infinite; }
.hello__typing i:nth-child(2) { animation-delay: 0.15s; }
.hello__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes hello-dots { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
.hello__teaser.is-typed .hello__typing { display: none; }
.hello__teaser-text:empty { display: none; }
.hello__tap { display: none; margin-top: 0.35rem; font-size: var(--step--1); font-weight: 600; color: var(--accent); }
.hello.needs-tap .hello__teaser.is-typed .hello__tap { display: block; animation: hello-msg 0.4s var(--ease) both; }

/* Chat card */
.hello__panel {
  width: min(22rem, calc(100vw - 2rem - env(safe-area-inset-left) - env(safe-area-inset-right)));
  /* Never taller than the space between the sticky header and the launcher */
  max-height: min(34rem, calc(100dvh - var(--hello-size) - var(--header-h) - 2.75rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 0.85rem; padding: 1rem;
  border-radius: 1.25rem; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
  transform-origin: bottom right; animation: hello-bubble 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hello__panel[hidden] { display: none; }
.hello__head { display: flex; align-items: center; gap: 0.75rem; }
.hello__who { flex: 1; min-width: 0; }
.hello__name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); letter-spacing: -0.02em; line-height: 1.2; }
.hello__status { display: flex; align-items: center; gap: 0.4rem; font-size: var(--step--1); color: var(--muted); }
.hello__online { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #3fcf6a; flex: none; }
.hello__icon-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; color: var(--text-2);
}
.hello__msgs { display: grid; gap: 0.45rem; }
.hello__msg {
  justify-self: start; max-width: 92%;
  padding: 0.65rem 0.85rem; border-radius: 0.3rem 1rem 1rem 1rem;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: var(--step--1); line-height: 1.5; color: var(--text-2);
  animation: hello-msg 0.4s var(--ease) both;
}
.hello__msg:first-child { color: var(--text); font-weight: 600; }
.hello__msg:nth-child(2) { animation-delay: 0.25s; }
@keyframes hello-msg { from { opacity: 0; transform: translateY(6px); } }
.hello__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.hello__act {
  display: flex; align-items: center; gap: 0.5rem; min-height: 44px; min-width: 0;
  padding: 0.55rem 0.75rem; border-radius: 0.8rem;
  border: 1px solid var(--line-strong); background: transparent;
  font-size: var(--step--1); font-weight: 600; text-decoration: none; line-height: 1.2;
  animation: hello-msg 0.4s var(--ease) 0.4s both;
  transition: border-color 0.2s, background-color 0.2s;
}
.hello__act:nth-child(2) { grid-column: 1 / -1; justify-content: center; }
.hello__act--primary { grid-column: 1 / -1; justify-content: center; background: var(--accent-fill); color: var(--on-accent); border-color: transparent; }
@media (hover: hover) { .hello__act:not(.hello__act--primary):hover { border-color: var(--text); } }
.hello__voice {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px;
  padding: 0 0.9rem; border: 0; border-radius: 99px; background: transparent; cursor: pointer;
  color: var(--muted); font-size: var(--step--1); font-weight: 600;
}
.hello__voice[hidden] { display: none; }
.hello__sound { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 0.25rem; }
.hello__voice[aria-pressed="true"] { color: var(--accent); }
@media (hover: hover) { .hello__voice:hover { color: var(--text); } }
/* Very narrow phones: stack the secondary actions */
@media (max-width: 22em) { .hello__actions { grid-template-columns: minmax(0, 1fr); } }

/* Keep the footer link and toasts clear of the launcher */
.site-footer { padding-bottom: calc(env(safe-area-inset-bottom) + 5.5rem); }
.toast { bottom: calc(6rem + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .hello__launcher { transform: none; opacity: 1; }
  .is-speaking [data-hello-face], .is-speaking .hello__ring, .is-speaking .hello__eq i { animation: none; }
}
/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 300; left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  max-width: calc(100% - 2rem);
  padding: 0.75rem 1.1rem; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: var(--step--1);
  box-shadow: var(--shadow); pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: transform 0.35s var(--ease), opacity 0.35s, visibility 0s linear 0.35s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition-delay: 0s; }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* QA mode & reduced motion: everything static and visible */
.qa .reveal { opacity: 1 !important; transform: none !important; }
.qa *, .qa *::before, .qa *::after { animation: none !important; transition: none !important; }
.qa { scroll-behavior: auto; }
.qa .hello__launcher { transform: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee__list[aria-hidden="true"] { display: none; }
  .marquee__list { flex-wrap: wrap; justify-content: center; }
  .marquee { mask-image: none; -webkit-mask-image: none; }
}

/* Forced colors / high contrast */
@media (forced-colors: active) {
  .btn, .chip, .wf-node, .ai-tabs [role="tab"] { border: 1px solid ButtonText; }
  .hero__title em { color: CanvasText; background: none; }
}
