/* ============================================================
   Karbon — design system v2
   Vanilla CSS. Dark by default, light theme via [data-theme].
   Editorial type (Inter + Instrument Serif), aurora hero,
   film grain, gradient-border surfaces, cursor spotlight.
   ============================================================ */

:root {
  color-scheme: dark;

  /* ---- dark theme (default) ---- */
  --bg:        #05060a;
  --bg-2:      #090b12;
  --surface:   #0d1019;
  --surface-2: #131826;
  --border:    rgba(255, 255, 255, 0.07);
  --border-2:  rgba(255, 255, 255, 0.14);
  --text:      #f4f6fb;
  --text-mid:  #aab1c2;
  --text-dim:  #6f7585;
  --accent:    #7c9bff;
  --accent-2:  #b388ff;
  --accent-3:  #5ce0c6;
  --accent-ink: #060810;
  --accent-soft: rgba(124, 155, 255, 0.13);
  --good:      #3ad29f;
  --danger:    #ff6f6f;

  --font:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --maxw: 1180px;
  --radius:    20px;
  --radius-sm: 12px;
  --radius-xs: 8px;

  /* surfaces: gradient hairline border via two background layers */
  --card-bg: linear-gradient(var(--surface), var(--surface)) padding-box,
             linear-gradient(155deg,
               rgba(255, 255, 255, 0.16),
               rgba(255, 255, 255, 0.03) 32%,
               rgba(124, 155, 255, 0.22) 100%) border-box;

  --hairline:  inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 1px 2px -1px rgba(0, 0, 0, 0.5), 0 4px 14px -6px rgba(0, 0, 0, 0.55);
  --shadow:    0 1px 0 rgba(255, 255, 255, 0.04) inset,
               0 2px 6px -3px rgba(0, 0, 0, 0.5),
               0 34px 80px -34px rgba(0, 0, 0, 0.85);
  --glow:      0 0 80px -24px rgba(124, 155, 255, 0.35);
  --ring:      0 0 0 3px var(--accent-soft);
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);

  --spot-color: rgba(124, 155, 255, 0.10);
}

[data-theme="light"] {
  color-scheme: light;

  --bg:        #f7f8fb;
  --bg-2:      #eef0f6;
  --surface:   #ffffff;
  --surface-2: #f2f4f9;
  --border:    rgba(15, 20, 35, 0.09);
  --border-2:  rgba(15, 20, 35, 0.16);
  --text:      #0d1220;
  --text-mid:  #49505f;
  --text-dim:  #71798a;
  --accent:    #2f5fff;
  --accent-2:  #7a48ff;
  --accent-3:  #0aa88a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(47, 95, 255, 0.10);
  --good:      #12996f;
  --danger:    #d6453f;

  --card-bg: linear-gradient(var(--surface), var(--surface)) padding-box,
             linear-gradient(155deg,
               rgba(15, 20, 35, 0.14),
               rgba(15, 20, 35, 0.05) 32%,
               rgba(47, 95, 255, 0.28) 100%) border-box;

  --hairline:  inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --shadow-sm: 0 1px 2px -1px rgba(20, 30, 60, 0.12), 0 6px 16px -10px rgba(20, 30, 60, 0.18);
  --shadow:    0 1px 0 rgba(255, 255, 255, 0.8) inset,
               0 2px 6px -3px rgba(20, 30, 60, 0.12),
               0 34px 80px -40px rgba(20, 30, 60, 0.3);
  --glow:      0 0 80px -30px rgba(47, 95, 255, 0.3);

  --spot-color: rgba(47, 95, 255, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The UA rule for [hidden] is display: none, but any author display —
   .btn is inline-flex — beats it, and the element stays on screen. This
   puts it back, so `el.hidden = true` means hidden everywhere. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

/* film grain over everything — keeps gradients from banding, adds texture */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 2000;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  mix-blend-mode: overlay;
}
[data-theme="light"] body::after { opacity: 0.06; mix-blend-mode: multiply; }

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.tiny { font-size: 0.72rem; letter-spacing: 0.04em; }
.grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 55%, var(--accent-3) 110%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: grad-flow 7s ease-in-out infinite;
}
.accent-serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.06em;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }

/* unified, accessible keyboard focus */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* refined scrollbars on the scrollable demo panes */
.chat-log {
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.chat-log::-webkit-scrollbar { width: 10px; height: 10px; }
.chat-log::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.5rem); }

/* keep anchored sections clear of the sticky header */
.section, .hero, #top { scroll-margin-top: 88px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 3000;
  background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- scroll progress ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 2100; pointer-events: none; }
.scroll-progress-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent-2), var(--accent)); background-size: 200% 100%; transform: scaleX(0); transform-origin: left; box-shadow: 0 0 12px -1px var(--accent); animation: grad-slide 6s linear infinite; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 0.94rem/1 var(--font); letter-spacing: 0.005em;
  padding: 0.9rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn-sm { padding: 0.56rem 1rem; font-size: 0.85rem; }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 30px -12px var(--accent);
}
/* shimmer sweep on hover */
.btn.primary::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.35) 50%, transparent 75%);
  transform: translateX(-100%);
  transition: transform 0.7s var(--ease);
}
.btn.primary:hover::before { transform: translateX(100%); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 20px 44px -14px var(--accent); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text); border-color: var(--border-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn.ghost:hover { border-color: var(--accent); color:var(--accent-text,var(--accent)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn.ghost:active { transform: translateY(0); }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-header[data-elevated="true"] {
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom-color: var(--border);
  box-shadow: 0 12px 30px -24px rgba(0, 0, 0, 0.8);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 1.5rem; }

.logo { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.05rem; }
.logo-mark {
  width: 24px; height: 24px; border-radius: 8px;
  background: conic-gradient(from var(--logo-angle, 210deg), var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px var(--border-2), 0 6px 20px -6px var(--accent);
  animation: logo-rotate 9s linear infinite;
}
.logo:hover .logo-mark { animation-duration: 2.4s; }
.logo-text { letter-spacing: -0.02em; white-space: nowrap; }
/* The header is a fixed 70px row; letting the wordmark wrap makes it
   taller than the row and the page shows through beside it. */
@media (max-width: 400px) { .logo { font-size: 0.98rem; } .logo-muted { display: none; } }
.logo-muted { color: var(--text-dim); font-weight: 500; }

.primary-nav ul { list-style: none; display: flex; gap: 1.9rem; }
.primary-nav a { color: var(--text-mid); font-weight: 500; font-size: 0.92rem; position: relative; transition: color 0.2s; }
.primary-nav a::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.25s var(--ease); }
.primary-nav a:hover { color: var(--text); }
.primary-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 0.7rem; }
.theme-toggle { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; transition: border-color 0.2s, background 0.2s, transform 0.2s; }
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle-icon { width: 15px; height: 15px; border-radius: 50%; background: var(--text); box-shadow: inset -5px -3px 0 0 var(--surface); transition: all 0.4s var(--ease); }
[data-theme="light"] .theme-toggle-icon { background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; width: 38px; height: 38px; border: 1px solid var(--border-2); border-radius: 11px; background: var(--surface); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .bar { width: 17px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s var(--ease); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(5rem, 13vw, 10rem) 0 clamp(4.5rem, 10vw, 7.5rem);
  overflow: hidden;
}

/* aurora backdrop: three drifting color fields + blueprint grid */
.hero-backdrop { position: absolute; inset: -44px; pointer-events: none; transition: transform 0.55s var(--ease); will-change: transform; }
.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.55;
  will-change: transform;
}
.aurora-a {
  width: 56vw; height: 56vw; max-width: 760px; max-height: 760px;
  top: -24%; right: -10%;
  background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 65%);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.aurora-b {
  width: 44vw; height: 44vw; max-width: 600px; max-height: 600px;
  top: 6%; left: -16%;
  background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent 65%);
  animation: drift-b 26s ease-in-out infinite alternate;
}
.aurora-c {
  width: 34vw; height: 34vw; max-width: 460px; max-height: 460px;
  bottom: -18%; right: 24%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent-3) 20%, transparent), transparent 65%);
  animation: drift-c 30s ease-in-out infinite alternate;
}
@keyframes drift-a { from { transform: translate(0, 0) scale(1); } to { transform: translate(-7%, 9%) scale(1.12); } }
@keyframes drift-b { from { transform: translate(0, 0) scale(1); } to { transform: translate(10%, -6%) scale(1.08); } }
@keyframes drift-c { from { transform: translate(0, 0) scale(1); } to { transform: translate(-8%, -10%) scale(1.15); } }

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 0%, #000 20%, transparent 78%);
}

/* soft fade into the next section */
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 9rem; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }

.hero-inner { position: relative; }
/* The facts row lives outside .hero-inner so it can leave the hero on a
   later schedule than the copy above it — see the scroll-scrubbed depth
   section further down. Its spacing still comes from .hero-cta's bottom
   margin, which collapses through. */
.hero-coda { position: relative; }

.hero-status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 1rem; border: 1px solid var(--border-2); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text-mid); font-size: 0.8rem; margin-bottom: 2.2rem;
  box-shadow: var(--shadow-sm);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: relative; box-shadow: 0 0 8px 0 color-mix(in srgb, var(--good) 60%, transparent); }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--good); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.7; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

