:root {
  --ink: #0b0c0e;
  --steel: #1a1d22;
  --steel-2: #2a3038;
  --paper: #e8e4d8;
  --yellow: #f5c518;
  --red: #ff3b30;
  --blue: #3d7eff;
  --ok: #3cb371;
  --mute: #9aa3ad;
  --display: "Bebas Neue", "Noto Sans SC", sans-serif;
  --sans: "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 72px; }

body {
  margin: 0;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.app-link { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--mono); background: rgba(245, 197, 24, 0.16); padding: 0.05em 0.35em; }

.asphalt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  opacity: 0.18;
  background-image: url("images/texture.webp");
  background-size: 420px auto;
  mix-blend-mode: overlay;
}

.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; z-index: 80; background: var(--yellow); color: var(--ink); padding: 8px; }

.gantry-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  min-height: 64px;
  background:
    repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--ink) 10px 20px) top / 100% 6px no-repeat,
    var(--ink);
  border-bottom: 1px solid var(--steel-2);
}
.brand { font-family: var(--display); font-size: 28px; letter-spacing: 0.08em; color: var(--yellow); }
.brand small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--mute);
}
.lane-links { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.lane-links a { color: var(--paper); }
.lane-links a.is-active { color: var(--yellow); }
.lane-links .live {
  background: var(--yellow);
  color: var(--ink);
  padding: 6px 12px;
  font-weight: 700;
}
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--yellow);
  border: 1px solid var(--yellow);
  padding: 6px 12px;
}

.hero { position: relative; min-height: 88vh; }
.hero img { width: 100%; height: 88vh; object-fit: cover; }
.gantry-glass {
  position: absolute;
  left: 24px;
  bottom: 28px;
  max-width: 640px;
  padding: 28px;
  background: rgba(11, 12, 14, 0.78);
  border: 1px solid rgba(245, 197, 24, 0.35);
  backdrop-filter: blur(8px);
}
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--yellow);
  text-transform: uppercase;
  margin: 0 0 8px;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: 0.04em; line-height: 1.05; margin: 0 0 12px; }
h1 { font-size: clamp(42px, 8vw, 76px); }
h1 em { font-style: normal; color: var(--red); }
h2 { font-size: clamp(28px, 4vw, 44px); color: var(--yellow); }
.lead { margin: 0 0 16px; color: #d5d0c4; }
.quiet { color: var(--mute); margin-top: 0; }

.led {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0 12px;
  align-items: baseline;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: #050607;
  border: 2px solid #3a2208;
  box-shadow: inset 0 0 24px #ff3b3022;
}
.led-label { grid-column: 1 / -1; font-family: var(--mono); font-size: 11px; color: #c08030; }
#led-ton { font-family: var(--display); font-size: 72px; color: var(--red); line-height: 0.9; text-shadow: 0 0 18px #ff3b30aa; }
.led em { font-style: normal; font-family: var(--mono); color: var(--red); }
#led-state { grid-column: 1 / -1; margin: 0; font-family: var(--mono); color: var(--yellow); }

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--yellow);
  font-weight: 700;
}
.btn.fill { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--yellow); }

.deck { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0; }
.night { background: linear-gradient(180deg, #101318, #0b0c0e); }

.steel-3, .ticket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.steel-3 article, .ticket-grid article, .io > div, .axle-board {
  background: var(--steel);
  border: 1px solid var(--steel-2);
  padding: 20px;
  box-shadow: inset 0 0 0 1px #0008;
}
.steel-3 .alert { border-color: var(--red); }
.steel-3 ul, .io ul { padding-left: 1.1em; margin: 0; }
.steel-3 li + li, .io li + li, .bound li + li { margin-top: 6px; }

.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  counter-reset: s;
}
.steps li {
  counter-increment: s;
  padding: 12px 10px;
  background: var(--steel);
  border-top: 4px solid var(--yellow);
  font-size: 14px;
}
.steps li::before {
  content: counter(s, decimal-leading-zero);
  display: block;
  font-family: var(--mono);
  color: var(--yellow);
  font-size: 11px;
}

.lane-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 48px;
}
.lane-block.flip { grid-template-columns: 1fr 1fr; }
.lane-block.flip figure { order: -1; }
.num { font-family: var(--mono); color: var(--yellow); font-size: 12px; letter-spacing: 0.16em; }
figure { margin: 0; }
figcaption { font-size: 13px; color: var(--mute); margin-top: 8px; }

.return-demo, .doc-demo {
  margin-top: 16px;
  padding: 12px;
  background: #12151a;
  border-left: 4px solid var(--blue);
}
.return-btns { display: flex; gap: 8px; margin-bottom: 8px; }
.return-btns button {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--mute);
  padding: 6px 12px;
}
.return-btns button.on { border-color: var(--blue); color: var(--blue); }
.return-state.ok { color: var(--ok); }
.return-state.loop { color: var(--red); }

.doc-demo { border-left-color: var(--yellow); }
.doc-demo label { display: block; margin: 6px 0; }
.doc-state.wait { color: var(--yellow); }
.doc-state.ready { color: var(--ok); }

.axle-board { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.axle-bars { display: flex; align-items: flex-end; gap: 12px; min-height: 240px; }
.axle-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}
.axle-fill {
  width: 100%;
  background: linear-gradient(#3d7eff, #1a3a80);
  border: 1px solid #5a8cff;
  min-height: 8px;
  transition: height 0.2s ease;
}
.axle-col.over .axle-fill { background: linear-gradient(#ff5a4a, #8a120c); border-color: var(--red); }
.axle-col.on { outline: 1px dashed var(--yellow); outline-offset: 4px; }
.axle-col span { font-family: var(--mono); font-size: 12px; }

.bound { padding-left: 1.2em; }
.bound li { padding-left: 6px; }

.io { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ticket-grid { grid-template-columns: repeat(4, 1fr); }

footer {
  padding: 24px 20px 40px;
  border-top: 6px solid var(--yellow);
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, var(--ink) 8px 16px) top / 100% 6px no-repeat, var(--ink);
  font-size: 14px;
  color: var(--mute);
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .lane-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--ink);
    padding: 12px 18px 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .lane-links.open { display: flex; }
  .hero img { height: 70vh; }
  .gantry-glass { position: relative; left: 0; bottom: 0; max-width: none; }
  .steel-3, .ticket-grid, .lane-block, .lane-block.flip, .axle-board, .io, .steps {
    grid-template-columns: 1fr;
  }
  .lane-block.flip figure { order: 0; }
  .steps { display: grid; }
}
