/* Decoding the Code · Module 2 · Sankofa Learning Design brand */
@font-face { font-family: "Fraunces"; src: url("../fonts/Fraunces-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/Fraunces-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --purple: #33065A; --purple-2: #45176E; --purple-line: #6B3E94; --lilac: #C9B8DE; --lilac-bg: #F1EAF7;
  --orange: #E68117; --orange-ink: #A8530A; --cream: #FAF6EE; --tint: #F4EEE0;
  --ink: #241531; --muted: #5A4A66; --line: #E3D8EA; --white: #FFFFFF;
  --good: #2F6B3A; --good-bg: #E5F0E3; --bad: #9B2C1F; --bad-bg: #F8E4DF;
  --display: "Fraunces", Georgia, serif; --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px; --col: 780px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--orange); color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--purple); color: var(--cream); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 18px 32px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand img { width: 48px; height: 48px; border-radius: 6px; }
.brand .t1 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); font-weight: 700; }
.brand .t2 { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.2; }
.prog { font-size: 13px; color: var(--lilac); }
.prog .bar { height: 6px; background: var(--purple-2); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.prog .bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .4s; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc .sec { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--lilac); font-weight: 700; padding: 14px 10px 4px; }
.toc button { background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.35; color: var(--cream); cursor: pointer; }
.toc button:hover:not(:disabled) { background: var(--purple-2); }
.toc button[aria-current="page"] { background: var(--purple-2); box-shadow: inset 3px 0 0 var(--orange); }
.toc button:disabled { opacity: .5; cursor: not-allowed; }
.toc .dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--lilac); margin-top: 1px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.toc .done .dot { background: var(--orange); border-color: var(--orange); color: var(--purple); }
.side .lic { margin-top: auto; font-size: 11.5px; color: var(--lilac); line-height: 1.45; }
.topbar { display: none; }