.hero-title {
  font-size: clamp(2.9rem, 8.2vw, 6.2rem);
  line-height: 0.99;
  letter-spacing: -0.042em;
  font-weight: 700;
  margin-bottom: 1.7rem;
}
.hero-title .accent-serif { letter-spacing: -0.01em; }
.hero-title .hero-line { display: inline-block; opacity: 0; transform: translateY(0.55em); }
.hero-title.in .hero-line { animation: line-rise 0.9s var(--ease) forwards; }
.hero-title.in .hero-line:nth-of-type(2) { animation-delay: 0.14s; }
@keyframes line-rise { to { opacity: 1; transform: none; } }

.hero-sub { max-width: 50ch; color: var(--text-mid); font-size: clamp(1.06rem, 1.7vw, 1.26rem); line-height: 1.62; margin-bottom: 2.4rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 3.6rem; }

.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; border-top: 1px solid var(--border); padding-top: 2rem; max-width: 820px; }
.hero-facts > div { padding-left: 1.4rem; border-left: 1px solid var(--border); }
.hero-facts > div:first-child { padding-left: 0; border-left: none; }
.hero-facts dt { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem; }
.hero-facts dd { font-size: 0.93rem; color: var(--text); line-height: 1.5; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 0.95rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex; align-items: center; gap: 2.4rem;
  white-space: nowrap; width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  font: 600 0.78rem var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
}
.marquee-track i { font-style: normal; color:var(--accent-text,var(--accent)); font-size: 0.6rem; opacity: 0.7; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---------- section scaffolding ---------- */
.section { padding: clamp(4.5rem, 10vw, 8rem) 0; position: relative; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: clamp(2.6rem, 5vw, 3.6rem); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: flex; align-items: center; gap: 0.9rem;
  color:var(--accent-text,var(--accent)); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.74rem; margin-bottom: 1.1rem;
}
.eyebrow::after { content: ""; flex: 0 0 3.2rem; height: 1px; background: linear-gradient(90deg, var(--accent), transparent); }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::after { display: none; }
.section-head h2 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -0.032em; line-height: 1.05; margin-bottom: 1.1rem; }
.section-sub { color: var(--text-mid); font-size: 1.06rem; line-height: 1.62; max-width: 58ch; }
.section-head.center .section-sub { margin: 0 auto; }

/* ---------- demos ---------- */
.demos { display: flex; flex-direction: column; gap: clamp(4rem, 8vw, 6.5rem); }
.demo { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(1.8rem, 4vw, 3.5rem); align-items: center; }
.demo.reverse .demo-copy { order: 2; }
.demo.reverse .demo-app { order: 1; }
.demo-tag { display: inline-flex; color:var(--accent-text,var(--accent)); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.85rem; padding: 0.32rem 0.7rem; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; background: var(--accent-soft); }
.demo-copy h3 { font-size: clamp(1.55rem, 2.8vw, 2.1rem); letter-spacing: -0.028em; margin-bottom: 0.9rem; }
.demo-copy > p { color: var(--text-mid); margin-bottom: 1.2rem; }
.demo-points { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.demo-points li { position: relative; padding-left: 1.5rem; color: var(--text-mid); font-size: 0.94rem; }
.demo-points li::before { content: ""; position: absolute; left: 0; top: 0.58em; width: 7px; height: 7px; border-radius: 2px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px -2px var(--accent); }

.demo-app { min-width: 0; perspective: 1400px; }
.chat-shell, .counter-shell, .json-shell {
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
  overflow: hidden;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.chat-shell:hover, .counter-shell:hover, .json-shell:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 0 95px -20px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* cursor spotlight (JS feeds --mx / --my) */
.spotlight { position: relative; }
.spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  border-radius: inherit; pointer-events: none;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--spot-color), transparent 70%);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* business + audience switchers */
.biz-switch, .aud-switch { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.3rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--hairline); }
.biz-switch { margin-top: 1.6rem; }
.aud-switch { margin-top: 0.6rem; }
.biz-tab, .aud-tab { font: 600 0.84rem var(--font); padding: 0.5rem 0.95rem; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-dim); cursor: pointer; transition: 0.2s var(--ease); white-space: nowrap; }
.biz-tab:hover, .aud-tab:hover { color: var(--text); }
.biz-tab.is-active, .aud-tab.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color:var(--accent-text,var(--accent)); }

