/* ============================================================
   THE SPIDER AND THE SHIELD — Hinglish interactive reader
   Editorial broadsheet · light palette · oxblood seal accent
   Sticky sidebar TOC · live timecode chip · scene meta strips
   ============================================================ */

:root {
  /* paper */
  --bone:        #F4F0E8;
  --cream:       #EDE6D7;
  --paper:       #FBF8F1;
  --paper-deep:  #E6DDC9;

  /* ink */
  --ink:         #11100E;
  --ink-soft:    #2A2620;
  --ink-mute:    #6B6357;
  --ink-faint:   #A6A092;
  --hairline:    rgba(17, 16, 14, 0.14);
  --hairline-soft: rgba(17, 16, 14, 0.07);

  /* oxblood seal */
  --oxblood:     #8E2A1A;
  --oxblood-deep:#6E1F12;
  --oxblood-tint: rgba(142, 42, 26, 0.10);

  /* type */
  --display: "Fraunces", "Cormorant Garamond", "Times New Roman", serif;
  --body:    "Spectral", "EB Garamond", Georgia, serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --hindi:   "Hind", "Spectral", Georgia, serif;

  /* reading column */
  --col:    66ch;
  --col-wide: 78ch;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --max-main: 920px;

  /* sidebar */
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(16px, 0.4vw + 14.5px, 18px);
  line-height: 1.65;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(ellipse 70% 60% at 15% 0%, rgba(180, 140, 80, 0.05), transparent 60%),
    radial-gradient(ellipse 80% 70% at 85% 100%, rgba(110, 60, 40, 0.04), transparent 65%);
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

header, section, article, footer, .progress, .page { position: relative; z-index: 1; }

::selection { background: var(--oxblood); color: var(--paper); }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; }

/* ============================================================
   PAGE LAYOUT — sidebar + main grid
   ============================================================ */
.page {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--hairline-soft);
  z-index: 100;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--oxblood);
  transition: width 0.08s linear;
}

/* ============================================================
   LIVE TIMECODE CHIP
   ============================================================ */
.live-tc {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  box-shadow: 0 10px 30px rgba(17, 16, 14, 0.25),
              0 2px 6px rgba(17, 16, 14, 0.15);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.live-tc.show {
  opacity: 1;
  transform: translateY(0);
}
.live-tc-time {
  font-family: var(--mono);
  font-weight: 600;
  color: #FFB14A;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.live-tc-time::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFB14A;
  margin-right: 0.45rem;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(255, 177, 74, 0.7);
  animation: blink 2s infinite;
}
@keyframes blink {
  0%   { box-shadow: 0 0 0 0 rgba(255, 177, 74, 0.55); }
  60%  { box-shadow: 0 0 0 8px rgba(255, 177, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 177, 74, 0); }
}
.live-tc-label {
  font-family: var(--display);
  font-style: italic;
  font-weight: 350;
  font-size: 0.92rem;
  color: var(--paper);
  opacity: 0.92;
  white-space: nowrap;
  font-variation-settings: "opsz" 24, "SOFT" 50;
}

/* ============================================================
   MOBILE TOC TOGGLE
   ============================================================ */
.toc-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 91;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 1.1rem 0.6rem 0.95rem;
  cursor: pointer;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 10px 30px rgba(17, 16, 14, 0.25);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.toc-toggle-line {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--paper);
  margin: 2.5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.toc-toggle-label { margin-left: 0.3rem; }
.toc-toggle[aria-expanded="true"] .toc-toggle-line:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.toc-toggle[aria-expanded="true"] .toc-toggle-line:nth-child(2) { opacity: 0; }
.toc-toggle[aria-expanded="true"] .toc-toggle-line:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }

/* ============================================================
   SIDEBAR TOC
   ============================================================ */
.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.6rem 1.1rem 1.6rem 1.5rem;
  border-right: 1px solid var(--hairline);
  background: var(--cream);
  font-size: 0.92rem;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
  display: flex;
  flex-direction: column;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }

