/* === Color Tokens (from spec Section 5, LOCKED) === */
:root {
  --prose-bg: #0d1119;
  --dialog-bg: #131a2a;
  --chrome-bg: #0a0e17;
  --text-prose: #d4cfc6;
  --text-ui: #e8e6e1;
  --text-muted: #8a8d96;
  --text-bar: #6b6e75;
  --text-dim: #3a3d45;
  --accent-green: #00cc66;
  --accent-green-dark: #00994d;
  --accent-teal: #00d4aa;
  --accent-orange: #ff5e1a;
  --border: #1a1f2e;
  --narration-bg: #0d1119;
  --bubble-partner: #252a37;
  --bubble-pov: #1e2a3a;
  --accent-digital: #38bdf8;
  --prose-font-size: 19px;
  --comm-chemical: #4ecdc4;
  --comm-telepathic: #a78bfa;
  --comm-spoken: #f59e0b;
  --comm-digital: #38bdf8;
  --comm-internal: #f472b6;
}

/* === Light Mode (Warm Sepia) === */
[data-theme="light"] {
  --prose-bg: #f4f0e8;
  --dialog-bg: #ece6d8;
  --narration-bg: #faf8f4;
  --chrome-bg: #ddd6c6;
  --bubble-partner: #d9d1c3;
  --bubble-pov: #faf8f4;
  --text-prose: #2c2417;
  --text-ui: #2c2417;
  --text-muted: #8a7d6b;
  --text-bar: #8a7d6b;
  --text-dim: #b8b0a0;
  --border: #d4ccba;
  --accent-teal: #008866;
  --accent-orange: #d44a10;
  --accent-digital: #0e78be;
  --comm-chemical: #2e9e96;
  --comm-telepathic: #7a5cc8;
  --comm-spoken: #c07a08;
  --comm-digital: #0e78be;
  --comm-internal: #c4508e;
}
[data-theme="light"] .swap-rule--thin {
  background: var(--text-prose);
}

/* === Base Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--prose-bg);
  overflow: hidden;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

/* === Reader Shell === */
#reader {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--prose-bg);
  font-family: 'Source Serif 4', serif;
}

/* === Bottom Bar === */
#bottom-bar {
  position: absolute;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0; right: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--prose-bg);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-bar);
}
#bar-center {
  color: var(--accent-teal);
  font-size: 10px;
  letter-spacing: 0.15em;
}
.block-marker {
  display: block;
  height: 0;
  overflow: hidden;
}
.bar-counter-label {
  color: var(--accent-orange);
}
.bar-counter-value {
  color: var(--text-ui);
}

/* === Page Container (holds paginated content) === */
#page-container {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}

/* === Paginated Content (CSS multi-column) === */
.segment-content {
  height: 100%;
  column-width: 100vw;
  column-gap: 0;
  column-fill: auto;
  padding-top: 24px;
  /* Slide transition: approximates spring (stiffness 300, damping 30, mass 0.8) */
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Prose Typography (from spec Section 7, LOCKED) === */
.segment-content p {
  font-family: 'Source Serif 4', serif;
  font-size: var(--prose-font-size);
  line-height: 1.65;
  color: var(--text-prose);
  margin-bottom: 18px;
  padding: 0 16px;
}
.segment-content em { font-style: italic; }
.segment-content strong { font-weight: 600; }
.segment-content hr.scene-break {
  border: none;
  height: 1px;
  margin: 32px 16px;
  background: var(--border);
}

/* === Tap Zones === */
.tap-zone {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 10;
  /* Invisible — no background, no cursor change */
  touch-action: manipulation;
}
#tap-prev   { left: 0;   width: 40%; }
#tap-center { left: 40%;  width: 30%; }
#tap-next   { left: 70%;  width: 30%; }

/* === Swap Rule === */
.swap-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  letter-spacing: 1px;
  line-height: 1;
  overflow: hidden;
  padding: 12px 16px;
  transition: none; /* transitions driven by JS during scroll */
}
.swap-rule--active {
  color: var(--accent-green);
  filter: drop-shadow(0 0 6px var(--accent-green)) drop-shadow(0 0 12px var(--accent-green-dark));
}
.swap-rule--deactivated {
  color: var(--text-prose);
}

