/* ==========================================================================
   Flappy Bird — Python Edition
   Dark-teal arcade landing page. No external CSS, no inline styles.
   ========================================================================== */

@font-face {
  font-family: "Press Start 2P";
  src: url("assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/SpaceGrotesk.ttf") format("truetype");
  font-display: swap;
  font-weight: 300 700;
  font-style: normal;
}

:root {
  --bg: #061a1f;
  --bg-deep: #041216;
  --bg-soft: #09242a;
  --panel: #0a2a30;
  --panel-2: #0d333a;
  --line: rgba(238, 246, 240, 0.12);
  --line-strong: rgba(238, 246, 240, 0.24);
  --ink: #f2f5ea;
  --muted: #9db6b8;
  --muted-2: #7d9a9d;
  --yellow: #ffd95c;
  --yellow-deep: #e8b62f;
  --green: #5ee270;
  --green-deep: #2fa44a;
  --teal: #4ec0ca;
  --red: #ef5b5b;
  --outline: #2f2423;
  --pixel: "Press Start 2P", ui-monospace, "Courier New", monospace;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow-pop: 0 14px 0 rgba(0, 0, 0, 0.28);
  --max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(1000px 620px at 82% -8%, rgba(78, 192, 202, 0.16), transparent 62%),
    radial-gradient(760px 520px at 4% 12%, rgba(94, 226, 112, 0.09), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(255, 217, 92, 0.07), transparent 62%),
    linear-gradient(180deg, #061a1f 0%, #041216 58%, #05171b 100%);
  background-attachment: fixed;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fine pixel grid over the whole page, very low contrast. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(238, 246, 240, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(238, 246, 240, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 78%);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img.pixel,
canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

p {
  margin: 0 0 1em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

::selection {
  background: var(--yellow);
  color: #1b2222;
}

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

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 100;
  padding: 10px 16px;
  color: #16201f;
  background: var(--yellow);
  border-radius: 8px;
  font-family: var(--pixel);
  font-size: 10px;
  transform: translate(-50%, -160%);
  transition: transform 0.16s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.container {
  width: min(100% - 40px, var(--max));
  margin-inline: auto;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px 0;
  background: rgba(4, 18, 22, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(4, 18, 22, 0.92);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 24px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.brand-accent {
  color: var(--green);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a {
  text-decoration: none;
  transition: color 0.16s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  margin-left: 4px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  --btn-bg: var(--panel-2);
  --btn-ink: var(--ink);
  --btn-edge: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border: 2px solid var(--btn-edge);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.42);
  transform: translateY(0);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.16s ease,
    border-color 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.46);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.42);
}

.btn-primary {
  --btn-bg: var(--yellow);
  --btn-ink: #1d2422;
  --btn-edge: #1d2422;
  box-shadow: 0 5px 0 #a9771a;
}

.btn-primary:hover {
  background: #ffe27d;
  box-shadow: 0 7px 0 #a9771a;
}

.btn-primary:active {
  box-shadow: 0 2px 0 #a9771a;
}

.btn-ghost {
  --btn-bg: rgba(238, 246, 240, 0.04);
  --btn-edge: var(--line-strong);
}

.btn-ghost:hover {
  --btn-bg: rgba(238, 246, 240, 0.09);
  border-color: rgba(238, 246, 240, 0.4);
}

.btn-small {
  padding: 10px 15px;
  font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.42);
}

.btn-small.btn-primary {
  box-shadow: 0 3px 0 #a9771a;
}

.btn-meta {
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  color: #4d3c14;
  opacity: 0.85;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding: clamp(40px, 6vw, 76px) 0 clamp(44px, 6vw, 72px);
  overflow-x: clip;
}

.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: min(100% - 40px, var(--max));
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(32px, 5vw, 70px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--green);
}

.pulse-dot {
  position: relative;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(94, 226, 112, 0.16);
  animation: blink 2.4s steps(1, end) infinite;
}

@keyframes blink {
  0%, 70% { opacity: 1; }
  71%, 100% { opacity: 0.35; }
}

h1 {
  font-family: var(--pixel);
  font-size: clamp(2.05rem, 5.2vw, 3.55rem);
  line-height: 1.16;
  letter-spacing: 0;
  margin: 0 0 26px;
}

.title-line {
  display: block;
  color: var(--yellow);
  text-shadow:
    3px 0 0 var(--outline), -3px 0 0 var(--outline),
    0 3px 0 var(--outline), 0 -3px 0 var(--outline),
    3px 3px 0 var(--outline), -3px 3px 0 var(--outline),
    3px -3px 0 var(--outline), -3px -3px 0 var(--outline),
    7px 7px 0 rgba(0, 0, 0, 0.45);
}

.title-alt {
  color: #f7f3e6;
  margin-left: 0.42em;
  text-shadow:
    3px 0 0 var(--outline), -3px 0 0 var(--outline),
    0 3px 0 var(--outline), 0 -3px 0 var(--outline),
    3px 3px 0 var(--outline), -3px 3px 0 var(--outline),
    3px -3px 0 var(--outline), -3px -3px 0 var(--outline),
    7px 7px 0 rgba(0, 0, 0, 0.45);
}

.lede {
  max-width: 46ch;
  margin-bottom: 30px;
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.62;
  color: #c4d6d5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 34px;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--muted);
}

.hero-facts li {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.hero-facts strong {
  font-family: var(--pixel);
  font-size: 12px;
  font-weight: 400;
  color: var(--yellow);
}

/* ==========================================================================
   Cabinet + canvas
   ========================================================================== */

.game-shell {
  position: relative;
  width: 100%;
  max-width: 436px;
  margin-inline: auto;
}

.game-shell::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 8% -14% -6%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(78, 192, 202, 0.28), transparent 74%);
  filter: blur(14px);
  pointer-events: none;
}

.cabinet {
  position: relative;
  z-index: 1;
  padding: 12px;
  border: 2px solid #1a4a52;
  border-radius: 22px;
  background:
    linear-gradient(160deg, #10373e 0%, #0a282e 46%, #071e23 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -18px 40px rgba(0, 0, 0, 0.34),
    0 30px 60px -22px rgba(0, 0, 0, 0.8),
    0 0 0 6px rgba(4, 18, 22, 0.6);
}

.cabinet-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 12px;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #6f969b;
}

.lights {
  display: inline-flex;
  gap: 5px;
}

.lights i {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(239, 91, 91, 0.8);
}

.lights i:nth-child(2) {
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(255, 217, 92, 0.8);
}

.lights i:nth-child(3) {
  background: var(--green);
  box-shadow: 0 0 6px rgba(94, 226, 112, 0.8);
}

.cabinet-title {
  white-space: nowrap;
}

.best-chip {
  margin-left: auto;
  padding: 5px 8px;
  color: var(--yellow);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 217, 92, 0.24);
  border-radius: 5px;
  white-space: nowrap;
}