/* chat */
.chat-bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chat-dots { display: inline-flex; gap: 5px; }
.chat-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.chat-dots i:nth-child(1) { background: #ff5f57; }
.chat-dots i:nth-child(2) { background: #febc2e; }
.chat-dots i:nth-child(3) { background: #28c840; }
.chat-bar .mono { color: var(--text-dim); margin-right: auto; }
.chat-biz { color:var(--accent-text,var(--accent)); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.chat-log { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; min-height: 240px; max-height: 340px; overflow-y: auto; }
.bubble { max-width: 85%; padding: 0.7rem 0.95rem; border-radius: 15px; font-size: 0.9rem; line-height: 1.45; animation: bubble-in 0.35s var(--ease); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bubble.bot { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.user { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; box-shadow: 0 6px 16px -10px var(--accent); }
.chat-options { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 1.1rem 0.9rem; }
.chat-options button { font: 500 0.84rem var(--font); padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; transition: 0.2s var(--ease); }
.chat-options button:hover { border-color: var(--accent); color:var(--accent-text,var(--accent)); transform: translateY(-1px); }
.chat-options .end-chip { opacity: 0.85; cursor: default; border-style: dashed; color: var(--good); border-color: var(--good); background: color-mix(in srgb, var(--good) 9%, transparent); }
.chat-options .end-chip:hover { transform: none; color: var(--good); border-color: var(--good); }
.chat-nav { display: flex; gap: 0.5rem; padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.chat-nav-btn { flex: 1; font: 500 0.82rem var(--font); padding: 0.55rem 0.7rem; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface); color: var(--text-mid); cursor: pointer; transition: 0.2s var(--ease); }
.chat-nav-btn:hover:not(:disabled) { border-color: var(--accent); color:var(--accent-text,var(--accent)); transform: translateY(-1px); }
.chat-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* counter */
.counter-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; padding: 1.2rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.counter-totals > div { position: relative; padding-left: 0.9rem; }
.counter-totals > div:first-child { padding-left: 0; }
.counter-totals > div + div::before { content: ""; position: absolute; left: 0; top: 0.1rem; bottom: 0.1rem; width: 1px; background: var(--border); }
.counter-totals p.value { font: 600 1.3rem var(--mono); font-feature-settings: "tnum"; margin-top: 0.25rem; letter-spacing: -0.01em; }
.counter-totals .mono.tiny { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.counter-totals .grand p.value {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; padding: 1.3rem; }
.money-col h4 { color: var(--text-dim); text-transform: uppercase; margin-bottom: 0.9rem; letter-spacing: 0.1em; }
.money-row { display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.money-row label { font: 600 0.86rem var(--mono); color: var(--text-mid); }
.money-row input { width: 100%; padding: 0.42rem 0.55rem; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); color: var(--text); font: 500 0.86rem var(--mono); transition: border-color 0.2s, box-shadow 0.2s; }
.money-row input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.row-total { font: 500 0.82rem var(--mono); color: var(--text-dim); font-feature-settings: "tnum"; min-width: 4.5rem; text-align: right; }

/* featured demo — embedded full product (Eliza's Math) */
.demo.featured { grid-template-columns: 1fr; gap: clamp(1.6rem, 3vw, 2.4rem); }
.demo.featured .demo-copy { max-width: 72ch; }
.featured-cta { display: flex; align-items: center; gap: 0.9rem 1.2rem; flex-wrap: wrap; margin-top: 1.6rem; }
.featured-hint { color: var(--text-dim); }

.app-frame {
  border: 1px solid transparent; border-radius: var(--radius); overflow: hidden;
  background: var(--card-bg); box-shadow: var(--shadow), var(--glow);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.app-frame:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 0 110px -18px color-mix(in srgb, var(--accent) 66%, transparent);
}
.app-frame-bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.frame-dots { display: inline-flex; gap: 5px; }
.frame-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.frame-dots i:nth-child(1) { background: #ff5f57; }
.frame-dots i:nth-child(2) { background: #febc2e; }
.frame-dots i:nth-child(3) { background: #28c840; }
.frame-url { color: var(--text-dim); margin-right: auto; }
.frame-expand { color: var(--text-mid); border: 1px solid var(--border-2); border-radius: 999px; padding: 0.22rem 0.7rem; transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.frame-expand:hover { color:var(--accent-text,var(--accent)); border-color: var(--accent); }
.app-frame-view { display: block; width: 100%; height: clamp(540px, 72vh, 700px); border: 0; background: #eef2ff; }
@media (max-width: 560px) { .app-frame-view { height: 560px; } }

/* work aside */
.work-aside {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.8rem 2rem;
  border: 1px solid transparent; border-radius: var(--radius);
  background: var(--card-bg); box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.work-aside:hover { transform: translateY(-3px); box-shadow: var(--shadow), var(--glow); }
.work-aside-copy h3 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0.3rem 0 0.4rem; }
.work-aside-copy p { color: var(--text-mid); font-size: 0.92rem; max-width: 52ch; }
.work-aside .eyebrow { color: var(--text-dim); margin-bottom: 0; }
.work-aside .eyebrow::after { display: none; }

/* ---------- capabilities ---------- */
.cap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.cap-card {
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 2rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.cap-card:hover { transform: translateY(-6px); box-shadow: var(--shadow), var(--glow); }
.cap-card::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent); opacity: 0; transition: opacity 0.3s; }
.cap-card:hover::after { opacity: 1; }
.cap-num {
  display: block; font-size: 2.2rem; font-weight: 600;
  margin-bottom: 1rem; letter-spacing: -0.02em; line-height: 1;
  background: linear-gradient(160deg, var(--text) 0%, transparent 160%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.32;
}
.cap-card h3 { font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 0.7rem; }
.cap-card p { color: var(--text-mid); font-size: 0.94rem; margin-bottom: 1.4rem; }
.cap-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cap-tags li { font-size: 0.74rem; padding: 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); background: var(--surface-2); transition: color 0.2s, border-color 0.2s; }
.cap-card:hover .cap-tags li { color: var(--text-mid); }

/* ---------- process ---------- */
.step-num {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem); font-weight: 600; line-height: 1;
  min-width: 4.2rem; letter-spacing: -0.03em;
  background: linear-gradient(170deg, var(--accent), var(--accent-2) 120%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}

/* ---------- contact ---------- */
/* clip, not hidden: overflow:hidden makes this a scroll container, and
   any view() timeline inside would then resolve against a box that
   never scrolls — pinning those animations at 100% forever. */
.contact { overflow: clip; }
.contact-card {
  position: relative;
  max-width: 600px; margin: 0 auto; text-align: center;
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: clamp(2.3rem, 5vw, 3.4rem);
  box-shadow: var(--shadow), var(--glow);
}
.contact-label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.8rem; }
.contact-email { display: inline-block; font: 600 clamp(1rem, 2.6vw, 1.45rem) var(--mono); color: var(--text); word-break: break-all; margin-bottom: 1.7rem; transition: color 0.2s; }
.contact-email:hover { color:var(--accent-text,var(--accent)); }
.contact-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.7rem; }
.contact-foot { color: var(--text-dim); }

/* ---------- footer ---------- */
/* clip rather than hidden — see the note on .contact above */
.site-footer { border-top: 1px solid var(--border); padding: clamp(2rem, 5vw, 3.2rem) 0 2.4rem; background: var(--bg-2); overflow: clip; }
.footer-word {
  font-size: clamp(4rem, 16vw, 12rem);
  font-weight: 800; line-height: 0.78; letter-spacing: -0.05em;
  text-align: center; user-select: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 14%, transparent), transparent 92%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: clamp(1.4rem, 4vw, 2.6rem);
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 1.6rem; }
.site-footer .logo-text { letter-spacing: -0.02em; font-weight: 700; }
.site-footer .mono.tiny { color: var(--text-dim); }
.footer-top { color: var(--text-mid); font-size: 0.85rem; font-weight: 500; transition: color 0.2s; }
.footer-top:hover { color:var(--accent-text,var(--accent)); }

/* ---------- reveal animation ----------
   Only hidden when JS is running — without it the content stays visible
   rather than being permanently stuck at opacity 0. */
html.js [data-reveal] {
  opacity: 0; transform: translateY(26px) scale(0.985);
  filter: blur(6px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js [data-reveal].in { opacity: 1; transform: none; filter: none; }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { filter: none; transform: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .demo, .demo.reverse .demo-copy, .demo.reverse .demo-app { grid-template-columns: 1fr; order: 0; }
  .demo { grid-template-columns: 1fr; }
  .cap-grid { grid-template-columns: 1fr; }
  .hero-facts { grid-template-columns: 1fr; gap: 0; }
  .hero-facts > div { padding-left: 0; border-left: none; padding-top: 1rem; border-top: 1px solid var(--border); }
  .hero-facts > div:first-child { padding-top: 0; border-top: none; }
  .step-num { min-width: 3.2rem; }
}

@media (max-width: 720px) {
  .primary-nav ul {
    position: fixed; top: 70px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1.5rem; transform: translateY(-120%);
    transition: transform 0.35s var(--ease); z-index: 90;
  }
  .primary-nav ul.open { transform: none; box-shadow: var(--shadow); }
  .primary-nav li { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: flex; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .header-actions .btn { display: none; }
  .money-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v3 visual layer — animated gradients, depth & pointer motion
   Additive on top of v2. Every animation here is frozen by the
   global prefers-reduced-motion rule near the top of this file,
   and all pointer-driven motion is gated on (hover: hover) in JS.
   ============================================================ */

@property --logo-angle { syntax: "<angle>"; inherits: false; initial-value: 210deg; }
@property --halo-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

@keyframes grad-flow   { 0%, 100% { background-position: 0% center; } 50% { background-position: 100% center; } }
@keyframes grad-slide  { to { background-position: 200% 0; } }
@keyframes logo-rotate { to { --logo-angle: 570deg; } }
@keyframes halo-spin   { to { --halo-angle: 360deg; } }

/* soft cinematic vignette for depth — sits under the film grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1999; pointer-events: none;
  background: radial-gradient(130% 100% at 50% -8%, transparent 56%, rgba(0, 0, 0, 0.3) 125%);
}
[data-theme="light"] body::before {
  background: radial-gradient(130% 100% at 50% -8%, transparent 64%, rgba(20, 30, 60, 0.06) 125%);
}

/* pointer-tracked 3D tilt (JS sets --tilt-x/--tilt-y and toggles .is-tilting) */
.tilt-card { transform-style: preserve-3d; will-change: transform; }
.tilt-card.is-tilting {
  transform: perspective(900px)
             rotateX(var(--tilt-x, 0deg))
             rotateY(var(--tilt-y, 0deg))
             translateY(-6px);
  transition: transform 0.12s var(--ease);
}

/* magnetic CTAs lean toward the pointer (JS writes the transform) */
.btn.primary { will-change: transform; }

/* contact card — the CTA focal point — gets a slowly rotating conic
   gradient hairline (same padding-box / border-box trick as --card-bg) */
.contact-card {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--halo-angle),
      color-mix(in srgb, var(--accent) 72%, transparent),
      var(--accent-2),
      var(--accent-3),
      color-mix(in srgb, var(--accent) 72%, transparent)) border-box;
  border-width: 1.5px;
  animation: halo-spin 14s linear infinite;
}

/* ============================================================
   v4 scroll layer — motion driven by scroll position, not by time
   ------------------------------------------------------------
   Two mechanisms, used deliberately:

   1. Native CSS scroll-driven animations (animation-timeline:
      scroll() / view()). These run off the main thread, so they stay
      smooth during heavy scrolling. Used for every effect that is a
      pure function of "how far has this element travelled through the
      viewport" — hero exit, parallax, card entries, footer word.
      Gated on html.sdt, which the boot script in index.html sets.

   2. A single rAF scroll driver in main.js, which publishes progress
      and damped velocity. Used only where real state is needed: the
      pinned process scene, the velocity-reactive marquee, the rail.
      This path also carries the no-sdt fallback.

   Every keyframe set below animates FROM a hidden state TO the natural
   one, so removing the animation (reduced motion, unsupported browser,
   no JS) leaves the element in its correct resting state. Nothing here
   can strand content at opacity: 0.
   ============================================================ */

/* overflow-x: clip contains the marquee and aurora bleed exactly like
   hidden did, but without turning <body> into a scroll container —
   which keeps position: sticky and scroll timelines resolving against
   the viewport. */
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

/* ---------- hero: scroll-scrubbed depth ---------- */

/* Parallax layers. Transform ownership is split three ways so the
   pointer drift (.hero-backdrop), the scroll parallax (.hero-layer) and
   the idle drift keyframes (.aurora) never overwrite each other. */
.hero-layer { position: absolute; inset: 0; will-change: transform; }

html.sdt .hero-layer {
  animation: layer-drift linear both;
  animation-timeline: scroll(root block);
  animation-range: 0 100vh;
}
/* Each layer travels a different distance over the same scroll, which is
   what reads as depth. --depth is written from the data-depth attribute
   by main.js. */
@keyframes layer-drift {
  to { transform: translate3d(0, calc(var(--depth, 0.3) * 260px), 0); }
}

/* The hero content recedes as you leave it. Drift and dissolve are two
   animations rather than one keyframe set so the facts row can share the
   drift exactly while fading on a schedule of its own — the hold before
   each fade is expressed as the range start rather than a keyframe
   percentage, so the scroll distance is readable straight off the rule. */
html.sdt .hero-inner,
html.sdt .hero-coda {
  animation: hero-drift linear both, hero-dissolve linear both;
  animation-timeline: scroll(root block), scroll(root block);
}
/* Nothing dissolves for the first quarter of a screen — the hero should
   feel solid while you are still reading it, and only recede on the way
   out. */
html.sdt .hero-inner { animation-range: 0 78vh, 26vh 78vh; }
/* The facts row is the last thing in the hero to reach a comfortable
   reading position — by the time it is mid-screen the copy above it has
   already gone. So it holds full contrast for another half-screen of
   scroll and only dissolves as it leaves the top, which is the whole
   point of the effect anyway. */
html.sdt .hero-coda { animation-range: 0 78vh, 74vh 122vh; }

@keyframes hero-drift   { to { transform: translate3d(0, -70px, 0) scale(0.96); } }
@keyframes hero-dissolve { to { opacity: 0; filter: blur(4px); } }

/* JS fallback: main.js writes --hero-p (0..1) when scroll timelines are
   unavailable — which today still means Firefox. Same motion, driven
   from the rAF loop instead of the compositor. --hero-q is the facts
   row's later dissolve, on the same 74vh→122vh window as above.

   Both are registered and written on .hero, not on :root. An
   unregistered inherited custom property set on the root element
   invalidates style for the whole document on every frame; typing them
   and scoping them keeps the work inside the hero subtree. */
@property --hero-p { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --hero-q { syntax: "<number>"; inherits: true; initial-value: 0; }

html.no-sdt .hero-layer { transform: translate3d(0, calc(var(--depth, 0.3) * var(--hero-p) * 260px), 0); }
html.no-sdt .hero-inner {
  opacity: calc(1 - var(--hero-p));
  transform: translate3d(0, calc(var(--hero-p) * -70px), 0);
}
html.no-sdt .hero-coda {
  opacity: calc(1 - var(--hero-q));
  transform: translate3d(0, calc(var(--hero-p) * -70px), 0);
}

/* ---------- marquee: reacts to scroll velocity ----------
   main.js takes over the transform entirely (it needs to reverse
   direction), so the CSS keyframe animation is dropped once it engages. */
.marquee-track.is-driven { animation: none; will-change: transform; }
.marquee { --skew: 0deg; }
.marquee-track.is-driven { transform: translate3d(var(--mx-offset, 0px), 0, 0) skewX(var(--skew, 0deg)); }

/* ---------- section headings: word-by-word rise ----------
   No will-change here: there are ~30 of these spans across the page and
   promoting every one costs more in layer memory than it saves. No
   blur either — a changing blur radius can't reuse a cached texture, so
   it re-runs a convolution per span per frame. Opacity and transform
   alone stay on the compositor. */
.section-head h2 .w {
  display: inline-block;
  white-space: pre-wrap;      /* the splitter keeps spaces inside the spans */
}
html.sdt .section-head h2.split .w {
  animation: word-rise linear both;
  animation-timeline: view(block);
  /* per-word range is written inline by the splitter, giving a true
     scroll-position stagger rather than a time delay */
  animation-range: entry 12% entry 62%;
}
@keyframes word-rise {
  from { opacity: 0; transform: translate3d(0, 0.62em, 0) rotate(2.5deg); }
  to   { opacity: 1; transform: none; }
}
/* h2s that are word-split don't also need the block-level reveal */
.section-head h2.split { opacity: 1 !important; transform: none !important; filter: none !important; }

/* ---------- demo shells: entry on scroll ----------
   These are the most expensive elements on the page to move: large
   panels carrying box-shadow, a gradient hairline border and
   backdrop-filter descendants. Scaling or rotating them re-rasterises
   that whole surface every frame — measured as the single biggest
   scroll cost in this layer. Translate + fade only, which the
   compositor can serve from one cached texture. */
html.sdt .demo-app > * {
  animation: app-enter linear both;
  animation-timeline: view(block);
  animation-range: entry 5% cover 32%;
}
@keyframes app-enter {
  from { opacity: 0; transform: translate3d(0, 52px, 0); }
  to   { opacity: 1; transform: none; }
}
/* The embedded iframe must not be transformed while it is live — a
   transformed ancestor makes it a containing block and Safari repaints
   the whole document. Fade only. */
html.sdt .demo.featured .demo-app > * { animation-name: app-enter-flat; }
@keyframes app-enter-flat {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- capability cards: staggered scroll entry ---------- */
html.sdt .cap-grid .cap-card {
  animation: card-rise linear both;
  animation-timeline: view(block);
}
html.sdt .cap-grid .cap-card:nth-child(1) { animation-range: entry 6%  entry 74%; }
html.sdt .cap-grid .cap-card:nth-child(2) { animation-range: entry 12% entry 80%; }
html.sdt .cap-grid .cap-card:nth-child(3) { animation-range: entry 18% entry 86%; }
html.sdt .cap-grid .cap-card:nth-child(4) { animation-range: entry 24% entry 92%; }
@keyframes card-rise {
  from { opacity: 0; transform: translate3d(0, 54px, 0); }
  to   { opacity: 1; transform: none; }
}
/* the tilt handler owns transform once the pointer is over the card */
html.sdt .cap-card.is-tilting { animation: none; }

/* ---------- footer word: scrubs open as you land ----------
   Each letter carries its own gradient rather than inheriting the
   parent's background-clip: text. Promoting a span with will-change
   gives it its own layer, and the parent's clipped background stops
   painting behind it — the text would render fully transparent. */
.footer-word .l {
  display: inline-block;
  background: linear-gradient(180deg, color-mix(in srgb, var(--text) 15%, transparent), transparent 94%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* Driven off root scroll, not view(): this word sits at the very bottom
   of the document, and an entry/cover range there can never finish —
   the page runs out of scroll before the element finishes entering, so
   the letters would stall part-open. Root progress always reaches 100%.
   Per-letter ranges are written inline by the splitter in main.js. */
html.sdt .footer-word.split .l {
  animation: letter-open linear both;
  animation-timeline: scroll(root block);
  animation-range: 88% 99%;
}
@keyframes letter-open {
  from { opacity: 0; transform: translate3d(0, 42%, 0) scaleY(0.7); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Pinned process scene
   .scene is a tall scroll track; .scene-stage pins inside it and
   main.js maps the scroll across the track to a single 0..1 value.
   ============================================================ */

.process { padding-bottom: 0; }

.scene { position: relative; height: 320vh; }
.scene-stage {
  position: sticky; top: 0;
  height: 100vh; min-height: 620px;
  display: flex; align-items: center;
  overflow: hidden;
}
.scene-inner {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  width: 100%;
}

/* --- the three steps --- */
.scene-steps { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; position: relative; }
.scene-step {
  display: flex; gap: clamp(1rem, 2.4vw, 1.8rem); align-items: flex-start;
  padding: 1.5rem 1.4rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  opacity: 0.3;
  transform: translate3d(0, 0, 0) scale(0.97);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease),
              background 0.45s var(--ease), border-color 0.45s var(--ease);
}
.scene-step.is-active {
  opacity: 1; transform: none;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
/* steps already walked past stay legible but recede */
.scene-step.is-done { opacity: 0.5; }
.scene-step h3 { font-size: clamp(1.15rem, 2.2vw, 1.35rem); letter-spacing: -0.02em; margin-bottom: 0.45rem; }
.scene-step p { color: var(--text-mid); max-width: 46ch; font-size: 0.95rem; }
.scene-step .step-num { opacity: 0.4; transition: opacity 0.45s var(--ease); }
.scene-step.is-active .step-num { opacity: 1; }

/* --- vertical progress rail down the middle --- */
.scene-rail {
  position: absolute; left: 50%; top: 12%; bottom: 12%;
  width: 2px; transform: translateX(-50%);
  background: var(--border); border-radius: 2px; overflow: hidden;
}
.scene-rail-fill {
  display: block; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 14px -2px var(--accent);
}

/* --- the build panel: a mirror of the steps that actually runs --- */
.scene-panel {
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.panel-bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.panel-title { color: var(--text-dim); margin-right: auto; }
.panel-pct { color:var(--accent-text,var(--accent)); font-feature-settings: "tnum"; }
.panel-log {
  list-style: none; margin: 0; padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 19rem; justify-content: flex-start;
}
.panel-log li {
  color: var(--text-mid); line-height: 1.5;
  opacity: 0; transform: translate3d(-6px, 4px, 0);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), color 0.35s var(--ease);
}
.panel-log li.on { opacity: 1; transform: none; }
.panel-log li b { color:var(--accent-text,var(--accent)); font-weight: 600; }
/* the most recently revealed line is the "live" one */
.panel-log li.cur { color: var(--text); }
.panel-foot {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2);
}
.panel-track { flex: 1; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.panel-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 12px -2px var(--accent);
}
.panel-state { color: var(--text-dim); min-width: 5.5rem; text-align: right; text-transform: lowercase; }
.scene-panel[data-state="live"] .panel-state { color: var(--good); }
.scene-panel[data-state="live"] { box-shadow: var(--shadow), 0 0 90px -20px color-mix(in srgb, var(--good) 55%, transparent); }

/* ---------- section rail ---------- */
.rail {
  position: fixed; right: clamp(0.8rem, 2vw, 1.6rem); top: 50%;
  transform: translateY(-50%); z-index: 90;
}
.rail-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem;
  padding: 0.34rem 0.2rem;
}
.rail-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border-2);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.rail-label {
  color: var(--text-dim); opacity: 0; transform: translateX(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), color 0.25s var(--ease);
  pointer-events: none; white-space: nowrap;
}
.rail:hover .rail-label { opacity: 1; transform: none; }
.rail a:hover .rail-dot { background: var(--text-mid); }
.rail a.is-current .rail-dot {
  background: var(--accent); transform: scale(1.5);
  box-shadow: 0 0 10px -1px var(--accent);
}
.rail a.is-current .rail-label { color:var(--accent-text,var(--accent)); }
@media (max-width: 1320px) { .rail { display: none; } }

/* ---------- responsive: unpin the scene ----------
   Pinning is a desktop affordance. On narrow screens the scene becomes
   an ordinary stacked list and main.js switches to plain reveals. */
@media (max-width: 900px) {
  .scene { height: auto; }
  .scene-stage { position: static; height: auto; min-height: 0; padding: 1rem 0 clamp(3rem, 8vw, 5rem); overflow: visible; }
  .scene-inner { grid-template-columns: 1fr; gap: 2rem; }
  .scene-rail { display: none; }
  .scene-step { opacity: 1; transform: none; }
  .panel-log { min-height: 0; }
  .panel-log li { opacity: 1; transform: none; }
}

/* ---------- reduced motion ----------
   Scroll-driven animations are progress-based, so the global
   animation-duration override near the top of this file does not stop
   them. They have to be removed outright. Every element then sits at
   its natural resting state, which is the finished one. */
@media (prefers-reduced-motion: reduce) {
  html.sdt .hero-layer,
  html.sdt .hero-inner,
  html.sdt .hero-coda,
  html.sdt .section-head h2.split .w,
  html.sdt .demo-app > *,
  html.sdt .cap-grid .cap-card,
  html.sdt .footer-word.split .l {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
  html.no-sdt .hero-layer,
  html.no-sdt .hero-inner,
  html.no-sdt .hero-coda { transform: none !important; opacity: 1 !important; }

  .scene { height: auto; }
  .scene-stage { position: static; height: auto; min-height: 0; overflow: visible; padding-bottom: 3rem; }
  .scene-rail { display: none; }
  .scene-step { opacity: 1 !important; transform: none !important; }
  .panel-log li { opacity: 1 !important; transform: none !important; }
  .marquee-track.is-driven { transform: none !important; }
}

/* ============================================================
   v5 layer — signal & conversion
   Hero constellation, command menu (⌘K), cursor halo,
   engagement + FAQ sections, and the 20-second brief builder.
   All motion respects the global reduced-motion rules; the
   pointer-driven pieces are created in JS only on fine pointers.
   ============================================================ */

/* ---------- hero constellation canvas ----------
   Sits above the aurora fields but under the content, inside the
   pointer-parallaxed backdrop so it drifts with the rest of the scene. */
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- ⌘K hint chip in the header ---------- */
.cmdk-hint {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 0.75rem;
  border: 1px solid var(--border-2); border-radius: 11px;
  background: var(--surface); color: var(--text-dim);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cmdk-hint:hover { color:var(--accent-text,var(--accent)); border-color: var(--accent); transform: translateY(-1px); }
@media (max-width: 860px) { .cmdk-hint { display: none; } }

/* ---------- command menu ---------- */
.cmdk {
  inset: 0; margin: min(14vh, 160px) auto auto;
  width: min(560px, calc(100vw - 2rem));
  border: none; padding: 0; background: transparent; overflow: visible;
}
.cmdk::backdrop {
  background: rgba(4, 6, 12, 0.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.cmdk-frame {
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
  overflow: hidden;
}
.cmdk[open] .cmdk-frame { animation: cmdk-pop 0.3s var(--ease); }
@keyframes cmdk-pop {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.cmdk-top {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.cmdk-glyph { color:var(--accent-text,var(--accent)); font-weight: 700; font-size: 1.05rem; }
.cmdk-input {
  flex: 1; min-width: 0; background: transparent; border: none;
  color: var(--text); font: 500 0.98rem var(--font); letter-spacing: -0.005em;
}
.cmdk-input:focus { outline: none; }
.cmdk-input::placeholder { color: var(--text-dim); }
.cmdk-top kbd {
  border: 1px solid var(--border-2); border-radius: 6px;
  padding: 0.14rem 0.45rem; color: var(--text-dim);
}
.cmdk-list { list-style: none; margin: 0; padding: 0.55rem; max-height: min(46vh, 380px); overflow-y: auto; }
.cmdk-group {
  padding: 0.6rem 0.75rem 0.3rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.cmdk-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.62rem 0.75rem; border-radius: var(--radius-xs);
  color: var(--text-mid); font-size: 0.92rem; font-weight: 500;
  cursor: pointer;
}
.cmdk-item .k-hint { margin-left: auto; color: var(--text-dim); font: 500 0.66rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.cmdk-item.is-sel {
  background: var(--accent-soft); color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.cmdk-item.is-sel .k-hint { color:var(--accent-text,var(--accent)); }
.cmdk-empty { padding: 1.1rem 0.75rem; color: var(--text-dim); }
.cmdk-foot {
  display: flex; gap: 1.2rem;
  padding: 0.6rem 1.1rem; border-top: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-dim);
}
body:has(dialog[open]) { overflow: hidden; }

/* ---------- cursor halo ----------
   The element only exists when JS confirms a fine pointer, so there is
   no touch-device cost. Native cursor stays — this is an accent, not a
   replacement. */
.cursor-halo {
  position: fixed; left: 0; top: 0; z-index: 2400;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 50%;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s var(--ease), width 0.22s var(--ease), height 0.22s var(--ease),
              margin 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
  will-change: transform;
}
.cursor-halo.is-on { opacity: 1; }
.cursor-halo.is-hot {
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.cursor-halo.is-down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }

/* ---------- engagement models ---------- */
.eng-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; }
.eng-card {
  display: flex; flex-direction: column; gap: 0.85rem;
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 2rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.eng-card:hover { transform: translateY(-6px); box-shadow: var(--shadow), var(--glow); }
.eng-card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.eng-card:hover::after { opacity: 1; }
.eng-kicker { color:var(--accent-text,var(--accent)); text-transform: uppercase; letter-spacing: 0.12em; }
.eng-card h3 { font-size: 1.35rem; letter-spacing: -0.02em; }
.eng-card > p { color: var(--text-mid); font-size: 0.94rem; }
.eng-card > p:nth-of-type(2) { flex: 1; }
.eng-best { border-top: 1px solid var(--border); padding-top: 0.9rem; color: var(--text-dim); font-size: 0.83rem; }
.eng-best b { color: var(--text-mid); font-weight: 600; }
.eng-note { margin-top: 2.2rem; text-align: center; color: var(--text-dim); font-size: 0.92rem; }
.eng-note em { color: var(--text-mid); }
@media (max-width: 860px) { .eng-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow 0.3s var(--ease);
}
.faq-item[open] { box-shadow: var(--shadow-sm), var(--glow); }
.faq-item summary {
  list-style: none; display: flex; align-items: center; gap: 1rem;
  padding: 1.05rem 1.3rem; cursor: pointer;
  font-weight: 600; font-size: 0.97rem; letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}
.faq-item summary:hover { color:var(--accent-text,var(--accent)); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon {
  position: relative; margin-left: auto; flex: 0 0 22px;
  width: 22px; height: 22px;
  border: 1px solid var(--border-2); border-radius: 50%;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease);
}
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 8px; height: 1.5px; background: var(--text-mid); border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: background 0.3s var(--ease);
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item[open] .faq-icon { transform: rotate(45deg); border-color: var(--accent); }
.faq-item[open] .faq-icon::before, .faq-item[open] .faq-icon::after { background: var(--accent); }
.faq-body { padding: 0 1.3rem 1.2rem; color: var(--text-mid); font-size: 0.93rem; }
.faq-body p { max-width: 64ch; }
.faq-item[open] .faq-body { animation: faq-in 0.4s var(--ease); }
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 20-second brief builder (contact) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.chip-row + .chip-row { margin-top: 0.55rem; }
.chip {
  font: 600 0.8rem var(--font);
  padding: 0.5rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-mid);
  cursor: pointer; transition: 0.2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color:var(--accent-text,var(--accent));
}
.brief-preview {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.contact-divider {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 1.7rem 0 1.3rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.12em;
}
.contact-divider::before, .contact-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.contact-card .contact-email { margin-bottom: 1rem; }
.contact-card .contact-actions:last-of-type { margin-bottom: 1.4rem; }

/* ============================================================
   v6 layer — showpiece
   ------------------------------------------------------------
   1. Buttons and pressable surfaces: gradient borders, sheen,
      click ripple, a real press state.
   2. The process section rebuilt for non-technical readers —
      a lens toggle plus a three-act panel that assembles as
      you scroll, instead of a terminal log.
   3. Per-section moments: drawn capability glyphs, counting
      proof numbers, sheen on demo shells, hero title shimmer.

   Everything additive. Every new animation is either paused by
   the reduced-motion block at the end of this layer or resolves
   to its finished state there.
   ============================================================ */

@property --sheen { syntax: "<percentage>"; inherits: false; initial-value: -60%; }

/* ------------------------------------------------------------
   1 · PRESSABLE SURFACES
   ------------------------------------------------------------ */

/* The ripple span is appended by main.js on pointerdown and removed
   when its animation ends, so nothing accumulates in the DOM. Hosts
   need position + overflow, which .btn already has. */
.rip {
  position: absolute; z-index: 0;
  border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: 0.26;
  transform: translate(-50%, -50%) scale(0);
  animation: rip-out 0.62s var(--ease) forwards;
}
@keyframes rip-out { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
/* text sits above its own ripple */
.btn > :not(.rip), .chip > :not(.rip), .lens-btn > :not(.rip) { position: relative; z-index: 1; }

.btn {
  isolation: isolate;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s var(--ease);
}
/* !important so the press still reads on magnetic buttons, whose
   transform is written inline by the pointer handler */
.btn:active { transform: scale(0.965) !important; }

/* --- primary: a slow gradient drift, and a real glow on approach --- */
.btn.primary {
  background-image: linear-gradient(115deg,
    var(--accent) 0%, var(--accent-2) 32%, var(--accent-3) 52%, var(--accent-2) 74%, var(--accent) 100%);
  background-size: 260% 100%;
  animation: grad-flow 9s ease-in-out infinite;
}
.btn.primary:hover,
.btn.primary:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34),
              0 22px 48px -16px var(--accent),
              0 0 26px -6px color-mix(in srgb, var(--accent-2) 75%, transparent);
}

/* --- ghost: hairline becomes a live gradient on hover --- */
.btn.ghost {
  background:
    linear-gradient(color-mix(in srgb, var(--surface) 72%, transparent),
                    color-mix(in srgb, var(--surface) 72%, transparent)) padding-box,
    linear-gradient(120deg, var(--border-2), var(--border-2)) border-box;
  border: 1px solid transparent;
}
.btn.ghost::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(110deg, transparent 30%,
              color-mix(in srgb, var(--accent) 20%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.75s var(--ease);
}
.btn.ghost:hover::before { transform: translateX(100%); }
.btn.ghost:hover,
.btn.ghost:focus-visible {
  color:var(--accent-text,var(--accent));
  border-color: transparent;   /* the gradient below is the border now */
  background:
    linear-gradient(color-mix(in srgb, var(--surface) 84%, transparent),
                    color-mix(in srgb, var(--surface) 84%, transparent)) padding-box,
    linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3)) border-box;
  box-shadow: 0 16px 36px -20px var(--accent);
}

/* --- arrow grows a trail as it leaves --- */
.btn-arrow { position: relative; }
.btn-arrow::before {
  content: ""; position: absolute; right: 100%; top: 50%;
  height: 1.5px; width: 0; border-radius: 2px; background: currentColor;
  transform: translateY(-50%); opacity: 0.85;
  transition: width 0.3s var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn:hover .btn-arrow::before { width: 9px; }

/* chips and tabs get the same press language */
.chip, .biz-tab, .aud-tab { position: relative; overflow: hidden; }
.chip:active, .biz-tab:active, .aud-tab:active { transform: scale(0.96); }

/* ------------------------------------------------------------
   2 · PROCESS — plain-English lens + three-act panel
   ------------------------------------------------------------ */

/* --- the lens toggle --- */
.lens {
  position: relative; display: inline-flex; gap: 0.2rem;
  margin-top: 1.7rem; padding: 0.3rem;
  border: 1px solid var(--border-2); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}
.lens-thumb {
  position: absolute; top: 0.3rem; bottom: 0.3rem; left: 0.3rem;
  width: var(--lens-w, 8.4rem);
  transform: translateX(var(--lens-x, 0px));
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -14px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.48s var(--ease), width 0.48s var(--ease);
}
.lens-btn {
  position: relative; overflow: hidden; z-index: 1;
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 0; background: none; cursor: pointer;
  font: 600 0.83rem/1 var(--font); color: var(--text-mid);
  padding: 0.6rem 1.1rem; border-radius: 999px;
  transition: color 0.35s var(--ease);
  white-space: nowrap;
}
.lens-btn:hover { color: var(--text); }
.lens-btn.is-active { color: #fff; }
.lens-ico { font-size: 0.95em; opacity: 0.9; }

/* Copy swap: everything carrying an alternate wording blurs out,
   gets rewritten, and settles back. One pass, ~460ms total. */
.process [data-tech] {
  transition: opacity 0.24s var(--ease), filter 0.24s var(--ease), transform 0.24s var(--ease);
}
.process.is-swapping [data-tech] { opacity: 0; filter: blur(5px); transform: translateY(-4px); }

/* --- steps ---
   The pinned stage has to clear the sticky header and still fit three
   steps plus their meta line at 900px tall, so the scene runs on
   tighter type than the rest of the page. */
.scene-stage { padding-top: 70px; }
.scene-steps { gap: 0.15rem; }
.scene-step { padding: 1.05rem 1.15rem; gap: clamp(0.85rem, 1.9vw, 1.4rem); }
.scene-step .step-num { font-size: clamp(1.9rem, 3.4vw, 2.6rem); min-width: 3.1rem; }
.scene-step h3 { font-size: clamp(1.08rem, 1.9vw, 1.26rem); margin-bottom: 0.35rem; }
.scene-step p { font-size: 0.9rem; line-height: 1.55; max-width: 52ch; }

.step-body { min-width: 0; }
.step-meta {
  margin-top: 0.7rem; color: var(--text-dim);
  display: inline-block;
  padding: 0.32rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
  transition: border-color 0.45s var(--ease), color 0.45s var(--ease);
}
.step-meta b { color:var(--accent-text,var(--accent)); font-weight: 600; }
.scene-step.is-active .step-meta { border-color: color-mix(in srgb, var(--accent) 32%, transparent); color: var(--text-mid); }

/* the active step gets a lit left edge that grows into place */
.scene-step { position: relative; }
.scene-step::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px -2px var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.5s var(--ease);
}
.scene-step.is-active::before { transform: scaleY(1); }

/* --- the panel stage: three acts, one at a time --- */
.panel-stage { position: relative; min-height: 20.5rem; padding: 1.15rem; }
.act {
  position: absolute; inset: 1.15rem;
  display: flex; flex-direction: column; gap: 0.85rem;
  opacity: 0; pointer-events: none;
  transform: translate3d(0, 16px, 0) scale(0.985);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.act.is-live { opacity: 1; transform: none; }
.act.is-past { transform: translate3d(0, -16px, 0) scale(0.985); }
.act-kicker { color:var(--accent-text,var(--accent)); text-transform: uppercase; letter-spacing: 0.12em; }

/* anything inside an act that streams in against a scroll threshold */
.act [data-at] {
  opacity: 0; transform: translate3d(-7px, 5px, 0);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), color 0.4s var(--ease);
}
.act [data-at].on { opacity: 1; transform: none; }

/* ACT 01 — the one-page plan */
.paper {
  flex: 1; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  overflow: hidden;
}
.paper-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
}
.paper-title { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.015em; }
.paper-badge {
  color:var(--accent-text,var(--accent)); text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap;
  padding: 0.24rem 0.6rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft);
}
.paper-rows { list-style: none; flex: 1; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.72rem; }
.paper-rows li { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.88rem; color: var(--text-mid); line-height: 1.45; }
.pr-mark {
  flex: 0 0 7px; width: 7px; height: 7px; margin-top: 0.5em; border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px -2px var(--accent);
}
.paper-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1rem; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-dim);
}
/* the signature writes itself once the footer arrives */
.sig { width: 92px; height: 22px; flex: 0 0 auto; overflow: visible; }
.sig-path {
  stroke: var(--accent); stroke-width: 0.035;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.15s var(--ease) 0.1s;
}
.paper-foot.on .sig-path { stroke-dashoffset: 0; }

/* ACT 02 — the weekly preview */
.preview {
  flex: 1; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  overflow: hidden;
}
.preview-top {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.preview-label { margin-right: auto; }
.preview-open { color:var(--accent-text,var(--accent)); }
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good); position: relative;
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--good) 60%, transparent);
}
.dot-live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--good); opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
.tick-rows { list-style: none; flex: 1; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.tick-rows li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.88rem; color: var(--text-mid); line-height: 1.4; }
.tick {
  flex: 0 0 19px; width: 19px; height: 19px; position: relative;
  border: 1px solid var(--border-2); border-radius: 6px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.tick::after {
  content: ""; position: absolute; left: 6px; top: 2.5px;
  width: 5px; height: 9px;
  border: 0 solid transparent; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.34s var(--ease) 0.14s, border-color 0.2s var(--ease) 0.14s;
}
.tick-rows li.on .tick { background: color-mix(in srgb, var(--good) 18%, transparent); border-color: var(--good); }
.tick-rows li.on .tick::after { border-color: var(--good); transform: rotate(45deg) scale(1); }
/* the one still in flight reads as in-progress, not done */
.tick-rows li.wip.on .tick { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); animation: wip-pulse 1.8s ease-in-out infinite; }
.tick-rows li.wip.on .tick::after { border-color: transparent; transform: rotate(45deg) scale(0); }
.tick-rows li.wip.on .tick::before {
  content: ""; position: absolute; inset: 5px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 10px -1px var(--accent);
}
@keyframes wip-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.preview-note {
  padding: 0.8rem 1rem; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-dim); font-size: 0.84rem; line-height: 1.5;
}

/* ACT 03 — live, and handed over */
.mini-browser {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 62%, transparent);
  overflow: hidden;
}
.mb-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
.mb-bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); }
.mb-url {
  margin-left: 0.5rem; flex: 1; color: var(--text-mid);
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
}
.act[data-act="2"] .mini-browser { flex: 1; display: flex; flex-direction: column; }
.mb-screen { position: relative; flex: 1; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; min-height: 5.6rem; }
.mb-live {
  position: absolute; right: 0.9rem; top: 0.9rem;
  color: var(--good); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--good) 40%, transparent);
  background: color-mix(in srgb, var(--good) 12%, transparent);
}
.mb-block { display: block; height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: 0.5; }
.mb-block.b1 { width: 46%; height: 14px; }
.mb-block.b2 { width: 72%; }
.mb-block.b3 { width: 58%; }
.act [data-at].mb-block.on { opacity: 0.5; }   /* keep the muted fill, only the entry animates */
.own-rows { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.own-rows li { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.86rem; color: var(--text-mid); line-height: 1.45; }
.own-key {
  flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 7px; margin-top: 0.05rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.own-key svg {
  width: 13px; height: 13px;
  stroke: var(--accent); stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------
   3 · PER-SECTION MOMENTS
   ------------------------------------------------------------ */

/* --- capability cards: number to the corner, glyph draws itself --- */
.cap-num { position: absolute; top: 1.5rem; right: 1.7rem; margin-bottom: 0; }
.cap-glyph {
  width: 34px; height: 34px; display: block; margin-bottom: 1.1rem;
  stroke: var(--accent); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 35%, transparent));
}
.cap-glyph path {
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.95s var(--ease);
}
.cap-card.in .cap-glyph path { stroke-dashoffset: 0; }
.cap-card.in .cap-glyph path:nth-child(2) { transition-delay: 0.13s; }
.cap-card.in .cap-glyph path:nth-child(3) { transition-delay: 0.26s; }
.cap-card.in .cap-glyph path:nth-child(4) { transition-delay: 0.39s; }

/* --- proof numbers --- */
.stat-band {
  margin-top: clamp(2.4rem, 5vw, 3.4rem);
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.stat { background: var(--bg-2); padding: clamp(1.3rem, 3vw, 1.9rem) 1rem; text-align: center; transition: background 0.35s var(--ease); }
.stat:hover { background: var(--surface); }
.stat-num {
  display: block; margin-bottom: 0.5rem;
  font: 700 clamp(2rem, 4.6vw, 3rem)/1 var(--font);
  letter-spacing: -0.042em; font-variant-numeric: tabular-nums;
  background: linear-gradient(150deg, var(--accent), var(--accent-2) 130%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-dim); line-height: 1.5; margin: 0; }
@media (max-width: 860px) { .stat-band { grid-template-columns: repeat(2, 1fr); } }

/* --- demo shells: a sheen crosses the surface on approach ---
   --sheen is a registered property so it can be transitioned; a raw
   gradient stop cannot. Masked to the border so it reads as light
   moving across glass, not a wash over the content. */
.chat-shell, .counter-shell, .json-shell, .app-frame, .eng-card, .contact-card, .work-aside {
  --sheen: -60%;
}
.chat-shell::after, .counter-shell::after, .json-shell::after,
.app-frame::after, .work-aside::after {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent calc(var(--sheen) - 18%),
              color-mix(in srgb, var(--accent) 13%, transparent) var(--sheen),
              transparent calc(var(--sheen) + 18%));
  transition: --sheen 0.9s var(--ease);
}
.chat-shell:hover, .counter-shell:hover, .json-shell:hover,
.app-frame:hover, .work-aside:hover { --sheen: 160%; }

/* --- demo tags: a live pulse, so the "this is running" claim reads --- */
.demo-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 0.5rem; align-self: center;
  background: var(--accent);
  box-shadow: 0 0 8px 0 var(--accent);
  animation: ping-solid 2.6s var(--ease) infinite;
}
@keyframes ping-solid { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.72); } }

/* --- hero title: a slow highlight travels the gradient words --- */
.hero-title .grad { background-size: 260% auto; animation-duration: 9s; }

/* --- constellation: a one-time nudge that the field is clickable ---
   Created by main.js only when the canvas is actually running, shown a
   few seconds in, and dropped for good on the first press. */
.net-hint {
  position: absolute; right: clamp(1.1rem, 4vw, 2.5rem); bottom: 1.6rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.14em;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  pointer-events: none;
}
.net-hint::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px 0 var(--accent);
  animation: ping-solid 2.2s var(--ease) infinite;
}
.net-hint.is-on { opacity: 0.75; transform: none; }
@media (max-width: 720px) { .net-hint { display: none; } }

/* --- engagement cards: the kicker number leads with a rule --- */
.eng-kicker { display: flex; align-items: center; gap: 0.6rem; }
.eng-kicker::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
}

/* --- FAQ: main.js animates the open/close height, CSS owns the look --- */
.faq-item.is-animating { overflow: hidden; }
.faq-item[open] summary { color:var(--accent-text,var(--accent)); }

/* ------------------------------------------------------------
   RESPONSIVE — unpinned scene, stacked acts
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .panel-stage { min-height: 0; display: flex; flex-direction: column; gap: 1.5rem; }
  .act { position: static; inset: auto; opacity: 1; transform: none; pointer-events: auto; }
  .act [data-at] { opacity: 1; transform: none; }
  .sig-path { stroke-dashoffset: 0; }
  .tick-rows li .tick { background: color-mix(in srgb, var(--good) 18%, transparent); border-color: var(--good); }
  .tick-rows li .tick::after { border-color: var(--good); transform: rotate(45deg) scale(1); }
  .tick-rows li.wip .tick { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
  .tick-rows li.wip .tick::after { border-color: transparent; }
  .scene-step::before { display: none; }
}
@media (max-width: 560px) {
  .lens { width: 100%; }
  .lens-btn { flex: 1; justify-content: center; padding-inline: 0.6rem; }
}

/* ------------------------------------------------------------
   REDUCED MOTION
   Idle loops stop; state-carrying visuals resolve to finished.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .btn.primary, .demo-tag::before, .dot-live::after, .tick-rows li.wip.on .tick { animation: none !important; }
  .rip { display: none; }
  .btn.ghost::before { display: none; }
  .cap-glyph path { stroke-dashoffset: 0 !important; transition: none; }
  .sig-path { stroke-dashoffset: 0 !important; transition: none; }
  .act { position: static; inset: auto; opacity: 1 !important; transform: none !important; pointer-events: auto; }
  .panel-stage { min-height: 0; display: flex; flex-direction: column; gap: 1.5rem; }
  .act [data-at] { opacity: 1 !important; transform: none !important; }
  .scene-step::before { transform: scaleY(1); transition: none; }
  .chat-shell::after, .counter-shell::after, .json-shell::after,
  .app-frame::after, .work-aside::after { display: none; }
  .tick-rows li .tick { background: color-mix(in srgb, var(--good) 18%, transparent); border-color: var(--good); }
  .tick-rows li .tick::after { border-color: var(--good); transform: rotate(45deg) scale(1); transition: none; }
  .tick-rows li.wip .tick { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
  .tick-rows li.wip .tick::after { border-color: transparent; }
}

/* ============================================================
   v7 layer — proof & first impression
   ------------------------------------------------------------
   1. "See the code" — the demo panel flips to reveal the actual
      module running it, fetched from the page's own source.
   2. First impression: a short curtain on the first view of a
      session, and a circular wipe on the theme toggle.
   3. Contextual cursor, a composing email, scrambling type, and
      a nav underline that travels between items.
   ============================================================ */

/* ------------------------------------------------------------
   1 · SEE THE CODE
   ------------------------------------------------------------ */

.src-btn { margin-top: 1.5rem; }
.src-ico { font-size: 0.76rem; letter-spacing: -0.06em; opacity: 0.7; transition: opacity 0.25s var(--ease); }
.src-btn:hover .src-ico, .src-btn[aria-expanded="true"] .src-ico { opacity: 1; }

/* .demo-app already sets a perspective, but the rotating element is a
   grandchild of it — perspective only reaches direct children, so the
   stage carries its own. */
.flip-stage { perspective: 1600px; }
.flip-inner {
  position: relative;                   /* containing block for the back face */
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.85s var(--ease);
}
.flip-inner.is-flipped { transform: rotateY(180deg); }
.flip-face {
  grid-area: 1 / 1; min-width: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
/* Taken out of flow deliberately: in flow, 220 lines of unwrapped source
   would size the grid row and the panel would be thousands of pixels
   tall. Absolute means the live demo alone sets the box and the code
   scrolls inside whatever height that is. */
.flip-face.is-back { position: absolute; inset: 0; transform: rotateY(180deg); }

.code-shell {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: var(--card-bg);
  border: 1px solid transparent; border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow);
}
.code-bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.code-path { color: var(--text-mid); margin-right: auto; }
.code-count { color:var(--accent-text,var(--accent)); }
.code-view {
  flex: 1; min-height: 0; overflow: auto;
  /* minmax(0, 1fr), not 1fr: an auto minimum would let the code column
     grow to its widest line and burst the panel instead of scrolling */
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.code-view::-webkit-scrollbar { width: 10px; height: 10px; }
.code-view::-webkit-scrollbar-thumb {
  background: var(--border-2); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
/* gutter and body must share a line-height exactly or the numbers drift */
.code-gutter, .code-body { font-size: 0.72rem; line-height: 1.7; padding-block: 0.9rem; }
.code-gutter {
  display: flex; flex-direction: column;
  position: sticky; left: 0; z-index: 1;
  padding-inline: 1rem 0.7rem;
  border-right: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); text-align: right; user-select: none;
}
.code-body {
  padding-inline: 1.1rem; margin: 0;
  color: var(--text-mid); white-space: pre;
}
.code-body .tok-com { color: var(--text-dim); font-style: italic; }
.code-body .tok-str { color: var(--good); }
.code-body .tok-kw  { color:var(--accent-text-2,var(--accent-2)); }
.code-body .tok-num { color: #ffb454; }
.code-body .tok-fn  { color:var(--accent-text,var(--accent)); }
.code-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim);
}
.code-foot > span { min-width: 0; }
.code-foot a { color:var(--accent-text,var(--accent)); white-space: nowrap; border-bottom: 1px solid transparent; transition: border-color 0.2s var(--ease); }
.code-foot a:hover { border-bottom-color: currentColor; }
@media (max-width: 560px) {
  .code-foot { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
}

/* ------------------------------------------------------------
   2 · FIRST IMPRESSION
   ------------------------------------------------------------ */

/* Curtain — two pseudo-elements on <html>, switched on by the boot
   script in index.html so they exist before the first paint instead of
   flashing in once main.js has run. Both are pointer-events: none for
   their whole life, so the page underneath is live the entire time and
   nothing has to clean them up. ~0.9s, once per session. */
html.intro::before, html.intro::after { pointer-events: none; }
html.intro::before {
  content: ""; position: fixed; inset: 0; z-index: 3000;
  background: var(--bg);
  animation: curtain-lift 0.5s var(--ease) 0.42s forwards;
}
html.intro::after {
  content: ""; position: fixed; z-index: 3001;
  left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 14px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: 0 0 0 1px var(--border-2), 0 0 60px -8px var(--accent);
  transform: scale(0.35); opacity: 0;
  animation: mark-in 0.4s var(--ease) forwards,
             mark-out 0.44s var(--ease) 0.42s forwards;
}
@keyframes mark-in  { to { transform: scale(1); opacity: 1; } }
@keyframes mark-out { to { transform: scale(1.6); opacity: 0; } }
@keyframes curtain-lift { to { clip-path: inset(0 0 100% 0); opacity: 0; } }

/* Theme toggle — a circular wipe from the button, via the View
   Transitions API. Where it is unsupported the theme just swaps, which
   is exactly what it did before. */
::view-transition-old(root), ::view-transition-new(root) {
  animation: none; mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
html.theme-wipe::view-transition-new(root) {
  animation: theme-reveal 0.62s var(--ease);
}
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--wipe-x, 50%) var(--wipe-y, 50%)); }
  to   { clip-path: circle(var(--wipe-r, 140%) at var(--wipe-x, 50%) var(--wipe-y, 50%)); }
}

