/* Overdrive '85 — landing page. Colours mirror Palette in GameScene.swift. */

:root {
  --night: #07040f;
  --shoulder: #170a2b;
  --shoulder-2: #1d0e36;
  --grid: #5b2a9e;
  --asphalt: #23212e;
  --pink: #ff2d9b;
  --cyan: #3ff0ff;
  --yellow: #ffd23f;
  --orange: #ff7a1a;
  --purple: #b44dff;
  --green: #39ff7a;
  --white: #f4f1ff;
  --lane: #c9c3e6;
  --dim: #8a83a8;
  --outline: #0a0612;

  --pixel: "Press Start 2P", ui-monospace, monospace;
  --mono: "VT323", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--lane);
  font-family: var(--mono);
  font-size: 22px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* CRT scanlines over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 2px, rgba(0, 0, 0, 0.22) 2px 3px);
  mix-blend-mode: multiply;
}

img, video { display: block; max-width: 100%; }
a { color: var(--cyan); }
a:hover { color: var(--white); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.pixel { font-family: var(--pixel); letter-spacing: 0.02em; line-height: 1.5; }

.glow-pink { color: var(--pink); text-shadow: 3px 3px 0 var(--outline), 0 0 18px rgba(255, 45, 155, 0.55); }
.glow-yellow { color: var(--yellow); text-shadow: 4px 4px 0 var(--pink), 0 0 24px rgba(255, 210, 63, 0.45); }
.glow-cyan { color: var(--cyan); text-shadow: 0 0 12px rgba(63, 240, 255, 0.5); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 4, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--pink);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  font-family: var(--pixel);
  font-size: 12px;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; image-rendering: pixelated; }
.topbar nav { display: flex; gap: 24px; font-family: var(--pixel); font-size: 10px; }
.topbar nav a { color: var(--lane); text-decoration: none; }
.topbar nav a:hover { color: var(--cyan); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  font-family: var(--pixel);
  font-size: 13px;
  text-decoration: none;
  color: var(--night);
  background: var(--yellow);
  border: 3px solid var(--outline);
  box-shadow: 5px 5px 0 var(--pink);
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.btn:hover { color: var(--night); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--pink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--pink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn small { display: block; font-size: 8px; opacity: 0.75; margin-bottom: 4px; }
.btn.ghost { background: transparent; color: var(--cyan); border-color: var(--cyan); box-shadow: 5px 5px 0 var(--grid); }
.btn.ghost:hover { color: var(--white); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 120px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(255, 45, 155, 0.28), transparent 70%),
    linear-gradient(to bottom, var(--night) 0%, var(--shoulder) 60%, var(--shoulder-2) 100%);
}

/* Synthwave sun + receding grid */
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 140px;
  width: min(560px, 90vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    repeating-linear-gradient(to bottom, transparent 0 22px, var(--shoulder) 22px 30px) 0 55% / 100% 45% no-repeat,
    linear-gradient(to bottom, var(--yellow), var(--orange) 45%, var(--pink));
  -webkit-mask: linear-gradient(to bottom, #000 60%, transparent 62%);
  mask: linear-gradient(to bottom, #000 60%, transparent 62%);
  opacity: 0.55;
}
.hero .grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 260px;
  transform: perspective(300px) rotateX(62deg);
  transform-origin: bottom center;
  background-image:
    linear-gradient(to right, var(--grid) 2px, transparent 2px),
    linear-gradient(to bottom, var(--grid) 2px, transparent 2px);
  background-size: 60px 60px;
  animation: drive 0.9s linear infinite;
  -webkit-mask: linear-gradient(to top, #000 40%, transparent);
  mask: linear-gradient(to top, #000 40%, transparent);
}
@keyframes drive { to { background-position: 0 60px; } }

.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}
.hero h1 { margin: 0; line-height: 1; }
.hero h1 .over { display: block; font-size: clamp(32px, 6.4vw, 68px); }
.hero h1 .year { display: block; font-size: clamp(64px, 12vw, 132px); margin-top: 12px; }
.hero .tag {
  margin: 24px 0 8px;
  font-family: var(--pixel);
  font-size: clamp(11px, 1.6vw, 15px);
  color: var(--cyan);
  word-spacing: 0.4em;
}
.hero .lede { max-width: 30ch; margin: 20px 0 32px; font-size: 26px; color: var(--white); }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 20px; }
.hero .meta { margin-top: 28px; font-size: 18px; color: var(--dim); }

.blink { animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

/* Phone frame */
.phone {
  justify-self: center;
  width: min(300px, 70vw);
  padding: 12px;
  border-radius: 44px;
  background: linear-gradient(145deg, #2a2440, #0d0a17);
  box-shadow:
    0 0 0 2px #3a3354,
    0 0 60px rgba(255, 45, 155, 0.35),
    0 0 120px rgba(63, 240, 255, 0.15),
    0 30px 60px rgba(0, 0, 0, 0.6);
  transform: rotate(3deg);
}
.phone .screen {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  aspect-ratio: 886 / 1920;
  background: var(--night);
}
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

/* ---------- Sections ---------- */

section { padding: 96px 0; }
section + section { border-top: 2px dashed rgba(91, 42, 158, 0.6); }

.eyebrow { font-family: var(--pixel); font-size: 11px; color: var(--pink); margin: 0 0 16px; }
h2 {
  margin: 0 0 20px;
  font-family: var(--pixel);
  font-size: clamp(20px, 3.4vw, 32px);
  line-height: 1.4;
  color: var(--white);
}
.section-lede { max-width: 52ch; margin: 0 0 48px; font-size: 24px; }

/* Feature cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  position: relative;
  padding: 28px 24px 24px;
  background: var(--shoulder);
  border: 2px solid var(--grid);
  box-shadow: 6px 6px 0 var(--outline);
}
.card .num {
  position: absolute;
  top: -14px;
  left: 20px;
  padding: 4px 8px;
  font-family: var(--pixel);
  font-size: 10px;
  background: var(--night);
  border: 2px solid currentColor;
}
.card h3 { margin: 8px 0 12px; font-family: var(--pixel); font-size: 16px; }
.card p { margin: 0; }
.card.bump { color: var(--green); }
.card.jump { color: var(--cyan); }
.card.survive { color: var(--yellow); }
.card p { color: var(--lane); }

/* Scoring table */
.score-board {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--grid);
  border: 2px solid var(--grid);
}
.score-board div {
  padding: 20px 16px;
  background: var(--night);
  text-align: center;
}
.score-board .pts { display: block; font-family: var(--pixel); font-size: 20px; margin-bottom: 8px; }
.score-board .what { font-family: var(--pixel); font-size: 10px; color: var(--white); }
.score-board .how { display: block; margin-top: 8px; font-size: 18px; color: var(--dim); }

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 443 / 960;
  object-fit: cover;
  border: 2px solid var(--grid);
  border-radius: 18px;
  image-rendering: pixelated;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.gallery figcaption { margin-top: 12px; font-family: var(--pixel); font-size: 10px; color: var(--cyan); text-align: center; }

/* Controls */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.keys { list-style: none; margin: 0; padding: 0; }
.keys li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 2px dotted var(--grid);
  font-size: 24px;
}
.keys .gesture { color: var(--white); }
.keys .action { font-family: var(--pixel); font-size: 12px; color: var(--yellow); align-self: center; }
.tip {
  padding: 24px;
  background: var(--shoulder);
  border-left: 6px solid var(--yellow);
}
.tip p { margin: 0 0 12px; }
.tip p:last-child { margin: 0; }
.hazard {
  height: 18px;
  margin-bottom: 20px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--outline) 12px 24px);
}

