/* Editorial type system for the existing 15-episode story.
   Scope excludes the approved opening. Values are roles, not per-frame guesses.
   Chapter → episode point → introduction → explanation → annotation.
   All sizes are rem-based or fluid with rem bounds; no fit-to-box shrinking. */
:root {
  --story-type-title: clamp(3rem, 3.65vw, 4rem);
  --story-type-point: clamp(1.75rem, 1.9vw, 2rem);
  --story-type-lead: 1.25rem;
  --story-type-body: 1.125rem;
  --story-type-figure: clamp(1.5rem, 1.7vw, 1.875rem);
  --story-type-caption: 1rem;
  --story-type-label: 0.875rem;
  --story-type-nav: 1rem;
  --story-type-title-ink: #f7f4ef;
  --story-type-emphasis: #f1cca0;
  --story-type-body-ink: #d5e3e9;
  --story-type-note-ink: #b8ced8;
  --story-type-link-ink: #addce8;
  --story-reading-line: 58ch;
  --story-title-leading: 1.08;
  --story-body-leading: 1.58;
  --guide-height: 4.25rem;
}
.episode .stage15 {
  padding: calc(var(--guide-height) + 2rem) var(--page) 2rem;
  grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
  gap: clamp(2rem, 3.3vw, 4rem);
  align-items: start;
  min-height: 100svh;
}
.episode .copy15 {
  align-self: start;
  max-width: 42rem;
  padding: 0;
  font-family: var(--font);
}
.episode .copy15 .chapter-heading {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: 1rem;
  font-family: var(--font);
  font-size: var(--story-type-title);
  font-weight: 600;
  line-height: var(--story-title-leading);
  letter-spacing: -0.035em;
  text-transform: none;
  color: var(--story-type-title-ink);
  margin: 0 0 1.5rem;
  max-width: none;
  text-wrap: balance;
}
.episode .copy15 .chapter-heading b {
  font-size: 0.48em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--story-type-emphasis);
  font-variant-numeric: tabular-nums lining-nums;
  padding-top: 0.18em;
  position: relative;
}
.episode .copy15 .chapter-heading b::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 0.48em;
  background: currentColor;
  opacity: 0.75;
}
.episode .copy15 .chapter-heading span {
  min-width: 0;
  text-wrap: balance;
}
.episode .copy15 .episode-point {
  font-family: var(--font);
  font-size: var(--story-type-point);
  line-height: 1.22;
  font-weight: 500;
  letter-spacing: -0.022em;
  margin: 0 0 1rem;
  color: var(--story-type-emphasis);
  text-wrap: pretty;
  max-width: 32ch;
}
.episode .copy15 .episode-point br {
  display: none;
}
.episode .copy15 .episode-point em {
  font-style: normal;
  color: inherit;
  font-weight: inherit;
}
.episode .copy15 .guide-lead {
  font-size: var(--story-type-lead);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--story-type-title-ink);
  max-width: var(--story-reading-line);
  margin: 0 0 1.375rem;
  text-wrap: pretty;
}
.episode .copy15 .narrative {
  font-size: var(--story-type-body);
  font-weight: 400;
  line-height: var(--story-body-leading);
  letter-spacing: 0;
  color: var(--story-type-body-ink);
  max-width: var(--story-reading-line);
  margin: 0;
  text-wrap: pretty;
}
.episode .copy15 .narrative p {
  margin: 0 0 1rem;
}
.episode .copy15 .narrative p:last-child {
  margin-bottom: 0;
}
.episode .copy15 .meaning {
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: var(--story-type-caption);
  line-height: 1.5;
  max-width: var(--story-reading-line);
}
.episode .guide-next {
  border-top: 1px solid #89a7b15e;
  padding: 1rem 2rem 0 0;
  min-height: 4.25rem;
}
.episode .guide-next .next-label {
  font-size: var(--story-type-label);
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: none;
  color: var(--story-type-emphasis);
  margin: 0 0 0.5rem;
}
.episode .guide-next .next-copy {
  font-size: var(--story-type-caption);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--story-type-body-ink);
}
.episode .guide-next .next-arrow {
  font-size: 1.75rem;
  line-height: 1;
  top: 1rem;
  right: 0;
}
.episode .visual-runway {
  align-self: stretch;
  min-width: 0;
}
.episode .figure15 {
  max-width: none;
  width: 100%;
  margin: 0;
  align-self: start;
}
.episode .guide-figure-heading {
  min-height: 5.75rem;
  padding: 0 0.5rem;
  margin: 0 0 0.75rem;
}
.episode .guide-example {
  font-size: var(--story-type-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.035em;
  text-transform: none;
  color: var(--story-type-note-ink);
  margin: 0 0 0.5rem;
}
.episode .guide-figure-heading h4 {
  font-family: var(--font);
  font-size: var(--story-type-figure);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--story-type-title-ink);
  margin: 0;
  max-width: 40ch;
  text-wrap: pretty;
}
.episode .figure15 .art15 {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 900/530;
  margin: 0.25rem auto 1rem;
  transform: none;
}
.episode .art15 svg {
  font-family: var(--font);
}
.episode .art15 svg text {
  paint-order: normal;
  stroke: none;
  letter-spacing: 0;
}
.episode .figure15 figcaption {
  font-size: var(--story-type-caption);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--story-type-body-ink);
  text-align: left;
  max-width: 68ch;
  min-height: 0;
  padding: 0;
  margin: 1rem 0.5rem 0;
  text-wrap: pretty;
}
.episode .phase-track {
  padding: 0 0.5rem;
  gap: 1rem;
}
.episode .phase-track button {
  font-size: var(--story-type-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  min-height: 3rem;
  padding: 0.75rem 0 0.25rem;
  gap: 0.5rem;
  color: var(--story-type-note-ink);
}
.episode .phase-track button b {
  font-size: 0.875em;
  font-weight: 500;
  opacity: 1;
  color: inherit;
}
.episode .phase-track button.active {
  color: var(--story-type-emphasis);
  border-top-color: var(--story-type-emphasis);
}
.episode .guide-follow {
  font-size: var(--story-type-label);
  color: var(--story-type-note-ink);
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0.625rem 0.5rem 0;
  min-height: 2.75rem;
  gap: 1rem;
}
.episode .guide-follow button {
  font-size: var(--story-type-label);
  font-weight: 500;
  min-height: 2.75rem;
  line-height: 1.4;
  padding: 0.5rem 0 0.5rem 0.5rem;
}
.episode .final-voice {
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--story-type-title-ink);
  margin: 1.5rem 0 0;
  padding-top: 1rem;
}
.episode .final-voice > a {
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  display: inline-block;
  min-height: 2.75rem;
}
.episode[data-episode="14"] .stage15 {
  padding-bottom: 7.5rem;
}
/* The top navigation is navigation, not the chapter heading itself. */
.guidebar {
  gap: 2rem;
}
.guide-home,
.guide-home .home-word {
  font-size: var(--story-type-nav);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}
