/* ─── TOKENS ─────────────────────────────────────────── */
:root {
  --bg:           #08080f;
  --bg2:          #0e0e1c;
  --surface:      rgba(255,255,255,0.04);
  --border:       rgba(255,255,255,0.08);

  --purple:       oklch(72% 0.22 285);
  --purple-dim:   oklch(55% 0.18 285);
  --purple-glow:  oklch(72% 0.22 285 / 0.18);

  --amber:        oklch(78% 0.18 72);
  --amber-dim:    oklch(58% 0.16 72);
  --amber-glow:   oklch(78% 0.18 72 / 0.15);

  --green:        oklch(72% 0.20 145);
  --green-dim:    oklch(50% 0.16 145);
  --green-glow:   oklch(72% 0.20 145 / 0.14);

  --qblue:        oklch(60% 0.18 248);
  --qblue-dim:    oklch(42% 0.14 248);
  --qblue-glow:   oklch(60% 0.18 248 / 0.18);

  --cyan:         oklch(76% 0.18 200);
  --cyan-dim:     oklch(52% 0.14 200);
  --cyan-glow:    oklch(76% 0.18 200 / 0.14);

  --text:         oklch(93% 0.01 285);
  --text-muted:   oklch(65% 0.02 285);
  --text-faint:   oklch(45% 0.02 285);

  --f-display: 'Syne', sans-serif;
  --f-body:    'DM Sans', sans-serif;
  --f-mono:    'DM Mono', 'Courier New', monospace;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── STARS ──────────────────────────────────────────── */
#stars-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

/* ─── NAV ────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(8,8,15,0.92), rgba(8,8,15,0));
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  transition: background 0.3s;
}
nav.scrolled {
  background: rgba(10,10,20,0.95);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.nav-logo .moon { color: var(--purple); font-size: 1.2em; }
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4em 1.1em;
  border-radius: 99px;
  border: 1px solid var(--purple-dim);
  color: var(--purple);
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--purple); color: #08080f; }

/* ─── HERO ───────────────────────────────────────────── */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 2rem 6rem;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(55% 0.25 285 / 0.22), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -58%);
  pointer-events: none;
}
/* ─── MOON ORBITAL SYSTEM ───────────────────────────── */
.moon-system {
  position: relative;
  width: clamp(240px, 32vw, 360px);
  aspect-ratio: 1;
  margin: 0 auto 2.5rem;
  perspective: 1000px;
  transform-style: preserve-3d;
  transform:
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg));
  transition: transform 0.4s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.moon-system-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: moonBob 7s ease-in-out infinite;
}
@keyframes moonBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.moon-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 42%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  animation: moonGlowPulse 5s ease-in-out infinite;
}
.moon-core svg,
.moon-core img { width: 100%; height: 100%; display: block; }
@keyframes moonGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 22px oklch(72% 0.22 285 / 0.45)) drop-shadow(0 0 48px oklch(72% 0.22 285 / 0.18)); }
  50%      { filter: drop-shadow(0 0 34px oklch(72% 0.22 285 / 0.7))  drop-shadow(0 0 72px oklch(72% 0.22 285 / 0.3)); }
}

.orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid oklch(72% 0.22 285 / 0.18);
  transform-style: preserve-3d;
  pointer-events: none;
}
.orbit-1 {
  width: 62%; height: 62%;
  transform: translate(-50%, -50%) rotateX(68deg) rotateZ(12deg);
  border-color: oklch(72% 0.22 285 / 0.22);
}
.orbit-2 {
  width: 82%; height: 82%;
  transform: translate(-50%, -50%) rotateX(72deg) rotateZ(-22deg);
  border-color: oklch(72% 0.22 285 / 0.14);
}
.orbit-3 {
  width: 100%; height: 100%;
  transform: translate(-50%, -50%) rotateX(65deg) rotateZ(36deg);
  border-color: oklch(72% 0.22 285 / 0.10);
  border-style: dashed;
}

