:root {
  --bg: #070b16;
  --panel: rgba(16, 24, 39, 0.78);
  --ink: #eef3ff;
  --muted: #9aa8c7;
  --line: rgba(255, 255, 255, 0.1);
  --gold: #f5c46b;
  --mint: #5eead4;
  --coral: #ff8a8a;
  --blue: #8eb2ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(94, 234, 212, 0.12), transparent 50%),
    radial-gradient(900px 500px at 100% 0%, rgba(245, 196, 107, 0.12), transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: Sora, system-ui, sans-serif;
}

body { overflow-x: hidden; }

h1, h2, h3, .brand-mark {
  font-family: Fraunces, Georgia, serif;
  margin: 0;
}

h1 { font-size: 1.35rem; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; max-width: 16ch; }
h3 { font-size: 1.2rem; }

p { color: var(--muted); line-height: 1.6; }

button, input {
  font: inherit;
}

.orb {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
}

.orb-a { width: 280px; height: 280px; left: -60px; top: 120px; background: rgba(94, 234, 212, 0.16); }
.orb-b { width: 320px; height: 320px; right: -80px; top: 40px; background: rgba(245, 196, 107, 0.14); }
.orb-c { width: 240px; height: 240px; right: 20%; bottom: -80px; background: rgba(142, 178, 255, 0.12); }

.topbar, .station-nav, main, footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 6vw 8px;
}

.brand { display: flex; gap: 14px; align-items: center; }

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--gold), #d9843b);
  color: #1a1206;
  font-size: 1.7rem;
}

.eyebrow, .kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0 0 8px;
  font-weight: 600;
}

.score-pill {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.score-pill strong { font-size: 1.3rem; color: var(--gold); }

.station-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 6vw 0;
}

.nav-dot, .cta, .ghost {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
}