/* ------------------------------------------------------------
   3 · CONTEXT & TYPE
   ------------------------------------------------------------ */

/* the cursor halo grows a label over things worth touching */
.cursor-halo::after {
  content: attr(data-label);
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  white-space: nowrap;
  font: 600 0.68rem/1 var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-ink);
  opacity: 0; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.cursor-halo.has-label {
  width: 84px; height: 84px; margin: -42px 0 0 -42px;
  background: var(--accent); border-color: var(--accent);
}
.cursor-halo.has-label::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* scrambling type settles from noise into the real string */
.scramble { font-variant-numeric: tabular-nums; }

/* the nav underline is one travelling bar rather than three separate ones.
   Scoped above the mobile breakpoint: the travelling bar is hidden on
   small screens anyway, and this rule sits after the media query that
   makes the menu a fixed drop-down — unscoped, it put the menu back in
   flow, where its closed-state translate dragged the header off screen
   and left no way to open the menu at all. */
@media (min-width: 721px) {
  .primary-nav ul { position: relative; }
}
.nav-ink {
  position: absolute; bottom: -6px; left: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px -1px var(--accent);
  width: var(--ink-w, 0px); transform: translateX(var(--ink-x, 0px));
  opacity: 0; pointer-events: none;
  transition: transform 0.42s var(--ease), width 0.42s var(--ease), opacity 0.25s var(--ease);
}
.nav-ink.is-on { opacity: 1; }
/* the per-link underline steps aside once the travelling one exists */
.primary-nav:has(.nav-ink) a::after { display: none; }
@media (max-width: 720px) { .nav-ink { display: none; } }