.best-chip b {
  font-weight: 400;
  color: #fff;
}

.canvas-wrap {
  position: relative;
  border: 2px solid #04171b;
  border-radius: 10px;
  background: #0a1c21;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 0 30px rgba(0, 0, 0, 0.55);
  touch-action: manipulation;
}

#game {
  width: 100%;
  height: auto;
  aspect-ratio: 288 / 512;
  background: #4ec0ca;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

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

.canvas-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.24) 100%);
  mix-blend-mode: multiply;
}

.loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: #08191d;
  color: var(--green);
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.14em;
  animation: loading-pulse 1.1s steps(1, end) infinite;
}

.loading[hidden] {
  display: none;
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.game-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding-top: 11px;
}

.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px 7px;
  color: #a9c3c4;
  background: rgba(4, 18, 22, 0.48);
  border: 1px solid rgba(238, 246, 240, 0.14);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease,
    transform 0.1s ease;
}

.tool:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(238, 246, 240, 0.08);
  border-color: rgba(238, 246, 240, 0.3);
}

.tool:active:not(:disabled) {
  transform: translateY(1px);
}

.tool:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.tool-key {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #0d2529;
  background: #a9c3c4;
  border-radius: 4px;
  font-family: var(--pixel);
  font-size: 8px;
  transition: background 0.14s ease;
}

.tool:hover:not(:disabled) .tool-key {
  background: var(--yellow);
}

.tool[aria-pressed="false"] .tool-key {
  background: var(--red);
  color: #fff;
}

.tool-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-hint {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted-2);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  color: #d7e4df;
  background: rgba(238, 246, 240, 0.07);
  border: 1px solid rgba(238, 246, 240, 0.22);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.5;
  white-space: nowrap;
}

/* ==========================================================================
   Stats strip
   ========================================================================== */

.stats-strip {
  border-block: 1px solid var(--line);
  background: rgba(9, 36, 42, 0.45);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  padding: 26px 12px;
  text-align: left;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat b {
  font-family: var(--pixel);
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 400;
  color: var(--yellow);
}

.stat span {
  font-size: 14px;
  color: var(--muted);
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: clamp(64px, 8vw, 108px) 0;
}

.section-alt {
  background:
    linear-gradient(180deg, transparent, rgba(9, 36, 42, 0.4) 12%, rgba(9, 36, 42, 0.4) 88%, transparent);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(34px, 4.5vw, 54px);
}

.section-head.compact {
  margin-bottom: 28px;
}

.section-head .eyebrow {
  margin-bottom: 16px;
}

.section-head h2 {
  margin-bottom: 16px;
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}

.section-head p:not(.eyebrow) {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.accent-green { color: var(--green); }
.accent-yellow { color: var(--yellow); }

/* ==========================================================================
   Feature cards
   ========================================================================== */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  position: relative;
  padding: 26px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(16, 55, 62, 0.72), rgba(7, 30, 35, 0.72));
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.feature-card::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 24px;
  width: 46px;
  height: 2px;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.18s ease, width 0.18s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(238, 246, 240, 0.26);
  background:
    linear-gradient(165deg, rgba(20, 66, 74, 0.85), rgba(8, 34, 39, 0.85));
}

