:root {
  --bg: #0c0d10;
  --bg-raise: #16181d;
  --ink: #f3efe6;
  --muted: #9a9386;
  --rule: #2a2d34;
  --paper: #f7f1e4;
  --paper-ink: #1a1714;
  --accent: #c4a35a;
  --hamza: #6b4423;
  --dron: #c2410c;
  --puja: #d4a017;
  --raz: #2b4cb8;
  --cherry: #8b0a12;
  --pam: #ffffff;
  --radha: #ffe8d2;
  --max: 42rem;
  --page-pad: clamp(1rem, 4vw, 2rem);
  --mast: 3.6rem;
  --font-ui: Outfit, "Segoe UI", sans-serif;
  --font-text: "Source Serif 4", Georgia, serif;
  --font-display: Fraunces, Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  background: var(--paper);
  color: var(--paper-ink);
  padding: 0.4rem 0.7rem;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-height: var(--mast);
  padding: 0.55rem var(--page-pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.mast-brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
}

.mast-brand strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.mast-brand span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-left: 0.85rem;
  row-gap: 0.25rem;
}

.chapters a {
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--muted);
}

.chapters a[aria-current="page"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.lang {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
}

.visits {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0;
  color: var(--muted);
  font-size: calc(0.72rem + 1px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mast:has(.visits:not([hidden])) .lang {
  margin-left: 0.75rem;
}

.visits:not([hidden]) {
  margin-left: auto;
}

.visits strong {
  color: var(--paper);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.visits-inception {
  margin-left: 0.45rem;
}

.lang select {
  appearance: none;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 0.72rem) 55%, calc(100% - 0.48rem) 55%;
  background-size: 0.28rem 0.28rem, 0.28rem 0.28rem;
  background-repeat: no-repeat;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  max-width: 9.5rem;
  padding: 0.35rem 1.55rem 0.35rem 0.7rem;
}

.lang select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modes {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
}

.modes button {
  background: transparent;
  border: 0;
  padding: 0.35rem 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
}

.modes button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.codes-toggle {
  flex-shrink: 0;
  margin-left: 0.35rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
}

.codes-toggle--solo {
  margin-left: 0.35rem;
}

.codes-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.story {
  max-width: calc(var(--max) + 6rem);
  margin: 0 auto;
  padding: 0 var(--page-pad) 5rem;
}

.ad-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.ad-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-caption {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink);
  text-align: center;
}

.ad-frame {
  width: min(42rem, 100%);
  aspect-ratio: 1024 / 434;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--rule);
}

.ad-still {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.ad-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
}

.ad-link:hover .ad-caption,
.ad-link:focus-visible .ad-caption {
  color: var(--accent);
}

.ad-link .ad-still {
  pointer-events: none;
}

.leaf--ad {
  padding: 2rem 0 2.4rem;
}

[data-code] {
  scroll-margin-top: calc(var(--mast) + 0.75rem);
}

.leaf--cover {
  padding: 4.8rem 0 3.2rem;
}

body[data-page="0"] {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-page="0"] .mast {
  position: relative;
  flex-shrink: 0;
}

body[data-page="0"] .story {
  flex: 1;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

body[data-page="0"] .leaf--cover {
  flex: 1;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

body[data-page="0"] .cover-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(14.5rem, 1fr);
}

body[data-page="0"] .cover-hero {
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem 0.9rem 1.35rem;
}

body[data-page="0"] .title-plate {
  flex: 1;
  min-height: 0;
  margin: 0;
  display: flex;
  align-items: center;
}

body[data-page="0"] .title-plate .panel-art {
  width: 100%;
  height: 100%;
  border-radius: 0.55rem;
  background: transparent;
}

body[data-page="0"] .title-plate .panel-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

body[data-page="0"] .cover-preface {
  flex-shrink: 0;
  max-width: none;
  margin: 0;
}

body[data-page="0"] .cover-preface p {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.45;
}

body[data-page="0"] .cover-toc {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem 0.85rem 1.35rem;
  border-left: 1px solid var(--rule);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(196, 163, 90, 0.08), transparent 46%),
    #101218;
}

body[data-page="0"] .cover-toc h2 {
  flex-shrink: 0;
  margin: 0 0 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

body[data-page="0"] .cover-toc ol {
  flex: 1;
  min-height: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

body[data-page="0"] .cover-toc a {
  display: grid;
  grid-template-columns: 1.9rem 1fr;
  gap: 0.6rem;
  align-items: center;
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border-radius: 0.55rem;
}

body[data-page="0"] .cover-toc a:hover,
body[data-page="0"] .cover-toc a:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  outline: none;
}

body[data-page="0"] .cover-toc-num {
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--rule));
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.84rem;
  line-height: 1;
}