/* the brief builder writes a real email in front of you */
.brief-mail {
  margin: 1.2rem 0 1.5rem; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  overflow: hidden;
}
.brief-mail-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.brief-mail-head .dot-live { flex: 0 0 auto; }
.brief-mail-body { padding: 0.85rem 0.95rem; display: flex; flex-direction: column; gap: 0.3rem; }
.brief-row { display: flex; gap: 0.6rem; font: 500 0.78rem/1.6 var(--mono); }
.brief-row dt { flex: 0 0 4.6rem; color: var(--text-dim); }
.brief-row dd { color: var(--text); margin: 0; min-width: 0; }
.brief-row dd b { color:var(--accent-text,var(--accent)); font-weight: 600; }
.brief-caret {
  display: inline-block; width: 0.5em; height: 1em; margin-left: 1px;
  background: var(--accent); vertical-align: -0.15em;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.brief-mail-foot {
  padding: 0.55rem 0.95rem; border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--text-dim);
}

@media (prefers-reduced-motion: reduce) {
  .flip-inner { transition: none; }
  /* the boot script never sets .intro here, but belt and braces */
  html.intro::before, html.intro::after { display: none; }
  html.theme-wipe::view-transition-new(root) { animation: none; }
  .brief-caret { animation: none; opacity: 1; }
  .cursor-halo::after { transition: none; }
}