main { min-width: 0; }
.lesson { max-width: var(--col); margin: 0 auto; padding: 48px 24px 96px; display: flex; flex-direction: column; gap: 28px; }
.lhead { padding-bottom: 20px; border-bottom: 3px solid var(--orange); }
.lhead .num { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-ink); font-weight: 700; }
.lhead h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.5vw, 44px); line-height: 1.12; margin: 6px 0 0; color: var(--purple); text-wrap: balance; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 8, 32, .5); }
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; background: var(--purple); color: var(--cream); align-items: center; gap: 12px; padding: 10px 16px; }
  .topbar button { background: none; border: 1.5px solid var(--lilac); color: var(--cream); border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
  .topbar .tt { font-family: var(--display); font-weight: 700; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lesson { padding: 28px 16px 80px; }
}

/* ---------- basic blocks ---------- */
.eyebrow { font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-ink); font-weight: 700; }
.b-heading h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; margin: 4px 0 0; color: var(--purple); text-wrap: balance; }
.b-text p { margin: 0; max-width: 66ch; }
.b-note { background: var(--lilac-bg); border-left: 5px solid var(--purple); border-radius: 10px; padding: 16px 20px; font-weight: 700; color: var(--purple); }
.b-statement { text-align: center; font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 28px); color: var(--purple); line-height: 1.3; padding: 26px 12px; border-top: 2px solid var(--orange); border-bottom: 2px solid var(--orange); text-wrap: balance; }
.media { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.media video { width: 100%; background: #000; aspect-ratio: 16 / 9; }
.media .cap { padding: 10px 16px; font-size: 14px; color: var(--muted); }
.missing { padding: 12px 16px; font-size: 14px; color: var(--muted); background: var(--tint); }
.missing code { font-size: 13px; }
details.tx { border-top: 1px solid var(--line); }
details.tx summary { cursor: pointer; padding: 10px 16px; font-size: 14px; font-weight: 700; color: var(--purple); }
details.tx p { margin: 0; padding: 0 16px 16px; font-size: 15px; color: var(--ink); }
.audio-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.audio-row .lbl { font-weight: 700; color: var(--purple); font-size: 15px; }
.audio-row audio { flex: 1 1 260px; min-width: 0; height: 40px; }

.b-image img { border-radius: var(--radius); width: 100%; }
.it { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.it.flipside .it-img { order: 2; }
.it-img img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.it-body { padding: 24px 26px; display: flex; flex-direction: column; gap: 8px; justify-content: center; min-width: 0; }
.it-body h3 { font-family: var(--display); font-size: 26px; margin: 0; color: var(--purple); line-height: 1.2; }
.it-body .word { font-family: var(--display); font-weight: 700; font-size: 24px; color: var(--orange-ink); margin-top: 6px; }
.it-body .parts { font-size: 16px; color: var(--ink); }
.it-body p { margin: 0; }
.it .media { border: 0; border-top: 1px solid var(--line); border-radius: 0; grid-column: 1 / -1; }
@media (max-width: 640px) { .it { grid-template-columns: 1fr; } .it.flipside .it-img { order: 0; } }

/* checklist */
.chk { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chk label { display: flex; gap: 14px; align-items: center; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; font-weight: 700; }
.chk input { width: 22px; height: 22px; accent-color: var(--purple); flex: none; }
.chk.static li { display: flex; gap: 14px; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.chk.static .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--purple); color: var(--cream); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* accordion */
.acc { display: grid; gap: 10px; }
.acc details { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acc summary { cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--purple); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--orange-ink); }
.acc details[open] summary::after { content: "–"; }
.acc details[open] summary { border-bottom: 1px solid var(--line); }
.acc .acc-body { padding: 14px 20px 18px; display: grid; gap: 12px; }
.acc .acc-body p { margin: 0; }
.acc audio { width: 100%; height: 38px; }

/* brain break */
.bb { background: var(--purple); color: var(--cream); border-radius: var(--radius); padding: 26px; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 22px; align-items: start; }
.bb img { width: 110px; }
.bb .eyebrow { color: var(--orange); }
.bb h3 { font-family: var(--display); font-size: 28px; margin: 2px 0 10px; }
.bb ol { margin: 0 0 12px; padding-left: 22px; }
.bb li { margin: 4px 0; }
.bb .tip { color: var(--lilac); font-style: italic; margin: 0; }
.bb .media { grid-column: 1 / -1; }
.bb .timer { display: inline-flex; gap: 10px; align-items: center; margin-top: 10px; }
.bb .timer button { background: var(--orange); color: var(--purple); border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.bb .timer span { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; min-width: 3ch; }
@media (max-width: 560px) { .bb { grid-template-columns: 1fr; } .bb img { width: 80px; } }

/* flip cards */
.flip { display: grid; gap: 16px; }
.flip.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flip.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 560px; margin: 0 auto; width: 100%; }
@media (max-width: 640px) { .flip.c3 { grid-template-columns: minmax(0, 1fr); max-width: 360px; margin: 0 auto; width: 100%; } }
.card { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1200px; }
.card .in { position: absolute; inset: 0; transition: transform .55s; transform-style: preserve-3d; }
.card[aria-pressed="true"] .in { transform: rotateY(180deg); }
.card .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; }
.card .face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .front { background: var(--orange); color: var(--purple); }
.card .back { background: var(--cream); color: var(--ink); border: 3px solid var(--purple); transform: rotateY(180deg); }
.card .ft { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; }
.card .bt { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--purple); }
.card .bx { font-size: 15.5px; margin-top: 6px; line-height: 1.4; }
.card .ex { margin-top: 10px; font-family: var(--display); font-size: 22px; color: var(--orange-ink); }
.card .ex b { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card .hint { position: absolute; bottom: 10px; right: 12px; font-size: 18px; opacity: .7; }
.card .front .hint { color: var(--purple); }
@media (prefers-reduced-motion: reduce) { .card .in { transition: none; } }

/* activity shell */
.act { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.act .q { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--purple); line-height: 1.3; margin: 0; }
.act .how { font-size: 14.5px; color: var(--muted); margin: 0; }
.btn { background: var(--purple); color: var(--cream); border: 0; border-radius: 999px; padding: 11px 26px; font-weight: 700; cursor: pointer; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--purple); border: 2px solid var(--purple); }
.btn.orange { background: var(--orange); color: var(--purple); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fb { border-radius: 10px; padding: 14px 18px; font-size: 15.5px; }
.fb.ok { background: var(--good-bg); color: var(--good); }
.fb.no { background: var(--bad-bg); color: var(--bad); }
.fb.info { background: var(--lilac-bg); color: var(--purple); }
.fb strong { display: block; margin-bottom: 2px; }

/* matching */
.mt { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 14px 18px; align-items: start; }
.mt .col { display: grid; gap: 12px; }
.mt .colh { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.mt .src { background: var(--orange); color: var(--purple); border: 2px solid var(--orange); border-radius: 10px; padding: 14px; font-weight: 700; text-align: left; cursor: pointer; min-height: 56px; }
.mt .src[aria-pressed="true"] { background: var(--purple); color: var(--cream); border-color: var(--purple); }
.mt .src.used { background: var(--tint); border-color: var(--line); color: var(--muted); }
.mt .tgt { background: var(--white); border: 2px dashed var(--purple-line); border-radius: 10px; padding: 12px 14px; text-align: left; cursor: pointer; display: grid; gap: 8px; }
.mt .tgt .slot { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.mt .tgt .slot.filled { display: inline-block; background: var(--purple); color: var(--cream); border-radius: 999px; padding: 3px 12px; justify-self: start; }
.mt .tgt.ok { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.mt .tgt.no { border-style: solid; border-color: var(--bad); background: var(--bad-bg); }
@media (max-width: 600px) { .mt { grid-template-columns: minmax(0, 1fr); } }

/* order tiles */
.ord .word { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--purple); }
.ord .from { font-size: 14px; color: var(--muted); }
.slots, .tray { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.slot-b { min-width: 74px; height: 62px; border: 2.5px dashed var(--purple-line); border-radius: 12px; background: var(--white); font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--purple); cursor: pointer; padding: 0 12px; }
.slot-b.filled { border-style: solid; border-color: var(--purple); background: var(--lilac-bg); }
.slot-b:disabled { cursor: default; }
.slots.ok .slot-b { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.tile { min-width: 74px; height: 62px; border: 0; border-radius: 12px; background: var(--orange); font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--purple); cursor: pointer; padding: 0 12px; box-shadow: 0 3px 0 var(--orange-ink); }
.tile:disabled { visibility: hidden; }
.morph { text-align: center; font-size: 15px; color: var(--muted); }
.morph b { color: var(--purple); }

/* say it split it */
.say .word { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4vw, 38px); color: var(--purple); text-align: center; }
.say .step { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.say .step h3 { margin: 0; font-size: 16px; color: var(--purple); }
.say .step.locked { opacity: .55; }
.tokens { display: flex; gap: 10px; justify-content: center; }
.tokens i { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--purple-line); background: var(--white); transition: background .15s; }
.tokens i.lit { background: var(--orange); border-color: var(--orange-ink); }
.pad { width: 170px; height: 120px; margin: 0 auto; border-radius: 18px; border: 0; background: var(--orange); color: var(--purple); font-weight: 700; cursor: pointer; display: grid; place-content: center; box-shadow: 0 5px 0 var(--orange-ink); font-size: 14px; line-height: 1.3; }
.pad b { font-family: var(--display); font-size: 30px; }
.pad:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--orange-ink); }
.pad:disabled { opacity: .5; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.chip-b { border: 2px solid var(--purple); background: var(--white); color: var(--purple); border-radius: 12px; padding: 10px 18px; font-family: var(--display); font-weight: 700; font-size: 22px; cursor: pointer; }
.chip-b.ok { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.chip-b.no { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.split { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.split span { background: var(--lilac-bg); color: var(--purple); border-radius: 8px; padding: 6px 12px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.linkish { background: none; border: 0; color: var(--purple); text-decoration: underline; cursor: pointer; padding: 0; font-size: 14.5px; }

/* scenario */
.scn { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scn .stage { position: relative; }
.scn .stage img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; filter: saturate(.9); }
.scn .bubble { position: absolute; left: 18px; bottom: 18px; max-width: min(70%, 420px); background: var(--white); color: var(--ink); border-radius: 18px 18px 18px 4px; padding: 12px 18px; font-family: var(--display); font-size: 20px; box-shadow: 0 4px 18px rgba(36, 21, 49, .25); }
.scn .bubble small { display: block; font-family: var(--body); font-size: 12px; font-weight: 700; color: var(--orange-ink); letter-spacing: .08em; text-transform: uppercase; }
.scn .body { padding: 22px 24px; display: grid; gap: 14px; }
.scn .setup { margin: 0; }
.scn .ask { font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--purple); margin: 0; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--cream); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; width: 100%; }
.opt .k { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--purple); color: var(--cream); display: grid; place-items: center; font-weight: 700; }
.opt.tried { opacity: .6; }
.opt.tried .k { background: var(--bad); }
.opt.right { border-color: var(--good); background: var(--good-bg); opacity: 1; }
.opt.right .k { background: var(--good); }
.pocket { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pocket li { background: var(--purple); color: var(--cream); border-radius: 10px; padding: 12px 16px; font-family: var(--display); font-size: 19px; }

/* continue + nav */
.cont { display: flex; justify-content: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cont .btn { margin-top: 18px; }
.next-lesson { display: flex; justify-content: center; padding-top: 24px; border-top: 3px solid var(--orange); }
.lockmsg { text-align: center; color: var(--muted); font-size: 14.5px; }

/* results + sankofa */
.res { background: var(--lilac-bg); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 8px; }
.res .big { font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--purple); font-variant-numeric: tabular-nums; }
.res ul { margin: 0; padding-left: 20px; font-size: 15px; }
.sk { background: var(--purple); color: var(--cream); border-radius: var(--radius); padding: 34px 26px 26px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.sk img { width: min(46%, 220px); border-radius: 8px; }
.sk blockquote { margin: 0; font-family: var(--display); font-size: clamp(22px, 3vw, 30px); line-height: 1.3; text-wrap: balance; }
.sk cite { color: var(--orange); font-style: normal; font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.sk .media { width: 100%; text-align: left; }
.sk .lic { font-size: 13px; color: var(--lilac); }
.done-box { text-align: center; display: grid; gap: 12px; justify-items: center; }
.done-box p { margin: 0; }

.reveal { animation: rise .45s ease both; }
@keyframes rise { from { opacity: .001; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }
