@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/fonts/literata-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #e9edf0;
  --sheet: #f6f8f9;
  --ink: #1c2740;
  --slate: #5a6578;
  --rule: #c9d0d8;
  --mark: #f3e66b;
  --mark-ink: #1c2740;
  --danger: #a23a2a;
  --v0: #2f6f73; --v1: #7a3f6b; --v2: #8a6516; --v3: #4b6b2e; --v4: #9b4430; --v5: #3d4f8f;

  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Plex", system-ui, sans-serif;

  --s-1: 0.8125rem;
  --s0: 1rem;
  --s1: 1.1875rem;
  --s2: 1.5rem;
  --s3: 2.25rem;

  --gutter: 7.5rem;
  --margin: 15rem;
  --player-h: 4.5rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121826;
    --sheet: #182033;
    --ink: #dbe2ea;
    --slate: #93a0b3;
    --rule: #2c3750;
    --mark: #b8a93a;
    --mark-ink: #121826;
    --danger: #e0806c;
    --v0: #6fb5b8; --v1: #c58fb7; --v2: #d2ad5c; --v3: #94b874; --v4: #df8b73; --v5: #8fa1df;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--s0)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--sheet); padding: .5rem 1rem; z-index: 10; }

.shell { display: grid; grid-template-columns: 17rem 1fr; min-height: 100vh; }
body.has-player .shell { padding-bottom: var(--player-h); }

/* sidebar */
.side {
  border-right: 1px solid var(--rule);
  padding: 1.5rem 1.25rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
body.has-player .side { height: calc(100vh - var(--player-h)); }
.side-head { display: flex; justify-content: space-between; align-items: baseline; }
.wordmark { font: 600 var(--s2)/1 var(--serif); text-decoration: none; letter-spacing: -0.01em; }
.menu-toggle { display: none; }
.side-body { display: flex; flex-direction: column; flex: 1; margin-top: 1.5rem; }
.new-btn { align-self: stretch; text-align: center; }
.side-h { font: 500 var(--s-1)/1.3 var(--sans); color: var(--slate); margin: 1.75rem 0 .5rem; }
.ep-list, .series-list { list-style: none; margin: 0; padding: 0; }
.ep-list a, .series-list a {
  display: block; text-decoration: none; padding: .45rem .5rem; margin: 0 -.5rem; border-radius: 4px;
}
.ep-list a:hover, .series-list a:hover { background: var(--sheet); }
.ep-list a[aria-current="page"], .series-list a[aria-current="page"] { background: var(--sheet); box-shadow: inset 3px 0 0 var(--ink); }
.ep-title { display: block; font: 400 .9375rem/1.3 var(--serif); }
.ep-sub { display: block; font-size: var(--s-1); color: var(--slate); margin-top: .15rem; }
.ep-sub .bar { display: block; height: 2px; background: var(--rule); margin-top: .35rem; }
.ep-sub .bar i { display: block; height: 100%; background: var(--ink); transition: width .4s; }
.side-link { display: inline-block; font-size: var(--s-1); color: var(--slate); margin-top: .75rem; }
.side-foot { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; gap: .25rem; }
.mode { font-size: var(--s-1); color: var(--slate); }
.empty-note { font-size: var(--s-1); color: var(--slate); }

/* main */
main { padding: 3rem clamp(1.25rem, 4vw, 4rem) 6rem; min-width: 0; }
main:focus { outline: none; }
.page { max-width: calc(var(--gutter) + 40rem + var(--margin) + 4rem); }
.narrow { max-width: 40rem; }

h1 { font: 600 var(--s3)/1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 .75rem; max-width: 30ch; }
h2 { font: 600 var(--s1)/1.3 var(--serif); margin: 2.5rem 0 .75rem; }
p { margin: 0 0 1rem; max-width: 65ch; }
.lede { font: 400 var(--s1)/1.55 var(--serif); color: var(--slate); max-width: 55ch; }

/* forms */
label, .label { display: block; font-weight: 500; margin-bottom: .35rem; }
.hint { display: block; font-size: var(--s-1); color: var(--slate); font-weight: 400; margin-top: .15rem; }
.field { margin-bottom: 1.5rem; }
textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: .6rem .75rem;
}
textarea:focus, input:focus, select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 1px var(--ink); }
textarea.big { font: 400 var(--s1)/1.5 var(--serif); min-height: 7rem; resize: vertical; }
input[type="number"] { width: 6rem; }
.row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.row > .field { flex: 1 1 12rem; }