/* Achievements */
.achievements { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.badge {
  padding: 24px 16px;
  text-align: center;
  background: var(--shoulder);
  border: 2px solid var(--grid);
}
.badge .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-size: 18px;
  color: var(--night);
  background: var(--c, var(--cyan));
  box-shadow: 0 0 0 4px var(--night), 0 0 0 6px var(--c, var(--cyan)), 0 0 24px var(--c, var(--cyan));
}
.badge h3 { margin: 0 0 8px; font-family: var(--pixel); font-size: 10px; line-height: 1.6; color: var(--white); }
.badge p { margin: 0; font-size: 19px; color: var(--dim); }

/* Final CTA */
.cta-final { text-align: center; background: linear-gradient(to bottom, var(--night), var(--shoulder)); }
.cta-final img { width: 128px; height: 128px; margin: 0 auto 32px; border-radius: 28px; image-rendering: pixelated; box-shadow: 0 0 40px rgba(255, 45, 155, 0.5); }
.cta-final .insert { margin: 32px 0 0; font-family: var(--pixel); font-size: 12px; color: var(--dim); }

/* Footer */
footer { padding: 40px 0; border-top: 2px solid var(--pink); font-size: 18px; color: var(--dim); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
footer nav { display: flex; gap: 24px; }
footer a { color: var(--lane); }

/* ---------- Prose pages (privacy, support) ---------- */

.prose { max-width: 720px; padding-top: 64px; padding-bottom: 96px; }
.prose h1 { font-family: var(--pixel); font-size: clamp(20px, 4vw, 30px); line-height: 1.4; color: var(--pink); margin: 0 0 8px; }
.prose h2 { font-size: 15px; margin-top: 40px; color: var(--cyan); }
.prose .updated { color: var(--dim); margin: 0 0 32px; }
.prose li { margin-bottom: 8px; }

/* Support form */
.support-form { display: grid; gap: 20px; margin-top: 32px; }
.support-form .field { display: grid; gap: 8px; }
.support-form label { font-family: var(--pixel); font-size: 10px; color: var(--white); }
.support-form .opt { color: var(--dim); }
.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--white);
  background: var(--shoulder);
  border: 2px solid var(--grid);
  border-radius: 0;
}
.support-form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.support-form textarea { resize: vertical; min-height: 140px; }
.support-form ::placeholder { color: var(--dim); }
.support-form input:focus,
.support-form select:focus,
.support-form textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 12px rgba(63, 240, 255, 0.35); }
.support-form .btn { justify-self: start; cursor: pointer; }
.support-form .btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.support-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 0; min-height: 1.35em; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--pink); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .achievements { grid-template-columns: repeat(3, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .hero { padding: 48px 0 100px; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero .ctas { justify-content: center; }
  .phone { transform: none; }
  .cards, .controls { grid-template-columns: 1fr; }
  .score-board { grid-template-columns: repeat(2, 1fr); }
  .topbar nav { display: none; }
  section { padding: 72px 0; }
}

@media (max-width: 520px) {
  body { font-size: 20px; }
  .achievements { grid-template-columns: repeat(2, 1fr); }
  .gallery { gap: 12px; }
  .btn { padding: 12px 16px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .grid, .blink { animation: none; }
  html { scroll-behavior: auto; }
}