.toc-head {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1rem;
}
.toc-title {
  font-family: var(--display);
  font-weight: 380;
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.05;
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-variation-settings: "opsz" 36, "SOFT" 50, "WONK" 1;
  letter-spacing: -0.01em;
}
.toc-title-and {
  font-size: 0.55em;
  display: block;
  color: var(--ink-mute);
  font-weight: 300;
  margin: 0.05em 0;
}
.toc-title-and em { font-style: italic; }
.toc-seal {
  color: var(--oxblood);
  font-style: normal;
  font-weight: 700;
  font-size: 0.95em;
  margin-left: 0.1em;
}
.toc-meta {
  margin: 0;
  line-height: 1.4;
}
.toc-meta .mono-tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-block;
  margin-top: 0.2rem;
}

.toc-nav { flex: 1; }
.toc-acts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-act {
  margin-bottom: 0.6rem;
  position: relative;
}
.toc-act-link {
  display: block;
  padding: 0.6rem 0.6rem 0.55rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, border-left-color 0.2s ease;
  border-radius: 2px;
}
.toc-act-link:hover {
  background: var(--paper);
  border-left-color: var(--hairline);
}
.toc-act.active > .toc-act-link {
  background: var(--paper);
  border-left-color: var(--oxblood);
}
.toc-act-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.toc-act-title {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.15;
  color: var(--ink);
  font-variation-settings: "opsz" 24, "SOFT" 50, "WONK" 1;
  margin-bottom: 0.18rem;
}
.toc-act-time {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
}

.toc-scenes {
  list-style: none;
  padding: 0.3rem 0 0.4rem 0.55rem;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}
.toc-act.active .toc-scenes,
.toc-act.expand .toc-scenes {
  max-height: 600px;
  opacity: 1;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
}
.toc-scene {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.32rem 0.55rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 0.85rem;
  line-height: 1.4;
  border-left: 1px solid var(--hairline);
  transition: color 0.2s ease, border-left-color 0.2s ease, background 0.2s ease;
}
.toc-scene:hover {
  color: var(--ink);
  border-left-color: var(--oxblood-tint);
  background: var(--paper);
}
.toc-scene.current {
  color: var(--oxblood-deep);
  border-left-color: var(--oxblood);
  background: var(--paper);
  font-weight: 500;
}
.toc-scene-num {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  min-width: 1.8em;
}
.toc-scene.current .toc-scene-num { color: var(--oxblood); }

.toc-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.toc-back {
  text-decoration: none;
  color: var(--oxblood);
}
.toc-back:hover { text-decoration: underline; }

/* ============================================================
   MAIN
   ============================================================ */
.main {
  min-width: 0;
  max-width: var(--max-main);
  width: 100%;
  margin: 0 auto;
  padding-bottom: 0;
}

.mono-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.mono-tag.right { text-align: right; }

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  border-bottom: 1px solid var(--hairline);
  background: var(--bone);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background-color: rgba(244, 240, 232, 0.92);
}
.masthead-inner {
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 2.2rem;
}
.hero-eyebrow .rule {
  flex: 1;
  max-width: 90px;
  height: 1px;
  background: var(--hairline);
}

.title {
  font-family: var(--display);
  font-weight: 350;
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 0.94;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  color: var(--ink);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}
.title-line { display: block; }
.title-line.one { font-weight: 320; }
.title-line.two { font-weight: 420; font-style: italic; display: inline-block; }
.title-and {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: 0.36em;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  display: block;
  margin: 0.3rem 0;
  font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 1;
}
.title .seal {
  display: inline-block;
  color: var(--oxblood);
  font-weight: 700;
  transform: translateY(-0.05em);
  margin-left: 0.06em;
  font-style: normal;
}

.tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.4vw + 0.5rem, 1.4rem);
  line-height: 1.45;
  max-width: 38ch;
  margin: 0 auto 2.2rem;
  color: var(--ink-soft);
  text-wrap: balance;
  font-variation-settings: "opsz" 36, "SOFT" 50;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.1rem 1.8rem;
  max-width: 660px;
  margin: 0 auto;
  padding: 1.2rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.hero-meta > div { text-align: center; }
.hero-meta dt {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.35rem;
}
.hero-meta dd {
  font-family: var(--display);
  font-size: 0.98rem;
  margin: 0;
  color: var(--ink);
}

