/* ============================================================
   Agent Arcade — Redesigned Homepage (Test)
   Theme: Deep-space retro arcade, CRT scanlines, neon chrome
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:      #06060f;
  --bg-section:   #0a0a1a;
  --bg-card:      #0f0f24;
  --bg-card-alt:  #12122a;
  --gold:         #ffc629;
  --gold-bright:  #ffd95c;
  --gold-dark:    #c9930a;
  --cyan:         #00e5ff;
  --magenta:      #ff2daa;
  --purple:       #9b4dff;
  --white:        #f0f2f8;
  --white-dim:    #c4c8d8;
  --border:       rgba(255,255,255,0.08);
  --glow-gold:    0 0 30px rgba(255,198,41,0.25);
  --glow-cyan:    0 0 20px rgba(0,229,255,0.2);
  --glow-magenta: 0 0 20px rgba(255,45,170,0.15);
  --radius:       12px;
  --radius-lg:    20px;
  --font-display: 'Orbitron', sans-serif;
  --font-body:    'Exo 2', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  background: var(--bg-deep);
  color: var(--white);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; height: auto; }

/* ---------- Scanlines (CRT effect) ---------- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.04) 2px,
    rgba(0,0,0,0.04) 4px
  );
  mix-blend-mode: multiply;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  background: rgba(6,6,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.3s ease;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold) !important;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.navbar-links li a {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white-dim);
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.navbar-links li a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.navbar-links li a.active { color: var(--gold); }

.btn-nav {
  padding: 8px 20px !important;
  font-size: 0.78rem !important;
  margin-left: 8px;
  color: #1a1000 !important;
}

.btn-nav:hover {
  color: #1a1000 !important;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright)) !important;
}

.navbar-github {
  display: flex;
  align-items: center;
  color: var(--white-dim) !important;
  padding: 6px !important;
  margin-left: 4px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.navbar-github:hover {
  color: var(--white) !important;
  background: rgba(255,255,255,0.08);
}

/* Hamburger toggle */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.navbar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white-dim);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.navbar-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .navbar-toggle { display: flex; }
  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(6,6,15,0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 16px 24px;
    gap: 4px;
  }
  .navbar-links.open { display: flex; }
  .navbar-links li a { display: block; padding: 12px 16px; font-size: 1rem; }
  .btn-nav { margin-left: 0; text-align: center; }
}

/* ---------- Starfield Canvas ---------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   NEW HERO — two-column: copy + desktop mockup
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  width: 900px;
  height: 900px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(155,77,255,0.14) 0%, rgba(255,198,41,0.07) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-banner-wrap {
  position: relative;
  width: 100vw;
  margin-bottom: 32px;
  padding: 20px 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(10,6,24,0.6) 10%,
    rgba(10,6,24,0.85) 30%,
    rgba(10,6,24,0.85) 70%,
    rgba(10,6,24,0.6) 90%,
    transparent 100%
  );
  display: flex;
  justify-content: center;
  animation: bannerFloat 6s ease-in-out infinite;
}

.hero-banner {
  width: 100%;
  max-width: 1200px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 40px rgba(155,77,255,0.2)) drop-shadow(0 0 80px rgba(255,198,41,0.08));
}

@keyframes bannerFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Two-column grid */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  z-index: 1;
}

/* ---------- Left column: Copy ---------- */
.hero-copy {
  text-align: left;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 16px;
}

.kicker-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: kickerPulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--cyan);
}

@keyframes kickerPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--cyan); }
  50% { opacity: 0.4; box-shadow: 0 0 2px var(--cyan); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--white);
}

.highlight {
  color: var(--gold);
  font-weight: 800;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--white-dim);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Built-with callout */
.built-with {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  margin-bottom: 20px;
  border-radius: 50px;
  background: rgba(155,77,255,0.08);
  border: 1px solid rgba(255,198,41,0.15);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white-dim);
}

.built-with-icon { font-size: 1.1rem; }
.built-with a { color: var(--gold); font-weight: 600; }
.built-with a:hover { color: var(--gold-bright); }
.built-with-separator { color: rgba(255,255,255,0.2); margin: 0 2px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-bright));
  color: #1a1000;
  box-shadow: var(--glow-gold);
}

.btn-primary:hover {
  color: #1a1000;
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255,198,41,0.4), 0 8px 30px rgba(0,0,0,0.4);
}

/* Pulsing CTA glow */
.btn-glow {
  animation: ctaGlow 3s ease-in-out infinite;
}

@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,198,41,0.25); }
  50% { box-shadow: 0 0 40px rgba(255,198,41,0.5), 0 0 80px rgba(255,198,41,0.15); }
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-sm { padding: 10px 24px; font-size: 0.8rem; }
.btn-icon { font-size: 1.1em; }

/* Badges */
.badge {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--white-dim);
}

/* ============================================================
   Right column: GIF Showcase Carousel
   ============================================================ */
.hero-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gif-showcase {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.gif-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: #0c0c1e;
  box-shadow:
    0 0 60px rgba(155,77,255,0.1),
    0 20px 60px rgba(0,0,0,0.5);
}