.guide-desktop a {
  font-size: var(--story-type-nav);
  font-weight: 500;
  line-height: 1.3;
  color: var(--story-type-note-ink);
  gap: 0.5rem;
}
.guide-desktop a b {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--story-type-note-ink);
}
.guide-desktop a[aria-current="step"],
.guide-desktop a[aria-current="step"] b {
  color: var(--story-type-emphasis);
}
.guide-chapters h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--story-type-title-ink);
}
.guide-chapters > p {
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--story-type-body-ink);
}
.guide-chapters nav a strong {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
}
.guide-chapters nav a small {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--story-type-body-ink);
}
.guide-chapters nav a b {
  font-size: 1rem;
  line-height: 1.6;
}
.guide-reading button {
  font-size: 1rem;
  line-height: 1.4;
}
/* If readable content is taller than the screen, let it flow. Never hide it
   or shrink it to fit a fixed 100vh box. Runtime sets type-flow after measuring. */
.episode.type-flow {
  height: auto !important;
  min-height: 0;
}
.episode.type-flow .stage15 {
  position: relative;
  height: auto;
  min-height: 0;
}
.episode.type-flow .figure15 {
  position: sticky;
  top: calc(var(--guide-height) + 1.5rem);
}
.episode.type-tall-figure .figure15 {
  position: relative;
  top: auto;
}
@media (max-width: 1100px) {
  :root {
    --story-type-title: 3rem;
    --story-type-point: 1.875rem;
    --story-type-lead: 1.25rem;
  }
  .guidebar {
    gap: 1rem;
    padding-inline: 1.5rem;
  }
  .guide-desktop {
    gap: 0.75rem;
  }
  .guide-desktop a {
    font-size: 0.875rem;
  }
  .guide-desktop a b {
    display: none;
  }
  .episode {
    height: auto !important;
    min-height: 0;
    padding: 0;
  }
  .episode .stage15 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 0;
    padding: calc(var(--guide-height) + 2rem) 2rem 3rem;
    gap: 2.5rem;
  }
  .episode .copy15 {
    align-self: center;
    max-width: 42rem;
    width: 100%;
  }
  .episode .visual-runway {
    width: 100%;
    max-width: 50rem;
    margin: 0 auto;
    min-height: 0;
  }
  .episode .figure15 {
    position: relative;
    top: 0;
  }
  .episode .guide-figure-heading {
    min-height: 0;
    margin-bottom: 1rem;
  }
  .episode .figure15 .art15 {
    max-width: 100%;
  }
  .episode[data-episode="14"] .stage15 {
    padding-bottom: 3rem;
  }
}
@media (max-width: 760px) {
  :root {
    --story-type-title: clamp(2.375rem, calc(8.2vw + 0.5rem), 3rem);
    --story-type-point: 1.625rem;
    --story-type-lead: 1.1875rem;
    --story-type-body: 1.125rem;
    --story-type-figure: 1.5rem;
    --story-type-caption: 1rem;
    --story-type-label: 0.875rem;
    --guide-height: 4.5rem;
  }
  .guidebar {
    padding-inline: 1rem;
    gap: 0.75rem;
  }
  .guide-mobile small {
    font-size: 0.75rem;
    line-height: 1.35;
    letter-spacing: 0.04em;
    color: var(--story-type-note-ink);
  }
  .guide-mobile strong {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
  }
  .guide-open {
    font-size: 0.875rem;
    line-height: 1.2;
    min-height: 2.75rem;
    padding: 0 0.75rem;
  }
  .episode .stage15 {
    padding: calc(var(--guide-height) + 1.5rem) 1.375rem 2.5rem;
    gap: 2rem;
  }
  .episode .copy15 .chapter-heading {
    column-gap: 0.625rem;
    line-height: 1.1;
    margin-bottom: 1.375rem;
    letter-spacing: -0.035em;
  }
  .episode .copy15 .chapter-heading b {
    font-size: 0.48em;
  }
  .episode .copy15 .episode-point {
    margin-bottom: 1rem;
    line-height: 1.22;
  }
  .episode .copy15 .guide-lead {
    line-height: 1.5;
    margin-bottom: 1.25rem;
  }
  .episode .copy15 .narrative {
    line-height: 1.6;
  }
  .episode .copy15 .meaning {
    margin-top: 1.5rem;
  }
  .episode .visual-runway {
    min-height: 0 !important;
    height: auto !important;
  }
  .episode .figure15 {
    position: relative !important;
    top: 0 !important;
    background: linear-gradient(180deg, #061d2ade, transparent 80%);
    padding-top: 0.75rem;
  }
  .episode .guide-figure-heading {
    min-height: 0;
    padding: 0;
    margin-bottom: 1rem;
  }
  .episode .guide-example {
    font-size: 0.875rem;
    line-height: 1.4;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
  }
  .episode .guide-figure-heading h4 {
    font-size: var(--story-type-figure);
    line-height: 1.25;
  }
  .episode .figure15 .art15 {
    aspect-ratio: 520/632;
    margin: 0 0 1rem;
  }
  .episode .phase-track {
    padding: 0;
    gap: 0.625rem;
  }
  .episode .phase-track button {
    font-size: 0.875rem;
    line-height: 1.4;
    min-height: 3rem;
    padding: 0.75rem 0 0.25rem;
  }
  .episode .phase-track button b {
    display: none;
  }
  .episode .figure15 figcaption {
    font-size: 1rem;
    line-height: 1.55;
    margin: 1rem 0 0;
    min-height: 0;
  }
  .episode .guide-follow {
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0.625rem 0 0;
    align-items: start;
    flex-wrap: wrap;
  }
  .episode .guide-follow button {
    font-size: 0.875rem;
    padding: 0.5rem 0;
  }
  .episode .final-voice {
    font-size: 1.25rem;
    line-height: 1.45;
  }
  .signature-final {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 1.5rem;
  }
}
@media (max-width: 359px) {
  .episode .stage15 {
    padding-inline: 1rem;
  }
  .guidebar {
    padding-inline: 0.625rem;
    gap: 0.5rem;
  }
  .guide-mobile {
    gap: 0.375rem;
  }
  .guide-mobile strong {
    font-size: 0.875rem;
  }
  .guide-mobile small {
    font-size: 0.6875rem;
  }
  .guide-open {
    padding: 0 0.625rem;
    font-size: 0.8125rem;
  }
}
.no-js .episode .stage15 {
  position: relative;
  height: auto;
  min-height: 0;
}
.no-js .episode .figure15 {
  position: relative;
  top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .episode {
    height: auto !important;
    min-height: 0;
  }
  .episode .stage15 {
    position: relative;
    height: auto;
    min-height: 0;
  }
  .episode .figure15 {
    position: relative;
    top: 0;
  }
}
/* Fit the figure's surrounding text before reducing the diagram itself. */
.episode .guide-figure-heading {
  min-height: 4.25rem;
}
@media (min-width: 1400px) {
  .episode .figure15 .art15 {
    max-width: min(
      100%,
      max(36rem, calc((100svh - var(--guide-height) - 24.25rem) * 1.6981132))
    );
  }
}
@media (max-width: 760px) {
  .episode .copy15 .chapter-heading {
    grid-template-columns: 1fr;
    row-gap: 0.625rem;
    font-size: clamp(2.375rem, 9.75vw, 2.75rem);
  }
  .episode .copy15 .chapter-heading b {
    font-size: 1.375rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
  }
  .episode .copy15 .chapter-heading b::after {
    width: 2.25rem;
    margin: 0;
    height: 1px;
  }
  .episode .guide-figure-heading {
    min-height: 0;
  }
}
/* Programmatic chapter targets are not controls; keyboard links keep focus rings. */
.episode .chapter-heading[tabindex="-1"]:focus {
  outline: none;
}

.episode.type-flow .figure15 .art15 {
  max-width: 100%;
}
@media (min-width: 761px) and (max-width: 1100px) {
  .guide-desktop {
    display: none;
  }
  .guide-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 1;
    min-width: 0;
  }
  .guide-mobile small {
    display: block;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--story-type-note-ink);
  }
  .guide-mobile strong {
    display: block;
    font-size: 1.125rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--story-type-emphasis);
  }
  .guide-open {
    font-size: 1rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid #88b8cb60;
    border-radius: 2rem;
  }
}

@media (min-width: 1101px) {
  .episode .guide-figure-heading {
    min-height: 6.5rem;
  }
  .episode .figure15 figcaption {
    min-height: 4.5rem;
  }
}
/* Existing hero glass extends by 3 px at one laptop width; clip only the
   off-viewport paint, without changing its layout or approved composition. */
#opening {
  overflow-x: clip;
}
.episode .chapter-heading span,
.episode .episode-point {
  overflow-wrap: anywhere;
}
.guidebar.type-compact .guide-desktop {
  display: none;
}
.guidebar.type-compact .guide-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.guidebar.type-compact .guide-mobile small {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--story-type-note-ink);
}
.guidebar.type-compact .guide-mobile strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--story-type-emphasis);
}
.guidebar.type-compact .guide-open {
  font-size: 1rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid #88b8cb60;
  border-radius: 2rem;
}
/* Inspection controls stay beside the caption, away from floating utilities. */
.episode .guide-follow {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.episode .guide-follow button {
  margin-left: 0.25rem;
}
