/* Retro arcade styling for the Super Dungeon Racer landing site. Dark-only on
   purpose — it's a game cabinet, not a document. Fonts are the same Pixeloid
   family the game HUD uses (OFL 1.1, bundled in fonts/). */

@font-face {
  font-family: "Pixeloid Sans";
  src: url("/assets/fonts/PixeloidSans.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid Sans";
  src: url("/assets/fonts/PixeloidSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pixeloid Mono";
  src: url("/assets/fonts/PixeloidMono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #0a0612;
  --bg-2: #140a24;
  --ink: #e7e0ff;
  --muted: #9a86c8;
  --cyan: #34f5e6;
  --magenta: #ff4fd8;
  --yellow: #ffd23f;
  --green: #56f18a;
  --red: #ff5a67;
  --panel: rgba(24, 14, 44, 0.72);
  --border: #4b2d7f;
  --grid: rgba(120, 70, 200, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Pixeloid Sans", system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(
      circle at 50% -10%,
      rgba(120, 40, 160, 0.35),
      transparent 55%
    ),
    radial-gradient(
      circle at 50% 120%,
      rgba(20, 120, 160, 0.22),
      transparent 55%
    ),
    linear-gradient(to bottom, var(--bg), var(--bg-2)),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:
    100% 100%,
    100% 100%,
    100% 100%,
    32px 32px,
    32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

/* CRT scanlines + a barely-there flicker, purely decorative. */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  mix-blend-mode: multiply;
}
.crt-flicker {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: rgba(140, 90, 220, 0.03);
  animation: flicker 5s steps(60) infinite;
}
@keyframes flicker {
  0%,
  96%,
  100% {
    opacity: 0.5;
  }
  97% {
    opacity: 0.8;
  }
  98% {
    opacity: 0.3;
  }
}

a {
  color: var(--cyan);
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Landing (cabinet) ---------- */

.cabinet {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) 20px 48px;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  margin-bottom: clamp(28px, 6vw, 52px);
}

.kicker {
  font-family: "Pixeloid Mono", monospace;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: var(--yellow);
  margin: 0 0 18px;
  animation: blink 1.1s steps(2) infinite;
}

.title {
  margin: 0;
  line-height: 0.98;
  font-weight: 700;
  font-size: clamp(44px, 12vw, 96px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.title .line {
  display: block;
  color: var(--ink);
  text-shadow:
    0 0 4px rgba(52, 245, 230, 0.5),
    3px 3px 0 var(--magenta),
    -3px -3px 0 rgba(52, 245, 230, 0.6);
}
.title .accent {
  color: var(--yellow);
  text-shadow:
    0 0 6px rgba(255, 210, 63, 0.6),
    3px 3px 0 var(--magenta),
    -2px -2px 0 var(--cyan);
}

.tagline {
  margin: 22px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Arcade menu ---------- */

.menu ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 560px;
}
.menu-item {
  margin: 10px 0;
}
.menu-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  transition:
    transform 0.08s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}
.menu-item a .cursor {
  color: var(--cyan);
  opacity: 0;
  font-weight: 700;
  transform: translateX(-4px);
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}
.menu-item a .label {
  flex: 1;
  font-size: clamp(14px, 3.4vw, 18px);
  letter-spacing: 0.04em;
}
.menu-item a .tag {
  font-family: "Pixeloid Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--bg);
  background: var(--cyan);
  padding: 3px 7px;
  border-radius: 3px;
}
.menu-item:nth-child(2) a .tag {
  background: var(--magenta);
}
.menu-item:nth-child(3) a .tag {
  background: var(--yellow);
}
.menu-item:nth-child(4) a .tag {
  background: var(--green);
}
.menu-item:nth-child(5) a .tag {
  background: var(--red);
}
.menu-item:nth-child(6) a .tag {
  background: var(--ink);
}

.menu-item a:hover,
.menu-item a:focus-visible,
.menu-item.selected a {
  outline: none;
  border-color: var(--cyan);
  background: rgba(52, 245, 230, 0.1);
  transform: translateX(6px);
}
.menu-item a:hover .cursor,
.menu-item a:focus-visible .cursor,
.menu-item.selected a .cursor {
  opacity: 1;
  transform: translateX(0);
  animation: blink 0.9s steps(2) infinite;
}

/* ---------- Newsletter ---------- */

.newsletter {
  margin: clamp(36px, 8vw, 64px) auto 0;
  max-width: 560px;
  padding: 24px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.newsletter h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--magenta);
  letter-spacing: 0.06em;
}
.newsletter p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
#newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#newsletter-form input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 12px 14px;
  font-family: "Pixeloid Mono", monospace;
  font-size: 14px;
  color: var(--ink);
  background: #0c0718;
  border: 2px solid var(--border);
  border-radius: 4px;
}
#newsletter-form input:focus {
  outline: none;
  border-color: var(--cyan);
}
#newsletter-form button {
  flex: 0 0 auto;
  padding: 12px 22px;
  font-family: "Pixeloid Sans", sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--cyan);
  border: 2px solid var(--cyan);
  border-radius: 4px;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease;
}
#newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--magenta);
}
#newsletter-form button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
  box-shadow: none;
}
.newsletter .status {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-family: "Pixeloid Mono", monospace;
  font-size: 12px;
}
.newsletter .status.ok {
  color: var(--green);
}
.newsletter .status.err {
  color: var(--red);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: clamp(36px, 8vw, 60px);
  text-align: center;
  color: var(--muted);
  font-family: "Pixeloid Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.footer .sep {
  margin: 0 8px;
  color: var(--border);
}

