:root {
  --bg: #0b1018;
  --panel: #121a25;
  --panel-2: #182231;
  --panel-3: #f7fbff;
  --ink: #f8fafc;
  --muted: #aab6c7;
  --soft: #dce7f3;
  --line: rgba(255,255,255,0.12);
  --cyan: #22d3ee;
  --mint: #7dd3a8;
  --honey: #f7c948;
  --rose: #fb7185;
  --violet: #a78bfa;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0,0,0,0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(34,211,238,0.12), transparent 34%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  overflow-x: hidden;
}

button, input { font: inherit; max-width: 100%; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.academy-shell {
  width: min(1180px, calc(100% - 28px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 16px 0 20px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.academy-top {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(34,211,238,0.18));
}

.brand strong { display: block; font-size: 18px; }
.brand small { display: block; margin-top: 2px; color: var(--cyan); font-size: 12px; }

.top-actions, .lesson-controls, .panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions { justify-content: flex-end; flex-wrap: wrap; }

.learning-pod {
  min-height: calc(100svh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: center;
}

.learning-pod > *, .lesson-stage > *, .side-console > * { min-width: 0; }

.lesson-stage, .side-console {
  display: grid;
  gap: 12px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow, .mini-label {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 900;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}
h2 { margin: 0; font-size: clamp(26px, 3.2vw, 44px); line-height: 1; letter-spacing: 0; }
h3 { margin: 0; font-size: 18px; }
p { line-height: 1.55; }

.xp-dial {
  width: 86px;
  height: 86px;
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.xp-dial svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.xp-dial circle {
  fill: none;
  stroke-width: 10;
  stroke: rgba(255,255,255,0.1);
}

#xp-ring {
  stroke: var(--mint);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 300ms ease;
}

.xp-dial span { font-weight: 900; color: var(--mint); }

.track-switcher {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.track-chip, .ghost-btn, .primary-btn, .mini-btn, .choice-btn, .module-dot {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255,255,255,0.055);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.track-chip {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 9px 6px;
}

.track-chip i { color: var(--track); font-size: 18px; }
.track-chip span { font-size: 11px; font-weight: 900; }
.track-chip.active {
  border-color: var(--track);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.055));
  transform: translateY(-1px);
}

.lesson-card, .choice-panel, .coach-card, .module-map, .lab-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18,26,37,0.9);
  box-shadow: var(--shadow);
}

.lesson-card {
  min-height: 260px;
  padding: clamp(18px, 3vw, 28px);
  position: relative;
  overflow: hidden;
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(34,211,238,0.14), transparent 35%, rgba(247,201,72,0.1));
  opacity: 0.9;
  pointer-events: none;
}

.lesson-card > * { position: relative; }

.lesson-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
}

#module-summary {
  max-width: 68ch;
  margin: 14px 0 18px;
  color: var(--soft);
  font-size: 17px;
}

.proof-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.proof-item {
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.16);
  color: var(--soft);
  font-size: 13px;
}

.choice-panel { padding: 16px; display: grid; gap: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice-btn {
  min-height: 92px;
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
}
.choice-btn strong { color: var(--honey); }
.choice-btn small { color: var(--muted); line-height: 1.4; }
.choice-btn:hover, .module-dot:hover, .ghost-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.28); }
.choice-btn.correct { border-color: var(--mint); background: rgba(125,211,168,0.13); }
.choice-btn.risky { border-color: var(--honey); background: rgba(247,201,72,0.12); }

.feedback {
  min-height: 44px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(0,0,0,0.2);
  color: var(--soft);
}

.lesson-controls { justify-content: space-between; }
.ghost-btn, .primary-btn {
  min-width: 112px;
  padding: 0 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.primary-btn {
  color: #061018;
  background: var(--cyan);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(34,211,238,0.22);
}

.side-console {
  align-self: stretch;
  align-content: center;
}

.coach-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
}

.coach-avatar {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(34,211,238,0.32);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(34,211,238,0.09);
}

.coach-avatar img { width: 54px; height: 54px; object-fit: contain; }
.coach-card p { margin: 6px 0 0; color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-grid article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.055);
}

.stat-grid strong { display: block; font-size: 28px; color: var(--mint); }
.stat-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }

.module-map, .lab-card { padding: 14px; display: grid; gap: 12px; }
.panel-head { justify-content: space-between; color: var(--soft); font-weight: 900; }
.mini-btn {
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.module-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.module-dot {
  min-height: 52px;
  padding: 6px;
  font-size: 12px;
  font-weight: 900;
  color: var(--muted);
}

.module-dot.active { color: #061018; background: var(--honey); border-color: transparent; }
.module-dot.done { color: var(--mint); border-color: rgba(125,211,168,0.55); }

.lab-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input[type="range"] { width: 100%; accent-color: var(--cyan); }
#readiness-score { color: var(--mint); }
#readiness-copy { margin: 0; color: var(--muted); font-size: 13px; }

.spark {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--spark, var(--cyan));
  pointer-events: none;
  animation: spark 700ms ease-out forwards;
  z-index: 50;
}

body.focus-mode .side-console { display: none; }
body.focus-mode .learning-pod { grid-template-columns: minmax(0, 860px); justify-content: center; }

@keyframes spark {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}

@media (max-width: 980px) {
  .learning-pod { grid-template-columns: 1fr; align-items: start; }
  .side-console { grid-template-columns: 1fr 1fr; align-content: start; }
  .coach-card, .module-map, .lab-card { min-height: 100%; }
}

@media (max-width: 720px) {
  .academy-shell { width: min(100% - 20px, 1180px); padding-top: 8px; }
  .academy-top { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: stretch; }
  .top-actions .ghost-btn { flex: 1 1 0; }
  .stage-header { align-items: flex-start; }
  .xp-dial { width: 74px; height: 74px; }
  .track-switcher { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .proof-list, .choice-grid, .side-console { grid-template-columns: 1fr; }
  .lesson-card { min-height: auto; }
  .lesson-controls { display: grid; grid-template-columns: 1fr; }
  .ghost-btn, .primary-btn { width: 100%; }
}

@media (max-width: 420px) {
  h1 { font-size: 34px; }
  h2 { font-size: 28px; }
  .brand-logo { width: 42px; height: 42px; }
  .track-chip span { font-size: 10px; }
  .module-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