.drop {
  border: 1px dashed var(--slate); border-radius: 4px; padding: 1.25rem; text-align: center; color: var(--slate);
  cursor: pointer;
}
.drop.over { background: var(--sheet); border-style: solid; color: var(--ink); }
.files { list-style: none; padding: 0; margin: .5rem 0 0; font-size: var(--s-1); }
.files li { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border-bottom: 1px solid var(--rule); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span {
  display: block; padding: .4rem .7rem; border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; font-size: .9375rem;
}
.chip span small { display: block; color: var(--slate); font-size: var(--s-1); }
.chip input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--sheet); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

details.more { margin: 1rem 0 2rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
details.more summary { cursor: pointer; font-weight: 500; }
details.more[open] summary { margin-bottom: 1.25rem; }

.btn {
  display: inline-block; border: 1px solid var(--ink); background: transparent; border-radius: 4px;
  padding: .55rem 1.1rem; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-quiet { border-color: transparent; color: var(--slate); padding-inline: .5rem; }
.btn-quiet:hover { color: var(--ink); }
.btn-danger { border-color: transparent; color: var(--danger); padding-inline: .5rem; }
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.error { color: var(--danger); }

/* progress: real sequence of stages */
.stages { list-style: none; padding: 0; margin: 2rem 0; counter-reset: st; max-width: 34rem; }
.stages li {
  counter-increment: st; display: grid; grid-template-columns: 2rem 1fr; gap: .25rem .75rem; padding: .7rem 0;
  border-bottom: 1px solid var(--rule); color: var(--slate);
}
.stages li::before { content: counter(st); font: 400 var(--s1)/1.2 var(--serif); }
.stages li.now { color: var(--ink); }
.stages li.now::before { background: var(--mark); color: var(--mark-ink); text-align: center; border-radius: 2px; }
.stages li.done { color: var(--ink); }
.stages li.done::before { content: "✓"; }
.stages .st-name { font-weight: 500; }
.stages .st-msg { grid-column: 2; font-size: var(--s-1); color: var(--slate); }
.log { font-size: var(--s-1); color: var(--slate); max-width: 40rem; }
.log summary { cursor: pointer; }
.log ol { padding-left: 1.25rem; }

/* episode header */
.ep-head { max-width: calc(var(--gutter) + 40rem); }
.ep-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .9375rem; color: var(--slate); margin-bottom: 1.25rem; }
.ep-meta b { font-weight: 500; color: var(--ink); }
.why { font: italic 400 var(--s0)/1.55 var(--serif); color: var(--slate); max-width: 60ch; }

.cast { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.cast li { max-width: 18rem; font-size: .9375rem; }
.cast .who { font-weight: 600; color: var(--vc); }
.cast .what { display: block; color: var(--slate); font-size: var(--s-1); }

.sources { counter-reset: src; list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.sources li { display: grid; grid-template-columns: 2.25rem 1fr; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.sources .n { font: 400 var(--s0)/1.4 var(--serif); color: var(--slate); }
.sources .t { font: 400 var(--s0)/1.4 var(--serif); }
.sources .a { display: block; font-size: var(--s-1); color: var(--slate); }
.sources .w { display: block; font-size: var(--s-1); color: var(--slate); font-style: italic; margin-top: .2rem; }

.tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--rule); margin: 2.5rem 0 1.5rem; }
.tabs button { background: none; border: 0; padding: .6rem 0; cursor: pointer; color: var(--slate); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }

/* the manuscript */
.script { position: relative; }
.line {
  display: grid; grid-template-columns: var(--gutter) minmax(0, 40rem) var(--margin); column-gap: 2rem;
  padding: .3rem 0; cursor: pointer;
}
.line + .line.turn { margin-top: .9rem; }
.spk { font: 500 var(--s-1)/1.9 var(--sans); color: var(--vc); text-align: right; padding-top: .1rem; }
.line:not(.turn) .spk { visibility: hidden; }
.txt { font: 400 var(--s1)/1.65 var(--serif); }
.txt mark { background: none; color: inherit; }
.line.now .txt mark {
  background: linear-gradient(to bottom, transparent 12%, var(--mark) 12%, var(--mark) 92%, transparent 92%);
  color: var(--mark-ink);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .2s;
}
.line:hover .txt { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .3em; }
.ref {
  font: 400 var(--s-1)/1.45 var(--serif); color: var(--slate); border-left: 1px solid var(--rule); padding-left: .75rem;
  align-self: start; margin-top: .3rem;
}
.ref + .ref { margin-top: .5rem; }
.refs { display: flex; flex-direction: column; gap: .6rem; }
.ref q { font-style: italic; quotes: "“" "”"; }
.ref .cite { display: block; font-family: var(--sans); font-size: .75rem; margin-top: .2rem; }
.ref .cite a { color: var(--slate); }
.line.now .ref { border-left-color: var(--ink); color: var(--ink); }
.time { display: block; font: 400 .75rem/1 var(--sans); color: var(--slate); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.line:not(.turn) .time { display: none; }

.aside {
  display: grid; grid-template-columns: var(--gutter) minmax(0, 40rem) var(--margin); column-gap: 2rem; margin: 1.25rem 0;
}
.aside .q { grid-column: 2; font: italic 400 var(--s0)/1.5 var(--serif); padding: .75rem 1rem; border-left: 3px solid var(--ink); background: var(--sheet); }
.aside .q b { font-style: normal; font-family: var(--sans); font-weight: 500; font-size: var(--s-1); display: block; color: var(--slate); }
.aside .a { grid-column: 1 / -1; }
.aside .line { padding-left: 0; }

/* ask */
.ask { display: grid; grid-template-columns: var(--gutter) minmax(0, 40rem); column-gap: 2rem; margin-top: 2.5rem; }
.ask form { grid-column: 2; }
.ask .actions { margin-top: .75rem; }

/* curriculum: a real sequence */
.curr { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: c; max-width: 44rem; }
.curr li { counter-increment: c; display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .25rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.curr li::before { content: counter(c); font: 400 var(--s2)/1.1 var(--serif); color: var(--slate); }
.curr .ct { font: 600 var(--s0)/1.35 var(--serif); }
.curr .cg { display: block; color: var(--slate); font-size: .9375rem; margin-top: .2rem; }
.covered { font-size: .9375rem; color: var(--slate); max-width: 44rem; }

/* player */
.player {
  position: fixed; inset: auto 0 0 0; height: var(--player-h); background: var(--sheet); border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.25rem; padding: 0 clamp(1rem, 3vw, 2rem);
  z-index: 5;
}
.pl-play {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); cursor: pointer;
  display: grid; place-items: center;
}
.pl-play svg { width: 1rem; height: 1rem; fill: currentColor; }
.pl-mid { min-width: 0; }
.pl-title { font: 400 .9375rem/1.2 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-track { display: flex; align-items: center; gap: .75rem; font-size: var(--s-1); color: var(--slate); font-variant-numeric: tabular-nums; margin-top: .3rem; }
.pl-track input[type="range"] { flex: 1; accent-color: var(--ink); }
.pl-right { display: flex; gap: .5rem; align-items: center; }
.pl-rate { background: none; border: 1px solid var(--rule); border-radius: 4px; padding: .3rem .5rem; cursor: pointer; font-size: var(--s-1); min-width: 3.25rem; font-variant-numeric: tabular-nums; }
.pl-skip { background: none; border: 0; cursor: pointer; color: var(--slate); font-size: var(--s-1); padding: .3rem; }
.pl-skip:hover, .pl-rate:hover { color: var(--ink); }

.center { min-height: 60vh; display: grid; place-items: center; }

@media (max-width: 1180px) {
  :root { --margin: 0rem; }
  .line { grid-template-columns: var(--gutter) minmax(0, 40rem); }
  .refs { grid-column: 2; flex-direction: row; flex-wrap: wrap; gap: .5rem 1rem; }
  .ref { max-width: 20rem; display: none; }
  .line.now .ref, .line.open .ref { display: block; }
}
@media (max-width: 760px) {
  :root { --gutter: 0rem; --player-h: 6.5rem; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 1rem 1.25rem; }
  body.has-player .side { height: auto; }
  .menu-toggle { display: inline-block; background: none; border: 1px solid var(--rule); border-radius: 4px; padding: .3rem .7rem; cursor: pointer; font-size: var(--s-1); }
  .side-body { display: none; }
  .side.open .side-body { display: flex; }
  main { padding-top: 1.5rem; }
  h1 { font-size: 1.75rem; }
  .line, .aside, .ask { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
  .spk { text-align: left; }
  .line:not(.turn) .spk { display: none; }
  .refs, .aside .q, .ask form { grid-column: 1; }
  .player { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; height: auto; padding-block: .6rem; row-gap: .4rem; }
  .pl-right { grid-column: 1 / -1; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.link-btn { display: block; text-decoration: underline; color: var(--slate); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.welcome-list { list-style: none; padding: 0; margin: 1.5rem 0 2rem; }
.welcome-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.welcome-list a { font: 400 var(--s1)/1.35 var(--serif); text-decoration: none; }
.welcome-list a:hover { text-decoration: underline; }
.welcome-list .hint { white-space: nowrap; }
