@layer reset, tokens, base, layout, components, motion;

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

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

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ol, ul, dl, dd, figure, pre { margin: 0; }
  ol, ul { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  input, button { font: inherit; color: inherit; }
}

@layer tokens {
  :root {
    color-scheme: light dark;
    --bg: light-dark(oklch(98.6% 0.004 250), oklch(14.2% 0.012 258));
    --bg-2: light-dark(oklch(96.2% 0.006 250), oklch(18.2% 0.014 258));
    --bg-3: light-dark(oklch(93% 0.008 250), oklch(22% 0.016 258));
    --fg: light-dark(oklch(21% 0.02 258), oklch(95.5% 0.006 250));
    --dim: light-dark(oklch(46% 0.02 258), oklch(73% 0.014 250));
    --faint: light-dark(oklch(62% 0.015 258), oklch(54% 0.014 258));
    --line: light-dark(oklch(90% 0.008 250), oklch(26% 0.016 258));
    --accent: light-dark(oklch(52% 0.14 162), oklch(87% 0.17 162));
    --accent-2: light-dark(oklch(50% 0.2 292), oklch(76% 0.15 292));
    --warn: light-dark(oklch(58% 0.14 70), oklch(82% 0.14 75));
    --glow: color-mix(in oklch, var(--accent) 30%, transparent);
    --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --wrap: min(72rem, 100% - 32px);
    --read: min(42rem, 100% - 32px);
    --r: 14px;
    --ease: cubic-bezier(.2, .7, .1, 1);
  }
  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
  /* The hero, the demos and the footer are night scenes in either theme. */
  .l-home, .hero, .sd-grid, .install, .foot, .kd-card { color-scheme: dark; }
}

@layer base {
  html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
  body {
    background: var(--bg); color: var(--fg);
    font: 400 17px/1.65 var(--sans); font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }
  ::selection { background: color-mix(in oklch, var(--accent) 35%, transparent); }
  a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
  h1, h2, h3 { text-wrap: balance; letter-spacing: -.025em; line-height: 1.1; font-weight: 620; }
  p, li { text-wrap: pretty; }
  code, .mono { font-family: var(--mono); font-size: .88em; font-variant-ligatures: none; }
  :not(pre) > code { background: var(--bg-3); padding: .1em .35em; border-radius: 5px; }
  .skip { position: absolute; left: -999px; }
  .skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--bg); padding: .4rem .8rem; }
}