.spinner {
  position: absolute;
  inset: 0;
  display: block;
  animation: orbitSpin linear infinite;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}
.orbit-1 .spinner { animation-duration: 9s; }
.orbit-2 .spinner { animation-duration: 16s; animation-direction: reverse; }
.orbit-3 .spinner { animation-duration: 26s; }
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.satellite {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  display: block;
}
.satellite::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: inherit;
  filter: blur(10px);
  opacity: 0.8;
  z-index: -1;
}
.sat-amber { background: var(--amber); box-shadow: 0 0 14px var(--amber), 0 0 4px #fff6 inset; }
.sat-cyan  { background: var(--cyan);  box-shadow: 0 0 14px var(--cyan),  0 0 4px #fff6 inset; width: 10px; height: 10px; margin-left: -5px; top: -5px; }
.sat-blue  { background: var(--qblue); box-shadow: 0 0 16px var(--qblue), 0 0 4px #fff6 inset; width: 14px; height: 14px; margin-left: -7px; top: -7px; }

@media (prefers-reduced-motion: reduce) {
  .moon-system-inner,
  .moon-core,
  .spinner { animation: none !important; }
  .moon-system { transition: none !important; transform: none !important; }
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 1rem;
}
h1 {
  font-family: var(--f-display);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
h1 em { color: var(--purple); font-style: normal; }
.hero-sub {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  margin: 0 auto 2.5rem;
}
.hero-badges {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35em 0.9em;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  letter-spacing: 0.04em;
}
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-faint);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--purple-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:0.4; transform:scaleY(1)} 50%{opacity:1; transform:scaleY(1.2)} }

/* ─── SECTION SHARED ─────────────────────────────────── */
section {
  position: relative;
  z-index: 1;
}
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* ─── GAMES HEADER ───────────────────────────────────── */
#games-header {
  padding: 5rem 0 2rem;
  text-align: center;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 0.75rem;
}
h2 {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.section-caption {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── GAME SECTIONS (accent colors) ──────────────────── */
#lunas-quest {
  padding: 5rem 0 6rem;
  --accent: var(--amber);
  --accent-dim: var(--amber-dim);
  --accent-glow: var(--amber-glow);
}
#lide {
  padding: 5rem 0 6rem;
  --accent: var(--qblue);
  --accent-dim: var(--qblue-dim);
  --accent-glow: var(--qblue-glow);
}
#ascii-game {
  padding: 5rem 0 6rem;
  --accent: var(--cyan);
  --accent-dim: var(--cyan-dim);
  --accent-glow: var(--cyan-glow);
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.game-layout.reverse { direction: rtl; }
.game-layout.reverse > * { direction: ltr; }

.game-number {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}
.game-title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}
.game-title span { color: var(--accent); }
.dev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.8em;
  border-radius: 99px;
  background: oklch(from var(--accent) l c h / 0.12);
  border: 1px solid oklch(from var(--accent) l c h / 0.3);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.dev-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.game-desc {
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.75;
  margin-bottom: 1.75rem;
  font-size: 1.0rem;
}
.game-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.game-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
}
.game-features li::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.75rem;
  margin-top: 0.2em;
  flex-shrink: 0;
}
.game-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn-primary {
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.65em 1.5em;
  border-radius: 8px;
  background: var(--accent);
  color: #08080f;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─── GAME VISUALS ───────────────────────────────────── */
.game-visual { position: relative; }

/* Luna's Quest: title + gameplay + card fan */
.luna-visual {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  border-radius: 16px;
}
.luna-title-img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 0 60px var(--amber-glow), 0 24px 60px rgba(0,0,0,0.6);
  display: block;
}
.card-fan {
  display: flex;
  margin-top: 1.5rem;
  justify-content: center;
}