body[data-page="0"] .cover-toc-name {
  font-family: var(--font-display);
  font-size: clamp(0.84rem, 1.1vw, 1.125rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

body[data-page="0"] .cover-toc a:hover .cover-toc-name,
body[data-page="0"] .cover-toc a:focus-visible .cover-toc-name {
  color: var(--accent);
}

body[data-page="0"] .cover-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem 1.15rem;
  min-height: 5.6rem;
  padding: 0.45rem 1.35rem;
  border-top: 1px solid var(--rule);
  background: #0a0b0e;
}

body[data-page="0"] .cover-byline {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

body[data-page="0"] .cover-byline .code {
  display: inline-block;
  margin: 0 0.4rem 0 0;
  vertical-align: middle;
}

body[data-page="0"] .cover-studio {
  flex: 0 0 auto;
  display: block;
  margin: 0;
  line-height: 0;
}

body[data-page="0"] .cover-studio img {
  display: block;
  height: 4.6rem;
  width: auto;
  object-fit: contain;
  background: transparent;
}

body[data-page="0"] .cover-follow {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

body[data-page="0"] .cover-follow-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--paper);
  white-space: nowrap;
}

body[data-page="0"] .cover-hand {
  font-size: 2.15rem;
  line-height: 1;
}

body[data-page="0"] .cover-follow a {
  display: block;
  line-height: 0;
  border-radius: 0.55rem;
  transition: transform 0.15s ease;
}

body[data-page="0"] .cover-follow a:hover,
body[data-page="0"] .cover-follow a:focus-visible {
  transform: scale(1.08);
  outline: none;
}

body[data-page="0"] .cover-follow img {
  display: block;
  width: 3.35rem;
  height: 3.35rem;
  object-fit: contain;
}

@media (max-width: 860px) {
  html:has(body[data-page="0"]),
  body[data-page="0"] {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  body[data-page="0"] {
    display: block;
  }

  body[data-page="0"] .story,
  body[data-page="0"] .leaf--cover,
  body[data-page="0"] .cover-split {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  body[data-page="0"] .cover-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  body[data-page="0"] .cover-hero {
    padding: 0.7rem 0.85rem 0.7rem;
    gap: 0.7rem;
  }

  body[data-page="0"] .title-plate,
  body[data-page="0"] .title-plate .panel-art,
  body[data-page="0"] .title-plate .panel-canvas {
    display: block;
    height: auto;
    flex: none;
  }

  body[data-page="0"] .cover-preface p {
    font-size: 0.95rem;
    line-height: 1.35;
  }

  body[data-page="0"] .cover-toc {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 0.7rem 0.85rem 0.4rem;
  }

  body[data-page="0"] .cover-toc ol {
    display: flex;
    flex: none;
    gap: 0.15rem;
    justify-content: flex-start;
  }

  body[data-page="0"] .cover-toc h2 {
    margin-bottom: 0.1rem;
  }

  body[data-page="0"] .cover-toc-num {
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.9rem;
  }

  body[data-page="0"] .cover-toc a {
    grid-template-columns: 1.9rem 1fr;
    gap: 0.5rem;
    padding: 0.08rem 0.3rem;
  }

  body[data-page="0"] .cover-toc-name {
    font-size: 0.82rem;
  }

  body[data-page="0"] .cover-foot {
    flex-wrap: nowrap;
    min-height: 0;
    margin-top: 0.4rem;
    padding: 0.7rem 0.75rem calc(1rem + env(safe-area-inset-bottom));
  }

  body[data-page="0"] .cover-byline {
    font-size: 0.95rem;
  }

  body[data-page="0"] .cover-studio img {
    height: 3.4rem;
  }

  body[data-page="0"] .cover-follow {
    margin-left: auto;
    flex: 0 1 auto;
    justify-content: flex-end;
  }

  body[data-page="0"] .cover-follow-label {
    font-size: 0.875rem;
  }

  body[data-page="0"] .cover-hand {
    font-size: 1.7rem;
  }

  body[data-page="0"] .cover-follow img {
    width: 2.45rem;
    height: 2.45rem;
  }
}

@media (max-width: 560px) {
  body[data-page="0"] .cover-foot {
    flex-wrap: wrap;
  }

  body[data-page="0"] .cover-follow {
    margin-left: 0;
    flex: 1 0 100%;
    justify-content: center;
  }
}

.title-plate {
  margin: 0;
}

.title-plate .panel-art {
  border-radius: 0.3rem;
}

.cover-kicker {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.leaf--cover h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
}

.cover-tag {
  margin: 0.75rem 0 0;
  font-size: 1.2rem;
}

.coming-soon {
  margin-top: 1.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.95rem;
}

.part-label {
  margin: 0 0 1.1rem;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.leaf--text .panels {
  max-width: 40rem;
}

.cover-cast {
  max-width: 40rem;
  margin: 2rem 0 0;
  text-align: left;
}

.cover-cast h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.cover-cast p {
  margin: 0 0 0.85rem;
  font-family: var(--font-text);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink);
}

.cover-cast p:last-child {
  margin-bottom: 0;
}

.cover-preface {
  max-width: 36rem;
  margin: 1.8rem 0 0;
}

.cover-preface p {
  margin: 0 0 0.85rem;
  font-family: var(--font-text);
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--ink);
}

.cover-preface p:last-child {
  margin-bottom: 0;
}

.cover-byline {
  margin: 2rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.cover-studio {
  margin: 1rem 0 0;
  max-width: 22rem;
}

.cover-studio img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.3rem;
  background: #050505;
}

.cover-copy {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.cover-copy a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.cover-copy a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cover-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cover-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.cover-social svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.cover-social a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.cover-chapter {
  margin: 2.4rem 0 0;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cover-line {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.cover-start {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 2.4rem;
}

.cover-start a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
}

.cover-start a:hover {
  border-bottom: 1px solid var(--accent);
}

.panels {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.6rem 0 0.4rem;
}

.panel {
  margin: 0;
}

.panel--text {
  padding-bottom: 0.15rem;
}

/* Text/dialogue stacks: cancel flex gap padding so volleys sit tight */
.panel--text + .panel--text {
  margin-top: -0.85rem;
}

.panel--text > .letter {
  margin-top: 0;
}

.panel--text > .letter > .talk {
  margin-top: 0;
}

body.hide-codes .code {
  display: none !important;
}

.code {
  display: block;
  width: fit-content;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border: 1px solid var(--accent);
  border-radius: 0.25rem;
  padding: 0.12rem 0.38rem;
  margin: 0 0 0.4rem;
  cursor: pointer;
  user-select: all;
  pointer-events: auto;
  text-transform: none;
}

.caption .code,
.speech .code,
.bio .code,
.continue .code,
.cover-kicker .code,
.cover-tag .code,
.cover-preface .code,
.leaf--cover h1 .code,
.part-label .code,
.bio-name .code,
.bio-role .code {
  display: inline-block;
  margin: 0 0.4rem 0.15rem 0;
  vertical-align: middle;
}

.code--art {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  z-index: 5;
  margin: 0;
  background: rgba(12, 13, 16, 0.84);
}

.code--copied {
  background: var(--accent);
  color: var(--bg);
}

.scene-break {
  height: 1px;
  margin: 0.35rem auto 1.7rem;
  max-width: 13rem;
  background: var(--rule);
  position: relative;
}

.scene-break::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: translate(-50%, -50%) rotate(45deg);
}

.prose {
  margin: 0 0 1rem;
}

.prose p {
  margin: 0 0 0.85rem;
  font-family: var(--font-text);
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--ink);
}

.prose p:last-child {
  margin-bottom: 0;
}

.panel-art {
  position: relative;
  overflow: hidden;
  border-radius: 0.3rem;
  background: #000;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.panel-art--placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 82%, var(--ink));
  border: 1px dashed var(--accent);
}

.placeholder-label {
  margin: 0;
  max-width: 34rem;
  padding: 2.4rem 1.5rem 1.2rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--muted);
}

.panel-canvas {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.panel-shield {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: transparent;
  cursor: default;
}

html.capture-block .panel-shield {
  background: var(--bg);
}

.title-lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(8, 9, 12, 0.12),
    rgba(8, 9, 12, 0.4) 46%,
    rgba(8, 9, 12, 0.12)
  );
}

