:root { color-scheme: light; font: 16px/1.5 system-ui, sans-serif; background: #fff; color: #24262d; --brand: #2b32a2; --line: #dedee8; }
* { box-sizing: border-box; }
body { margin: 0; }
body::before { content: ""; display: block; height: 2px; background: linear-gradient(90deg, #1b0ae9, #ce20ed, #a95634, #23571f, #1908e8); }
main { max-width: 1040px; margin: auto; padding: clamp(20px, 4vw, 48px); }
header p { color: #45475b; font-size: .86rem; margin: 0; }
header span { color: var(--brand); padding: 0 .45rem; }
h1 { font-size: clamp(1.7rem, 4.3vw, 3.2rem); letter-spacing: -.052em; line-height: 1.1; margin: .35em 0 .65em; }
figure { margin: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
svg { display: block; width: 100%; height: auto; fill: #24262d; }
.beat { opacity: 0; }
.beat[data-in="0"] { opacity: 1; }
.cover, .cover .label, .white { fill: #fff; }
.cover .title { font-family: Futura, "Century Gothic", system-ui, sans-serif; font-weight: 500; }
.cover-name { font-size: 21px; }
.title { font-size: 61px; font-weight: 680; letter-spacing: -2px; }
.heading { font-size: 42px; font-weight: 650; letter-spacing: -1.5px; }
.label { font-size: 16px; font-weight: 700; letter-spacing: 2px; fill: var(--brand); }
.small, .point { font-size: 22px; font-weight: 550; }
.card { fill: #fff; stroke: #d2d1e6; }
.wire { fill: none; stroke: #696dc5; stroke-width: 2; }
.separator { fill: none; stroke: #c8c7dc; }
.draw { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--progress, 0)); }
.step-disc { fill: var(--brand); }
.step-number { fill: #fff; text-anchor: middle; font-size: 14px; font-weight: 700; }
.lens, .point { fill: var(--brand); font-size: 22px; font-weight: 700; }
.point { text-anchor: middle; }
.rail { fill: #c8c7dc; }
.muted { fill: #535568; }
figcaption { display: grid; place-items: center; min-height: 3.75em; padding: .5rem 1rem; text-align: center; border-top: 1px solid var(--line); }
.controls { display: flex; align-items: center; gap: clamp(.25rem, 1vw, .7rem); padding-block: 1rem; }
button { font: inherit; font-weight: 650; border: 0; border-radius: 5px; padding: .5rem .7rem; min-width: 5rem; background: var(--brand); color: #fff; cursor: pointer; }
input { flex: 1 1 auto; min-width: 0; margin: 0; accent-color: var(--brand); cursor: pointer; }
output { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: .85rem; color: #45475b; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
details { border-top: 1px solid var(--line); padding-top: .8rem; color: #45475b; }
summary { cursor: pointer; width: fit-content; }
#transcript { max-width: 65ch; }
[hidden] { display: none !important; }
#part { color: #45475b; font-size: .9rem; }
#tracking { color: #45475b; font-size: .9rem; }
#checkpoint, #complete { padding: clamp(18px, 4vw, 38px); border: 1px solid var(--line); border-radius: 9px; background: #f6f5fa; }
#checkpoint h2, #complete h2 { margin-top: 0; line-height: 1.15; }
fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
legend { font-weight: 650; margin-bottom: .75rem; }
fieldset label { display: flex; align-items: baseline; gap: .6rem; background: #fff; border: 1px solid var(--line); padding: .7rem; margin-bottom: .5rem; border-radius: 5px; cursor: pointer; }
fieldset input { flex: none; }
button:disabled { opacity: .55; cursor: default; }
.scene-title { font-size: 23px; font-weight: 650; letter-spacing: -.35px; fill: #24262d; }
.stage-marker { fill: var(--brand); }
.node-label { font-size: 25px; font-weight: 650; }
.diagram-node { will-change: opacity, transform; }
.diagram-muted { opacity: .18; }
.check-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

#scene-progress { margin: .65rem 0 -.55rem; color: #45475b; font-size: .9rem; }
#transcript h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
#transcript p { margin: .55rem 0; }

main { max-width: 1260px; }
.lecture-layout { display: grid; grid-template-columns: minmax(165px, 220px) minmax(0, 1fr); gap: clamp(16px, 3vw, 34px); }
.lecture-layout nav { align-self: start; position: sticky; top: 1rem; border-top: 1px solid var(--line); }
.lecture-layout nav h2 { margin: .8rem 0; font-size: .85rem; }
#toc { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
#toc button { width: 100%; text-align: start; background: transparent; color: #45475b; display: grid; grid-template-columns: 1.35rem 1fr; gap: .25rem; font-size: .85rem; padding: .5rem; }
#toc button:not(:disabled):hover, #toc button[aria-current="step"] { background: #eeedf8; color: var(--brand); }
#toc button[aria-current="step"] { opacity: 1; }
.controls button { display: grid; place-items: center; flex: none; width: 36px; height: 36px; min-width: 36px; padding: 7px; background: transparent; color: var(--brand); }
.controls button:not(:disabled):hover { background: #eeedf8; }
.controls #play { background: var(--brand); color: #fff; }
.controls #play:hover { background: #29218c; }
.controls svg { fill: currentColor; }
.controls .pause-icon, #play[data-playing="true"] .play-icon { display: none; }
#play[data-playing="true"] .pause-icon { display: inline; }
#mute svg { fill: none; stroke: currentColor; }
#mute .sound-off, #mute[aria-pressed="true"] .sound-on { display: none; }
#mute[aria-pressed="true"] .sound-off { display: inline; }
@media (max-width: 660px) {
  .lecture-layout { grid-template-columns: 1fr; }
  .lecture-layout nav { position: static; }
  #toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.player-name { float: right; color: var(--brand); font-size: .85rem; font-weight: 700; }

.diagram-surface { fill: #fff; stroke: #d9dbea; stroke-width: 1.5; }
.diagram-orbit { fill: none; stroke: #ececf7; stroke-width: 1; }
.diagram-ink { fill: none; stroke: var(--brand); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: var(--trace, 0); }
.diagram-link { fill: none; stroke: #9c9dcb; stroke-width: 1.6; stroke-dasharray: 3 5; }
.diagram-dot { fill: #d0d2e7; }
.diagram-accent { fill: var(--brand); }
.diagram-tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.diagram-label { fill: #30334b; font-size: 18px; font-weight: 620; }

main { padding: clamp(14px, 3vw, 32px); }
main > header h1 { font-size: clamp(1.65rem, 4vw, 2.5rem); margin: .3rem 0 .8rem; }
.lecture-layout { grid-template-columns: minmax(125px, 162px) minmax(0, 1fr); gap: clamp(12px, 3vw, 24px); }
@media (max-width: 660px) {
  .lecture-layout { grid-template-columns: 1fr; }
  .player-name { float: none; display: block; margin: 0 0 .5rem; padding: 0; }
  .lecture-layout nav h2 { margin: .45rem 0; }
}

.lecture-layout { grid-template-columns: minmax(145px, 184px) minmax(0, 1fr); }
.lecture-layout .course-toc-heading { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .9rem; }
#course-toc { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
#course-toc button { background: transparent; color: #45475b; width: 100%; text-align: left; display: flex; justify-content: space-between; gap: .45rem; font-size: .85rem; }
#course-toc button:hover, #course-toc button:focus-visible { background: #eeedf8; color: var(--brand); }
#course-toc button span { color: var(--brand); }
#course-invitation { width: min(31rem, calc(100% - 34px)); border: 1px solid var(--line); border-radius: 12px; padding: clamp(16px, 4vw, 32px); color: #24262d; background: #fff; }
#course-invitation::backdrop { background: #17172d82; }
#course-invitation h2 { margin: 0; line-height: 1.15; }
.course-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.course-actions form { margin: 0; }
.course-link { display: inline-flex; align-items: center; gap: .45em; background: var(--brand); color: #fff; border-radius: 6px; padding: .58rem .85rem; font-weight: 650; text-decoration: none; }
.course-link:hover { text-decoration: underline; }
.secondary-action { background: transparent; border: 1px solid var(--line); color: var(--brand); }
@media (max-width: 660px) {
  .lecture-layout { grid-template-columns: 1fr; }
  #course-toc { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

.cue-embedded main { padding-bottom: 8px; }
.cue-embedded .lecture-content > details { display: none; }
.cue-embedded .controls { padding-bottom: .3rem; }
.cue-embedded #tracking:empty { display: none; }

/* Stage-first Cue layout. The host frame follows the content height. */
main { padding: clamp(12px, 2vw, 24px); }
main > header h1 { font-size: clamp(1.35rem, 2.5vw, 2rem); margin: .15em 0 .65rem; }
#part { margin: 0 0 .48rem; }
#stage { aspect-ratio: 16 / 9; }
#scene-progress { margin: 0; }
#tracking:empty { display: none; }
#return-progress { width: 100%; margin-top: .7rem; }
.cue-sections { margin: 0; padding: 0; }
.cue-sections summary { font-size: .85rem; font-weight: 700; }
.lecture-layout .cue-sections nav { border: 0; position: static; }
.transport-meta { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; margin-top: .25rem; }
main:has(#lesson[hidden]) #sidebar-transport { display: none; }

@media (min-width: 661px) {
  .cue-sections summary { display: none; }
  #sidebar-transport { margin-top: .7rem; padding-top: .55rem; border-top: 2px solid #a7acd2; }
  #transport .controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; padding: 0; }
  #transport .controls button { justify-self: center; }
  #seek { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 660px) {
  .lecture-layout { gap: .65rem; }
  .cue-sidebar { grid-row: 2; }
  #return-progress { width: auto; margin: 0 0 .5rem; }
  #transport .controls { padding-block: .45rem 0; }
}