.feature-card:hover::after {
  opacity: 1;
  width: 86px;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  color: var(--yellow);
  background: rgba(255, 217, 92, 0.09);
  border: 1px solid rgba(255, 217, 92, 0.24);
  border-radius: 10px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  margin-bottom: 9px;
  font-size: 1.14rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

/* ==========================================================================
   Screenshots
   ========================================================================== */

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.shot {
  margin: 0;
}

.shot-frame {
  position: relative;
  border: 2px solid rgba(238, 246, 240, 0.18);
  border-radius: 14px;
  background: #041418;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

.shot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.shot-frame img {
  width: 100%;
  height: auto;
  aspect-ratio: 576 / 1024;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.shot:hover .shot-frame img {
  transform: scale(1.025);
}

.shot figcaption {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #d9e5e0;
}

.shot figcaption span {
  font-family: var(--pixel);
  font-size: 8px;
  color: var(--green);
}

/* ==========================================================================
   Download cards
   ========================================================================== */

.download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
  align-items: stretch;
}

.download-card,
.browser-card {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(165deg, rgba(17, 58, 65, 0.7), rgba(7, 28, 33, 0.8));
}

.download-card {
  border-color: rgba(255, 217, 92, 0.26);
  box-shadow: 0 24px 60px -34px rgba(255, 217, 92, 0.35);
}

.browser-card {
  position: relative;
  overflow: hidden;
}

.browser-bird {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 68px;
  height: 48px;
  opacity: 0.9;
  animation: bob 3.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(94, 226, 112, 0.7);
}

.download-card h3,
.browser-card h3 {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.03em;
}

.card-copy {
  max-width: 52ch;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.97rem;
}

.code-block {
  margin: 0 0 22px;
  padding: 16px 18px;
  overflow-x: auto;
  color: #dff5e3;
  background: rgba(2, 12, 15, 0.72);
  border: 1px solid rgba(238, 246, 240, 0.12);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.85;
  tab-size: 2;
}

.code-prompt {
  color: var(--green);
  user-select: none;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.requirement {
  font-size: 12.5px;
  color: var(--muted-2);
}

.ticks {
  display: grid;
  gap: 9px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.94rem;
  color: #c2d4d2;
}

.ticks li {
  position: relative;
  padding-left: 26px;
}

.ticks li::before {
  content: "";
  position: absolute;
  top: 0.42em;
  left: 2px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

.browser-card .btn {
  align-self: flex-start;
  margin-top: 26px;
}

/* ==========================================================================
   Controls table
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 28, 33, 0.55);
}

.controls-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.controls-table th {
  padding: 16px 22px;
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--green);
  border-bottom: 1px solid var(--line);
}

.controls-table td {
  padding: 15px 22px;
  color: #c9d9d6;
  border-bottom: 1px solid rgba(238, 246, 240, 0.07);
}

.controls-table tbody tr:last-child td {
  border-bottom: 0;
}

.controls-table tbody tr {
  transition: background 0.14s ease;
}

.controls-table tbody tr:hover {
  background: rgba(238, 246, 240, 0.035);
}

.controls-table td:first-child {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.controls-table kbd {
  margin-right: 3px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding: clamp(48px, 6vw, 72px) 0 26px;
  border-top: 1px solid var(--line);
  background: rgba(3, 13, 16, 0.6);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand p {
  max-width: 38ch;
  margin: 18px 0 0;
  color: var(--muted-2);
  font-size: 0.93rem;
  line-height: 1.6;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  margin-bottom: 6px;
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--green);
}

.footer-col a {
  width: fit-content;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
  transition: color 0.14s ease;
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted-2);
}

.footer-bottom a {
  color: var(--muted);
  text-decoration-color: var(--line-strong);
}

.footer-bottom a:hover {
  color: var(--ink);
}

/* ==========================================================================
   Error page
   ========================================================================== */

.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 220px);
  padding: clamp(48px, 9vw, 104px) 0;
  text-align: center;
}

.error-card {
  position: relative;
  width: min(100%, 640px);
  padding: clamp(28px, 5vw, 52px) clamp(22px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(78, 192, 202, 0.16), transparent 60%),
    linear-gradient(165deg, rgba(17, 58, 65, 0.82), rgba(7, 28, 33, 0.9));
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.9);
}

.error-bird {
  width: 68px;
  height: 48px;
  margin: 0 auto 18px;
}

.error-code {
  margin: 0 0 20px;
  font-family: var(--pixel);
  font-size: clamp(3rem, 11vw, 5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--yellow);
  text-shadow:
    3px 0 0 var(--outline), -3px 0 0 var(--outline),
    0 3px 0 var(--outline), 0 -3px 0 var(--outline),
    4px 5px 0 rgba(0, 0, 0, 0.4);
}

.error-card h1 {
  margin: 0 0 16px;
  font-family: var(--pixel);
  font-size: clamp(0.82rem, 2.3vw, 1.05rem);
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: #fff;
}

.error-card p {
  max-width: 46ch;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.98rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1020px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }

  .hero-copy {
    max-width: 640px;
  }

  .game-shell {
    max-width: 400px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-links {
    display: none;
  }

  .nav-cta {
    margin-left: auto;
  }

  .screenshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shot:last-child {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat {
    justify-content: flex-start;
    padding: 20px 22px;
  }

  .stat + .stat {
    border-left: 0;
  }

  .stat:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .container {
    width: min(100% - 28px, var(--max));
  }

  .site-header {
    padding: 10px 0;
  }

  .brand {
    font-size: 11px;
  }

  .brand img {
    width: 28px;
    height: 20px;
  }

  .nav-cta {
    padding: 9px 12px;
    font-size: 13px;
  }

  h1 {
    font-size: clamp(2rem, 11.5vw, 2.9rem);
    margin-bottom: 20px;
  }

  .title-alt {
    margin-left: 0.28em;
  }

  .eyebrow {
    font-size: 8px;
    margin-bottom: 16px;
  }

  .hero {
    padding-top: 34px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .hero-facts {
    gap: 10px 18px;
    font-size: 13px;
  }

  .feature-grid,
  .screenshot-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shot:last-child {
    display: block;
  }

  .feature-card {
    padding: 22px 20px;
  }

  .game-shell {
    max-width: 360px;
  }

  .game-toolbar {
    gap: 5px;
  }

  .tool-label {
    font-size: 8px;
    letter-spacing: 0.04em;
  }

  .game-hint {
    font-size: 12px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }

  .controls-table th,
  .controls-table td {
    padding: 13px 16px;
  }
}

@media (max-width: 380px) {
  .game-shell {
    max-width: 100%;
  }

  .tool-key {
    width: 18px;
    height: 18px;
    font-size: 7px;
  }

  .tool {
    padding: 7px 2px 6px;
  }
}

/* ==========================================================================
   Motion / contrast preferences
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #c3d5d3;
    --muted-2: #a9c0c0;
    --line: rgba(238, 246, 240, 0.3);
  }
}
