@font-face { font-family: "Space Grotesk"; src: url("/vendor/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/vendor/plex-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #05070d;
  --panel: #0c111c;
  --panel-2: #121927;
  --line: #222c3e;
  --text: #edf1f7;
  --muted: #98a4b8;
  --amber: #ffb454;
  --cyan: #64d2ff;
  --green: #5fd39a;
  --red: #ff7a6b;
  --radius: 14px;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); font: 400 16px/1.55 var(--sans);
  background:
    radial-gradient(1px 1px at 12% 18%, #ffffff55, transparent),
    radial-gradient(1px 1px at 72% 8%, #ffffff44, transparent),
    radial-gradient(1px 1px at 88% 62%, #ffffff33, transparent),
    radial-gradient(1px 1px at 34% 78%, #ffffff33, transparent),
    radial-gradient(1200px 500px at 85% -10%, #15233f66, transparent),
    var(--ink);
  background-attachment: fixed;
}
a { color: var(--cyan); }
h1, h2, h3, p { margin: 0; }
img, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--panel); padding: 8px 12px; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; padding: 26px 16px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 26px; background: #070a12cc; backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--amber); text-decoration: none; font-weight: 700; letter-spacing: .18em; padding: 0 10px; }
#nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
#nav a svg { flex: none; }
#nav .short { display: none; }
#nav a:hover { color: var(--text); background: var(--panel); }
#nav a[aria-current="page"] { color: var(--ink); background: var(--amber); }
.rail-note { font-size: 12px; color: var(--muted); padding: 0 10px; }

main { padding: clamp(18px, 3vw, 38px); min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px; }
.page-head h1 { font-size: clamp(27px, 4vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -.01em; }
.page-head p { color: var(--muted); max-width: 62ch; margin-top: 7px; }
.eyebrow { font: 400 12px var(--mono); color: var(--amber); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.stamp { font: 400 12px var(--mono); color: var(--muted); }
.stale { color: var(--amber); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.card-sub { color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 16px; align-items: start; }

.stat { display: flex; flex-direction: column; gap: 3px; }
.stat b { font: 400 clamp(22px, 2.6vw, 30px)/1.1 var(--mono); }
.stat span { color: var(--muted); font-size: 13px; }
.stat.amber b { color: var(--amber); } .stat.cyan b { color: var(--cyan); } .stat.green b { color: var(--green); }

.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

.btn { border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 500; min-height: 40px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--amber); color: var(--ink); border-color: var(--amber); font-weight: 600; }
.btn:disabled { opacity: .55; cursor: wait; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: 14px; min-height: 34px; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--cyan); color: var(--ink); border-color: var(--cyan); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); min-width: 0; }
.input { width: 100%; background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--text); font-size: 16px; min-height: 40px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row > .grow { flex: 1 1 200px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font: 400 11px var(--mono); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.warn { color: var(--amber); border-color: #6b4e24; }
.tag.ok { color: var(--green); border-color: #2a5e45; }
.tag.bad { color: var(--red); border-color: #6e3730; }

.note { font-size: 14px; color: var(--muted); border-left: 2px solid var(--amber); padding: 2px 0 2px 12px; }
.notice { background: #2a1d0a; border: 1px solid #6b4e24; border-radius: 10px; padding: 11px 14px; font-size: 14px; }
.notice.good { background: #0e2a1d; border-color: #2a5e45; }
.error { color: var(--red); }

.skeleton { background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel)); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--radius); min-height: 120px; }
@keyframes shimmer { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding: 0; overflow: hidden; }
.hero-img { background: #000; min-height: 300px; max-height: 520px; display: flex; align-items: center; justify-content: center; }
.hero-img img { width: 100%; height: 100%; max-height: 520px; object-fit: contain; }
.hero-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero-body h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; font-weight: 600; margin: 0; }
.hero-text { color: #c7cfdb; font-size: 15px; max-height: 240px; overflow: auto; }
.link-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s; }
.link-card:hover { border-color: var(--amber); }
.link-card .kicker { font: 400 11px var(--mono); color: var(--amber); letter-spacing: .1em; text-transform: uppercase; }
.link-card strong { font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.gallery a { display: block; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 1; position: relative; color: #fff; text-decoration: none; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery a:hover img { transform: scale(1.04); }
.gallery span { position: absolute; inset: auto 0 0; padding: 22px 9px 8px; font-size: 12px; line-height: 1.3; background: linear-gradient(transparent, #000d); }

.table-wrap { overflow-x: auto; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
td { padding: 11px 12px; border-bottom: 1px solid #182030; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr[aria-selected="true"] { background: var(--panel-2); }
tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 var(--amber); }
.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.name { font-weight: 600; }

.strip { width: 100%; height: 96px; margin-top: 8px; }
.chart { width: 100%; height: 240px; }
.chart.tall { height: 340px; }
.map { width: 100%; aspect-ratio: 2/1; background: #070c16; border-radius: 10px; }

.scene { position: relative; height: min(70dvh, 640px); min-height: 420px; padding: 0; overflow: hidden; background: #03050a; }
.scene canvas { width: 100% !important; height: 100% !important; }
.label { position: absolute; top: 0; left: 0; font-size: 12px; pointer-events: none; color: #dfe6f0; white-space: nowrap; text-shadow: 0 0 5px #000; will-change: transform; }
.scene-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; background: #0a0f1acc; backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.scene-bar input[type=range] { flex: 1 1 160px; accent-color: var(--amber); min-width: 120px; }
.scene-date { font: 400 13px var(--mono); min-width: 96px; }

.tooltip { position: fixed; pointer-events: none; z-index: 30; background: #0a0f1af2; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; max-width: 240px; }
.pass { display: grid; grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid #182030; align-items: center; }
.pass:last-child { border-bottom: 0; }
.pass .time { font: 400 15px var(--mono); }
.pass .day { font-size: 12px; color: var(--muted); }
.pass.dim { opacity: .62; }
.gauge { height: 10px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.gauge i { display: block; height: 100%; background: var(--amber); border-radius: 99px; transition: width .3s; }
.steps { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.steps li { color: var(--muted); }
.steps li.on { color: var(--text); }
.steps li.on::marker { color: var(--amber); }

@media (max-width: 980px) {
  .split, .hero { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .shell { display: block; padding-bottom: 76px; }
  .rail { position: fixed; inset: auto 0 0; height: auto; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 20; background: #070a12f5; }
  .brand, .rail-note { display: none; }
  #nav { flex-direction: row; justify-content: space-between; gap: 0; }
  #nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 6px 1px; font-size: 10px; text-align: center; border-radius: 8px; }
  #nav a[aria-current="page"] { background: transparent; color: var(--amber); }
  #nav .full { display: none; }
  #nav .short { display: block; white-space: nowrap; }
  main { padding: 16px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .hero-img { min-height: 220px; }
  .scene { height: 66dvh; min-height: 380px; }
}