/* Composed card with real frame */
.lq-card {
  position: relative;
  width: 110px;
  flex-shrink: 0;
  transition: transform 0.2s, filter 0.2s;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.6));
}
.lq-card:hover {
  transform: rotate(0deg) translateY(-10px) scale(1.08) !important;
  filter: drop-shadow(0 16px 40px rgba(0,0,0,0.8));
  z-index: 10;
}
.lq-card-frame {
  display: block;
  width: 100%;
  position: relative;
  z-index: 2;
}
.lq-card-art {
  position: absolute;
  top: 3%;
  left: 7%;
  width: 86%;
  height: 52%;
  z-index: 1;
  overflow: hidden;
  border-radius: 48% 48% 8% 8% / 50% 50% 8% 8%;
}
.lq-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.lq-card-name {
  position: absolute;
  z-index: 3;
  top: 55.5%;
  left: 12%;
  width: 76%;
  text-align: center;
  font-family: var(--f-display);
  font-size: 0.48rem;
  font-weight: 700;
  color: #3a1a00;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

/* Game screenshot panels */
.ascii-screenshot {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 0 60px var(--cyan-glow), 0 24px 60px rgba(0,0,0,0.6);
  display: block;
  image-rendering: pixelated;
}
.lide-screenshot {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 60px var(--green-glow), 0 24px 60px rgba(0,0,0,0.6);
  display: block;
}
.luna-gameplay-img { border-radius: 12px; }

/* ─── DIVIDER ─────────────────────────────────────────── */
.game-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── ABOUT ──────────────────────────────────────────── */
#about {
  padding: 6rem 0;
  background: linear-gradient(to bottom, transparent, rgba(20,12,40,0.4), transparent);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: center;
}
.about-luna {
  position: relative;
}
.about-luna-img {
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  filter: saturate(1.1);
  box-shadow: 0 0 80px oklch(72% 0.22 285 / 0.2), 0 32px 64px rgba(0,0,0,0.6);
}
.about-luna-caption {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-faint);
  font-style: italic;
  text-align: center;
}
.about-text h2 {
  margin-bottom: 1.25rem;
}
.about-text h2 span { color: var(--purple); }
.about-text p {
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 1.1rem;
  font-size: 1.0rem;
}
.about-text p strong { color: var(--text); font-weight: 500; }
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--purple);
  border: 1px solid oklch(72% 0.22 285 / 0.3);
  padding: 0.55em 1.2em;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.github-link:hover {
  background: oklch(72% 0.22 285 / 0.1);
}
.github-link svg { width: 18px; height: 18px; }

/* ─── NEWSLETTER ─────────────────────────────────────── */
#newsletter {
  padding: 5rem 0;
}
.newsletter-box {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
}
.newsletter-box .moon-sm { font-size: 2.5rem; margin-bottom: 1rem; }
.newsletter-box h2 { font-size: 1.8rem; margin-bottom: 0.6rem; }
.newsletter-box p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.75rem; font-weight: 300; }
.newsletter-note { font-size: 0.72rem; color: var(--text-faint); margin-top: 0.75rem; }
.email-form-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--purple);
  color: #08080f;
  font-family: var(--f-display);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.75em 1.75em;
  border-radius: 10px;
  transition: opacity 0.2s, transform 0.15s;
}
.email-form-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.email-form-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ─── FOOTER ─────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-logo {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-logo .moon { color: var(--purple); }
.footer-copy {
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footer-socials {
  display: flex;
  gap: 1.25rem;
}
.footer-socials a {
  font-size: 0.8rem;
  color: var(--text-faint);
  transition: color 0.2s;
  font-weight: 500;
}
.footer-socials a:hover { color: var(--purple); }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 800px) {
  .game-layout { grid-template-columns: 1fr; gap: 2rem; }
  .game-layout.reverse { direction: ltr; }
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-luna-img { max-width: 220px; }
  .nav-links { display: none; }
  .lq-card { width: 80px; }
}

/* ─── FADE-IN ANIMATION ──────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
