:root {
  --paper: #161613;
  --surface: #201f1b;
  --sunken: #100f0d;
  --ink: #edeae0;
  --muted: #9b998e;
  --line: #33322b;
  --line-strong: #4d4c42;
  --blue: #135ef2;
  --blue-hover: #2f70f4;
  --blue-text: #7aa3ff;
  --acid: #cbf43d;
  --acid-ink: #171713;
  --operation: #0d0d0b;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}
body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 Manrope, sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button, .btn { font: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--blue);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--blue-text);
  outline-offset: 3px;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 8;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  background: var(--operation);
  border-right: 1px solid var(--line);
}
.rail-mark {
  width: 22px;
  height: 22px;
  color: var(--acid);
}
.rail-rule { width: 1px; height: 48px; background: var(--line); }
.rail-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 9px/1 "DM Mono", monospace;
  letter-spacing: 0.18em;
  color: #b8b7af;
}
.rail-spacer { flex: 1; }
.rail-credit {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 500 8px/1.4 "DM Mono", monospace;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.wrap {
  margin-left: 52px;
  width: calc(100% - 52px);
  max-width: none;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(22, 22, 19, 0.92);
  backdrop-filter: blur(10px);
}
.wordmark {
  margin-right: auto;
  font: 600 15px/1 Unbounded, sans-serif;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.wordmark span { color: var(--blue-text); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a { white-space: nowrap; }
.nav a:not(.wordmark):not(.btn) {
  color: var(--muted);
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}
.nav a:not(.wordmark):not(.btn):hover,
.nav a[aria-current="page"] { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}
.btn-quiet:hover { background: var(--surface); }

.hero, .section, .footer { padding: 72px 48px; }
.hero { padding-top: 56px; padding-bottom: 40px; }
.kicker {
  display: block;
  margin-bottom: 16px;
  color: var(--blue-text);
  font: 500 11px/1 "DM Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  max-width: 18ch;
  margin: 0 0 20px;
  font: 600 clamp(40px, 6vw, 72px)/1.02 Unbounded, sans-serif;
  letter-spacing: -0.045em;
  overflow-wrap: break-word;
}
h2 {
  margin: 0 0 12px;
  font: 600 clamp(28px, 3.4vw, 42px)/1.1 Unbounded, sans-serif;
  letter-spacing: -0.04em;
}
h3 { margin: 0 0 8px; font: 700 18px/1.25 Manrope, sans-serif; }
.lede, .section p { max-width: 42rem; color: var(--muted); }
.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.prose .license-rows { margin-top: 8px; }
.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font: 500 11px/1.5 "DM Mono", monospace;
  letter-spacing: 0.04em;
}

.frame-well {
  margin: 8px 48px 72px;
  padding: 0;
  background: var(--operation);
  border: 1px solid var(--line);
}
.frame-well img { width: 100%; height: auto; display: block; }
.frame-caption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 0;
  padding: 0 18px 14px;
  color: var(--muted);
  font: 500 10px/1.4 "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.problem { border-top: 1px solid var(--line); }
.rows { margin-top: 36px; border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row small {
  color: var(--blue-text);
  font: 500 11px/1 "DM Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.row p { margin: 0; }

.stages {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 36px;
}
.stage {
  padding: 28px 24px 32px;
  background: var(--paper);
}
.stage .num {
  display: block;
  margin-bottom: 28px;
  color: var(--muted);
  font: 500 11px/1 "DM Mono", monospace;
  letter-spacing: 0.14em;
}
.stage p { margin: 0; }

.local {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  background: var(--operation);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.local p { color: #b8b7af; }
.signal {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 72px;
}
.signal i {
  display: block;
  width: 6px;
  background: var(--acid);
  animation: pulse 1.4s var(--ease) infinite;
  animation-delay: var(--d);
}
@keyframes pulse {
  0%, 100% { transform: scaleY(0.45); opacity: 0.55; }
  50% { transform: scaleY(1); opacity: 1; }
}

.stills {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 36px;
}
.still { margin: 0; }
.still img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-top: 2px solid var(--ink);
}
.still figcaption {
  margin-top: 10px;
  color: var(--muted);
  font: 500 10px/1.4 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cta-band { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

@media (min-width: 901px) {
  .hero-copy {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 34%);
    gap: 40px;
    align-items: end;
  }
  .row {
    grid-template-columns: 88px 1fr 1.2fr;
    gap: 24px;
  }
  .prose .license-rows .row {
    grid-template-columns: 88px 1fr 1.4fr;
  }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .local {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
  .stills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.page-hero { padding-bottom: 24px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 48px; }
.prose ol { padding-left: 1.2em; color: var(--muted); }
.prose li { margin: 10px 0; }
.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 10px 0 0; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .rail { display: none; }
  .wrap { margin-left: 0; width: 100%; min-width: 0; }
  .hero, .section, .footer { padding-left: 20px; padding-right: 20px; }
  .frame-well {
    margin-left: 20px;
    margin-right: 20px;
    padding-left: 0;
    padding-right: 0;
  }

  .nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
  }
  .wordmark { margin-right: auto; }
  .nav > .btn {
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    white-space: nowrap;
  }
  .nav-links {
    flex: 1 0 100%;
    order: 3;
    gap: 16px;
    padding-top: 4px;
  }
  .nav-links a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  h1 {
    max-width: none;
    font-size: clamp(32px, 9vw, 56px);
  }
  .hero-actions,
  .download-actions {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .hero-actions .btn,
  .download-actions .btn {
    flex: 1 1 100%;
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .signal i { animation: none; }
}