.gif-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gif-game-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.5px;
  transition: opacity 0.3s ease;
}

.gif-viewport {
  position: relative;
  background: #060612;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gif-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.gif-img.visible {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(6px);
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(255, 183, 77, 0.3);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-label {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Dot indicators */
.gif-indicators {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.gif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.gif-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(255,198,41,0.5);
}

/* Progress bar under the toolbar */
.gif-progress {
  height: 2px;
  background: var(--gold);
  width: 0%;
  transition: none;
  box-shadow: 0 0 6px rgba(255,198,41,0.4);
}

/* ============================================================
   Sections (unchanged from original)
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: 50px 0;
  scroll-margin-top: 60px;
}

.section:nth-child(even) { background: var(--bg-section); }

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 56px;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-icon {
  -webkit-text-fill-color: initial;
  margin-right: 8px;
}

/* ---------- Game Cards ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.game-card:hover { transform: translateY(-6px); }

.game-card-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.game-card:hover .game-card-glow { opacity: 1; }

.ninja { background: linear-gradient(160deg, #1a0f2e, #0d1a2e); }
.ninja .game-card-glow { background: radial-gradient(ellipse at 30% 20%, rgba(255,198,41,0.08), transparent 70%); }
.ninja:hover { box-shadow: 0 0 40px rgba(255,198,41,0.12), 0 20px 50px rgba(0,0,0,0.4); }

.galaxy { background: linear-gradient(160deg, #0d1a2e, #1a0f2e); }
.galaxy .game-card-glow { background: radial-gradient(ellipse at 70% 20%, rgba(0,229,255,0.08), transparent 70%); }
.galaxy:hover { box-shadow: 0 0 40px rgba(0,229,255,0.12), 0 20px 50px rgba(0,0,0,0.4); }

.cosmic { background: linear-gradient(160deg, #1a1020, #0d1a20); }
.cosmic .game-card-glow { background: radial-gradient(ellipse at 50% 20%, rgba(255,45,170,0.08), transparent 70%); }
.cosmic:hover { box-shadow: 0 0 40px rgba(255,45,170,0.12), 0 20px 50px rgba(0,0,0,0.4); }

.game-card-content {
  position: relative;
  z-index: 1;
  padding: 40px 32px;
}

/* Card screenshot thumbnail header */


/* Sprite icon + title side by side */
.game-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.game-header h3 {
  margin-bottom: 0;
}

/* Sprite icon container */
.game-icon-sprite {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Ninja running CSS sprite animation — 6 frames, no red frame */
.ninja-anim {
  width: 64px;
  height: 64px;
  background: url('ninja-sprite.png') 0 0 no-repeat;
  background-size: 320px 64px;
  image-rendering: pixelated;
  animation: ninjaRun 1s steps(5) infinite;
}

@keyframes ninjaRun {
  from { background-position: 0 0; }
  to { background-position: -320px 0; }
}

/* Ship hover animation */
.sprite-icon {
  max-width: 64px;
  max-height: 64px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 8px rgba(0,229,255,0.3));
}

.ship-hover {
  animation: shipBob 2s ease-in-out infinite;
}

@keyframes shipBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Meteor spin animation */
.meteor-spin {
  filter: drop-shadow(0 0 8px rgba(255,45,170,0.3));
  animation: meteorTumble 4s linear infinite;
}

@keyframes meteorTumble {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.game-icon { font-size: 3rem; margin-bottom: 16px; }

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.game-card p {
  color: var(--white-dim);
  margin-bottom: 24px;
  line-height: 1.7;
  font-size: 1rem;
}

.controls-mini { display: flex; flex-direction: column; gap: 8px; }

.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.control-row span { color: var(--white-dim); font-size: 0.95rem; }

kbd {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  color: var(--cyan);
  white-space: nowrap;
}

/* ---------- Steps / How it works ---------- */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  left: 36px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--purple), var(--cyan), var(--gold));
  opacity: 0.3;
}

.step {
  display: flex;
  gap: 28px;
  padding: 32px 0;
  position: relative;
}

.step-number {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--bg-card);
  border: 2px solid rgba(155,77,255,0.3);
  color: var(--gold);
  position: relative;
  z-index: 1;
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--white);
}

.step-content p {
  color: var(--white-dim);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- Story ---------- */
.story-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--cyan));
}

.story-timeline { text-align: center; margin-bottom: 24px; }

.timeline-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 50px;
  background: rgba(255,198,41,0.1);
  border: 1px solid rgba(255,198,41,0.25);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}

.story-text p {
  margin-bottom: 16px;
  color: var(--white-dim);
  font-size: 1.05rem;
  line-height: 1.75;
}

.story-text strong { color: var(--white); }
.story-inspiration { font-style: italic; opacity: 0.8; }

/* ---------- Controls Section ---------- */
.controls-grid { max-width: 600px; margin: 0 auto; }

.control-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
  text-align: center;
}

.control-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--white);
}

.control-card table { width: 100%; border-collapse: collapse; }

.control-card td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  color: var(--white);
}

