:root {
  color-scheme: light dark;
  --background: #f4f6f8;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #46586b;
  --line: #c3cdd7;
  --accent: #315c88;
  --tint: #e8eff6;
  --primary-text: #ffffff;
  --comparison: #8a9aac;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #111827;
    --surface: #172337;
    --ink: #f4f6f8;
    --muted: #c3cdd7;
    --line: #3b4c61;
    --accent: #79a9dc;
    --tint: #1d2b40;
    --primary-text: #111827;
    --comparison: #8a9aac;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font: 1rem/1.6 system-ui, sans-serif;
}
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
p, h1, h2, figure, dl, dd { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
code { font: .9em var(--mono); overflow-wrap: anywhere; }
.shell { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.skip-link {
  position: absolute;
  inset: .5rem auto auto 1rem;
  transform: translateY(-160%);
  z-index: 1;
  padding: .45rem .8rem;
  color: var(--ink);
  background: var(--surface);
}
.skip-link:focus { transform: none; }
.site-header, .site-footer { background: var(--surface); }
.site-header { border-bottom: 1px solid var(--line); }
.topbar, .footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.topbar { padding-block: .9rem; }
.wordmark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; color: var(--ink); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; }
nav a { font-size: .875rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.hero {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-block: clamp(3rem, 8vw, 7rem);
}
.eyebrow { color: var(--accent); font: 650 .875rem/1.5 var(--mono); }
h1 {
  margin-block: .7rem 1.05rem;
  font-size: clamp(2.8rem, 6vw, 5.75rem);
  font-weight: 770;
  line-height: .99;
  letter-spacing: -.05em;
  word-spacing: .035em;
}
h1 span { color: var(--accent); }
.lead { max-width: 36rem; color: var(--muted); font-size: clamp(1.03rem, 2vw, 1.24rem); }
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.button {
  padding: .68rem 1rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}
.button:hover { background: var(--tint); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--primary-text); }
.hero-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(.85rem, 2.5vw, 1.3rem);
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: linear-gradient(145deg, var(--surface) 50%, var(--tint));
}
.cli-example {
  display: grid;
  gap: .35rem;
  margin-top: .85rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--tint);
}
.hero-note { margin-top: .7rem; color: var(--muted); font-size: .875rem; }
.story, .scope {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  gap: clamp(1.5rem, 6vw, 5rem);
  align-items: center;
  border-top: 1px solid var(--line);
  padding-block: clamp(2.75rem, 7vw, 5.5rem);
}
.story-copy, .scope-copy { display: grid; gap: .8rem; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.03; letter-spacing: -.045em; }
.story-copy > p:not(.eyebrow), .scope-copy p { color: var(--muted); }
.text-link { width: fit-content; font-weight: 650; }
.metrics { display: grid; gap: .55rem; margin-block: .2rem; }
.metrics div { border-left: 2px solid var(--accent); padding-left: .75rem; }
.metrics dt { color: var(--muted); font-size: .875rem; }
.metrics dd { font-size: .925rem; }
.metrics strong { color: var(--ink); font: 700 1.08rem/1.5 var(--mono); }
.metrics dd span { color: var(--muted); }
.visual { min-width: 0; }
.visual figcaption { margin-top: .5rem; font-size: .875rem; color: var(--muted); }
.motion-figure { position: relative; display: block; width: 100%; aspect-ratio: var(--ratio); }
.hero-mark { --ratio: 560 / 104; }
.latency { --ratio: 480 / 306; }
.wire { --ratio: 480 / 212; }
.architecture { --ratio: 480 / 396; }
.mark-fallback, .static-graphic {
  width: 100%; height: 100%;
  display: grid;
  align-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .6rem;
}
.mark-fallback { justify-items: center; background: var(--tint); }
.mark-fallback img { width: clamp(3.25rem, 8vw, 4.5rem); }
.static-graphic { padding: clamp(.7rem, 3vw, 1.1rem); gap: .65rem; }
.static-graphic p { font-weight: 650; }
.static-bars { display: grid; gap: .28rem; font-size: .875rem; }
.bar { display: block; width: var(--fraction); height: .5rem; border-radius: .15rem; background: var(--accent); }
.bar.comparison { background: var(--comparison); }
.static-flow { gap: .45rem; font: .875rem/1.5 var(--mono); }
.static-flow p { border: 1px solid var(--line); border-radius: .3rem; padding: .32rem .55rem; }
.wire-story .visual { order: -1; }
.ratio-band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .9rem;
  margin-bottom: .35rem;
  padding: .4rem .65rem;
  border-left: 2px solid var(--accent);
  border-radius: .18rem;
  background: var(--tint);
}
.ratio-band strong { color: var(--accent); font: 700 1rem/1.4 var(--mono); }
.wire-stat { display: flex; align-items: center; flex-wrap: wrap; gap: .1rem .9rem; }
.wire-stat strong { color: var(--accent); font: 750 clamp(2.3rem, 5vw, 3.65rem)/1.2 var(--mono); letter-spacing: -.06em; }
.wire-stat span { font-size: .875rem; line-height: 1.4; }
.paths { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.paths li + li { margin-top: .35rem; }
.paths strong { color: var(--ink); }
.scope { align-items: start; }
.scope h2 { margin-top: .4rem; }
.site-footer { border-top: 1px solid var(--line); }
.footer-row { padding-block: 1.2rem; color: var(--muted); font-size: .875rem; }
.scroll-progress { display: none; }

@media (prefers-reduced-motion: no-preference) {
  [data-reveal][data-playing] :is(.hero-copy > *, .hero-panel, .story-copy > *, .visual, .scope > div) {
    animation: section-enter .5s var(--enter-delay, 0s) cubic-bezier(.2, .72, .35, 1) both;
  }
  .hero-copy h1 { --enter-delay: .14s; }
  .hero-copy .lead { --enter-delay: .33s; }
  .hero-copy .actions { --enter-delay: .52s; }
  .hero-panel { --enter-delay: .2s; }
  .story-copy h2 { --enter-delay: .08s; }
  .story-copy > :nth-child(n+3), .scope-copy, .visual { --enter-delay: .16s; }
  .story-copy .text-link { --enter-delay: .23s; }

  .hero-panel::after, .motion-figure::after {
    position: absolute;
    inset: 0;
    border: 1px solid var(--accent);
    border-radius: .65rem;
    opacity: 0;
    pointer-events: none;
    content: "";
  }
  .hero[data-playing] .hero-panel::after, .motion-figure[data-playing]::after {
    animation: edge-signal 1.6s ease-out both;
  }
  .visual:has(.latency[data-playing]) .ratio-band {
    animation: ratio-signal .36s 1.44s ease-out both;
  }
  .wire-story:has(.wire[data-playing]) .wire-stat {
    animation: ratio-signal .4s 2.2s ease-out both;
  }

  :root[data-tab-hidden] [data-reveal] *,
  :root[data-tab-hidden] [data-reveal] *::after {
    animation-play-state: paused !important;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button { transition: transform .18s ease-out, border-color .18s ease-out, background-color .18s ease-out; }
  .button:hover { transform: translateY(-2px); border-color: var(--accent); }
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-progress {
      display: block;
      position: fixed;
      inset: 0 0 auto;
      z-index: 2;
      height: 2px;
      pointer-events: none;
      background: var(--accent);
      transform: scaleX(0);
      transform-origin: left;
      animation: scroll-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes section-enter {
  from { opacity: .28; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes edge-signal {
  0%, 100% { opacity: 0; }
  35% { opacity: .52; }
}
@keyframes ratio-signal {
  0% { opacity: .66; transform: translateY(4px); }
  60% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}
@keyframes scroll-progress { to { transform: scaleX(1); } }

@media (max-width: 48rem) {
  .hero, .story, .scope { grid-template-columns: 1fr; }
  .wire-story .visual { order: 0; }
}
