/* === Color Palette === */
:root {
  --bg: #0b0d10;
  --bg-card: #141820;
  --accent: #00ffd5;
  --accent-dim: #00ffd540;
  --text: #e0e0e6;
  --text-muted: #7a7f8a;
  --border: #1e2330;
  --glow: 0 0 20px #00ffd530;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* === Grid Background === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 59px, var(--border) 59px, var(--border) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, var(--border) 59px, var(--border) 60px);
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* === CRT Scanline Overlay === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 9999;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

/* === Blinking Cursor === */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* === Layout === */
.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Site Header === */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-header-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.site-header-title:hover {
  text-decoration: none;
}

/* === Auth Nav === */
.auth-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.auth-sign-in {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.auth-sign-in:hover {
  text-decoration: underline;
}

.auth-email {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-sign-out {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.auth-sign-out:hover {
  text-decoration: underline;
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 6rem 0 4rem;
}

.hero-tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 1rem;
}

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

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.8rem;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: var(--glow);
}

.btn-primary:hover {
  box-shadow: 0 0 30px #00ffd550;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

.btn-secondary:hover {
  border-color: var(--accent);
}

/* === Section Shared === */
.section {
  padding: 4rem 0;
}

.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2rem;
  text-align: center;
}

/* === Game Cards === */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.game-card-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.game-card-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.game-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.game-card-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
  display: inline-block;
}

/* === Philosophy === */
.philosophy {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.philosophy blockquote {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--accent);
  border-left: 3px solid var(--accent-dim);
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.philosophy p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === How It Works === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.feature {
  padding: 1.5rem 1rem;
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.feature-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  margin-top: 2rem;
}

.footer-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* === Responsive === */
@media (max-width: 900px) {
  .game-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .site-header {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .auth-email {
    display: none;
  }

  .game-grid,
  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 4rem 0 2.5rem;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }

  .cursor {
    animation: none;
    opacity: 1;
  }

  .game-card,
  .btn {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