/* Thin rule (chapter-header post-swap) */
.swap-rule--thin {
  display: block;
  height: 1px;
  background: var(--text-prose);
  margin: 0;
  padding: 0;
  filter: none;
  overflow: visible;
}

/* === Segments === */
.segment {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === Prose Segment === */
.segment--prose {
  overflow: hidden;
}

/* === Chapter Title Segment === */
.chapter-title-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--prose-bg);
  padding: 0 10px;
}
.chapter-title-split {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.chapter-title-split svg {
  display: block;
}
.chapter-title-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  letter-spacing: 0.12em;
  color: var(--text-ui);
  text-align: center;
  line-height: 1.1;
}
.chapter-title-subtitle {
  font-family: 'Source Serif 4', serif;
  font-size: calc(var(--prose-font-size) + 3px);
  color: var(--text-prose);
  line-height: 1.4;
  text-align: center;
  margin-top: 64px;
}
/* When subtitle follows a heading (title card), tighten the gap */
.chapter-title-heading + .chapter-title-subtitle {
  margin-top: 20px;
}
/* === Dialog Segment === */
.segment--dialog {
  background: var(--dialog-bg);
}
.dialog-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}
.dialog-scroll::-webkit-scrollbar {
  display: none;
}

/* === Dialog Header === */
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--dialog-bg);
  border-bottom: 1px solid var(--border);
}
.dialog-header-speaker {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dialog-header-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 0.12em;
}
.dialog-header-comm {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* === Dialog Bubbles === */
.dialog-msg {
  display: flex;
  flex-direction: column;
}
.dialog-msg--pov {
  align-items: flex-end;
  padding-left: 6%;
  padding-right: 12px;
}
.dialog-msg--partner {
  align-items: flex-start;
  padding-left: 12px;
  padding-right: 6%;
}
.dialog-bubble {
  font-family: 'Source Serif 4', serif;
  font-size: var(--prose-font-size);
  line-height: 1.5;
  color: var(--text-ui);
  padding: 10px 14px;
  max-width: 95%;
}
.dialog-bubble--pov {
  background: var(--bubble-pov);
  border-radius: 14px 14px 4px 14px;
}
.dialog-bubble--partner {
  background: var(--bubble-partner);
  border-radius: 14px 14px 14px 4px;
}

/* === Dialog Descriptor === */
.dialog-descriptor {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.dialog-msg--partner .dialog-descriptor {
  margin-left: 14px;
}
.dialog-msg--pov .dialog-descriptor {
  margin-right: 14px;
  text-align: right;
}

/* === Dialog Narration (hard-cut to prose bg) === */
.dialog-narration {
  background: var(--narration-bg);
  margin: 24px -1px;
  padding: 24px 16px;
}
.dialog-narration p {
  font-family: 'Source Serif 4', serif;
  font-size: var(--prose-font-size);
  line-height: 1.65;
  color: var(--text-prose);
  margin-bottom: 18px;
}
.dialog-narration p:last-child {
  margin-bottom: 0;
}

/* === Dialog Aside (Open Border) === */
.aside-container {
  margin: 20px 12px;
  position: relative;
  padding-bottom: 10px;
  /* Label midpoint offset — adjustable if label height changes */
  --aside-label-mid: 11px;
}

/* U-shaped frame: left, right, bottom borders via pseudo-element.
   Starts at label midpoint so the label "sits in the gap." */
.aside-container::before {
  content: '';
  position: absolute;
  top: var(--aside-label-mid);
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid color-mix(in srgb, var(--accent-digital) 14%, transparent);
  border-top: none;
  border-radius: 0;
  pointer-events: none;
}

/* Top row: label + connecting rule */
.aside-top {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Label: icon + speaker name, masks left border behind it */
.aside-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  background: var(--dialog-bg);
  flex-shrink: 0;
}
.aside-label svg {
  opacity: 0.7;
  flex-shrink: 0;
}
.aside-label span {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent-digital);
  opacity: 0.6;
  white-space: nowrap;
}

/* Rule: extends from label to right border */
.aside-rule {
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--accent-digital) 14%, transparent);
  position: relative;
  z-index: 1;
}

