/* Open node: a fixed panel that grows out of its card. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--scrim);
  opacity: 0;
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: var(--panel);
}
.panel[hidden], .scrim[hidden], .panel-ring[hidden] { display: none; }
.panel-box {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-ring {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 26;
  border: 1px solid var(--line-strong);
  pointer-events: none;
  transform-origin: 0 0;
}
@media (max-width: 700px) { .panel-ring { border: 0; } }

.panel-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--panel);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
  mask-image: linear-gradient(to bottom, #000 72%, transparent);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
}
.crumbs a, .crumbs span {
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs a { color: var(--text-3); transition: color 150ms ease; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-3); flex: none; }
.crumbs [aria-current] { color: var(--text); }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.panel-content {
  max-width: var(--measure, 1080px);
  margin: 0 auto;
  padding: 84px 56px 96px;
}
.panel-content.is-swapping { opacity: 0; transform: translateY(6px); }
.panel-content, .crumbs { transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out); }
.crumbs.is-swapping { opacity: 0; }

@media (max-width: 700px) {
  .panel-content { padding: 72px 20px 80px; }
  .panel-bar { padding: 12px 14px; }
}

/* Panel typography. Large, quiet, built for reading at a glance. */
.p-eyebrow {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-3);
}
.p-title {
  margin: 0;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.0;
  font-weight: 600;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.p-title:focus { outline: none; }
.p-link { color: inherit; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .p-link:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.16em; text-decoration-color: var(--line-strong); }
}
.p-lead {
  margin: 22px 0 0;
  max-width: 40ch;
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--text-2);
  text-wrap: pretty;
}
.p-section { margin-top: 72px; }
.p-section:first-child { margin-top: 0; }
.p-h2 {
  margin: 0 0 22px;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.p-h2 .t {
  margin-left: 14px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-3);
  white-space: nowrap;
}
.p-text {
  margin: 0 0 16px;
  max-width: 62ch;
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
  text-wrap: pretty;
}
.p-text.muted { color: var(--text-2); }
.p-text code, .note-v code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.prose .p-text { font-size: 21px; line-height: 1.62; max-width: 60ch; }
.prose .p-text:first-child { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.4; letter-spacing: -0.012em; }

.p-list { margin: 0; padding: 0; list-style: none; max-width: 64ch; }
.p-list li {
  position: relative;
  padding: 10px 0 10px 22px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
  border-top: 1px solid var(--line);
}
.p-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 21px;
  width: 6px;
  height: 1px;
  background: var(--text-3);
}

/* Tables: readable at large sizes, wrap long descriptions, become cards on narrow screens. */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
  line-height: 1.5;
}
.tbl th {
  padding: 0 18px 12px 0;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  color: var(--text-3);
  border-bottom: 1px solid var(--line-strong);
  vertical-align: bottom;
}
.tbl td {
  padding: 16px 18px 16px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.tbl .k { width: 22%; color: var(--text-2); font-weight: 500; }
.tbl .time { width: 9.5em; font-family: var(--mono); font-size: 14px; color: var(--text-2); white-space: nowrap; }
.tbl .alt { color: var(--text-2); }

.facts .tbl td { font-size: 18px; }

@media (max-width: 760px) {
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: auto; }
  .tbl thead { display: none; }
  .tbl tr {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .tbl td { padding: 4px 0; border: 0; }
  .tbl td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin: 8px 0 2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
  }
  .tbl td.time { white-space: normal; }
  .tbl .k { width: auto; }
}


