/* ─────────────────────────────────────────────────────────────────
   Flappy Bird — Tal Pais
   8-bit arcade aesthetic. Sky blue, yolk yellow, ink black.
   Distinct from both the editorial homepage and the techy sorting
   page — same brand, different mood.
   ───────────────────────────────────────────────────────────────── */

:root {
  --sky:        #79c1ec;
  --paper:      #fdeba0;   /* warm yolk yellow */
  --paper-2:    #f7d046;
  --ink:        #0d0d0d;
  --ink-soft:   #2c1f12;
  --ink-fade:   #6b5530;
  --accent:     #fa6d2a;   /* beak orange */
  --accent-2:   #e94f1d;
  --pipe:       #5cb85c;
  --rule:       #c8a060;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* prevent pinch-zoom + double-tap-zoom from triggering on the game */
  touch-action: manipulation;
}

/* Faint dot pattern — adds 8-bit atmosphere without distracting */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1.5px);
  background-size: 10px 10px;
}

main, header, footer { position: relative; z-index: 2; }

::selection { background: var(--accent); color: var(--paper); }

a { color: var(--accent-2); }

/* ── masthead ──────────────────────────────────────── */

.masthead {
  background: var(--paper-2);
  border-bottom: 4px solid var(--ink);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Press Start 2P", monospace;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  font-size: 11px;
  letter-spacing: 0.04em;
}
.brand-sub {
  font-size: 7px;
  border-left: 2px solid var(--ink);
  padding-left: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
}

.nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color 0.18s ease;
}
.nav a::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  opacity: 0;
  color: var(--accent-2);
  transition: opacity 0.18s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::before { opacity: 1; }
.nav a.active { color: var(--accent-2); }
.nav a.active::before { opacity: 1; }

/* ── page wrapper ──────────────────────────────────── */

.game-page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(24px, 5vh, 48px) 16px clamp(32px, 6vh, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.5vh, 24px);
}

/* ── page header ───────────────────────────────────── */

.page-header { text-align: center; width: 100%; }

.eyebrow {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.page-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(34px, 9vw, 56px);
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--accent);
  text-shadow: 4px 4px 0 var(--ink);
  letter-spacing: 0.02em;
}

.page-lead {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 38ch;
  margin: 0 auto;
}

/* ── game frame ────────────────────────────────────── */

.game-frame {
  position: relative;
  padding: 6px;
  background: var(--ink);
  /* chunky pixel-art shadow */
  box-shadow:
    6px 6px 0 var(--ink),
    6px 6px 0 4px var(--accent);
}

.game-frame canvas {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 288 / 432;
  background: var(--sky);
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  /* swallow gestures on the canvas itself */
  touch-action: none;
  cursor: pointer;
  outline: none;
}

@media (max-height: 720px) {
  .game-frame canvas { max-width: 300px; }
}
@media (max-height: 600px) {
  .game-frame canvas { max-width: 240px; }
}

/* ── controls hint ─────────────────────────────────── */

.controls-hint {
  font-family: "Press Start 2P", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

/* ── info panel ────────────────────────────────────── */

.info {
  background: #fff7d0;
  border: 4px solid var(--ink);
  padding: 16px 18px;
  max-width: 480px;
  width: 100%;
  box-shadow: 4px 4px 0 var(--ink);
}
.info p {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}
.info code {
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 0;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,0.15);
}

/* ── colophon ──────────────────────────────────────── */

.colophon {
  background: var(--paper-2);
  border-top: 4px solid var(--ink);
  margin-top: clamp(28px, 6vh, 48px);
  padding: 22px 18px 26px;
}
.colophon-grid {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.colophon-grid p { margin: 0; }
.colophon a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.colophon a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}
.colophon em {
  font-family: "JetBrains Mono", monospace;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
