/* SPASTAZ site — styled after the in-game main menu */
:root {
  --bg: #09090d;
  --panel: #000;
  --grid: rgba(255, 255, 255, 0.05);
  --grid-major: rgba(255, 255, 255, 0.09);
  --line: #e6e6e6;
  --btn-line: #6f6f74;
  --text: #ececec;
  --muted: #8d8d94;
  --dim: #55555c;
  --bar: #8a8a8f;
  --sidebar: 290px;
  --ui: "Orbitron", system-ui, sans-serif;
  --body: "Rajdhani", system-ui, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 18px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text); }
img { max-width: 100%; display: block; }
::selection { background: #fff; color: #000; }

/* ---------- layout ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  gap: 12px;
  min-height: 100vh;
  padding: 12px;
}
.sidebar {
  position: sticky; top: 12px;
  align-self: start;
  height: calc(100vh - 24px);
  display: flex; flex-direction: column; gap: 12px;
}
.main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* ---------- panels ---------- */
.panel {
  border: 2px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
}
.panel-title {
  font: 700 14px/1.2 var(--ui);
  letter-spacing: .04em;
  margin: 0 0 12px;
}
.gridbox {
  border: 2px solid var(--line);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

/* ---------- sidebar ---------- */
.brand {
  display: block; text-decoration: none;
  font: 800 20px/1 var(--ui); letter-spacing: .08em;
  text-align: center; padding: 14px 0 4px;
}
.log { flex: 0 1 auto; min-height: 150px; max-height: 34vh; overflow: auto; }
.log ul { list-style: none; margin: 0; padding: 0; }
.log li { font-size: 15px; line-height: 1.35; padding: 6px 0; border-top: 1px solid #1d1d22; }
.log li:first-child { border-top: 0; padding-top: 0; }
.log time { display: block; font: 12px var(--mono); color: var(--muted); }
.log a { text-decoration: none; }
.log a:hover { text-decoration: underline; }

.nav { display: flex; flex-direction: column; gap: 10px; }
.btn {
  display: block;
  border: 2px solid var(--btn-line);
  background: #000;
  color: var(--text);
  font: 700 15px/1 var(--ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  padding: 16px 12px;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.btn:hover, .btn:focus-visible { border-color: var(--line); background: #111116; outline: none; }
.btn[aria-current="page"] { border-color: var(--line); background: #fff; color: #000; }
.btn.primary { border-color: var(--line); }
.btn.small { display: inline-block; padding: 12px 18px; font-size: 13px; }
.btn.disabled { border-style: dashed; color: var(--muted); cursor: default; background: #000; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.sidebar-foot { margin-top: auto; font: 11px/1.5 var(--mono); color: var(--dim); text-align: center; }

.menu-toggle { display: none; }

/* ---------- header ---------- */
.title {
  font: 800 clamp(26px, 4vw, 42px)/1 var(--ui);
  letter-spacing: .06em;
  text-align: center;
  margin: 14px 0 6px;
}
.subtitle {
  text-align: center; color: var(--muted);
  font: 13px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 4px;
}

/* ---------- hero viewport ---------- */
.viewport {
  position: relative;
  height: min(62vh, 560px);
  min-height: 360px;
  overflow: hidden;
  cursor: none;
}
.viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewport .scan {
  position: absolute; left: 0; right: 0; height: 3px;
  background: rgba(200, 200, 205, .55);
  top: 40%;
  animation: scan 9s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 40%; } to { top: 62%; } }
.crosshair {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  pointer-events: none; left: 40%; top: 45%;
}
.crosshair .readout {
  position: absolute; left: 42px; top: 30px; white-space: nowrap;
  font: 10px var(--mono); color: #ddd; letter-spacing: .05em;
}
.hero-copy {
  position: absolute; left: 0; right: 0; top: 12%;
  text-align: center; padding: 0 16px; pointer-events: none;
}
.hero-copy p { margin: 0 auto 18px; max-width: 34em; color: #cfcfd4; font-size: 20px; }
.hero-copy .cta { pointer-events: auto; display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-copy .cta a { cursor: pointer; }

/* ---------- content ---------- */
.section { padding: 26px clamp(18px, 3vw, 34px); }
.section h2 {
  font: 700 18px/1.2 var(--ui); letter-spacing: .06em; text-transform: uppercase;
  margin: 0 0 14px;
}
.section h3 { font: 700 14px/1.3 var(--ui); letter-spacing: .05em; text-transform: uppercase; margin: 26px 0 8px; }
.section p { margin: 0 0 14px; max-width: 70ch; }
.section ul, .section ol { max-width: 70ch; padding-left: 1.2em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.tag {
  display: inline-block; font: 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--btn-line); padding: 5px 7px; color: #cfcfd4;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { border: 2px solid var(--btn-line); background: #000; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; }
.card p { margin: 0; color: #c9c9ce; font-size: 17px; }
.card .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.card.feature { border-color: var(--line); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { border: 1px solid #2a2a30; padding: 12px 14px; }
.stat b { display: block; font: 700 13px var(--ui); letter-spacing: .05em; }
.stat span { font: 13px var(--mono); color: var(--muted); }

table.spec { border-collapse: collapse; width: 100%; max-width: 640px; font-size: 16px; }
table.spec th, table.spec td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #222228; vertical-align: top; }
table.spec th { font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); width: 38%; }

.changelog article { border-top: 1px solid #222228; padding: 20px 0; }
.changelog article:first-child { border-top: 0; padding-top: 0; }
.changelog header { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.changelog h3 { margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.shot {
  aspect-ratio: 16 / 9; border: 2px solid var(--btn-line); background: #000;
  display: grid; place-items: center; color: var(--dim); font: 12px var(--mono); overflow: hidden;
}
.shot img, .shot video { width: 100%; height: 100%; object-fit: cover; }

details { border: 1px solid #2a2a30; padding: 12px 16px; margin-bottom: 10px; max-width: 80ch; }
details summary { cursor: pointer; font: 700 13px/1.4 var(--ui); letter-spacing: .04em; }
details[open] summary { margin-bottom: 8px; }
details p:last-child { margin-bottom: 0; }

.guide { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.toc { position: sticky; top: 24px; align-self: start; font-size: 16px; }
.toc ol { padding-left: 1.1em; margin: 0; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a:hover { color: var(--text); }
.toc { max-height: calc(100vh - 48px); overflow: auto; }
.toc ol ol { padding-left: 1em; margin: 4px 0 10px; font-size: 15px; }
.toc > ol > li > a { color: var(--text); font-weight: 700; }
.guide-body { min-width: 0; }
.guide-body .lede { font-size: 20px; color: #d6d6db; }
.guide-body h2.part {
  font: 800 20px/1.25 var(--ui); letter-spacing: .05em; text-transform: uppercase;
  margin: 44px 0 6px; padding-top: 18px; border-top: 2px solid var(--line);
}
.guide-body h2.part:first-of-type { margin-top: 20px; }
.guide-body h3 { margin-top: 34px; scroll-margin-top: 16px; }
.guide-body h4 { font: 700 13px/1.3 var(--ui); letter-spacing: .04em; color: #d6d6db; margin: 22px 0 8px; }
.guide-body code, table.ref code {
  font: 14px var(--mono); background: #15151b; border: 1px solid #26262d; padding: 0 5px; white-space: nowrap;
}
.guide-body pre {
  background: #000; border: 1px solid #2a2a30; border-left: 3px solid var(--btn-line);
  padding: 12px 16px; overflow-x: auto; max-width: 80ch; margin: 0 0 16px;
}
.guide-body pre code { background: none; border: 0; padding: 0; white-space: pre; font-size: 14px; line-height: 1.5; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; max-width: 100%; }
table.ref { border-collapse: collapse; font-size: 16px; min-width: 420px; max-width: 900px; width: 100%; }
table.ref th, table.ref td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid #222228; }
table.ref th { font: 700 11px var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--btn-line); }
table.ref tr:hover td { background: #0e0e13; }
.note { border-left: 3px solid var(--line); padding: 8px 14px; background: #0f0f14; margin: 0 0 16px; max-width: 70ch; }
kbd {
  font: 13px var(--mono); border: 1px solid var(--btn-line); padding: 1px 6px; background: #000;
}

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font: 12px var(--mono); color: var(--dim); padding: 4px 4px 8px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 10px; }
  .sidebar { position: static; height: auto; }
  .brand { padding: 8px 0; }
  .menu-toggle { display: block; }
  .nav { display: none; }
  .nav.open { display: flex; }
  .log, .sidebar-foot { display: none; }
  .viewport { height: 460px; cursor: auto; }
  .crosshair { display: none; }
  .hero-copy { top: 8%; }
  .guide { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  .viewport .scan { animation: none; }
}