/* ============================================================
   v8 — websites layer
   The site had four app demos and nothing that read as "website
   work". This adds the exhibit-A band and the three embedded
   concept sites, each rendered at desktop width inside browser
   chrome and scaled down by --s (written by main.js) so the
   preview looks like a website instead of a squeezed phone view.
   ============================================================ */

/* ---------------- exhibit A ---------------- */
.selfband {
  position: relative;
  padding: clamp(3rem, 6vw, 4.6rem) 0;
  border-block: 1px solid var(--border);
  background:
    radial-gradient(70% 130% at 12% 0%, var(--accent-soft), transparent 62%),
    var(--bg-2);
}
.selfband-in { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.selfband-copy h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.06; margin-bottom: 0.9rem; }
.selfband-copy .section-sub { margin-bottom: 0; }
.selfband-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

/* Buttons and the one static row share a layout so the group reads
   as one set — only the interactive ones get hover and a cursor. */
.self-do {
  width: 100%; display: flex; align-items: flex-start; gap: 0.85rem; text-align: left;
  padding: 0.95rem 1.05rem; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--card-bg); box-shadow: var(--shadow-sm); color: inherit;
  font: inherit; cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.self-do:hover:not(.is-static) { transform: translateY(-3px); box-shadow: var(--shadow), var(--glow); }
