/*
 * root's site. Tokens are the app's own (src/app.css): neutral black, small radii, borders
 * doing the work, one mono face for labels. Status colours mean what they mean in the app,
 * and appear only where the section is about that status.
 */
:root {
  color-scheme: dark;
  --page: #09090b; --panel: #0f0f11; --sunk: #141416; --raised: #18181b;
  --line: #232327; --line-strong: #303036;
  --ink: #ededf0; --ink-2: #b8b8c1; --ink-3: #a0a0aa; --ink-4: #8a8a94;
  --ok: #5fc48c; --warn: #d9a84e; --serious: #dd8a52; --crit: #e0705a; --data: #86a8cc;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
  --width: 1160px;
  --gutter: clamp(18px, 4vw, 44px);
  --r: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); overflow-x: clip; -webkit-font-smoothing: antialiased; }
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 1.15rem + 4.6vw, 5.2rem); font-weight: 680; line-height: 1.02; letter-spacing: -0.035em; }
h2 { font-size: clamp(2rem, 1.25rem + 2.7vw, 3.5rem); font-weight: 650; line-height: 1.05; letter-spacing: -0.03em; }
h3 { font-size: 1.05rem; font-weight: 620; line-height: 1.3; letter-spacing: -0.008em; }
code, pre, .eyebrow, .film figcaption, .kind, .facts dt { font-variant-ligatures: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }

.wrap { max-width: calc(var(--width) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 600 0.75rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); }
.eyebrow i { width: 9px; height: 9px; border-radius: 2px; background: var(--tick, var(--ink-4)); }
.lead { font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.stack { display: grid; gap: 20px; justify-items: start; align-content: start; }
.mono { font-family: var(--mono); }

/* Sections: real content over one fixed cloud. Keep these stacking rules. */
.hero, .section { position: relative; }
.section { padding-block: clamp(72px, 9vw, 128px); }
.wrap { position: relative; z-index: 1; }
.anchor { position: absolute; inset: 0; pointer-events: none; }
.scene-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scene-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; opacity: 0; transition: opacity 1s ease; }
.has-scene .scene-layer canvas { opacity: 1; }

/* The glow: a status colour falling across a section that is about that status. */
.hue::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(70% 46% at 14% 8%, color-mix(in srgb, var(--hue) 11%, transparent), transparent 70%); -webkit-mask-image: linear-gradient(180deg, transparent, #000 clamp(70px, 16%, 180px)); mask-image: linear-gradient(180deg, transparent, #000 clamp(70px, 16%, 180px)); }

.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.stage { position: relative; height: clamp(300px, 34vw, 430px); border-radius: var(--r); }
/* Without WebGL the stage is still a finished thing: a still from the real app. */
/* No WebGL, so no scene to hold these. A section with its film right below needs nothing more. */
.no-webgl .stage { background: var(--panel) var(--still) left top / cover no-repeat; border: 1px solid var(--line); }
.no-webgl .stage.film-below { display: none; }
.no-webgl .split:has(> .film-below) { grid-template-columns: minmax(0, 1fr); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--page) 78%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom-color: var(--line); }
.bar { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; margin-right: auto; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; }
.brand svg { width: 24px; height: 24px; }
.navlink { color: var(--ink-3); text-decoration: none; font-size: 0.92rem; }
.navlink:hover { color: var(--ink); }
@media (max-width: 760px) { .navlink.opt { display: none; } }

/* Buttons: the app's own: a white primary, a bordered ghost. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 18px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); font: 560 0.95rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.button:hover { background: #1c1c1f; border-color: #55555f; }
.button.primary { background: var(--ink); border-color: var(--ink); color: #0f0f11; }
.button.primary:hover { background: #fff; border-color: #fff; }
.button svg { width: 17px; height: 17px; }
.button.small { min-height: 36px; padding: 0 13px; font-size: 0.88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero */
.hero { padding-block: clamp(48px, 7vw, 92px) clamp(48px, 7vw, 96px); }
.hero-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.6fr); gap: 24px; align-items: center; min-height: clamp(320px, 34vw, 460px); }
.hero-mark { position: relative; height: clamp(200px, 26vw, 360px); }
.no-webgl .hero-mark { display: none; }
@media (max-width: 760px) { .hero-top { grid-template-columns: minmax(0, 1fr); min-height: 0; } .hero-mark { height: 150px; order: -1; width: 150px; } }

