/* ─── Design Tokens (mirrors main site) ─────────────────────────── */
:root {
  --black: #06060a;
  --deep: #09090f;
  --surface: #0d0d16;
  --purple-dim: #1a1028;
  --purple-mid: #6b21a8;
  --purple-core: #a855f7;
  --purple-bright: #c084fc;
  --purple-glow: #e9d5ff;
  --purple-ultra: #7c3aed;
  --text-primary: #ede9fe;
  --text-secondary: #a78bfa;
  --text-muted: #4c3a6e;
  --text-dim: #2d1f4a;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text-primary);
  font-family: 'DM Mono', monospace;
  overflow-x: hidden;
  cursor: none;
  min-height: 100vh;
}

/* ─── Grain overlay ──────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* ─── Grid background ────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ─── Custom Cursor ──────────────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--purple-core);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  box-shadow: 0 0 12px var(--purple-core), 0 0 24px var(--purple-mid);
}
.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1px solid var(--purple-bright);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: transform 0.15s ease, width 0.2s, height 0.2s, opacity 0.2s;
  opacity: 0.4;
  transform: translate(-12px, -12px);
}

/* ─── Nav ────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
  background: rgba(6, 6, 10, 0.85);
  backdrop-filter: blur(20px);
}
.nav-logo {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  color: var(--purple-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.nav-logo span { color: var(--text-muted); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-cta {
  font-family: 'Martian Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--black);
  background: var(--purple-core);
  border: none;
  padding: 8px 20px;
  cursor: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
  display: inline-block;
}
.nav-cta:hover {
  background: var(--purple-bright);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* ─── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  padding-top: 100px;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--purple-core);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--purple-core);
}

.hero-title {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}
.hero-title .line-1 { color: var(--text-primary); display: block; }
.hero-title .line-2 {
  color: transparent;
  -webkit-text-stroke: 1px var(--purple-mid);
  display: block;
}
.hero-title .line-3 { color: var(--purple-core); display: block; }

.hero-sub {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.9;
  max-width: 500px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}
.hero-sub em { color: var(--purple-bright); font-style: normal; }

.hero-links {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn-ghost {
  font-family: 'Martian Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--text-dim);
  padding: 14px 32px;
  cursor: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-ghost:hover {
  border-color: var(--purple-mid);
  color: var(--purple-bright);
}

/* ─── Blink cursor ───────────────────────────────────────────────── */
.blink { animation: blink 1.2s step-end infinite; color: var(--purple-core); }

/* ─── Status dot ─────────────────────────────────────────────────── */
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.status-dot.building {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

/* ─── Dividers ───────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-dim), transparent);
  margin: 0 48px;
  position: relative;
  z-index: 2;
}

/* ─── Section base ───────────────────────────────────────────────── */
section {
  position: relative;
  z-index: 2;
  padding: 100px 48px;
}

.section-header { margin-bottom: 56px; }

.section-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--purple-core);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-tag::after {
  content: '';
  display: block;
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--purple-dim);
}

.section-title {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.section-title span { color: var(--purple-core); }

/* ─── Game Section ───────────────────────────────────────────────── */
.game-section {
  background: var(--surface);
  border-top: 1px solid rgba(168, 85, 247, 0.08);
  border-bottom: 1px solid rgba(168, 85, 247, 0.08);
}

.game-container {
  background: rgba(6, 6, 10, 0.9);
  border: 1px solid rgba(168, 85, 247, 0.15);
  max-width: 960px;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--purple-dim);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.terminal-title {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-left: 8px;
}

.game-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

#dino-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

.game-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--purple-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.game-hint {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.game-hint kbd {
  font-family: 'Martian Mono', monospace;
  font-size: 9px;
  color: var(--purple-bright);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 2px 6px;
  border-radius: 2px;
}

.score-display {
  display: flex;
  gap: 24px;
}
.score-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-left: 2px solid var(--purple-dim);
  padding-left: 16px;
}
.score-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.score-value {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 20px;
  color: var(--purple-bright);
  letter-spacing: 0.05em;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 2;
  padding: 40px 48px;
  border-top: 1px solid rgba(168, 85, 247, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo {
  font-family: 'Martian Mono', monospace;
  font-weight: 800;
  font-size: 12px;
  color: var(--purple-core);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
  text-transform: uppercase;
}
.footer-links a:hover { color: var(--purple-bright); }
.footer-copy {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px currentColor; }
  50%       { opacity: 0.6; box-shadow: 0 0 4px currentColor; }
}

/* ─── Responsive — Tablet ─────────────────────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 16px 24px; }
  .nav-status { display: none; }
  .hero { padding: 0 24px; padding-top: 80px; }
  section { padding: 72px 24px; }
  .divider { margin: 0 24px; }
  footer { padding: 32px 24px; }
}

/* ─── Responsive — Phone ─────────────────────────────────────────── */
@media (max-width: 600px) {
  nav { padding: 14px 16px; }
  .nav-logo { font-size: 11px; }
  .nav-cta { padding: 7px 14px; font-size: 10px; }

  .hero { padding: 0 16px; padding-top: 72px; }
  .hero-sub { font-size: 12px; }
  .hero-title { font-size: clamp(32px, 10vw, 64px); }

  section { padding: 56px 16px; }

  .game-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .score-display { width: 100%; justify-content: flex-end; }

  footer {
    padding: 24px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer-links { flex-wrap: wrap; gap: 16px; }
  .divider { margin: 0 16px; }

  /* On very small screens cursor is hidden — use default */
  body { cursor: auto; }
  .cursor, .cursor-ring { display: none; }
}