.self-do.is-static { cursor: default; }
.self-key {
  flex: none; display: grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 0.4rem;
  border-radius: 7px; border: 1px solid var(--border-2); background: var(--surface-2);
  color:var(--accent-text,var(--accent)); font-size: 0.78rem; font-weight: 600;
}
.self-txt { display: block; font-size: 0.85rem; color: var(--text-dim); line-height: 1.45; }
.self-txt b { display: block; font-size: 0.94rem; font-weight: 600; color: var(--text); letter-spacing: -0.01em; margin-bottom: 0.1rem; }
.self-do:hover:not(.is-static) .self-key { border-color: var(--accent); }

@media (max-width: 900px) {
  .selfband-in { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .selfband-list { grid-template-columns: 1fr; }
}

/* ---------------- the three sites ---------------- */
.sites { display: flex; flex-direction: column; gap: clamp(3.5rem, 7vw, 6rem); }
.site { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(1.8rem, 4vw, 3.4rem); align-items: center; }
/* The iframe inside is laid out at 1280px. Grid items default to
   min-width: auto, which would let that width size the column and
   defeat the whole scale-to-fit. */
.site > * { min-width: 0; }
.browser, .browser-view { min-width: 0; max-width: 100%; }
.site.reverse .site-copy { order: 2; }
.site.reverse .site-app { order: 1; }
.site-copy h3 { font-size: clamp(1.5rem, 2.7vw, 2rem); letter-spacing: -0.028em; margin: 0.35rem 0 0.7rem; }
.site-copy > p { color: var(--text-mid); font-size: 0.97rem; max-width: 48ch; }
.site-copy .demo-points { margin-top: 1rem; }
.site-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.8rem 1.1rem; margin-top: 1.5rem; }