/* A film */
.film { position: relative; margin: clamp(30px, 4vw, 52px) 0 0; }
.film-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--line-strong), 0 30px 90px rgba(0, 0, 0, 0.6); }
.film video { width: 100%; height: 100%; object-fit: cover; }
.film-play { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; padding: clamp(14px, 2.4vw, 28px); border: 0; background: linear-gradient(to top, rgba(9, 9, 11, 0.55), transparent 42%); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.film-play span { display: inline-flex; align-items: center; gap: 11px; min-height: 46px; padding: 0 18px 0 14px; border-radius: 6px; background: var(--ink); color: #0f0f11; font-weight: 600; font-size: 0.95rem; transition: background-color .15s; }
.film-play:hover span { background: #fff; }
.film-play svg { width: 18px; height: 18px; }
.film figcaption { margin-top: 12px; font: 500 0.78rem/1.4 var(--mono); color: var(--ink-4); }
.is-playing .film-play { display: none; }

/* Facts on hairlines */
.facts { display: grid; gap: 0; margin: 4px 0 0; width: 100%; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: minmax(0, 10.5em) minmax(0, 1fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.facts dt { font: 600 0.8rem/1.45 var(--mono); color: var(--ink-3); }
.facts dd { margin: 0; color: var(--ink-2); font-size: 0.97rem; line-height: 1.5; }

/* The quote the product began with */
.statement { max-width: 24em; font-size: clamp(1.75rem, 1.15rem + 2.4vw, 3.15rem); font-weight: 600; line-height: 1.16; letter-spacing: -0.024em; }
.js .statement .word { color: color-mix(in srgb, var(--ink) 30%, transparent); transition: color .3s ease; }
.js .statement .word.on { color: var(--ink); }
.statement code { font: 600 0.82em var(--mono); letter-spacing: -0.03em; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.card { border-radius: var(--r); background: color-mix(in srgb, var(--panel) 86%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 20px 20px 22px; }
.card h3 { margin-bottom: 7px; }
.card p { color: var(--ink-3); font-size: 0.95rem; line-height: 1.5; }
.spot { background-image: radial-gradient(320px circle at var(--sx, 50%) var(--sy, -40%), var(--spot, transparent), transparent 62%); }
.spot:hover { --spot: color-mix(in srgb, var(--ink) 7%, transparent); }

/* Every kind of thing root watches */
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; list-style: none; }
.kind { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent); font-size: 0.88rem; color: var(--ink-2); }
.kind b { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 4px; font: 600 0.62rem/1 var(--mono); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.kind svg { width: 16px; height: 16px; fill: currentColor; }

/* Two ways to run it */
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: clamp(28px, 4vw, 44px); }
.way { border-radius: var(--r); border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 90%, transparent); padding: 22px; display: grid; gap: 12px; align-content: start; }
.way p { color: var(--ink-3); font-size: 0.97rem; line-height: 1.5; }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; border-radius: 6px; border: 1px solid var(--line); background: var(--sunk); font: 500 0.86rem/1.65 var(--mono); color: var(--ink-2); }
pre .c { color: var(--ink-4); }

/* Close */
.close-card { position: relative; display: grid; gap: 22px; justify-items: center; text-align: center; padding-block: clamp(30px, 6vw, 70px); }
.close-mark { position: relative; width: min(100%, 300px); height: 220px; }
.no-webgl .close-mark { display: none; }

.site-footer { position: relative; overflow: hidden; padding: 28px 0 0; border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; color: var(--ink-4); font-size: 0.86rem; }
.foot a { color: var(--ink-3); }
.foot .grow { margin-right: auto; }
.footer-mark { position: relative; z-index: 1; margin: 20px 0 -0.08em; text-align: center; font-weight: 800; font-size: clamp(6rem, 1rem + 25vw, 24rem); line-height: 0.78; letter-spacing: -0.06em; color: rgba(237, 237, 240, 0.04); -webkit-text-fill-color: transparent; -webkit-text-stroke: 1px rgba(237, 237, 240, 0.12); background-image: radial-gradient(420px circle at var(--fx, 50%) var(--fy, 70%), var(--data), transparent 58%); -webkit-background-clip: text; background-clip: text; user-select: none; }

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .stage { height: clamp(220px, 52vw, 320px); }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