.nav-dot {
  white-space: nowrap;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.nav-dot.is-active, .nav-dot.is-done {
  color: #081018;
}

.nav-dot.is-active { background: var(--mint); }
.nav-dot.is-done { background: var(--gold); }

a.week-nav {
  text-decoration: none;
  background: rgba(94, 234, 212, 0.16);
  color: var(--mint);
  border-color: rgba(94, 234, 212, 0.4);
}

main { padding: 18px 6vw 80px; }

.station { display: none; animation: rise 0.45s ease; }
.station.is-active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.lead { max-width: 62ch; font-size: 1.05rem; }

.mission-grid, .map-layout, .bins {
  display: grid;
  gap: 18px;
}

.mission-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.glass ol { padding-left: 18px; color: var(--ink); }
.glass li { margin: 8px 0; }
.tip em { color: var(--mint); font-style: normal; }

.week-panel {
  margin: 0 0 28px;
  max-width: 72ch;
}

.week-panel h2 { max-width: none; margin-bottom: 8px; }

.week-panel strong { color: var(--ink); }

.week-day {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.week-day.is-today {
  padding: 16px;
  margin-left: -8px;
  margin-right: -8px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 16px;
  background: rgba(94, 234, 212, 0.06);
}

.week-day h3 { color: var(--gold); margin-bottom: 8px; }
.week-day ul { margin: 0; padding-left: 18px; color: var(--ink); }
.week-day li { margin: 8px 0; }

.week-links {
  margin: 12px 0 4px;
  color: var(--mint);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.link-list a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.week-note {
  margin: 18px 0 0;
  color: var(--muted);
}

.week-note em { color: var(--coral); font-style: normal; }

.cta, .ghost {
  padding: 14px 20px;
  margin-top: 18px;
}

.cta {
  background: linear-gradient(180deg, #fff1c2, var(--gold));
  color: #2a1c06;
  font-weight: 700;
}

.cta:disabled {
  opacity: 0.38;
  filter: grayscale(0.7);
  cursor: not-allowed;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.flip {
  height: 220px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  box-shadow: var(--shadow);
}

.front { background: #2b3d5c; }
.back { background: #334e63; display: none; }
.flip.is-flipped .front { display: none; }
.flip.is-flipped .back { display: flex; }
.face small { color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.face p { color: var(--ink); margin: 0; }

.map-layout { grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); align-items: start; }

.venn {
  position: relative;
  min-height: 360px;
  border-radius: var(--radius);
  background: #0d1526;
  border: 1px solid var(--line);
}

.ring {
  position: absolute;
  border: 2px solid transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.ring.real {
  inset: 18px;
  border-radius: 28px;
  background: rgba(142, 178, 255, 0.12);
  border-color: rgba(142, 178, 255, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 16px;
}

.ring.rational {
  left: 8%;
  top: 28%;
  width: 44%;
  height: 54%;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.18);
  border-color: var(--mint);
}

.ring.irrational {
  right: 8%;
  top: 28%;
  width: 44%;
  height: 54%;
  border-radius: 50%;
  background: rgba(245, 196, 107, 0.16);
  border-color: var(--gold);
}

.ring.is-on { box-shadow: 0 0 0 4px rgba(255,255,255,0.12); transform: scale(1.02); }

.tray, .chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.chip, .preset {
  font-family: "JetBrains Mono", monospace;
  border: 1px solid var(--line);
  background: #243452;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: grab;
}

.chip.is-selected { outline: 2px solid var(--mint); }
.chip.is-right { background: rgba(94, 234, 212, 0.18); }
.chip.is-wrong { background: rgba(255, 138, 138, 0.18); }

.bins { grid-template-columns: 1fr 1fr; margin-top: 8px; }

.bin {
  min-height: 220px;
  border-radius: var(--radius);
  padding: 18px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,0.03);
}

.bin h3, .bin p { margin: 0 0 8px; }
.bin.is-hot { border-style: solid; }
.rational-bin.is-hot { border-color: var(--mint); }
.irrational-bin.is-hot { border-color: var(--gold); }

.bin-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 90px;
}

.row-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.status { min-height: 1.5em; color: var(--blue); }

.inspector label { display: block; margin-bottom: 8px; color: var(--gold); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }

.inspect-row { display: flex; gap: 10px; flex-wrap: wrap; }

.inspect-row input {
  flex: 1;
  min-width: 220px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #10192b;
  color: var(--ink);
  padding: 14px 16px;
}

.inspect-row .cta { margin-top: 0; }

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 8px;
}

.badge.rational { background: rgba(94, 234, 212, 0.18); color: var(--mint); }
.badge.irrational { background: rgba(245, 196, 107, 0.18); color: var(--gold); }
.badge.real { background: rgba(142, 178, 255, 0.18); color: var(--blue); }

.quiz-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.choices { display: grid; gap: 10px; margin-top: 16px; }

.choice {
  text-align: left;
  background: #243452;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
}

.choice.is-picked { border-color: var(--mint); }
.choice.is-correct { border-color: var(--mint); background: rgba(94, 234, 212, 0.12); }
.choice.is-miss { border-color: var(--coral); background: rgba(255, 138, 138, 0.1); }

.why { margin-top: 14px; color: var(--ink); }

.hidden { display: none; }

.certificate { margin-top: 20px; text-align: center; }
.certificate h3 { max-width: none; font-size: 2rem; }

footer {
  padding: 0 6vw 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 800px) {
  .map-layout, .bins { grid-template-columns: 1fr; }
  .venn { min-height: 300px; }
  h2 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .station, .flip-inner { animation: none; transition: none; }
}

body.portal h2 { max-width: none; }

.portal-sub {
  position: relative;
  z-index: 1;
  padding: 0 6vw 4px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.portal-sub a { color: var(--blue); }

.portal-rules { padding: 0 6vw; margin: 8px 0 0; }

.week-panel { max-width: none; }

.item-grid { margin-top: 16px; }

.item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
}

.item-card.is-today {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(94, 234, 212, 0.07);
}

.item-card.is-warn h3 { color: var(--gold); }

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.item-time { color: var(--mint); font-weight: 600; }

.item-card h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 6px;
}

.item-course { margin: 0 0 8px; color: var(--blue); font-size: 0.9rem; }

.item-do { margin: 0 0 10px; color: var(--ink); }

.must-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 196, 107, 0.28);
  border-radius: 12px;
  background: rgba(245, 196, 107, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.must-list li { margin: 0; }
.must-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
  cursor: pointer;
}
.must-list input {
  margin-top: 3px;
  accent-color: var(--gold);
  flex-shrink: 0;
}
.must-list input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.item-links { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 0.75rem; }
.item-links a {
  color: var(--mint);
  text-underline-offset: 3px;
}

.khan-watch {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.khan-watch a {
  color: var(--gold);
  font-size: 0.88rem;
  text-underline-offset: 3px;
}

.lesson-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
}
.lesson-player {
  margin: 0;
}
.player-label {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
}
.lesson-player video,
.lesson-player audio {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  background: #0b1220;
}
.lesson-player video {
  aspect-ratio: 16 / 9;
}

@media (max-width: 700px) {
  .item-grid { grid-template-columns: 1fr; }
}