/* browser chrome */
.browser {
  border: 1px solid transparent; border-radius: var(--radius); overflow: hidden;
  background: var(--card-bg); box-shadow: var(--shadow), var(--glow);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.browser:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), 0 0 110px -18px color-mix(in srgb, var(--accent) 66%, transparent);
}
.browser-bar { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.browser-url {
  margin-right: auto; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.2rem 0.8rem; background: var(--bg);
}

/* The iframe is laid out at --w wide and scaled to fit, so the page
   inside renders its desktop layout. The wrapper's aspect ratio is
   the same ratio, which keeps the scaled result exactly filling it. */
.browser-view {
  --w: 1280px;
  --h: 860px;
  --s: 0.5;
  position: relative; overflow: hidden;
  aspect-ratio: 1280 / 860;
  background: var(--surface-2);
}
.site-iframe {
  display: block; width: var(--w); height: var(--h); border: 0;
  transform: scale(var(--s)); transform-origin: top left;
  background: #fff;
}
/* Inert until asked for, so the page's own scroll is never hijacked
   by a wheel event landing inside an embedded site. */
.browser-view .site-iframe { pointer-events: none; }
.browser-view.is-live .site-iframe { pointer-events: auto; }

.site-veil {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 0.6rem;
  border: 0; cursor: pointer; color: var(--text);
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.browser:hover .site-veil, .site-veil:focus-visible { opacity: 1; }
.browser-view.is-live .site-veil { display: none; }
.veil-txt {
  font: 600 0.82rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.55rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.veil-ring {
  position: absolute; width: 84px; height: 84px; border-radius: 50%;
  border: 1px solid var(--accent); opacity: 0.4;
  animation: veil-pulse 2.4s var(--ease) infinite;
}
@keyframes veil-pulse {
  from { transform: scale(0.7); opacity: 0.5; }
  to   { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .veil-ring { animation: none; } }

/* Touch devices get no hover, so the invitation is always up until
   the visitor takes it. */
@media (hover: none) {
  .site-veil { opacity: 1; background: color-mix(in srgb, var(--bg) 30%, transparent); }
}

.sites-note {
  margin-top: clamp(2.6rem, 5vw, 3.6rem);
  padding: 1.3rem 1.5rem;
  border: 1px dashed var(--border-2); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-mid); font-size: 0.92rem; max-width: 78ch;
}
.sites-note b { color: var(--text); }

@media (max-width: 900px) {
  .site, .site.reverse .site-copy, .site.reverse .site-app { grid-template-columns: 1fr; order: 0; }
  .site { grid-template-columns: 1fr; }
}

/* A phone is too narrow to read a scaled-down desktop layout, so the
   preview switches to the site's own mobile rendering instead. */
@media (max-width: 560px) {
  .browser-view { --w: 420px; --h: 640px; aspect-ratio: 420 / 640; }
}
