/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #07070e;
  --bg-card: #0d0d1a;
  --fg: #e8e8f0;
  --fg-dim: #7a7a9a;
  --accent: #00ff9d;
  --accent-dim: rgba(0, 255, 157, 0.15);
  --amber: #ff9500;
  --amber-dim: rgba(255, 149, 0, 0.15);
  --crt-bg: #001a0a;
  --font-display: 'Press Start 2P', monospace;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --max-w: 1200px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== NAV ===== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(7, 7, 14, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 255, 157, 0.08);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.nav-tagline {
  font-size: 0.75rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(0,255,157,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 80%, rgba(255,149,0,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,157,0.3), transparent);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.hero-highlight {
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--fg-dim);
  max-width: 42ch;
  line-height: 1.7;
}

/* ===== GAME SCREEN ===== */
.game-screen {
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen-bezel {
  background: #111;
  border: 3px solid #1e1e2e;
  border-radius: 12px;
  padding: 8px;
  box-shadow:
    0 0 0 1px rgba(0,255,157,0.1),
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 0 30px rgba(0,255,157,0.03);
}

.screen-content {
  background: var(--crt-bg);
  border-radius: 6px;
  overflow: hidden;
  width: 320px;
  height: 240px;
}

.arcade-scene {
  width: 100%;
  height: 100%;
  position: relative;
  background: radial-gradient(ellipse at center, #003310 0%, #001a0a 100%);
}

.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.25) 2px,
    rgba(0,0,0,0.25) 4px
  );
  pointer-events: none;
  z-index: 10;
}

.game-field {
  width: 100%;
  height: 100%;
  position: relative;
}

.ghost {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #ff4444;
  border-radius: 50% 50% 0 0;
  clip-path: polygon(0 40%, 25% 100%, 50% 100%, 75% 100%, 100% 100%, 100% 40%);
}

.ghost::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: repeating-linear-gradient(90deg, #ff4444 0 4px, transparent 4px 8px);
}

.ghost-1 { top: 40px; left: 60px; }
.ghost-2 { top: 60px; left: 100px; background: #ff88ff; }
.ghost-3 { top: 40px; left: 140px; background: #88ffff; }
.ghost-4 { top: 60px; left: 180px; background: #ffcc44; }

.pac-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffdd44;
}
.p1 { top: 80px; left: 20px; }
.p2 { top: 120px; left: 80px; }
.p3 { top: 60px; left: 200px; }
.p4 { top: 160px; left: 260px; }

.power-pellet {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffdd44;
  box-shadow: 0 0 6px #ffdd44;
}
.pp1 { top: 100px; left: 40px; }
.pp2 { top: 100px; left: 260px; }

.player-char {
  position: absolute;
  bottom: 20px;
  left: 150px;
  width: 16px;
  height: 16px;
  background: #ffff44;
  border-radius: 50%;
}

.score-display {
  position: absolute;
  top: 6px;
  left: 8px;
  font-family: var(--font-display);
  font-size: 0.4rem;
  color: #00ff9d;
  letter-spacing: 0.05em;
}

/* ===== SCROLL CUE ===== */
.hero-scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-dim);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 2px solid var(--fg-dim);
  border-bottom: 2px solid var(--fg-dim);
  transform: rotate(45deg);
  opacity: 0.5;
}

/* ===== MANIFESTO ===== */
.manifesto {
  padding: 6rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, transparent, rgba(0,255,157,0.02), transparent);
}

.manifesto-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.manifesto-quote {
  font-family: var(--font-display);
  font-size: clamp(0.6rem, 1.5vw, 0.9rem);
  line-height: 1.8;
  color: var(--accent);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.manifesto-body {
  font-size: 1.1rem;
  color: var(--fg-dim);
  line-height: 1.8;
  max-width: 60ch;
  margin: 0 auto;
}

/* ===== GAMES SECTION ===== */
.games {
  padding: 6rem 2rem;
}

.games-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  margin-bottom: 1rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--fg-dim);
}

.games-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.game-card:hover {
  border-color: rgba(0,255,157,0.2);
  transform: translateY(-4px);
}

