:root {
  --bg0: #0b2c22;
  --bg1: #0f4d39;
  --surface: rgba(255, 255, 255, 0.10);
  --surface2: rgba(255, 255, 255, 0.16);
  --stroke: rgba(255, 255, 255, 0.16);

  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.70);
  --muted2: rgba(255, 255, 255, 0.56);

  --accent: #ffe277;
  --accent2: #7df2c7;

  --success: #47e093;
  --danger: #ff5a5f;
  --info: #58a6ff;

  --radius: 18px;
  --radius-sm: 12px;

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.22);

  --container: 1100px;
}

/* Base */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg1);
  min-height: 100vh;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

main { display: block; }

/* Headings centered */
h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

/* Utilities */
.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}
.section {
  padding: clamp(1.5rem, 3vw, 3.25rem) 0;
}
.surface {
  background: linear-gradient(135deg, var(--surface2), var(--surface));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}
.muted { color: var(--muted); }

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(12, 46, 35, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; }
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo { width: 44px; height: 44px; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25)); }
.brand-name {
  font-weight: 900;
  letter-spacing: 0.2px;
  font-size: 18px;
  line-height: 1;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateY(-1px);
}
.nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle-bars {
  width: 18px;
  height: 12px;
  position: relative;
  display: block;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after,
.nav-toggle-bars {
  background: transparent;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after { bottom: 0; }

/* Hero */
.hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
  overflow: hidden;
}
.hero.hero--fullscreen {
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: center;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: saturate(1.05) contrast(1.05);
}
.hero::after { content: none; }
.hero-content {
  width: min(860px, calc(100% - 2rem));
  margin-inline: auto;
  text-align: center;
  padding: clamp(1.25rem, 2.8vw, 2.25rem);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.hero-content h2 {
  margin: 0 0 10px 0;
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 950;
  letter-spacing: -0.02em;
}
.hero-content p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.65;
}
.hero-actions { margin-top: 18px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* Buttons / links */
.cta,
button.cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 14px;
  text-decoration: none;
  color: rgba(6, 23, 18, 0.95);
  background: var(--accent);
  box-shadow: 0 10px 25px rgba(255, 226, 119, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.cta:hover { transform: translateY(-1px); filter: saturate(1.05); box-shadow: 0 14px 30px rgba(255, 226, 119, 0.28); }
.cta:active { transform: translateY(0); }

.cta.cta--ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}
.cta.cta--ghost:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }

/* Cards */
.card-grid {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 0;
}
.card {
  grid-column: span 4;
  padding: 22px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 211, 90, 0.25); background: rgba(255, 255, 255, 0.14); }
.card h3 { margin: 0 0 10px 0; font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 14px; }
.card-icon { font-size: 40px; margin-bottom: 10px; }

/* About / generic prose */
.about {
  width: min(var(--container), calc(100% - 2rem));
  margin: clamp(1.25rem, 3vw, 2.5rem) auto;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-sm);
}
.about h2 { margin: 0 0 14px 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -0.02em; }
.about h3 { margin: 20px 0 10px 0; font-size: 16px; color: rgba(255, 255, 255, 0.92); }
.about p, .about li { color: var(--muted); line-height: 1.85; font-size: 14px; }

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 26px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 23, 18, 0.55);
  backdrop-filter: blur(12px);
}
.footer-inner {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  gap: 14px;
  align-items: center;
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-logo { width: 40px; height: 40px; }
.footer-title { font-weight: 950; letter-spacing: -0.01em; }
.footer-tagline { color: var(--muted2); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.footer-meta { color: var(--muted2); font-size: 13px; }

/* Game / misc helpers used across pages */
.play-area { padding: 0; }
.game { width: min(var(--container), calc(100% - 2rem)); margin-inline: auto; display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.quiz { grid-column: span 6; padding: 18px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10); box-shadow: var(--shadow-sm); }
.quiz h3 { margin: 0 0 8px 0; font-size: 16px; }
.quiz p { margin: 0 0 10px 0; color: var(--muted); line-height: 1.7; }

/* Simulator full frame */
.sim-full { width: min(1200px, calc(100% - 2rem)); margin: 24px auto; height: min(78vh, 860px); border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255,255,255,0.12); box-shadow: var(--shadow); background: rgba(0,0,0,0.25); position: relative; }
.overlay-btn { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* Responsive nav */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 64px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border-radius: 18px;
    background: rgba(6, 23, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: var(--shadow);
  }
  .site-header[data-nav-open="true"] .nav { display: flex; }
  .nav a { padding: 12px 12px; font-size: 14px; }
  .card { grid-column: span 12; }
  .quiz { grid-column: span 12; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
