@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
/* Bold, for the wordmark (Brand Foundations v1 sets it in mono). */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #0b0f17;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(248, 250, 252, 0.14);
  --cyan: #06b6d4;
  --coral: #ec4899;
  --amber: #f59e0b;
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }

/* Scene layers. Without WebGL the canvas stays empty and the gradient
   below carries the page. */
#scene, .vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}
#scene { display: block; }
.vignette {
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 55%, rgba(11, 15, 23, 0.85) 100%);
}
.no-webgl body {
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(6, 182, 212, 0.18), transparent),
    radial-gradient(40% 40% at 70% 60%, rgba(236, 72, 153, 0.16), transparent),
    radial-gradient(40% 40% at 45% 85%, rgba(245, 158, 11, 0.12), transparent),
    var(--ink);
}

/* HUD */
.hud {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gutter);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-top { top: 0; }
.hud-bottom { bottom: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 17px;
}
.mark { width: 30px; height: 30px; }
/* The Figma mark (Brand Foundations v1): drawn cyan, pink, then amber on top. */
.mark circle { fill: none; stroke-width: 8; }
.mark circle:nth-child(1) { stroke: var(--cyan); }
.mark circle:nth-child(2) { stroke: var(--coral); }
.mark circle:nth-child(3) { stroke: var(--amber); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(11, 15, 23, 0.45);
  backdrop-filter: blur(8px);
}
/* Site nav: the same links on every page, the current one marked. It sits
   beside the status pill and drops to its own row on phones. */
.site-nav { display: flex; gap: 22px; margin: 0 22px 0 auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.site-nav a { position: relative; padding: 8px 0; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color 0.2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0.14em; bottom: 2px; height: 1px; background: var(--accent, var(--cyan)); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); animation: pulse 2.2s ease-in-out infinite; }

.cue { display: inline-flex; align-items: center; gap: 12px; transition: opacity 0.4s; }
.cue i { display: block; width: 1px; height: 28px; background: linear-gradient(var(--text), transparent); animation: drip 1.8s ease-in-out infinite; }

/* Chapter rail */
.rail {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rail button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 6px 0 6px 18px;
  cursor: pointer;
  position: relative;
  text-align: right;
}
.rail button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s, background 0.3s;
}
.rail button[aria-current="step"] { color: var(--text); }
.rail button[aria-current="step"]::before { width: 14px; left: -4px; background: var(--cyan); }

/* Chapters: plain flowing sections without JS; fixed overlays driven by
   scroll progress with it. */
main { position: relative; z-index: 2; }

.chapter {
  min-height: 100vh;
  padding: 18vh var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1200px;
}

.js .chapter {
  position: fixed;
  inset: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 0 calc(var(--gutter) + 48px) 0 var(--gutter);
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.js .chapter.is-active { pointer-events: auto; }
.js .track { height: 700vh; }

.side-right { align-items: flex-end; text-align: right; }
.side-right > * { max-width: 30rem; }
.side-left > * { max-width: 30rem; }
.side-right .tags { justify-content: flex-end; }

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b { color: var(--text); font-weight: 400; margin-right: 10px; }

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 0.95; }
h1 { font-size: clamp(48px, 9.5vw, 148px); }
h2 { font-size: clamp(36px, 5.6vw, 84px); }
h1 em, .finale h2 {
  font-style: normal;
  background: linear-gradient(100deg, var(--cyan), var(--coral) 55%, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chapter p:not(.eyebrow) {
  margin: 24px 0 0;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.55;
  color: #c9cde0;
}
.hero .lede { max-width: 34rem; }

.tags { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(11, 15, 23, 0.4);
}

.finale { align-items: center; text-align: center; }
.js .finale { justify-content: flex-end; padding-bottom: 11vh; }
.finale > * { max-width: 44rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; width: 100%; }
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  text-align: left;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(14, 14, 22, 0.55);
  backdrop-filter: blur(14px);
  transition: border-color 0.3s, transform 0.3s, background 0.3s;
}
.card:hover { border-color: rgba(6, 182, 212, 0.6); transform: translateY(-3px); background: rgba(17, 24, 39, 0.7); }
.card .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.card .value { font-size: clamp(16px, 1.6vw, 20px); font-weight: 500; overflow-wrap: anywhere; }
.finale .live { font-size: 15px; }
.finale .live a { text-decoration-color: rgba(248, 250, 252, 0.35); text-underline-offset: 4px; }
.finale .live a:hover { text-decoration-color: var(--cyan); }
.finale .legal { font-family: var(--mono); font-size: 11px !important; letter-spacing: 0.12em; color: var(--muted) !important; }
.finale .social { font-family: var(--mono); font-size: 12px !important; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted) !important; margin-top: 40px; }
.finale .social a { color: var(--text); text-decoration: none; }
.finale .social a[href^="mailto:"] { text-transform: none; }
.finale .social a:hover { color: var(--accent, var(--cyan)); }
.finale .social + .legal, .product .finale .social + .legal { margin-top: 12px; }

/* Load-in */
.js .hero > * { animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
.js .hero > :nth-child(2) { animation-delay: 0.12s; }
.js .hero > :nth-child(3) { animation-delay: 0.24s; }

@keyframes rise { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

@media (max-width: 720px) {
  .rail { display: none; }
  .hud-top { flex-wrap: wrap; row-gap: 6px; background: linear-gradient(rgba(11, 15, 23, 0.85) 60%, transparent); }
  .site-nav { order: 1; flex-basis: 100%; justify-content: space-between; gap: 10px; margin: 0; letter-spacing: 0.08em; overflow-x: auto; scrollbar-width: none; }
  .js .chapter { padding: 0 var(--gutter); justify-content: flex-end; padding-bottom: 22vh; }
  .js .finale { padding-bottom: 9vh; }
  .finale h2 { font-size: 40px; }
  .side-right { align-items: flex-start; text-align: left; }
  .side-right .tags { justify-content: flex-start; }
  .cards { grid-template-columns: 1fr; }
  .hud-bottom .readout { display: none; }
  .hud-bottom { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