/* hero stagger */
@media (prefers-reduced-motion: no-preference) {
  .hero .hero-eyebrow,
  .hero .title,
  .hero .tagline,
  .hero .hero-meta {
    animation: rise 1.05s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero .hero-eyebrow { animation-delay: 0.05s; }
  .hero .title        { animation-delay: 0.18s; }
  .hero .tagline      { animation-delay: 0.42s; }
  .hero .hero-meta    { animation-delay: 0.62s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   OXBLOOD RULE
   ============================================================ */
.oxblood-rule {
  border: 0;
  height: 1px;
  background: var(--oxblood);
  margin: 0 auto;
  opacity: 0.45;
  position: relative;
  width: calc(100% - 2 * var(--gutter));
  max-width: var(--max-main);
}
.oxblood-rule::before,
.oxblood-rule::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--oxblood);
  border-radius: 50%;
  top: -2.5px;
}
.oxblood-rule::before { left: 0; }
.oxblood-rule::after  { right: 0; }

/* ============================================================
   PROLOGUE
   ============================================================ */
.prologue {
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter);
  display: grid;
  justify-items: center;
}
.proem-title {
  font-family: var(--display);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(1.4rem, 2vw + 0.5rem, 1.9rem);
  letter-spacing: -0.005em;
  margin: 0 0 1.4rem;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 50, "WONK" 1;
  text-align: center;
}
.prologue p {
  max-width: var(--col);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 0.95rem;
  color: var(--ink);
}
.proem-rules {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
  margin-top: 0.4rem !important;
}
.proem-rules strong {
  font-family: var(--mono);
  font-weight: 500;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oxblood);
  display: inline-block;
  margin-right: 0.6rem;
}

/* ============================================================
   ACT
   ============================================================ */
.act {
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) clamp(1.5rem, 3vw, 2.5rem);
  scroll-margin-top: 80px;
}

.act-head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 4.5vw, 4rem);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 1.8rem 0;
}
.act-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--oxblood);
  font-weight: 500;
  margin-bottom: 0.8rem;
  padding: 0.32rem 0.85rem;
  border: 1px solid var(--oxblood);
  border-radius: 2px;
}
.act-title {
  font-family: var(--display);
  font-weight: 380;
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0.2rem 0 0.6rem;
  color: var(--ink);
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 1;
  text-wrap: balance;
}
.act-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  justify-content: center;
}
.act-meta .act-tc { color: var(--oxblood); font-weight: 500; }
.act-meta .act-duration::before,
.act-meta .act-read::before { content: "·"; margin-right: 0.4rem; color: var(--ink-faint); }

/* ============================================================
   SCENE
   ============================================================ */
.scene {
  max-width: var(--col-wide);
  margin: 0 auto clamp(2rem, 3.5vw, 3.5rem);
  padding-bottom: clamp(1.5rem, 2.5vw, 2.2rem);
  border-bottom: 1px solid var(--hairline-soft);
  scroll-margin-top: 80px;
}
.scene:last-child { border-bottom: 0; }

.scene-head {
  margin-bottom: 1.4rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--oxblood);
}
.scene-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 0.35rem;
}
.scene-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.6vw + 0.5rem, 1.6rem);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 1;
  letter-spacing: -0.005em;
}
.scene-tc {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.scene-tc .mono-tag {
  color: var(--oxblood-deep);
  background: var(--oxblood-tint);
  padding: 0.13em 0.45em;
  border-radius: 2px;
  font-size: 0.64rem;
  margin-right: 0.2rem;
}

/* ============================================================
   CUE BLOCKS
   ============================================================ */
.cue {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.3rem;
}
/* Force all body children into column 2 (multiple <p> children would otherwise
   wrap into column 1 on subsequent rows) */
.cue > *:not(.cue-label) {
  grid-column: 2;
}
.cue-label {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 0.4rem;
  align-self: start;
  border-top: 1px solid var(--hairline);
  grid-row: span 99;
}
.cue-direction {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92rem;
  color: var(--ink-mute);
  display: inline-block;
  margin-left: 0.4em;
}
.cue p {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  line-height: 1.7;
}
.cue p:last-child { margin-bottom: 0; }
.cue-aside {
  font-family: var(--display);
  font-style: italic;
  font-weight: 320;
  font-size: 0.92rem !important;
  color: var(--ink-mute);
  padding-left: 0.85rem;
  border-left: 1px solid var(--hairline);
  margin-top: 0.55rem !important;
}

.cue-narrator p,
.cue-host p {
  font-family: var(--body);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.72;
  color: var(--ink);
}

.cue-host {
  background: var(--paper);
  padding: 1.3rem 1.4rem;
  border-radius: 2px;
  border-left: 2px solid var(--ink);
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
.cue-host .cue-label {
  border-top: 0;
  padding-top: 0;
  color: var(--ink);
}

.cue-visual p,
.cue-audio p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 320;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink-soft);
  font-variation-settings: "opsz" 24, "SOFT" 50;
}