/* Aside messages area */
.aside-messages {
  padding: 8px 14px 0;
  position: relative;
  z-index: 1;
}

/* Aside bubble — left-aligned (aside speaker) */
.aside-msg--dc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: 18%;
}

/* Aside bubble — right-aligned (POV reply) */
.aside-msg--pov {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-left: 18%;
}

.aside-bubble {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  font-size: var(--prose-font-size);
  line-height: 1.5;
  padding: 8px 12px;
  max-width: 95%;
  background: transparent;
}
.aside-bubble--dc {
  border: 1px solid color-mix(in srgb, var(--accent-digital) 18%, transparent);
  border-radius: 10px 10px 10px 3px;
  color: color-mix(in srgb, var(--accent-digital) 85%, transparent);
}
.aside-bubble--pov {
  border: 1px solid color-mix(in srgb, var(--accent-digital) 12%, transparent);
  border-radius: 10px 10px 3px 10px;
  color: color-mix(in srgb, var(--accent-digital) 60%, transparent);
}

/* === Dialog Bottom Bar (static, in scroll flow) === */
.dialog-bottom-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 30px;
  background: var(--prose-bg);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-bar);
}

/* === Swap Scroll Segment === */
.segment--swap-scroll {
  overflow: hidden; /* the inner scroller handles overflow */
}
.swap-scroller {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.swap-scroller::-webkit-scrollbar {
  display: none;
}
.swap-scroll-content {
  /* JS sets height to scroller height + SWAP_SCROLL_RANGE */
}
.swap-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  /* Height set by JS to match scroller visible area */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* === Swap Layout Areas === */
.swap-pre-text {
  padding: 24px 16px 0;
}
.swap-pre-text p {
  font-family: 'Source Serif 4', serif;
  font-size: var(--prose-font-size);
  line-height: 1.65;
  color: var(--text-prose);
  margin-bottom: 18px;
}
.swap-post-area {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Text swap: new text that pulls up from below */
.swap-new-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 0 16px;
}
.swap-new-text p {
  font-family: 'Source Serif 4', serif;
  font-size: var(--prose-font-size);
  line-height: 1.65;
  color: var(--text-prose);
  margin-bottom: 18px;
}

/* Map swap: map halves */
.swap-map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.swap-map-half {
  display: block;
  max-width: 100%;
  height: auto;
  transition: none; /* driven by JS */
}
.swap-map-gap {
  /* Collapsible gap between map halves, height driven by JS */
}

/* === Swap Completion Flash === */
@keyframes swap-flash-green {
  0%   { filter: drop-shadow(0 0 6px var(--accent-green)) drop-shadow(0 0 12px var(--accent-green-dark)); }
  50%  { filter: drop-shadow(0 0 20px var(--accent-green)) drop-shadow(0 0 40px var(--accent-green-dark)) brightness(1.5); }
  100% { filter: none; }
}
@keyframes swap-flash-map {
  0%   { box-shadow: none; }
  40%  { box-shadow: 0 0 30px var(--accent-green), 0 0 60px var(--accent-green-dark); }
  100% { box-shadow: none; }
}
.swap-flash {
  animation: swap-flash-green 0.4s ease-out forwards;
}

/* === Fix URL Fadeout === */
.fix-url-fading {
  transition: opacity 0.4s ease;
  opacity: 0;
}

/* === Swap Complete Segment === */
.segment--swap-complete {
  overflow: hidden;
}
.swap-complete-map {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--prose-bg);
  padding: 16px;
}
.swap-complete-map img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* === Chapter Header Intro (scroll layer outside #reader) === */
#chapter-intro {
  position: relative;
  width: 100%;
  overflow: visible;
  z-index: 50;
  background: var(--prose-bg);
}
#chapter-intro .swap-viewport {
  height: 100vh;
  height: 100dvh;
}

/* === Settings Overlay === */
#overlay-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #000;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#overlay-bg.active {
  opacity: 1;
  pointer-events: auto;
}

/* Page container z-index for overlay layering (spec Section 2) */
#page-container {
  z-index: 1;
}

/* Reader shrink when overlay is open */
#reader {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}
#reader.shrunk {
  transform: scale(0.84) translateY(24px);
  border-radius: 12px;
  z-index: 25;
  /* Note: #reader is already position: fixed — do NOT change to relative, it would break layout */
}