.game-thumb {
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* GALAGA thumb */
.galaga-thumb {
  background: radial-gradient(ellipse at bottom, #001a40, #07070e);
}

.thumb-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,157,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,157,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

.thumb-ships {
  position: relative;
  z-index: 2;
  width: 180px;
}

.ship-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.ship {
  width: 16px;
  height: 10px;
}

.ship.e {
  background: #00ff9d;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.ship.p {
  background: #ff4444;
  clip-path: polygon(50% 0%, 100% 60%, 80% 100%, 20% 100%, 0% 60%);
}

.thumb-beam {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 30px;
  background: linear-gradient(0deg, var(--accent), transparent);
  box-shadow: 0 0 8px var(--accent);
}

/* PAC-MAN thumb */
.pacman-thumb {
  background: #001a0a;
  padding: 1rem;
}

.pm-maze {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.maze-row {
  display: flex;
  gap: 2px;
}

.mw {
  height: 14px;
  flex: 1;
  background: rgba(0,255,157,0.4);
  border-radius: 1px;
}

.mw.top-h { background: rgba(0,255,157,0.8); }
.mw.side-v { background: rgba(0,255,157,0.8); }
.mw.bot-h { background: rgba(0,255,157,0.5); }
.mw.top-left-c { border-radius: 4px 0 0 0; background: rgba(0,255,157,0.8); }
.mw.top-right-c { border-radius: 0 4px 0 0; background: rgba(0,255,157,0.8); }
.mw.bot-left-c { border-radius: 0 0 0 4px; background: rgba(0,255,157,0.8); }
.mw.bot-right-c { border-radius: 0 0 4px 0; background: rgba(0,255,157,0.8); }
.mw.ghost-house-d { background: transparent; border: 1px solid rgba(0,255,157,0.8); border-radius: 0 0 2px 2px; height: 10px; }
.mw.dot { background: transparent; }
.mw.dot::after { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; background: #ffdd44; margin: 4px auto; }

.pm-char {
  position: absolute;
  bottom: 30px;
  left: calc(50% - 8px);
  width: 16px;
  height: 16px;
  background: #ffdd44;
  border-radius: 50%;
  clip-path: polygon(100% 50%, 50% 50%, 75% 25%, 100% 0%, 100% 100%, 75% 75%, 50% 50%);
  animation: chomp 0.4s infinite;
}

@keyframes chomp {
  0%, 100% { clip-path: polygon(100% 50%, 50% 50%, 75% 25%, 100% 0%, 100% 100%, 75% 75%, 50% 50%); }
  50% { clip-path: polygon(100% 50%, 50% 50%, 65% 20%, 80% 10%, 80% 0%, 80% 10%, 65% 20%, 50% 50%); }
}

/* SPACE INVADERS thumb */
.invaders-thumb {
  background: #0a0010;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.inv-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.invader {
  width: 12px;
  height: 10px;
}

.invader.i1 {
  background: var(--accent);
  clip-path: polygon(20% 0%, 80% 0%, 85% 30%, 100% 30%, 100% 60%, 80% 60%, 80% 100%, 60% 100%, 60% 70%, 40% 70%, 40% 100%, 20% 100%, 20% 60%, 0% 60%, 0% 30%, 15% 30%);
  box-shadow: 0 0 4px var(--accent);
}

.invader.i2 {
  background: #ff9500;
  clip-path: polygon(0% 20%, 30% 0%, 70% 0%, 100% 20%, 100% 50%, 80% 50%, 80% 70%, 60% 70%, 60% 100%, 40% 100%, 40% 70%, 20% 70%, 20% 50%, 0% 50%);
  box-shadow: 0 0 4px var(--amber);
}

.bunker {
  width: 30px;
  height: 12px;
  background: var(--accent);
  border-radius: 50% 50% 0 0;
  opacity: 0.5;
  margin: 0 auto;
}

.b1 { margin-left: 30px; }
.b3 { margin-right: 30px; }

.player-laser {
  width: 2px;
  height: 20px;
  background: #00ff9d;
  box-shadow: 0 0 6px #00ff9d;
  margin: 4px auto 0;
}

.game-meta {
  padding: 1.25rem;
}

.game-name {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.game-status {
  font-size: 0.8rem;
  color: var(--fg-dim);
}

/* ===== FEATURES ===== */
.features {
  padding: 6rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.features-header {
  text-align: center;
  margin-bottom: 4rem;
}

.features-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 4rem;
}

.feature {
  position: relative;
}

.feature-icon {
  margin-bottom: 1.25rem;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--fg);
  letter-spacing: 0.08em;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--fg-dim);
  line-height: 1.7;
}

/* ===== CLOSING ===== */
.closing {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(0,255,157,0.03), transparent);
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.closing-inner {
  max-width: 700px;
  margin: 0 auto;
}

.closing-title {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.5vw, 0.85rem);
  line-height: 2;
  color: var(--fg);
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

.closing-body {
  font-size: 1.1rem;
  color: var(--fg-dim);
  max-width: 55ch;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.25rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

.footer-note {
  font-size: 0.75rem;
  color: var(--fg-dim);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-right {
    order: -1;
  }

  .hero-title {
    font-size: 0.9rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 480px) {
  .screen-content {
    width: 260px;
    height: 200px;
  }

  .hero {
    padding-top: 5rem;
  }

  .manifesto, .games, .features, .closing {
    padding: 4rem 1.5rem;
  }
}