:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f4ef, #111110);
  --bg-alt: light-dark(#efebe2, #171614);
  --surface: light-dark(#fffdf9, #1c1b18);
  --line: light-dark(#e2dbcd, #2e2b26);
  --ink: light-dark(#1f1a14, #ece7de);
  --muted: light-dark(#5f574b, #b3ab9e);
  --accent: light-dark(#8b1e24, #e57a80);
  --accent-ink: light-dark(#fbf7ee, #1a0f0f);
  --accent-fill: light-dark(#8b1e24, #e57a80);
  --gold: light-dark(#85611d, #d6b25e);
  --run: light-dark(#1d5fbf, #79b8ff);
  --handoff: light-dark(#007477, #79d7dc);
  --ok: light-dark(#187345, #a2d7a4);
  --attn: light-dark(#9a5700, #f3bf62);
  --focus: light-dark(#5a2380, #c9a2ff);
  --shadow: light-dark(0 18px 50px -24px rgba(60, 30, 10, .35), 0 18px 50px -24px rgba(0, 0, 0, .8));
  --serif: "Palatino Linotype", Palatino, Georgia, serif;
  --radius: 14px;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 76px; }
body { margin: 0; }
a { color: var(--run); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--surface); padding: .5rem 1rem; }
.skip:focus { left: 8px; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

.button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .6rem 1.25rem;
  border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.button.primary { background: var(--accent-fill); color: var(--accent-ink); box-shadow: var(--shadow); }
.button.primary:hover { transform: translateY(-1px); }
.button.ghost { color: var(--ink); border-color: var(--line); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; }
.button.ghost:hover { border-color: var(--accent); }
.button.small { min-height: 38px; padding: .35rem 1rem; font-size: .92rem; }

.top {
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--accent); }
.brand-mark { width: 34px; height: 34px; }
.brand-name { font: 700 1.3rem var(--serif); letter-spacing: .16em; text-transform: uppercase; }
.top-nav { display: flex; gap: 1.25rem; margin-left: auto; }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.top-nav a:hover { color: var(--ink); }

.eyebrow { margin: 0 0 .5rem; color: var(--gold); font: italic 700 1rem var(--serif); letter-spacing: .04em; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
h1 { font: 700 clamp(2.3rem, 5vw, 3.9rem)/1.05 var(--serif); letter-spacing: -.01em; }
h2 { font: 700 clamp(1.8rem, 3.6vw, 2.6rem)/1.1 var(--serif); }
h3 { font-size: 1.1rem; }
.accent { color: var(--accent); }

.hero { padding: clamp(3rem, 8vw, 6rem) 0 2.5rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 60vw; height: 60vw; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 3rem; align-items: center; position: relative; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; margin: 1.25rem 0 1.75rem; }
.lede strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta-row.center { justify-content: center; }
.hint { color: var(--muted); font-size: .92rem; margin: 1rem 0 0; }

.hero-art {
  position: relative; padding: 1.5rem; border-radius: 22px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.phalanx-rows { display: grid; gap: 1rem; }
.lane { display: flex; gap: .4rem; overflow: hidden; }
.pill {
  flex: 1 1 0; padding: .45rem .25rem; text-align: center; border-radius: 999px; font-size: .72rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted);
  background: var(--bg-alt); border: 1px solid var(--line);
}
.lane .pill { animation: lane 7.5s infinite both; }
.lane .pill:nth-child(2) { animation-delay: .9s; }
.lane .pill:nth-child(3) { animation-delay: 1.8s; }
.lane .pill:nth-child(4) { animation-delay: 2.7s; }
.lane .pill:nth-child(5) { animation-delay: 3.6s; }
.lane:nth-child(2) .pill { animation-name: lane2; }
.lane:nth-child(3) .pill { animation-name: lane3; }
.pill.dev { --tone: var(--run); }
.pill.rev { --tone: var(--handoff); }
.pill.pub { --tone: var(--gold); }
.pill.del { --tone: var(--attn); }
.pill.ok { --tone: var(--ok); }
@keyframes lane { 0%, 100% { color: var(--muted); border-color: var(--line); }
  8%, 60% { color: var(--tone); border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); } }
@keyframes lane2 { 0%, 15%, 100% { color: var(--muted); border-color: var(--line); }
  25%, 72% { color: var(--tone); border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); } }
@keyframes lane3 { 0%, 30%, 100% { color: var(--muted); border-color: var(--line); }
  40%, 85% { color: var(--tone); border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, var(--surface)); } }
.hero-shield {
  position: absolute; right: -18px; bottom: -22px; width: 92px; height: 92px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .25)); animation: bob 6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

.proof {
  list-style: none; padding: 0; margin-top: 3rem; display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 1fr); color: var(--muted); font-size: .95rem;
}
.proof li { border-top: 2px solid var(--line); padding-top: .75rem; }
.proof strong { display: block; color: var(--ink); font: 700 1.2rem var(--serif); }

.band { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.band.alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-lede { color: var(--muted); max-width: 46rem; font-size: 1.08rem; margin: 1rem 0 2.5rem; }

.flow { display: grid; gap: 1.5rem; }
.flow-figure {
  margin: 0; padding: 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow);
}
.flow-svg { display: block; width: 100%; max-width: 980px; height: auto; margin-inline: auto; }
.edge { fill: none; stroke: var(--line); stroke-width: 2; }
.edge.dashed { stroke-dasharray: 5 5; }
.arrow-head { fill: var(--muted); }
.route { fill: none; stroke: none; }
.node rect { fill: var(--bg-alt); stroke: var(--line); stroke-width: 1.5; transition: fill .35s, stroke .35s; }
.node text { fill: var(--muted); text-anchor: middle; font-family: inherit; }
.node .node-title { fill: var(--ink); font-weight: 700; font-size: 17px; }
.node .node-sub { font-size: 13px; }
.writer .writer-title { text-anchor: start; fill: var(--ink); font-size: 13px; font-weight: 600; }
.writer rect { fill: var(--surface); }
.st { fill: var(--line); stroke: none; }
.writer .st { animation: stage 6s infinite both; }
.st.s1 { --tone: var(--run); }
.st.s2 { --tone: var(--handoff); animation-delay: 1.2s; }
.st.s3 { --tone: var(--gold); animation-delay: 2.4s; }
.st.s4 { --tone: var(--ok); animation-delay: 3.6s; }
.writer.wB .st { animation-duration: 7s; }
.writer.wC .st { animation-duration: 8s; }
@keyframes stage { 0%, 100% { fill: var(--line); } 10%, 70% { fill: var(--tone); } }
.node.done rect { stroke: var(--ok); }
.node.observer rect { stroke-dasharray: 6 4; }
.node.is-active > rect, .node.is-active .writer > rect {
  fill: color-mix(in srgb, var(--accent) 10%, var(--surface)); stroke: var(--accent); stroke-width: 2.5;
}
.packet { fill: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 70%, transparent)); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(4, 1fr); }
.steps button {
  display: flex; flex-direction: column; gap: .6rem; width: 100%; height: 100%; text-align: left; padding: 1rem; border-radius: 12px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: .92rem;
  transition: background-color .25s, border-color .25s, color .25s;
}
.steps button:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.steps strong { color: var(--ink); }
.steps .num {
  flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .85rem;
}
.steps li.is-active button {
  background: var(--surface); border-color: var(--accent); color: var(--ink); box-shadow: var(--shadow);
}
.steps li.is-active .num { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; }
.flow-controls { margin-top: 1rem; }

.demos { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, 1fr); }
.demo {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.demo video { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--bg-alt); }
.demo figcaption { padding: 1rem 1.1rem 1.2rem; color: var(--muted); font-size: .93rem; }
.demo figcaption strong { color: var(--ink); }
.demo:first-child { grid-column: 1 / -1; }
.demo:first-child figcaption { font-size: 1rem; }

.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, 1fr); margin-top: 2.5rem; }
.feature {
  padding: 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.feature .icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 1.35rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-alt)); margin-bottom: .9rem;
}
.feature p { color: var(--muted); font-size: .94rem; margin: .5rem 0 0; }

.targets { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); margin-top: 2rem; }
.target { padding: 1.25rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 12px 12px 0; }
.target:nth-child(2) { border-color: var(--handoff); }
.target:nth-child(3) { border-color: var(--gold); }
.target:nth-child(4) { border-color: var(--run); }
.target p { color: var(--muted); margin: .4rem 0 0; font-size: .94rem; }

.closing { padding: clamp(4rem, 9vw, 7rem) 0; text-align: center; }
.closing-shield { width: 72px; height: 72px; }
.closing h2 { margin-top: 1rem; font-style: italic; color: var(--accent); }
.closing p { color: var(--muted); font-size: 1.1rem; }

.foot { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.foot-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.foot nav { display: flex; gap: 1.25rem; }
.foot a { color: var(--muted); }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero-grid, .flow { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .targets, .proof { grid-template-columns: repeat(2, 1fr); }
  .demos { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top-nav { display: none; }
  .top-inner .button { margin-left: auto; }
  .hero-art { display: none; }
  .flow-figure { overflow-x: auto; }
  .flow-svg { min-width: 640px; }
  .steps button { flex-direction: row; }
  .features, .targets, .proof, .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .packets { display: none; }
  .reveal { opacity: 1; transform: none; }
}
.flow.is-paused .packets { display: none; }
.flow.is-paused .st, .motion-paused .lane .pill, .motion-paused .hero-shield { animation-play-state: paused; }