/* ============================================================
   ON-SCREEN CARDS
   ============================================================ */
.onscreen {
  margin: 1.6rem 0 1.8rem;
  padding: 1.4rem 1.7rem 1.4rem 2.4rem;
  background: var(--paper);
  border-left: 3px solid var(--oxblood);
  border-radius: 2px;
  position: relative;
}
.onscreen::before {
  content: "“";
  position: absolute;
  left: 0.5rem;
  top: 0;
  font-family: var(--display);
  font-size: 4.5rem;
  line-height: 0.8;
  color: var(--oxblood);
  opacity: 0.5;
  font-style: italic;
  font-variation-settings: "opsz" 144, "WONK" 1;
  pointer-events: none;
}
.onscreen blockquote {
  font-family: var(--display);
  font-weight: 360;
  font-style: italic;
  font-size: clamp(1.1rem, 1.1vw + 0.7rem, 1.35rem);
  line-height: 1.42;
  margin: 0 0 0.85rem;
  color: var(--ink);
  font-variation-settings: "opsz" 48, "SOFT" 50, "WONK" 1;
  text-wrap: balance;
}
.onscreen figcaption {
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

/* on-screen variants */
.onscreen-title {
  text-align: center;
  background: var(--ink);
  border-left: 0;
  border-radius: 0;
  padding: 1.8rem 1.5rem;
  margin: 2.2rem 0;
}
.onscreen-title::before { display: none; }
.onscreen-title blockquote {
  font-family: var(--display);
  font-style: normal;
  font-weight: 420;
  font-size: clamp(1.4rem, 2vw + 0.4rem, 2rem);
  letter-spacing: 0.04em;
  color: var(--paper);
  text-transform: uppercase;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  margin-bottom: 0.55rem;
}
.onscreen-title figcaption {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.98rem;
  color: var(--paper);
  opacity: 0.7;
}

.onscreen-handwritten {
  background: #FAF5DE;
  border-left: 3px solid #C8A04A;
  padding: 1.3rem 1.5rem;
}
.onscreen-handwritten::before { display: none; }
.onscreen-handwritten blockquote {
  font-family: "Caveat", "Bradley Hand", cursive;
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.25rem, 1.4vw + 0.6rem, 1.6rem);
  color: #3a2a14;
  line-height: 1.35;
}

.onscreen-ledger {
  background: var(--bone);
  border-left: 3px solid var(--ink);
}
.onscreen-ledger::before { display: none; }
.onscreen-ledger blockquote {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.onscreen-ledger .ledger-row {
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.9em;
  color: var(--ink-soft);
}

.onscreen-headline {
  background: var(--ink);
  border-left: 0;
  border-radius: 0;
  padding: 1.5rem 1.4rem;
  text-align: center;
}
.onscreen-headline::before { display: none; }
.onscreen-headline blockquote {
  font-family: var(--display);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw + 0.4rem, 1.4rem);
  letter-spacing: 0.01em;
  color: var(--paper);
  text-transform: uppercase;
  line-height: 1.2;
  font-variation-settings: "opsz" 60, "SOFT" 30;
}
.onscreen-headline figcaption {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--paper);
  opacity: 0.7;
  margin-top: 0.65rem;
}

.onscreen-readboard {
  background: #1A1714;
  border-left: 0;
  border-radius: 0;
  padding: 1.1rem 1.4rem;
  text-align: center;
}
.onscreen-readboard::before { display: none; }
.onscreen-readboard blockquote {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(0.92rem, 1vw + 0.35rem, 1.1rem);
  letter-spacing: 0.06em;
  color: #FFB14A;
  margin: 0;
  text-transform: uppercase;
}

/* ============================================================
   STAGE DIRECTION / ETHICAL NOTE
   ============================================================ */