/* Settings Top Bar */
#settings-top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 48px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 30;
  transform: translateY(-48px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#settings-top-bar.active {
  transform: translateY(0);
}

/* === Settings Content Area === */
#settings-content {
  position: fixed;
  top: 48px;
  left: 0; right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 20px 16px 16px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--border);
  transform: translateY(-48px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
#settings-content.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Big chevron on Fix URL page */
.fix-url-chevron svg {
  width: 33vw;
  height: auto;
}

.fix-url-btn {
  background: none;
  border: 1px solid var(--accent-orange);
  border-radius: 6px;
  padding: 8px 20px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--accent-orange);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Settings Bottom Bar */
#settings-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 52px;
  background: var(--chrome-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 30;
  transform: translateY(52px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#settings-bottom-bar.active {
  transform: translateY(0);
}

/* Settings bar buttons */
.settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-ui);
  -webkit-tap-highlight-color: transparent;
}
.settings-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.settings-font-btn {
  min-width: 32px;
}
.settings-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* Settings bottom bar components */
.settings-progress-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.settings-progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s ease;
}
.settings-page-count {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-bar);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* === Chapter Menu === */
.chapter-menu {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--chrome-bg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0s, opacity 0s;
  pointer-events: none;
}
.chapter-menu.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.chapter-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.chapter-menu-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--text-ui);
}
.chapter-menu-spacer {
  width: 20px;
}
.chapter-menu-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.chapter-menu-list::-webkit-scrollbar {
  display: none;
}
.chapter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chapter-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.chapter-row--current .chapter-circle {
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
  background: rgba(0, 204, 102, 0.06);
}
.chapter-row--current {
  background: var(--prose-bg);
}
.chapter-row-title {
  font-family: 'Source Serif 4', serif;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-muted);
}
.chapter-row--current .chapter-row-title {
  color: var(--text-ui);
}

/* Disable tap zones when overlay is open */
.overlay-open #tap-prev,
.overlay-open #tap-next {
  pointer-events: none;
}

/* === Book Intro Page === */
#book-intro {
  position: relative;
  background: var(--prose-bg);
}

.intro-framing {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 48px 24px 8vh;
  text-align: center;
}

.intro-placeholder {
  color: var(--text-muted);
  font-family: 'Source Serif 4', serif;
  font-size: 18px;
  font-style: italic;
  line-height: 1.8;
  max-width: 360px;
  margin: 12px 0;
}

.intro-swap-area {
  height: calc(100dvh + 300px);
  position: relative;
}

.intro-swap-viewport {
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--prose-bg);
}

/* === Intro White Box === */
.intro-white-box {
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 12px;
  max-width: 400px;
  padding: 32px 28px;
  text-align: left;
}
.intro-white-box p {
  font-family: 'Source Serif 4', serif;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.intro-white-box p:last-child {
  margin-bottom: 0;
}
.intro-status {
  font-size: 13px !important;
  color: #666 !important;
  font-style: italic;
  margin-top: 16px !important;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
}

/* === Intro Word List === */
.intro-words {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10vh 24px 10vh;
}
.intro-word {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  letter-spacing: 0.15em;
  color: var(--text-prose);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 18vh;
}
.intro-word:last-child {
  margin-bottom: 0;
}
.intro-word--tryagain {
  color: #00d4aa;
}
.intro-word--dots {
  font-size: 40px;
  letter-spacing: 0.5em;
}
.intro-word--swapped {
  color: #d4a04a;
}

/* === Tap Hint Chevron (one-off on Part 1 card) === */
.tap-hint-chevron {
  position: absolute;
  bottom: 48px;
  right: 24px;
  color: var(--text-ui);
  animation: tap-hint-pulse 2s ease-in-out infinite;
}
@keyframes tap-hint-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}

/* === Intro Down Chevron === */
.intro-chevron {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-prose);
  animation: intro-chevron-pulse 2s ease-in-out infinite;
}
@keyframes intro-chevron-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* === Intro Fade Transition === */
#book-intro.intro-fading {
  transition: background-color 0.7s ease, opacity 0.7s ease;
  background-color: var(--prose-bg);
  opacity: 0;
}