.control-card tr:last-child td { border-bottom: none; }
.control-card td:first-child { text-align: right; width: 55%; }
.control-card td:last-child { text-align: left; color: var(--white-dim); }

/* ---------- Install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  align-items: start;
}

.install-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 32px;
}

.install-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--gold);
}

.install-card p { color: var(--white-dim); margin-bottom: 20px; font-size: 1rem; }
.install-note { margin-top: 20px !important; font-size: 0.9rem; }

/* Code blocks */
.code-block {
  background: #0d0d1a;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.code-dots { display: flex; gap: 6px; }

.code-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #ffbd2e; }
.code-dots i:nth-child(3) { background: #28c840; }

.code-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--white-dim);
}

.code-block pre { padding: 16px; overflow-x: auto; }

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--cyan);
}

.code-comment { color: #5a5a7a; }

/* ---------- Credits ---------- */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.credit-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.credit-item:hover {
  transform: translateY(-4px);
  border-color: rgba(155,77,255,0.3);
}

.credit-icon { font-size: 2rem; margin-bottom: 12px; }

.credit-item h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--gold);
}

.credit-item p {
  font-size: 0.9rem;
  color: var(--white-dim);
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  padding: 60px 0 40px;
  background: #050510;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 4px;
}

.footer-sub {
  color: var(--white-dim);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--white-dim);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--cyan); }

.footer-copy {
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}

/* ---------- Scroll reveal ---------- */
.section { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.section.visible { opacity: 1; transform: translateY(0); }

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

/* Tablet landscape */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .hero-copy { text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-badges { justify-content: center; }
  .built-with { margin: 0 auto; }
  .hero-stage { order: -1; }
  .gif-showcase { max-width: 400px; }
  .install-grid { grid-template-columns: 1fr; }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .hero { padding: 40px 16px 30px; min-height: auto; }
  .hero-title { font-size: 1.8rem; }
  .hero-desc { font-size: 1rem; }
  .section { padding: 30px 0; }
  .section-title { font-size: 1.5rem; margin-bottom: 36px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-card-content { padding: 28px 20px; }
  .steps::before { left: 28px; }
  .step { gap: 18px; padding: 24px 0; }
  .step-number { width: 56px; height: 56px; font-size: 0.9rem; }
  .story-card { padding: 24px; }
  .credits-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
  .credit-item { padding: 18px 14px; }
  .credit-item h4 { font-size: 0.8rem; }
  .credit-item p { font-size: 0.82rem; }
  .control-card { padding: 24px 16px; }
  .control-card td { padding: 8px 10px; font-size: 0.9rem; }
  .footer { padding: 40px 0 30px; }
  .footer-links { gap: 16px; flex-wrap: wrap; }
  .gif-showcase { max-width: 360px; }
  .lightbox img { max-width: 95vw; max-height: 75vh; }
  .lightbox-close { top: 12px; right: 16px; font-size: 2rem; }
}

/* Mobile */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { padding: 30px 12px 20px; }
  .hero-title { font-size: 1.45rem; }
  .hero-desc { font-size: 0.92rem; margin-bottom: 20px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; justify-content: center; }
  .hero-badges { gap: 6px; }
  .badge { font-size: 0.68rem; padding: 4px 10px; }
  .built-with { font-size: 0.78rem; padding: 6px 14px; flex-wrap: wrap; justify-content: center; }
  .gif-showcase { max-width: 100%; }
  .gif-frame { border-radius: 8px; }
  .gif-game-label { font-size: 0.7rem; }
  .section { padding: 22px 0; }
  .section-title { font-size: 1.3rem; margin-bottom: 28px; }
  .game-header { gap: 10px; }
  .game-icon-sprite { width: 48px; height: 48px; }
  .ninja-anim { width: 48px; height: 48px; background-size: 240px 48px; }
  @keyframes ninjaRun { to { background-position: -240px 0; } }
  .sprite-icon { max-width: 48px; max-height: 48px; }
  .game-card-content { padding: 22px 16px; }
  .game-title { font-size: 1.1rem; }
  .game-desc { font-size: 0.88rem; }
  .step { gap: 14px; padding: 20px 0; }
  .step-number { width: 48px; height: 48px; font-size: 0.8rem; }
  .step-content h3 { font-size: 1rem; }
  .step-content p { font-size: 0.92rem; }
  .steps::before { left: 23px; }
  .story-card { padding: 20px 16px; }
  .story-text p { font-size: 0.92rem; }
  .controls-grid { max-width: 100%; }
  .control-card td { padding: 8px 6px; font-size: 0.85rem; }
  kbd { font-size: 0.72rem; padding: 2px 6px; }
  .code-block code { font-size: 0.78rem; }
  .code-block pre { padding: 12px; }
  .credits-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .credit-icon { font-size: 1.5rem; margin-bottom: 8px; }
  .footer-title { font-size: 1.1rem; }
  .footer-links { gap: 12px; }
  .footer-links a { font-size: 0.82rem; }
  .lightbox img { max-width: 98vw; max-height: 70vh; border-radius: 6px; }
  .lightbox-close { top: 8px; right: 12px; }
}