.stage-direction {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-mute);
  text-align: center;
  margin: 1.4rem auto;
  max-width: 50ch;
  font-variation-settings: "opsz" 18, "SOFT" 50;
}

.ethical-note {
  max-width: var(--col-wide);
  margin: 0 auto 2.6rem;
  padding: 1.3rem 1.6rem;
  background: var(--cream);
  border-left: 2px solid var(--oxblood);
  border-radius: 2px;
}
.ethical-note .cue-label {
  display: block;
  border-top: 0;
  padding-top: 0;
  margin-bottom: 0.55rem;
  color: var(--oxblood);
  font-weight: 500;
}
.ethical-note p {
  margin: 0;
  font-family: var(--body);
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink);
}

/* ============================================================
   KBD / CODE
   ============================================================ */
.kbd {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  background: var(--oxblood-tint);
  color: var(--oxblood-deep);
  padding: 0.16em 0.5em;
  border-radius: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  font-weight: 500;
}
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--hairline-soft);
  padding: 0.1em 0.4em;
  border-radius: 2px;
  letter-spacing: 0.01em;
}

/* ============================================================
   CODA
   ============================================================ */
.coda {
  padding: clamp(3rem, 6vw, 5rem) var(--gutter);
  text-align: center;
  background: var(--cream);
  scroll-margin-top: 80px;
}
.coda-head {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.85rem;
  margin: 0 0 2.5rem;
}
.coda-meta {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.dedication {
  font-family: var(--display);
  font-weight: 350;
  font-style: italic;
  font-size: clamp(1.3rem, 1.7vw + 0.6rem, 1.85rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 32ch;
  margin: 0 auto 2.8rem;
  font-variation-settings: "opsz" 48, "SOFT" 50, "WONK" 1;
}

.memoriam, .primary-sources {
  max-width: 50ch;
  margin: 0 auto 2.2rem;
}
.memoriam .mono-tag,
.primary-sources .mono-tag {
  display: block;
  color: var(--oxblood);
  margin-bottom: 0.8rem;
}
.memoriam p,
.primary-sources p {
  font-family: var(--display);
  font-style: italic;
  font-weight: 350;
  font-size: 1rem;
  line-height: 1.55;
  margin: 0.25rem 0;
  color: var(--ink-soft);
}

.disclaimer {
  max-width: 60ch;
  margin: 1.8rem auto 0;
  padding-top: 1.8rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--body);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-mute);
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bone);
  padding: clamp(1.8rem, 3.5vw, 2.5rem) var(--gutter);
  border-top: 1px solid var(--hairline);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 380;
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
  font-variation-settings: "opsz" 32, "SOFT" 50, "WONK" 1;
}
.footer-sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.back-to-top {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--oxblood);
  text-decoration: none;
  border-bottom: 1px solid var(--oxblood-tint);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}
.back-to-top:hover { border-color: var(--oxblood); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
  }
  .toc {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 85vw);
    height: 100vh;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
    box-shadow: 8px 0 28px rgba(17, 16, 14, 0.25);
  }
  .toc.open { transform: translateX(0); }
  .toc-toggle { display: inline-flex; }
  .main { max-width: 100%; }
  .live-tc { bottom: 5rem; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .masthead-inner { gap: 0.5rem; }
  .mono-tag.right { display: none; }

  .scene-head { padding-left: 0.9rem; }

  .cue {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
  .cue-label {
    border-top: 0;
    border-bottom: 1px solid var(--hairline);
    padding-top: 0;
    padding-bottom: 0.3rem;
    margin-bottom: 0.4rem;
  }
  .cue-host { padding: 1.1rem 1rem; }

  .onscreen {
    padding: 1.1rem 1.2rem 1.1rem 1.9rem;
  }
  .onscreen::before {
    font-size: 3.4rem;
    left: 0.3rem;
  }

  .footer-grid { gap: 1rem; }
  .live-tc { right: 0.75rem; bottom: 4.5rem; padding: 0.45rem 0.85rem; }
  .live-tc-label { display: none; }
  .toc-toggle { left: 0.75rem; bottom: 0.75rem; }
}

/* mobile drawer overlay */
.toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 16, 14, 0.4);
  z-index: 94;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.toc-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
