:root {
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: #211936;
  background: #f8f7fc;
  --ink: #211936;
  --muted: #645d75;
  --border: #e6e0f0;
  --purple: #613cc0;
  --light: #f0eafa;
  --lemon: #f0f776;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 285px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: #5530ad; text-underline-offset: .2em; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #8755ea; outline-offset: 4px; }
main:focus { outline: none; }
p { line-height: 1.55; }
.skip { position: absolute; top: -100px; left: 12px; background: white; padding: 12px; z-index: 9; }
.skip:focus { top: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 max(28px, calc((100% - 1280px)/2)); background: white; min-height: 72px; border-bottom: 1px solid var(--border); }
.brand, .top-nav button, .help { display: flex; align-items: center; gap: 9px; border: 0; background: none; color: var(--ink); }
.brand { padding: 0; font-size: 1.23rem; font-weight: 850; letter-spacing: -.055em; white-space: nowrap; }
.brand-accent { color: var(--purple); }
.icon { display: inline-grid; align-items: center; justify-items: center; flex: none; line-height: 1; font-family: system-ui, sans-serif; }
.mark { width: 35px; height: 35px; border-radius: 10px; background: #30205c; color: var(--lemon); font-size: 23px; }
.top-nav { display: flex; align-self: stretch; gap: 23px; }
.top-nav button { padding: 4px 0 0; border-bottom: 3px solid transparent; font-weight: 650; font-size: .92rem; }
.top-nav button.active { color: #5530ad; border-bottom-color: #794fdb; }
.help { border: 1px solid var(--border); border-radius: 24px; padding: 9px 16px; white-space: nowrap; font-weight: 700; font-size: .9rem; }
.help:hover, .quiet:hover:not(:disabled), .back:hover { background: var(--light); }
.help .icon { color: var(--purple); font-size: 19px; }
.layout { width: min(1280px, calc(100% - 56px)); margin: 32px auto 58px; display: grid; grid-template-columns: 232px minmax(0,1fr); gap: 30px; }
aside { min-width: 0; }
.eyebrow { margin: 0 0 14px; text-transform: uppercase; letter-spacing: .105em; color: #653abe; font-weight: 820; font-size: .8rem; }
aside .eyebrow { margin: 8px 0 14px; color: var(--muted); }
.path-list { display: grid; gap: 9px; }
.path { width: 100%; min-height: 67px; padding: 10px 12px; display: flex; align-items: center; text-align: left; gap: 10px; border: 1px solid var(--border); border-radius: 13px; background: white; color: var(--ink); }
.path:hover { border-color: #a688e0; }
.path.chosen { border-color: #a585e8; background: #eee6ff; box-shadow: 0 0 0 1px #a585e827; }
.path strong, .path small { display: block; }
.path strong { font-size: .94rem; }
.path small { margin-top: 3px; font-size: .82rem; color: var(--muted); }
.path-mark { color: #6038b8; background: #efeafd; width: 34px; height: 34px; border-radius: 9px; font-size: 20px; }
.chosen .path-mark { background: #ded0f8; }
.path-check { margin-left: auto; color: #5733a5; font-weight: 800; }
.progress-card { margin-top: 22px; padding: 15px; border: 1px solid var(--border); border-radius: 14px; background: white; }
.progress-head { display: flex; justify-content: space-between; gap: 4px; font-size: .92rem; }
.progress-head span { color: #6038b8; font-weight: 800; }
.progress-card p { margin: 3px 0 10px; color: var(--muted); font-size: .82rem; }
.progress-card small { color: var(--muted); font-size: .78rem; }
progress { width: 100%; margin: 12px 0 0; height: 8px; appearance: none; border: none; border-radius: 6px; overflow: hidden; background: #eee9f6; }
progress::-webkit-progress-bar { background: #eee9f6; }
progress::-webkit-progress-value { background: #7950ce; border-radius: 6px; }
progress::-moz-progress-bar { background: #7950ce; border-radius: 6px; }
.hero { isolation: isolate; position: relative; overflow: hidden; border-radius: 24px; background: #30205c; color: white; min-height: 342px; display: flex; align-items: center; }
.hero-copy { position: relative; z-index: 1; padding: 35px 38px; max-width: 61%; }
.hero .eyebrow { color: #e3cffc; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.75rem); line-height: .99; letter-spacing: -.073em; margin: 0; font-weight: 880; }
.hero h1 span { color: var(--lemon); }
.hero-copy > p:not(.eyebrow) { max-width: 375px; color: #e9e0f7; margin: 13px 0 22px; }
.hero-art { position: absolute; right: 0; top: 0; bottom: 0; width: 60%; background: radial-gradient(circle at 64% 50%,#734ab0 0,#48307b 42%,#30205c 76%); display: grid; place-items: center; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,#30205c,transparent 22%); pointer-events: none; }
.hero-art.has-image { background: #30205c url(hero.webp) center right / cover no-repeat; }
.hero-art.has-image .fallback-art { display: none; }
.fallback-art { display: grid; place-items: center; height: 52%; aspect-ratio: .88; background: linear-gradient(145deg,#c6a6fb,#6d49a7); color: var(--lemon); border: 4px solid #d7bfff; clip-path: polygon(0 0,100% 0,100% 65%,88% 82%,50% 100%,12% 82%,0 65%); font-size: clamp(2rem,9vw,7rem); transform: rotate(-13deg); }
.primary, .quiet, .back { border-radius: 10px; padding: 11px 17px; font-weight: 760; border: 1px solid transparent; }
.primary { background: #613cc0; color: white; }
.primary:hover { background: #5030a3; }
.hero .primary { color: #2c2342; background: var(--lemon); }
.hero .primary:hover { background: #faffae; }
.hero .primary:focus-visible { outline-color: #fff; }
.quiet, .back { border-color: var(--border); background: white; color: #5331a3; }
.quiet:disabled { opacity: .45; }
.route { margin-top: 31px; }
.route-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.route h2, .lesson-heading h1 { margin: 0; font-weight: 850; color: var(--ink); letter-spacing: -.052em; font-size: clamp(1.8rem,3.5vw,2.7rem); line-height: 1.13; }
.route-heading p, .lesson-heading > p:not(.eyebrow) { color: var(--muted); margin: 6px 0 0; }
.count { flex: none; padding: 6px 12px; border-radius: 20px; color: #5431a5; background: #eee8fa; font-weight: 750; font-size: .82rem; }
.unit h3 { margin: 24px 0 10px; font-size: .89rem; color: #5a477d; }
.lesson-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.lesson-card { position: relative; color: var(--ink); background: white; border: 1px solid var(--border); border-radius: 14px; padding: 13px; min-height: 91px; display: flex; align-items: center; gap: 12px; text-align: left; }
a.lesson-card { text-decoration: none; }
.lesson-card.ready { border-color: #8c65db; box-shadow: 0 0 0 1px #8c65db30; background: #fefcff; }
.lesson-card:hover { border-color: #8356d5; background: #f3edfe; }
.lesson-icon { width: 42px; height: 42px; border-radius: 11px; background: #ede5fe; color: #6639bb; font-size: 23px; font-weight: 750; }
.unit-1 .lesson-icon { color: #545188; background: #e7e7fe; }
.unit-2 .lesson-icon { color: #17624d; background: #ddf3e9; }
.card-copy { display: grid; gap: 3px; min-width: 0; }
.card-copy strong { font-size: .99rem; line-height: 1.2; }
.card-meta, .card-status { color: var(--muted); font-size: .75rem; }
.ready .card-status { color: #6038b8; font-weight: 700; }
.complete .card-status { color: #17624d; font-weight: 700; }
.card-indicator { margin-left: auto; color: #635b75; width: 24px; font-size: 17px; }
.ready .card-indicator { color: #6038b8; }
.complete .card-indicator { color: #17624d; }
footer { border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; padding: 20px max(28px,calc((100% - 1280px)/2)); color: var(--muted); font-size: .83rem; }
.lesson-heading { margin: 17px 0 21px; }
.lesson-heading .eyebrow { margin-bottom: 7px; }
.lesson-heading h1 { font-size: clamp(2rem,5vw,3.5rem); }
.lesson-tabs { display: flex; gap: 8px; margin-bottom: 13px; }
.lesson-tabs button { border-radius: 9px; border: 1px solid var(--border); background: white; color: #5331a3; padding: 9px 16px; font-weight: 740; }
.lesson-tabs button[aria-current] { background: #e9dffc; border-color: #b99ce9; color: #391f77; }
.surface { padding: clamp(14px,3vw,26px); background: white; border: 1px solid var(--border); border-radius: 18px; }
.surface h2, .surface h3 { font-weight: 800; letter-spacing: -.025em; margin: 0 0 5px; }
.surface p { margin-top: 5px; }
.story { color: white; background: linear-gradient(145deg,#34215f,#4d307b); padding: clamp(14px,4vw,30px); border-radius: 14px; }
.story-copy { display: flex; align-items: flex-start; gap: 17px; min-height: 124px; }
.story-copy p { color: #f1e7fd; max-width: 580px; }
.story-symbol { border-radius: 14px; width: 56px; height: 56px; font-size: 32px; color: var(--lemon); background: #ffffff20; }
.story-controls, .story-steps, .lesson-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.story-controls { justify-content: space-between; margin: 6px 0 0; }
.story-controls .primary { background: var(--lemon); color: #2c2342; }
.story-controls .primary:hover { background: #faffae; }
.story-controls .quiet { color: white; background: #ffffff10; border-color: #f1e7fd65; }
.story-controls .quiet:hover:not(:disabled) { background: #ffffff2b; }
.transcript, .media { padding: 13px 0; border-bottom: 1px solid var(--border); }
.transcript h3:first-of-type { margin-top: 14px; }
.transcript p:last-child, .media p:last-child { margin-bottom: 0; }
summary { cursor: pointer; font-weight: 750; color: #5331a3; }
.media iframe { width: min(100%,720px); aspect-ratio: 16/9; border: 0; border-radius: 11px; background: #221733; display: block; }
.lesson-actions { margin-top: 19px; }
.sources { color: var(--muted); padding-inline: 4px; }
.scenario, .feedback { border-radius: 12px; padding: 15px; background: #f2ecfc; }
.scenario p, .feedback ol { margin-bottom: 0; }
fieldset { border: none; padding: 0; margin: 22px 0 0; }
fieldset legend { margin: 0 0 8px; font-weight: 800; padding: 0; }
.choice { display: flex; align-items: baseline; gap: 10px; cursor: pointer; margin-bottom: 7px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; }
.choice:has(input:checked) { border-color: #a888df; background: #f4edff; }
.choice input { accent-color: #6339b9; flex: none; }
.feedback { margin-top: 16px; }
.feedback.passed { background: #def5e9; }
.feedback.retry { background: #fcf0d9; }
.feedback li { margin: 5px 0; }
.resource-grid { display: grid; gap: 11px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.resource { padding: 15px; background: white; border: 1px solid var(--border); border-radius: 13px; }
.resource h2 { font-size: 1.07rem; margin: 0 0 7px; }
.resource p { margin: 0; color: var(--muted); }
@media(max-width:900px) {
  .layout { gap: 18px; grid-template-columns: 185px minmax(0,1fr); }
  .hero-copy { padding-inline: 25px; max-width: 68%; }
}
@media(max-width:710px) {
  .layout { display: block; width: calc(100% - 32px); margin-top: 16px; }
  .topbar { padding: 0 16px; gap: 9px; min-height: 57px; }
  .top-nav { gap: 10px; }
  .top-nav button { font-size: .78rem; }
  .brand { font-size: 1rem; }
  .mark { width: 28px; height: 28px; font-size: 18px; }
  .help { padding: 6px 9px; font-size: .76rem; }
  .help .icon { display: none; }
  aside { margin-bottom: 14px; }
  .path-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .path { min-height: 54px; padding: 7px; gap: 5px; justify-content: center; }
  .path-mark { display: none; }
  .path-check { display: none; }
  .path strong { font-size: clamp(.72rem,2.3vw,.94rem); }
  .progress-card { margin-top: 8px; padding: 7px 10px; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3px 12px; }
  .progress-card p { margin: 0; }
  .progress-card small { text-align: right; }
  progress { margin: 0; }
  .hero { min-height: 296px; border-radius: 17px; }
  .hero-copy { padding: 22px; max-width: 71%; }
  .hero-copy > p:not(.eyebrow) { margin: 10px 0 15px; }
  .route { margin-top: 22px; }
}
@media(max-width:490px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; gap: 0; padding-top: 8px; }
  .brand { order: 0; }
  .help { order: 1; }
  .top-nav { order: 2; width: 100%; gap: 20px; }
  .top-nav button { min-height: 38px; font-size: .86rem; }
  .hero-copy { max-width: 100%; padding-right: 21%; }
  .hero-art { opacity: .36; width: 74%; }
  .lesson-grid,.resource-grid { grid-template-columns: 1fr; }
  .count { display: none; }
  .story-copy { gap: 9px; }
  .story-symbol { width: 36px; height: 36px; font-size: 21px; }
  .story-steps { gap: 7px; }
  .story-controls .quiet { padding-inline: 9px; }
}
@media (prefers-reduced-motion:no-preference) {
  .story-copy > div { animation: appear .2s ease-out; }
  @keyframes appear { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
}

.lesson-media { margin-bottom: 18px; }
.lesson-media > h2 { font-size: 1.16rem; }
.resource-section { margin-top: 28px; }
.resource-section > h2 { letter-spacing: -.03em; margin: 0 0 10px; }
.resource h3 { font-size: 1.05rem; margin: 0 0 7px; }
.video-row { border: 1px solid var(--border); background: #fcfaff; padding: 10px 12px; border-radius: 10px; margin-top: 8px; }
.video-row strong, .video-row small { display: block; }
.video-row small { color: var(--muted); margin-top: 3px; }
.video-actions, .topic-guides { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.video-row .quiet { padding: 6px 10px; }
.video-link { display: inline-block; text-decoration: none; }
.video-player iframe { width: min(100%, 680px); display: block; aspect-ratio: 16/9; margin-top: 10px; border: 0; border-radius: 8px; background: #211936; }

/* Pre-rendered pages (read by search engines and shown until the app loads) */
.layout.prerender { display: block; max-width: 860px; }
.prerender .surface { margin-bottom: 16px; }
.prerender .hero { padding: 0; }
.prerender .back, .prerender .quiet { display: inline-block; text-decoration: none; }
.topbar a.brand { text-decoration: none; }
.top-nav a { align-self: center; font-weight: 650; font-size: .92rem; color: var(--ink); text-decoration: none; }

/* Topic explainer: what it is, why it matters, how it works, and an example */
.explainer { margin-bottom: 18px; display: grid; gap: 12px; }
.explain-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.explain-grid > div, .example { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.explainer h2 { font-size: 1rem; margin: 0 0 6px; color: var(--purple); letter-spacing: -.01em; }
.explainer p { margin: 0; line-height: 1.55; }
.example { background: #fbf9df; border-color: #e7e9a8; }
.example h2 { color: #4a3d12; display: flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .explain-grid { grid-template-columns: 1fr; } }