.title-lock h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 500;
  line-height: 1.05;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.65);
}

.title-lock p {
  margin: 0.45rem 0 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--paper);
}

.letter {
  margin-top: 0.7rem;
}

.letter--talk {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.prose + .letter--talk {
  margin-top: 0.85rem;
}

.letter--talk .talk {
  margin-top: 0;
}

.talk {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.caption {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.2rem 0.55rem;
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.speech {
  margin: 0;
  padding: 0.85rem 1rem 1rem 1.1rem;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: 0.15rem 0.85rem 0.85rem 0.15rem;
  border-left: 4px solid var(--accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.speech strong {
  display: inline;
  font-family: inherit;
  font-style: normal;
  font-weight: 700;
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
}

.speech[data-speaker="HAMZA"] {
  background: var(--hamza);
  color: #f7f1e4;
  border-left-color: #3d2414;
}

.speech[data-speaker="DRON"] {
  background: var(--dron);
  color: #fff6ee;
  border-left-color: #7a2208;
}

.speech[data-speaker="PUJA"] {
  background: var(--puja);
  color: #1a1408;
  border-left-color: #8a5a00;
}

.speech[data-speaker="RAZ"] {
  background: var(--raz);
  color: #f2f5ff;
  border-left-color: #162a6e;
}

.speech[data-speaker="CHERRY"] {
  background: var(--cherry);
  color: #fff0f0;
  border-left-color: #4a0508;
}

.speech[data-speaker="PAM"] {
  background: var(--pam);
  color: #1a1714;
  border-left-color: #cfc9be;
}

.speech[data-speaker="VILLAGER"] {
  border-left-color: #8a7a55;
}

.speech[data-speaker="RATNAVATI"],
.speech[data-speaker="GHOST QUEEN"] {
  background: #5c0a12;
  color: #ffe8ea;
  border-left-color: #2a0408;
}

.speech[data-speaker="JOSHI"],
.speech[data-speaker="MR. RATHORE"] {
  border-left-color: #c9a227;
}

.speech[data-speaker="RADHA"] {
  background: var(--radha);
  color: #3d2414;
  border-left-color: #e8a06a;
}

.speech[data-speaker="JAY"] {
  background: #0e2a4a;
  color: #e7eef8;
  border-left-color: #071828;
}

.speech[data-speaker="JACKY"] {
  border-left-color: #6b3a3a;
}

.speech[data-speaker="MOTHER"],
.speech[data-speaker="HAMZA'S MOTHER"] {
  border-left-color: #8b9a62;
}

.speech[data-speaker="HALLUCINATION"],
.speech[data-speaker="RAZ'S HALLUCINATION"],
.speech[data-speaker="DRON'S HALLUCINATION"],
.speech[data-speaker="HAMZA'S HALLUCINATION"] {
  border-left-color: #7a5aa8;
}

.speech p {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.12rem;
  line-height: 1.4;
}

.dossier {
  display: grid;
  gap: 1.2rem;
  padding: 1.6rem 0 0.4rem;
}

@media (min-width: 880px) {
  .dossier {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.bio {
  margin: 0;
  padding: 1.15rem 1.2rem 1.3rem;
  background: var(--bg-raise);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
}

.bio-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.bio[data-character="hamza"] {
  border-left: 4px solid var(--hamza);
}

.bio[data-character="hamza"] .bio-name {
  color: #c4a07a;
}

.bio[data-character="dron"] {
  border-left: 4px solid var(--dron);
}

.bio[data-character="dron"] .bio-name {
  color: #e0703a;
}

.bio[data-character="puja"] {
  border-left: 4px solid var(--puja);
}

.bio[data-character="puja"] .bio-name {
  color: var(--puja);
}

.bio[data-character="raz"] {
  border-left: 4px solid var(--raz);
}

.bio[data-character="raz"] .bio-name {
  color: #7ea0ff;
}

.bio[data-character="pam"] {
  border-left: 4px solid #d8d4cc;
}

.bio[data-character="pam"] .bio-name {
  color: var(--pam);
}

.bio[data-character="cherry"] {
  border-left: 4px solid var(--cherry);
}

.bio[data-character="cherry"] .bio-name {
  color: #e04555;
}

.bio-role {
  margin: 0.15rem 0 1rem;
  color: var(--muted);
}

.bio div {
  margin: 0 0 0.85rem;
}

.bio dt {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.bio dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-text);
}

.continue {
  margin: 2.5rem 0 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

html[data-script] .continue,
html[data-script] .part-label,
html[data-script] .bio dt,
html[data-script] .cover-toc h2,
html[data-script] .mast-brand span,
html[data-script] .modes button,
html[data-script] .codes-toggle,
html[data-script] .caption,
html[data-script] .title-lock p,
html[data-script] .ad-label {
  letter-spacing: 0.01em;
  text-transform: none;
}

html[data-script] .continue {
  font-family: var(--font-text);
  font-size: 1.05rem;
  line-height: 1.65;
}

html[data-script] .caption {
  font-size: 0.85rem;
}

html[data-script] .prose p,
html[data-script] .speech p,
html[data-script] .cover-preface p {
  line-height: 1.75;
}

.hits,
.pager {
  display: none;
}

body[data-mode="pages"] {
  overflow: hidden;
}

body[data-mode="pages"] .continue,
body[data-mode="pages"] .chapter-foot {
  display: none;
}

.chapter-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.15rem;
  margin: 2.2rem 0 0.4rem;
  padding: 0.95rem 0 calc(0.6rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}

.chapter-foot .cover-byline {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0.01em;
}

.chapter-foot .cover-studio {
  flex: 0 0 auto;
  display: block;
  margin: 0;
  max-width: none;
  line-height: 0;
}

.chapter-foot .cover-studio img {
  display: block;
  width: auto;
  height: 4.6rem;
  border-radius: 0;
  background: transparent;
}

.chapter-foot .cover-follow {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

.chapter-foot .cover-follow-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  white-space: nowrap;
}

.chapter-foot .cover-hand {
  font-size: 2.15rem;
  line-height: 1;
}

.chapter-foot .cover-follow a {
  display: block;
  line-height: 0;
}

.chapter-foot .cover-follow img {
  display: block;
  width: 3.35rem;
  height: 3.35rem;
  object-fit: contain;
}

@media (max-width: 640px) {
  .chapter-foot {
    flex-wrap: nowrap;
    row-gap: 0.95rem;
    padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
  }

  .chapter-foot .cover-byline {
    font-size: 0.95rem;
  }

  .chapter-foot .cover-studio img {
    height: 3.4rem;
  }

  .chapter-foot .cover-follow {
    margin-left: auto;
    flex: 0 1 auto;
    justify-content: flex-end;
  }

  .chapter-foot .cover-follow-label {
    font-size: 0.95rem;
  }

  .chapter-foot .cover-hand {
    font-size: 1.85rem;
  }

  .chapter-foot .cover-follow img {
    width: 2.45rem;
    height: 2.45rem;
  }
}

@media (max-width: 560px) {
  .chapter-foot {
    flex-wrap: wrap;
  }

  .chapter-foot .cover-follow {
    margin-left: 0;
    flex: 1 0 100%;
    justify-content: center;
  }
}

body[data-mode="pages"] .story {
  max-width: none;
  height: calc(100vh - var(--mast));
  padding: 0;
}

body[data-mode="pages"] .stage {
  position: relative;
  height: 100%;
  perspective: 2200px;
}

body[data-mode="pages"] .leaf {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 1.4rem var(--page-pad) 5.5rem;
  max-width: calc(var(--max) + 6rem);
  width: 100%;
  margin: 0 auto;
  left: 0;
  right: 0;
  background: var(--bg);
  transform-origin: left center;
  backface-visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

body[data-mode="pages"] .leaf--cover {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
}

body[data-mode="pages"] .leaf--ad .ad-frame {
  width: min(36rem, 56vw);
  height: auto;
}

body[data-mode="pages"] .leaf.is-current {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

body[data-mode="pages"] .leaf.is-past,
body[data-mode="pages"] .leaf.is-ahead {
  z-index: 1;
}

body[data-mode="pages"] .leaf.is-flip-out {
  animation: flip-out 0.55s ease forwards;
  z-index: 3;
}

body[data-mode="pages"] .leaf.is-flip-in {
  animation: flip-in 0.55s ease forwards;
  z-index: 4;
}

body[data-mode="pages"] .leaf.is-flip-back-out {
  animation: flip-back-out 0.55s ease forwards;
  z-index: 3;
}

body[data-mode="pages"] .leaf.is-flip-back-in {
  animation: flip-back-in 0.55s ease forwards;
  z-index: 4;
}

@keyframes flip-out {
  from {
    transform: rotateY(0);
    opacity: 1;
  }
  to {
    transform: rotateY(-78deg);
    opacity: 0;
  }
}

@keyframes flip-in {
  from {
    transform: rotateY(78deg);
    opacity: 0;
  }
  to {
    transform: rotateY(0);
    opacity: 1;
  }
}

@keyframes flip-back-out {
  from {
    transform: rotateY(0);
    opacity: 1;
  }
  to {
    transform: rotateY(78deg);
    opacity: 0;
  }
}

@keyframes flip-back-in {
  from {
    transform: rotateY(-78deg);
    opacity: 0;
  }
  to {
    transform: rotateY(0);
    opacity: 1;
  }
}

body[data-mode="pages"] .hits {
  display: block;
  position: fixed;
  inset: var(--mast) 0 0;
  z-index: 15;
  pointer-events: none;
}

body[data-mode="pages"] .hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  border: 0;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
}

body[data-mode="pages"] .hit--prev {
  left: 0;
  cursor: w-resize;
}

body[data-mode="pages"] .hit--next {
  right: 0;
  cursor: e-resize;
}

body[data-mode="pages"] .pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1rem;
  z-index: 16;
}

.pager button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-raise);
  cursor: pointer;
}

.pager button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pager p {
  margin: 0;
  min-width: 4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

body.book-locked .story,
body.book-locked .pager {
  filter: blur(16px);
  user-select: none;
  pointer-events: none;
}

.book-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
}

.book-gate-card {
  width: min(26rem, 100%);
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.4rem 1.35rem 1.2rem;
  background: var(--bg-raise);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.book-gate-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.book-gate-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
}

.book-gate-kindle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.book-gate-kindle img {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.5rem;
}

.book-gate-kindle:hover,
.book-gate-kindle:focus-visible {
  color: var(--paper);
}

.book-gate-card p {
  margin: 0;
  color: var(--muted);
}

.book-gate-card input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.6rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.book-gate-card button {
  justify-self: start;
  padding: 0.55rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
}

.book-gate-error {
  color: #e7b4a8;
}

.blur-plate {
  max-width: 42rem;
  margin: 2rem auto;
  padding: 0 var(--page-pad);
}

.blur-plate-still,
.blur-plate-line {
  margin: 0.8rem 0;
  border-radius: 0.4rem;
  background: #2a2d34;
}

.blur-plate-still {
  height: 14rem;
}

.blur-plate-line {
  height: 0.85rem;
}

.blur-plate-line:nth-child(4n) {
  width: 72%;
}

a.chapter-locked {
  opacity: 0.7;
}

.cover-toc a.chapter-locked .cover-toc-name::after {
  content: " · Locked";
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media print {
  .panel-art {
    display: none !important;
  }

  body.book-locked .story,
  body.book-locked .pager,
  .book-gate {
    display: none !important;
  }
}