/* ---------- Content pages (Manual / Release Notes) ---------- */

.content-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 64px;
  position: relative;
  z-index: 1;
}
.topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  margin-bottom: 12px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  z-index: 2;
}
.topbar .back {
  font-family: "Pixeloid Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--yellow);
  white-space: nowrap;
}
.topbar .back:hover {
  color: var(--cyan);
}
.crumbs {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.crumb-title {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.crumb-sub {
  font-family: "Pixeloid Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

/* Rendered-markdown prose, retro-themed. */
.prose {
  line-height: 1.7;
  font-size: 15px;
  color: var(--ink);
}
.prose h1 {
  font-size: clamp(28px, 6vw, 40px);
  color: var(--yellow);
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 var(--magenta);
  margin: 0.6em 0 0.4em;
}
.prose h2 {
  font-size: 22px;
  color: var(--cyan);
  margin: 1.6em 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.prose h3 {
  font-size: 17px;
  color: var(--magenta);
  margin: 1.3em 0 0.4em;
}
.prose a {
  color: var(--cyan);
  text-decoration: underline;
}
.prose strong {
  color: var(--yellow);
}
.prose code {
  font-family: "Pixeloid Mono", monospace;
  font-size: 0.92em;
  background: #0c0718;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--green);
}
.prose pre {
  background: #0c0718;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  overflow-x: auto;
}
.prose pre code {
  border: 0;
  padding: 0;
  background: none;
}
.prose blockquote {
  margin: 1em 0;
  padding: 10px 16px;
  border-left: 4px solid var(--magenta);
  background: var(--panel);
  color: var(--muted);
  border-radius: 0 4px 4px 0;
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li {
  margin: 0.3em 0;
}
.prose hr {
  border: 0;
  border-top: 2px dashed var(--border);
  margin: 2em 0;
}
/* Older/newer release links at the foot of a single release-note page (/notes/vX_Y_Z).
   Wraps to one link per line on a phone rather than squeezing three onto one. */
.prose .release-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em 0.9em;
  text-align: center;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}
.prose th {
  background: rgba(75, 45, 127, 0.4);
  color: var(--cyan);
  font-weight: 700;
}
.prose tr:nth-child(even) td {
  background: rgba(24, 14, 44, 0.4);
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .crt-flicker,
  .kicker,
  .cursor {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .menu-item a .tag {
    display: none;
  }
  #newsletter-form button {
    flex: 1 1 100%;
  }
}