/* Group indexes: a contents list. */
.index { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.index li { border-top: 1px solid var(--line); }
.ix { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 22px 0 24px; text-decoration: none; }
.ix-kicker { grid-column: 1; font-size: 15px; font-weight: 500; color: var(--text-3); }
.ix-title { grid-column: 1; font-size: 28px; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; transition: color 160ms ease; }
.ix-text { grid-column: 1; max-width: 56ch; margin-top: 4px; font-size: 17px; line-height: 1.45; color: var(--text-2); }
.ix-text.mono { font-family: var(--mono); font-size: 15px; }
.ix-go { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 22px; height: 22px; color: var(--text-3); transition: color 160ms ease, transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ix:hover .ix-title { color: var(--accent-text); }
  .ix:hover .ix-go { color: var(--accent-text); transform: translateX(4px); }
}

/* Root panel. */
.cover { text-align: left; }
.cover-ring { width: min(420px, 80%); height: auto; aspect-ratio: 15 / 8; margin: 0 0 28px -8px; display: block; }
.cover-ring:has(.root-img) { width: min(600px, 100%); aspect-ratio: 1; margin-left: -12px; }
.cover-ring .root-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cover .p-title { letter-spacing: 0.12em; font-size: clamp(44px, 8vw, 84px); }
.cover .p-lead { max-width: none; }
.cover-aha {
  margin: 36px 0 0;
  max-width: 20ch;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.cover-aha::before { content: "\201C"; margin-left: -0.42em; color: var(--accent); }
.cover-aha::after { content: "\201D"; color: var(--accent); }

/* Notes column next to a post recreation. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 600px);
  gap: 56px;
  align-items: start;
  margin-top: 48px;
}
.split.two-posts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
@media (max-width: 1000px) {
  .split, .split.two-posts { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
.notes { display: grid; gap: 0; }
.note { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.note-k {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
}
.note-v { display: block; font-size: 18px; line-height: 1.55; color: var(--text); text-wrap: pretty; }
.note-v.mono { font-family: var(--mono); font-size: 15px; white-space: pre-wrap; }

.post-wrap { min-width: 0; }
.proposed {
  margin: 0 0 14px;
  font-size: 16px;
  font-style: italic;
  color: var(--text-3);
}

/* Media slot: an empty, labelled frame. */
.slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--slot);
  color: var(--text-3);
  overflow: hidden;
}
.slot-label {
  max-width: 80%;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

/* Storyboard. */
.sb-scene { margin-top: 88px; }
.sb-scene-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 14px; }
.sb-scene-num {
  font-size: 17px;
  font-weight: 500;
  color: var(--accent-text);
}
.sb-cols, .sb-beat {
  display: grid;
  grid-template-columns: 8.6em minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 28px;
}
.has-stills .sb-cols, .has-stills .sb-beat { grid-template-columns: 8.6em 196px minmax(0, 1fr) minmax(0, 1.35fr); gap: 24px; }
.sb-still { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; display: block; }
.sb-still-btn { display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: 6px; cursor: zoom-in; transition: transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .sb-still-btn:hover { transform: translateY(-1px); } }
.sb-still-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Lightbox: the still at its full size over a dimmed board, out on click or Esc. */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--scrim);
  cursor: zoom-out;
  touch-action: none;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity 220ms var(--ease-out);
}
.lightbox.is-on { opacity: 1; }
/* Hidden means gone: the author display rule above would otherwise beat the hidden attribute and
   leave an invisible layer over the whole page, eating every scroll and click after the first close. */
.lightbox[hidden] { display: none; }
.lightbox:not(.is-on) { pointer-events: none; }
.lb-img {
  display: block; max-width: min(1600px, 100%); max-height: 100%;
  border-radius: 10px;
  box-shadow: var(--panel-shadow);
  transform: scale(0.98);
  transition: transform 220ms var(--ease-out);
}
.lightbox.is-on .lb-img { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lb-img, .sb-still-btn { transition: none; }
}
.sb-cols {
  margin-top: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
}
.sb-beat {
  position: relative;
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}
.sb-time { font-family: var(--mono); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.sb-tag {
  display: block;
  margin-top: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-2);
}
.sb-vo, .sb-vis { font-size: 17px; line-height: 1.55; min-width: 0; }
.sb-vo p, .sb-vis p { margin: 0 0 10px; text-wrap: pretty; }
.sb-vo p:last-child, .sb-vis p:last-child { margin-bottom: 0; }
.sb-vis p { color: var(--text-2); }
.sb-vis p:first-child { color: var(--text); }
.cue {
  display: block;
  margin-bottom: 1px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
/* AHA beats: a single pencil rule in the margin, the line set in ink above the beat. */
.sb-beat.is-aha {
  margin-left: -24px;
  padding-left: 22px;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sb-aha {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--accent-text);
}
.sb-aha b { font-weight: 650; }
.sb-endnotes { margin-top: 28px; }
.runtime {
  margin-top: 28px;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-2);
}
/* Contents line: plain text links. */
.sb-toc { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; }
.sb-toc a {
  font-size: 17px;
  color: var(--text-2);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}