@layer layout {
  /* Bar */
  .bar {
    position: sticky; top: 0; z-index: 5; view-transition-name: bar;
    background: color-mix(in oklch, var(--bg) 72%, transparent);
    backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent);
  }
  .l-home .bar { background: color-mix(in oklch, oklch(14.2% 0.012 258) 55%, transparent); border-color: oklch(100% 0 0 / .06); color-scheme: dark; color: var(--fg); }
  .bar-inner { width: var(--wrap); margin-inline: auto; height: 3.6rem; display: flex; align-items: center; gap: 2rem; }
  .brand { display: flex; align-items: center; gap: .55rem; color: var(--fg); text-decoration: none; font-weight: 600; letter-spacing: -.02em; font-size: 1.05rem; }
  .brand svg { width: 22px; height: 22px; color: var(--accent); }
  .brand b { font-weight: 600; color: var(--dim); }
  .links { display: flex; gap: .25rem; margin-left: auto; }
  .links a, #menu a {
    color: var(--dim); text-decoration: none; font-size: .92rem; padding: .35rem .7rem; border-radius: 99px;
    transition: color .2s, background-color .2s;
  }
  .links a:hover { color: var(--fg); background: var(--bg-3); }
  .links a[aria-current="page"] { color: var(--fg); background: var(--bg-3); }
  .md { font: 500 .78rem var(--mono); color: var(--faint); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: .15rem .45rem; }
  .md:hover { color: var(--accent); border-color: var(--accent); }
  .menu-btn { display: none; margin-left: auto; width: 2.4rem; height: 2.4rem; border: 0; background: none; cursor: pointer; place-items: center; }
  .menu-btn span, .menu-btn span::before { display: block; width: 18px; height: 1.5px; background: var(--fg); position: relative; }
  .menu-btn span::before { content: ""; position: absolute; top: 6px; }
  .menu-btn span { top: -3px; }

  #menu {
    inset: 3.9rem 12px auto auto; margin: 0; width: min(18rem, calc(100vw - 24px));
    padding: .5rem; border: 1px solid var(--line); border-radius: var(--r);
    background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px -20px oklch(0% 0 0 / .45);
    opacity: 0; translate: 0 -6px; transition: opacity .2s, translate .2s var(--ease), display .2s allow-discrete, overlay .2s allow-discrete;
  }
  #menu:popover-open { display: grid; opacity: 1; translate: 0 0; }
  @starting-style { #menu:popover-open { opacity: 0; translate: 0 -6px; } }
  #menu a { display: block; font-size: 1rem; border-radius: 10px; padding: .6rem .8rem; }
  #menu a:hover { background: var(--bg-3); color: var(--fg); }

  @media (max-width: 820px) {
    .links, .md { display: none; }
    .menu-btn { display: grid; }
  }

  /* Footer */
  .foot { background: oklch(12% 0.012 258); color: var(--dim); border-top: 1px solid var(--line); margin-top: 8rem; overflow: clip; }
  .foot-inner { width: var(--wrap); margin-inline: auto; padding: 4rem 0 3rem; display: grid; gap: 1rem; }
  .foot .mark {
    font-size: clamp(4rem, 17vw, 13rem); font-weight: 700; letter-spacing: -.06em; line-height: .8; margin-bottom: 2rem;
    background: linear-gradient(180deg, oklch(95% 0.01 250 / .9), oklch(95% 0.01 250 / .04) 85%); -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .foot .mark b { font-weight: 700; }
  .foot p { max-width: 40rem; font-size: .95rem; }
  .foot .small { font-size: .82rem; color: var(--faint); }

  /* Doc pages */
  .page { width: var(--wrap); margin-inline: auto; }
  .page-head { padding: clamp(3rem, 8vw, 6rem) 0 2.5rem; max-width: 50rem; }
  .page-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -.045em; line-height: 1; view-transition-name: title; }
  .page-head .lede, .page-head p { margin-top: 1.25rem; font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--dim); max-width: 38rem; line-height: 1.5; }
  .page-body { display: grid; grid-template-columns: minmax(0, 42rem) 1fr; gap: 4rem; border-top: 1px solid var(--line); padding-top: 2.5rem; }
  .toc { position: sticky; top: 5.5rem; align-self: start; justify-self: end; width: 13rem; font-size: .86rem; }
  .toc p { color: var(--faint); font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem; }
  .toc ol { list-style: none; border-left: 1px solid var(--line); }
  .toc a { display: block; padding: .3rem 0 .3rem 1rem; margin-left: -1px; color: var(--dim); text-decoration: none; border-left: 1px solid transparent; line-height: 1.35; }
  .toc a:hover { color: var(--fg); border-color: var(--accent); }
  @media (max-width: 1080px) { .page-body { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
}

@layer components {
  /* Prose */
  .prose { min-width: 0; }
  .prose > .sect + .sect { margin-top: 3rem; }
  .prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin-bottom: 1rem; position: relative; }
  .prose h3 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
  .prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose .notice, .prose .install { margin-bottom: 1.15rem; }
  .prose p, .prose li { color: color-mix(in oklch, var(--fg) 86%, var(--dim)); }
  .prose li { margin: .45rem 0 .45rem 1.2rem; padding-left: .2rem; }
  .prose li::marker { color: var(--faint); }
  .prose strong { color: var(--fg); font-weight: 600; }
  .prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: 0; display: flex; gap: .7rem; align-items: baseline; }
  .prose input[type="checkbox"] {
    appearance: none; flex: none; width: 1.05rem; height: 1.05rem; border-radius: 5px; border: 1.5px solid var(--faint); translate: 0 .15rem;
    display: grid; place-items: center;
  }
  .prose input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
  .prose input[type="checkbox"]:checked::after { content: ""; width: .5rem; height: .28rem; border: 2px solid var(--bg); border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -.06rem; }
  .prose li:has(> input:not(:checked)) { color: var(--dim); }
  .anchor { position: absolute; left: -1.2em; color: var(--faint); text-decoration: none; opacity: 0; transition: opacity .15s; font-weight: 400; }
  h2:hover > .anchor, h3:hover > .anchor { opacity: 1; }
  .prose table { width: 100%; border-collapse: collapse; font-size: .9rem; display: block; overflow-x: auto; }
  .prose th, .prose td { text-align: left; vertical-align: top; padding: .7rem 1rem .7rem 0; border-bottom: 1px solid var(--line); }
  .prose th { font: 500 .75rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
  .prose td:first-child { white-space: nowrap; }
  .prose pre { background: var(--bg-2); border: 1px solid var(--line); padding: 1rem 1.2rem; border-radius: var(--r); overflow-x: auto; font-size: .88rem; line-height: 1.6; }

  .pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4.5rem; }
  .pager a { display: grid; gap: .1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r); color: var(--fg); text-decoration: none; font-weight: 550; transition: border-color .2s, background-color .2s; }
  .pager a:hover { border-color: var(--accent); background: var(--bg-2); }
  .pager small { color: var(--faint); font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
  .pager .next { text-align: right; grid-column: 2; }

  /* Tutorial: each h2 is a numbered step on a line. */
  .tutorial .prose { counter-reset: step; }
  .tutorial .sect { position: relative; padding-left: 3.25rem; padding-bottom: .5rem; }
  .tutorial .sect::before { content: ""; position: absolute; left: .95rem; top: 2.4rem; bottom: -2.5rem; width: 1px; background: linear-gradient(var(--line), transparent); }
  .tutorial .sect:last-of-type::before { display: none; }
  .tutorial .sect h2 { counter-increment: step; }
  .tutorial .sect h2::before {
    content: counter(step); position: absolute; left: -3.25rem; top: -.1rem;
    width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
    font: 600 .85rem var(--mono); color: var(--accent); background: color-mix(in oklch, var(--accent) 12%, var(--bg)); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  }
  .tutorial .sect .anchor { display: none; }

  .notice { display: flex; gap: .8rem; align-items: baseline; padding: .9rem 1.1rem; border-radius: var(--r); font-size: .95rem;
    border: 1px solid color-mix(in oklch, var(--warn) 35%, transparent); background: color-mix(in oklch, var(--warn) 8%, var(--bg)); color: var(--fg); }
  .notice-dot { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: var(--warn); translate: 0 -.05rem; box-shadow: 0 0 0 0 var(--warn); animation: pulse 2.4s infinite; }

  .install { display: flex; align-items: center; gap: .75rem; background: oklch(15% 0.014 258); color: var(--fg); border: 1px solid oklch(100% 0 0 / .08); border-radius: var(--r); padding: .55rem .55rem .55rem 1.1rem; }
  .install code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: .86rem; color: var(--accent); scrollbar-width: none; }
  .install code::before { content: "$ "; color: var(--faint); }
  .copy { flex: none; border: 1px solid oklch(100% 0 0 / .14); background: oklch(100% 0 0 / .06); border-radius: 9px; padding: .35rem .8rem; font-size: .82rem; cursor: pointer; }
  .copy:hover { background: oklch(100% 0 0 / .12); }

  /* ---------- Home ---------- */
  .hero {
    position: relative; isolation: isolate; overflow: clip;
    margin-top: -3.6rem; padding: calc(3.6rem + clamp(2.5rem, 7vw, 6rem)) 0 clamp(4rem, 8vw, 6rem);
    background: oklch(12.5% 0.014 260); color: var(--fg);
  }
  .hero::before {
    content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
    background:
      radial-gradient(40% 50% at 78% 30%, oklch(70% 0.17 162 / .28), transparent 70%),
      radial-gradient(35% 45% at 15% 10%, oklch(62% 0.2 292 / .30), transparent 70%),
      radial-gradient(50% 40% at 50% 100%, oklch(55% 0.12 230 / .25), transparent 70%);
    filter: blur(10px);
    animation: drift 18s ease-in-out infinite alternate;
  }
  .hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(oklch(100% 0 0 / .05) 1px, transparent 1px), linear-gradient(90deg, oklch(100% 0 0 / .05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(70% 60% at 50% 35%, #000 20%, transparent 75%);
  }
  .hero-inner {
    width: var(--wrap); margin-inline: auto; display: grid; gap: 1.5rem 4rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas: "title title" "lede card" "cta card";
    align-items: start;
  }
  .hero h1 {
    grid-area: title; max-width: 15ch; margin-bottom: 1rem; font-size: clamp(2.9rem, 7.2vw, 6.6rem); line-height: .94; letter-spacing: -.055em; font-weight: 650;
    background: linear-gradient(175deg, oklch(98% 0.005 250) 30%, oklch(98% 0.005 250 / .55)); -webkit-background-clip: text; background-clip: text; color: transparent;
    padding-bottom: .08em; view-transition-name: title;
  }
  .hero .lede { grid-area: lede; font-size: clamp(1.08rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--dim); max-width: 34rem; }
  .hero .island.key-demo { grid-area: card; align-self: start; }
  .cta { grid-area: cta; display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .5rem; }
  .btn {
    display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.25rem; border-radius: 99px; text-decoration: none;
    font-weight: 550; font-size: .98rem; color: var(--fg); border: 1px solid oklch(100% 0 0 / .16); background: oklch(100% 0 0 / .04);
    transition: background-color .2s, transform .2s var(--ease), box-shadow .2s;
  }
  .btn:hover { background: oklch(100% 0 0 / .1); transform: translateY(-1px); }
  .btn.primary { background: var(--accent); color: oklch(16% 0.03 162); border-color: transparent; box-shadow: 0 0 0 0 var(--glow), 0 10px 30px -10px var(--glow); }
  .btn.primary:hover { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 18%, transparent), 0 14px 40px -10px var(--glow); }
  .btn.primary::after { content: "→"; transition: translate .2s var(--ease); }
  .btn.primary:hover::after { translate: 3px 0; }
  @media (max-width: 900px) {
    .hero-inner { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "lede" "cta" "card"; }
    .hero .island.key-demo { margin-top: 1.5rem; }
  }

  /* The key card, with a slowly turning edge. */
  .kd-card {
    position: relative; padding: 1.4rem 1.5rem 1.25rem; border-radius: 20px; color: var(--fg);
    background: linear-gradient(160deg, oklch(22% 0.02 258 / .85), oklch(16% 0.016 258 / .85));
    backdrop-filter: blur(20px); box-shadow: 0 30px 80px -30px oklch(0% 0 0 / .7), inset 0 1px 0 oklch(100% 0 0 / .06);
  }
  .kd-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: conic-gradient(from var(--spin), oklch(87% 0.17 162 / .9), oklch(76% 0.15 292 / .6), transparent 40%, transparent 60%, oklch(87% 0.17 162 / .9));
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: spin 8s linear infinite;
  }
  .kd-title { display: flex; align-items: center; gap: .55rem; font: 500 .78rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
  .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--faint); }
  .live .dot { background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 2.4s infinite; }
  .kd-card dl { display: grid; gap: .9rem; margin: 1.1rem 0 1rem; }
  .kd-card dt { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin-bottom: .2rem; }
  .kd-card dd { font-size: .95rem; }
  .kd-pub { word-break: break-all; line-height: 1.5; font-size: .92rem; color: var(--faint); transition: color .6s; }
  .settled .kd-pub { color: var(--accent); }
  .kd-sent { color: var(--fg); }
  .kd-note { font-size: .8rem; color: var(--faint); border-top: 1px solid oklch(100% 0 0 / .07); padding-top: .8rem; }

  .home .sect { width: var(--wrap); margin-inline: auto; padding-top: clamp(5rem, 12vw, 9rem); }
  .home .sect > h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); letter-spacing: -.045em; line-height: 1; max-width: 18ch; margin-bottom: 1.25rem; }
  .home .sect > p { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--dim); max-width: 38rem; line-height: 1.6; }
  .home .sect > p + p { margin-top: 1rem; }
  .home .anchor { display: none; }

  /* Sealed demo */
  .island.sealed { margin-top: 2.5rem; }
  .sd-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr); align-items: stretch; gap: 0;
    background: oklch(13% 0.014 260); border: 1px solid oklch(100% 0 0 / .07); border-radius: 22px; padding: .6rem;
    box-shadow: 0 40px 100px -40px oklch(0% 0 0 / .55); color: var(--fg);
  }
  .sd-pane { display: grid; align-content: start; gap: .9rem; padding: 1.4rem; border-radius: 16px; min-width: 0; }
  .sd-you { background: oklch(17% 0.016 258); }
  .sd-label { font: 500 .72rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
  .sd-in {
    width: 100%; font-size: 1.1rem; background: none; border: 0; border-bottom: 1px solid oklch(100% 0 0 / .12);
    padding: .4rem 0 .6rem; outline: none; caret-color: var(--accent); min-width: 0;
  }
  .sd-line { display: flex; gap: 1ch; align-items: baseline; font-size: 1.1rem; }
  .sd-ps { color: var(--accent); }
  .sd-line:focus-within .sd-in { border-color: var(--accent); }
  .sd-arrow { width: 3.5rem; position: relative; }
  .sd-arrow::before { content: ""; position: absolute; inset: 50% .6rem auto; height: 1px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
  .sd-arrow::after { content: ""; position: absolute; top: calc(50% - 4px); right: .6rem; width: 8px; height: 8px; border-top: 1px solid var(--accent-2); border-right: 1px solid var(--accent-2); rotate: 45deg; }
  .sd-out { white-space: pre-wrap; word-break: break-all; font-size: .86rem; line-height: 1.6; color: var(--dim); min-height: 9.5em; }
  .sd-out .k { color: var(--faint); }
  .sd-out .ct { color: var(--accent-2); }
  .sd-out.flash .ct { animation: flash .5s var(--ease); }
  @media (max-width: 760px) {
    .sd-grid { grid-template-columns: minmax(0, 1fr); }
    .sd-arrow { width: auto; height: 2.5rem; }
    .sd-arrow::before { inset: .6rem auto .6rem 50%; width: 1px; height: auto; background: linear-gradient(var(--accent), var(--accent-2)); }
    .sd-arrow::after { top: auto; bottom: .6rem; right: calc(50% - 4px); rotate: 135deg; }
  }

  /* Promises: the list becomes cards. */
  #s-what-it-promises ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; margin-top: 2.5rem; counter-reset: p; container-type: inline-size; }
  #s-what-it-promises li {
    counter-increment: p; position: relative; overflow: hidden; padding: 1.6rem 1.6rem 1.7rem; border-radius: 18px; color: var(--dim); line-height: 1.55;
    background: var(--bg-2); border: 1px solid var(--line); transition: border-color .3s, transform .3s var(--ease);
  }
  #s-what-it-promises li::before { content: "0" counter(p); display: block; font: 500 .75rem var(--mono); color: var(--accent); margin-bottom: 2.2rem; }
  #s-what-it-promises li::after {
    content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(var(--glow), transparent 65%); opacity: 0; transition: opacity .4s;
  }
  #s-what-it-promises li:hover { border-color: color-mix(in oklch, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
  #s-what-it-promises li:hover::after { opacity: 1; }
  #s-what-it-promises li strong { display: block; font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.2; margin-bottom: .6rem; color: var(--fg); font-weight: 600; }

  /* Principals */
  .principals { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .75rem; margin-top: 2.5rem; }
  .principals li { display: grid; gap: .2rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
  .principals b { font-weight: 600; }
  .p-key { font-size: .74rem; color: var(--accent); }
  .p-key::before { content: "key "; color: var(--faint); }
  .p-grant { font-size: .88rem; color: var(--dim); }
  .p-phone { opacity: .55; }
  .p-phone b { text-decoration: line-through; text-decoration-color: var(--warn); }
  .p-phone .p-grant { color: var(--warn); }
  .p-relay .p-key { color: var(--accent-2); }
  .p-agent { border-color: color-mix(in oklch, var(--accent-2) 40%, var(--line)); }

  /* What we won't claim */
  #s-what-we-wont-claim ul { list-style: none; margin-top: 2rem; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
  #s-what-we-wont-claim li { background: var(--bg); padding: 1.2rem 1.4rem 1.2rem 3.4rem; position: relative; color: var(--dim); }
  #s-what-we-wont-claim li::before { content: "✕"; position: absolute; left: 1.4rem; top: 1.2rem; color: var(--faint); font-size: .9rem; }
  #s-what-we-wont-claim li strong { color: var(--fg); font-weight: 600; }

  /* Status */
  .status-card { margin: 2rem 0 1.5rem; padding: 1.6rem; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); max-width: 36rem; }
  .st-num { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
  .st-num b { font-size: clamp(2.6rem, 6vw, 3.6rem); letter-spacing: -.05em; line-height: 1; font-weight: 650; }
  .st-num span { color: var(--dim); }
  .st-bar { height: 8px; border-radius: 99px; background: var(--bg-3); margin: 1.2rem 0 .8rem; overflow: hidden; }
  .st-bar span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
  .st-note { font-size: .82rem; color: var(--faint); }

  /* Journey: a sticky stage, beats scroll past it. */
  .journey { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 3rem; margin: 2.5rem 0 4rem; view-timeline: --journey block; }
  .page .journey { margin-right: calc(-1 * min(16rem, 25vw)); }
  .j-stage {
    position: sticky; top: 7rem; align-self: start; height: 15rem; border-radius: 20px;
    background: var(--bg-2); border: 1px solid var(--line); overflow: hidden;
    background-image: radial-gradient(circle at 1px 1px, color-mix(in oklch, var(--fg) 12%, transparent) 1px, transparent 0); background-size: 18px 18px;
  }
  .j-node { position: absolute; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 5.2rem; height: 5.2rem; border-radius: 18px;
    background: var(--bg); border: 1px solid var(--line); z-index: 1; box-shadow: 0 10px 30px -15px oklch(0% 0 0 / .4); }
  .j-node span { position: absolute; top: calc(100% + .5rem); white-space: nowrap; font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
  .j-node::before { content: ""; width: 1.6rem; height: 1.6rem; border-radius: 6px; border: 1.5px solid var(--dim); }
  .j-tab { left: 14%; } .j-relay { left: 50%; } .j-laptop { left: 86%; }
  .j-relay::before { border-radius: 50%; border-color: var(--accent-2); border-style: dashed; }
  .j-laptop::before { border-radius: 4px; width: 2rem; height: 1.3rem; border-color: var(--accent); }
  .j-wire { position: absolute; top: 50%; left: 14%; right: 14%; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px); }
  .j-packet { position: absolute; top: calc(50% - 2.6rem); left: 14%; translate: -50% 0; z-index: 2; height: 1.6rem; display: grid; }
  .j-packet > span { grid-area: 1 / 1; padding: .15rem .55rem; border-radius: 7px; font-size: .78rem; white-space: nowrap; }
  .j-plain { background: var(--accent); color: oklch(16% 0.03 162); }
  .j-sealed { background: var(--accent-2); color: oklch(98% 0 0); opacity: 0; }
  .j-beats { list-style: none; counter-reset: beat; display: grid; gap: 0; }
  .j-beats li { counter-increment: beat; min-height: 34vh; padding: 1rem 0; color: var(--dim); font-size: 1.05rem; }
  .j-beats li::before { content: "0" counter(beat); display: block; font: 500 .72rem var(--mono); color: var(--accent); margin-bottom: .5rem; }
  .j-beats b { display: block; color: var(--fg); font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: .3rem; font-weight: 600; }
  @media (max-width: 1080px) { .page .journey { margin-right: 0; } }
  @media (max-width: 760px) {
    .journey { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .j-stage { top: 4.4rem; height: 11rem; z-index: 1; }
    .j-node { width: 3.8rem; height: 3.8rem; border-radius: 14px; }
    .j-beats li { min-height: 46vh; }
  }
}

@layer motion {
  @keyframes spin { to { --spin: 360deg; } }
  @keyframes drift { to { transform: translate3d(-3%, 4%, 0) scale(1.06); } }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, currentColor 0%, transparent); } 50% { box-shadow: 0 0 14px 2px color-mix(in oklch, var(--accent) 50%, transparent); } }
  @keyframes flash { from { opacity: .35; filter: blur(2px); } }
  @keyframes rise { from { opacity: 0; translate: 0 18px; filter: blur(6px); } }

  @keyframes j-travel {
    0%, 6% { left: 14%; } 40%, 46% { left: 50%; } 72%, 78% { left: 86%; } 100% { left: 14%; }
  }
  @keyframes j-plain { 0%, 8% { opacity: 1; } 12%, 70% { opacity: 0; } 74%, 78% { opacity: 1; } 82%, 100% { opacity: 0; } }
  @keyframes j-sealed { 0%, 8% { opacity: 0; } 12%, 70% { opacity: 1; } 74%, 78% { opacity: 0; } 82%, 100% { opacity: 1; } }
  @keyframes j-relay { 0%, 34%, 52%, 100% { box-shadow: none; } 40%, 46% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent-2) 20%, transparent), 0 0 40px color-mix(in oklch, var(--accent-2) 40%, transparent); } }
  @keyframes j-laptop { 0%, 66%, 84%, 100% { box-shadow: none; } 72%, 78% { box-shadow: 0 0 0 6px color-mix(in oklch, var(--accent) 20%, transparent), 0 0 40px var(--glow); } }
  @keyframes beat { from, to { opacity: .3; } 40%, 60% { opacity: 1; } }

  @media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

    .hero h1 { animation: rise .9s var(--ease) both; }
    .hero .lede { animation: rise .9s .12s var(--ease) both; }
    .hero .cta { animation: rise .9s .22s var(--ease) both; }
    .hero .key-demo { animation: rise 1.1s .3s var(--ease) both; }
    .page-head > * { animation: rise .7s var(--ease) both; }
    .page-head > :nth-child(2) { animation-delay: .08s; }

    /* Fallback: the journey loops in time. */
    .j-packet { animation: j-travel 7s var(--ease) infinite; }
    .j-plain { animation: j-plain 7s linear infinite; }
    .j-sealed { animation: j-sealed 7s linear infinite; }
    .j-relay { animation: j-relay 7s linear infinite; }
    .j-laptop { animation: j-laptop 7s linear infinite; }

    @supports (animation-timeline: view()) {
      /* Sections arrive as they scroll in. */
      .home .sect > *, .prose > .sect {
        animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%;
      }
      /* The journey is driven by the scroll, not the clock. */
      .j-packet, .j-plain, .j-sealed, .j-relay, .j-laptop {
        animation-duration: auto; animation-iteration-count: 1; animation-timing-function: linear; animation-fill-mode: both;
        animation-timeline: --journey; animation-range: contain 0% contain 100%;
      }
      .j-beats li { animation: beat linear both; animation-timeline: view(); animation-range: cover 20% cover 80%; }
      .st-bar span { animation: grow linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; }
      @keyframes grow { from { width: 0; } }
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .kd-card::before, .hero::before, .notice-dot, .live .dot { animation: none; }
  }
}
