:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --hero-from: #1d4ed8;
  --hero-to: #7c3aed;
  --accent: #fde047;
  --trains: #dc2626;
  --aircraft: #0284c7;
  --rockets: #7c3aed;
  --general: #059669;
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131c31;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #1e293b;
    --hero-from: #1e3a8a;
    --hero-to: #4c1d95;
    --trains: #f87171;
    --aircraft: #38bdf8;
    --rockets: #a78bfa;
    --general: #34d399;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 56px 0 40px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
}
.lead {
  max-width: 36em;
  margin: 16px 0 24px;
  font-size: 1.15rem;
  opacity: 0.95;
}
.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.jump a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.jump a:hover,
.jump a:focus-visible {
  background: var(--accent);
  color: #1e1b4b;
}

/* Topics */
main { padding: 32px 16px 48px; }

.topic {
  --topic: var(--text);
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 6px solid var(--topic);
  border-radius: var(--radius);
  scroll-margin-top: 16px;
}
.topic--trains { --topic: var(--trains); }
.topic--aircraft { --topic: var(--aircraft); }
.topic--rockets { --topic: var(--rockets); }
.topic--general { --topic: var(--general); }

.topic__head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.topic__icon { font-size: 2.5rem; line-height: 1; }
.topic h2 { margin: 0; color: var(--topic); }
.topic__head p { margin: 4px 0 0; color: var(--muted); }

.quiz-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.quiz a,
.quiz--soon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.quiz a { transition: border-color 0.15s, transform 0.15s; }
.quiz a:hover,
.quiz a:focus-visible {
  border-color: var(--topic);
  transform: translateY(-2px);
}
.quiz__title { font-weight: 700; }
.quiz__meta { font-size: 0.9rem; color: var(--muted); }
.quiz--soon { border-style: dashed; }

/* Footer */
.footer {
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.topic h2 a { color: inherit; text-decoration: none; }
.topic h2 a:hover { text-decoration: underline; }
.topic__more { margin: 16px 0 0; font-weight: 700; }
.topic__more a { color: var(--topic); }