.sb-toc a:hover { color: var(--text); text-decoration-color: var(--line-strong); }

@media (max-width: 1100px) {
  .sb-cols { display: none; }
  .sb-beat { grid-template-columns: 8.6em minmax(0, 1fr); gap: 14px 20px; }
  .has-stills .sb-beat { grid-template-columns: 8.6em minmax(0, 1fr); }
  .sb-still-cell { grid-column: 2; max-width: 360px; }
  .sb-vo, .sb-vis { grid-column: 2; }
}
@media (max-width: 640px) {
  .sb-beat {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 20px 0 22px;
  }
  .has-stills .sb-beat { grid-template-columns: minmax(0, 1fr); }
  .sb-beat.is-aha { margin-left: -14px; padding-left: 12px; }
  .sb-still-cell, .sb-vo, .sb-vis { grid-column: 1; max-width: none; }
  .sb-time { display: flex; align-items: center; gap: 10px; }
  .sb-tag { margin-top: 0; }
}

/* Run sheet. */
.rs { margin-top: 48px; }
.rs-scroll {
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  border-top: 1px solid var(--line-strong);
}
.rs-grid { position: relative; display: grid; min-width: max-content; }
.rs-row { display: contents; }
.rs-who {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 16px 20px 16px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.rs-who b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.008em; }
.rs-who span { display: block; font-size: 14px; color: var(--text-2); }
.rs-tz {
  position: sticky;
  left: 210px;
  z-index: 2;
  padding: 16px 18px 16px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-2);
}
.rs-track {
  position: relative;
  border-bottom: 1px solid var(--line);
  min-height: 72px;
}
.rs-head {
  position: sticky;
  top: 0;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--panel);
  border-bottom: 1px solid var(--line-strong);
}
.rs-days { position: relative; }
.rs-day {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--line);
}
.rs-day.is-t0 { background: var(--accent-soft); border-left-color: var(--accent-line); }
.rs-daylabel { position: absolute; top: 12px; transform: translateX(10px); font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--text-3); white-space: nowrap; }
.rs-daylabel.is-t0 { color: var(--text); font-weight: 600; }
.rs-launch { display: block; margin-top: 2px; font-weight: 400; color: var(--text-3); }
.rs-ev {
  position: absolute;
  top: 50%;
  transform: translate(-0.5px, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--text-2);
}
.rs-ev::before {
  content: "";
  flex: none;
  width: 1px;
  height: 20px;
  background: var(--text-3);
}
.rs-ev .at { display: block; font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--text-3); }
.rs-ev.is-main { color: var(--text); font-weight: 600; }
.rs-ev.is-main::before { width: 2px; height: 28px; background: var(--accent); }
.rs-ev.is-main .at { color: var(--text-2); }
.rs-legend { margin-top: 18px; font-size: 15px; color: var(--text-2); }

@media (max-width: 700px) {
  .rs-tz { left: 150px; }
}

/* Small screens: the post comes first, the notes follow. */
@media (max-width: 1000px) {
  .split:not(.two-posts) .post-wrap { order: -1; }
}

/* The notes stay beside a long thread while it scrolls. */
@media (min-width: 1001px) {
  .split:not(.two-posts) > .notes { position: sticky; top: 76px; }
}

/* "Why him / Why her" above a post, outside the recreation. */
.why { margin: 0 0 22px; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.why .note-k { margin-bottom: 8px; }
.why-text { margin: 0; font-size: 18px; line-height: 1.55; color: var(--text); text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  .panel-content.is-swapping { transform: none; }
  .li-act.pop svg { animation: none; }
}

.launch-notes { max-width: 62ch; margin-top: 36px; }
.launch-notes + .split { margin-top: 36px; }
