/* ==========================================================================
   A STORY IN THE MAKING · SHAHZODA
   A Personal Monograph of Thought & Craft
   Design System: Literary + Atelier + Editorial + Dreamy
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. VARIABLES & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Editorial Palette: Paper, Ink, Atelier, Gold & Burgundy */
  --bg-vellum: #f8f5ee;
  --bg-paper: #f2ebe0;
  --bg-parchment: #eae2d3;
  --bg-atelier: #171615;
  --bg-atelier-dark: #121110;
  --bg-atelier-card: #201e1c;
  
  --ink-primary: #1e1c1a;
  --ink-secondary: #585049;
  --ink-muted: #8b8075;
  --ink-light: #eae3d6;
  --ink-light-muted: #a69b8f;
  
  --accent-burgundy: #4e1c25;
  --accent-burgundy-light: #732f3b;
  --accent-gold: #c8a268;
  --accent-gold-light: #e4c593;
  --accent-thread: #d5b583;
  --border-light: rgba(30, 28, 26, 0.12);
  --border-dark: rgba(234, 227, 214, 0.12);

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-fashion: 'Bodoni Moda', 'Didot', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Caveat', cursive;

  /* Transitions & Animation Curves */
  --ease-cinematic: cubic-bezier(0.25, 1, 0.35, 1);
  --ease-page: cubic-bezier(0.645, 0.045, 0.355, 1);
  --transition-slow: 0.85s var(--ease-cinematic);
  --transition-medium: 0.45s var(--ease-cinematic);
  --transition-fast: 0.25s ease;

  /* Spacing */
  --space-unit: clamp(1rem, 2vw, 2rem);
  --max-width: 1360px;
  --header-height: 72px;
}

/* --------------------------------------------------------------------------
   02. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button, a, [role="button"], .book-card, .gallery-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-vellum);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  background-color: var(--bg-vellum);
  transition: background-color var(--transition-slow);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.is-locked {
  overflow: hidden;
}

/* Focus styles for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   03. PROCEDURAL GRAIN & TEXTURE
   -------------------------------------------------------------------------- */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.grain-svg {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   04. SITE HEADER & CHAPTER NAVIGATION RIBBON
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  z-index: 500;
  transition: transform var(--transition-medium), opacity var(--transition-medium), background-color var(--transition-slow), border-color var(--transition-slow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(248, 245, 238, 0.82);
  border-bottom: 1px solid var(--border-light);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

body.book-is-open .site-header {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.theme-atelier .site-header {
  background: rgba(23, 22, 21, 0.85);
  border-bottom: 1px solid var(--border-dark);
  color: var(--ink-light);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-colophon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--ink-muted);
}

body.theme-atelier .header-colophon {
  color: var(--ink-light-muted);
}

.colophon-mark {
  font-family: var(--font-fashion);
  font-weight: 600;
  color: var(--accent-burgundy);
}

body.theme-atelier .colophon-mark {
  color: var(--accent-gold);
}

/* Chapter Ribbon Indicator */
.chapter-ribbon {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.2vw, 1.2rem);
}

.ribbon-item {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}

body.theme-atelier .ribbon-item {
  color: var(--ink-light-muted);
}

.ribbon-num {
  font-size: 0.65rem;
  opacity: 0.7;
}

.ribbon-item:hover {
  color: var(--ink-primary);
  transform: translateY(-1px);
}

body.theme-atelier .ribbon-item:hover {
  color: #fff;
}

.ribbon-item.active {
  color: var(--accent-burgundy);
  font-weight: 600;
}

body.theme-atelier .ribbon-item.active {
  color: var(--accent-gold);
}

.ribbon-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 1px;
  background: currentColor;
}

.ribbon-dot {
  color: var(--border-light);
  font-size: 0.7rem;
}

body.theme-atelier .ribbon-dot {
  color: var(--border-dark);
}

/* Atmospheric Sound Controller */
.sound-control {
  display: flex;
  align-items: center;
}

.sound-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 0.38rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  transition: all var(--transition-fast);
}

body.theme-atelier .sound-btn {
  border-color: var(--border-dark);
  color: var(--ink-light);
}

.sound-btn:hover {
  border-color: var(--accent-gold);
  background: rgba(200, 162, 104, 0.08);
}

.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-bar {
  width: 2px;
  height: 3px;
  background-color: currentColor;
  border-radius: 1px;
  transition: height 0.2s ease;
}

.sound-btn.is-playing .sound-bar:nth-child(1) {
  animation: barWave 1.1s ease-in-out infinite alternate;
}
.sound-btn.is-playing .sound-bar:nth-child(2) {
  animation: barWave 0.9s ease-in-out infinite 0.2s alternate;
}
.sound-btn.is-playing .sound-bar:nth-child(3) {
  animation: barWave 1.3s ease-in-out infinite 0.4s alternate;
}
.sound-btn.is-playing .sound-bar:nth-child(4) {
  animation: barWave 0.8s ease-in-out infinite 0.1s alternate;
}

@keyframes barWave {
  0% { height: 3px; }
  100% { height: 12px; }
}

/* --------------------------------------------------------------------------
   05. ACT 0: THE MYSTERIOUS OPENING BOOK COVER
   -------------------------------------------------------------------------- */
.book-cover-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #262320 0%, #171514 65%, #0f0e0d 100%);
  color: var(--ink-light);
  overflow: hidden;
  z-index: 100;
  padding: calc(env(safe-area-inset-top, 0px) + 1.5rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  transition: opacity 1.2s var(--ease-cinematic), transform 1.2s var(--ease-cinematic);
}

body.book-is-open .book-cover-stage {
  position: relative;
  min-height: 65vh;
  min-height: 65dvh;
  height: auto;
  opacity: 1;
  visibility: visible;
  padding: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 2rem) 1rem 3rem;
}

body.book-is-open .cover-interaction-prompt {
  display: none;
}

.cover-ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 700px);
  height: min(80vh, 700px);
  background: radial-gradient(circle, rgba(200, 162, 104, 0.12) 0%, rgba(78, 28, 37, 0.08) 45%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.book-perspective-wrapper {
  perspective: 1800px;
  perspective-origin: 50% 50%;
  margin-bottom: 2.5rem;
}

.book-3d {
  position: relative;
  width: clamp(280px, 34vw, 420px);
  height: clamp(400px, 48vw, 590px);
  transform-style: preserve-3d;
  transition: transform 1.4s var(--ease-page), box-shadow 1.4s var(--ease-page);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.75), 0 10px 25px -10px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

/* Realistic 3D Hinge Book Opening */
.book-hardcover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2b2522 0%, #1f1a18 50%, #161211 100%);
  border-radius: 3px 6px 6px 3px;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.6s var(--ease-page), box-shadow 1.6s var(--ease-page);
  cursor: pointer;
  z-index: 20;
  box-shadow: inset 4px 0 10px rgba(0, 0, 0, 0.4), inset -1px 0 3px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.book-hardcover:hover {
  box-shadow: 0 40px 75px -15px rgba(0, 0, 0, 0.85), inset 4px 0 10px rgba(0, 0, 0, 0.5);
}

.book-3d.opened .book-hardcover {
  transform: rotateY(-140deg);
  box-shadow: -20px 20px 40px rgba(0, 0, 0, 0.6);
}

.cover-texture-layer {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0, rgba(255,255,255,0.015) 1px, transparent 0, transparent 4px);
  pointer-events: none;
}

.cover-filigree-border {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(200, 162, 104, 0.45);
  padding: 6px;
  position: relative;
}

.cover-inner-frame {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(200, 162, 104, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: clamp(1.2rem, 2.5vw, 2rem) 1rem;
}

.cover-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  color: var(--accent-gold-light);
  opacity: 0.8;
}

.cover-centerpiece {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.cover-monogram {
  font-family: var(--font-fashion);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.cover-divider-line {
  width: 45px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.6;
  margin: 0.75rem 0;
}

.cover-main-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  letter-spacing: 0.24em;
  font-weight: 300;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.35;
}

.cover-main-title .italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-gold-light);
  letter-spacing: 0.2em;
}

.cover-subline {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--ink-light-muted);
  margin-top: 0.6rem;
  max-width: 220px;
}

.cover-footer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
}

.book-spine-crease {
  position: absolute;
  top: 0;
  left: 24px;
  width: 2px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.5), rgba(255,255,255,0.06), rgba(0,0,0,0.4));
}

/* Page Block beneath cover */
.book-first-leaf {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  background: var(--bg-paper);
  border-radius: 0 4px 4px 0;
  z-index: 10;
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-primary);
  box-shadow: inset 8px 0 15px rgba(0, 0, 0, 0.15);
}

.leaf-content {
  text-align: center;
  position: relative;
}

.leaf-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-fashion);
  font-size: 7rem;
  color: rgba(30, 28, 26, 0.04);
  pointer-events: none;
  font-weight: 700;
}

.leaf-preface {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  font-style: italic;
  color: var(--ink-secondary);
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

.book-pages-side {
  position: absolute;
  top: 3px;
  right: -10px;
  width: 14px;
  height: calc(100% - 6px);
  background: repeating-linear-gradient(to right, #ded8cc, #ded8cc 1px, #ede7dc 1px, #ede7dc 3px);
  transform: rotateY(90deg);
  transform-origin: left;
  border-radius: 0 2px 2px 0;
}

/* Action Button: Open Book */
.cover-interaction-prompt {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  z-index: 25;
}

.open-book-action {
  background: transparent;
  border: 1px solid var(--accent-gold);
  border-radius: 40px;
  padding: 0.85rem 2.2rem;
  cursor: pointer;
  color: var(--accent-gold-light);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.open-book-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(200, 162, 104, 0.2), transparent);
  transition: transform 0.6s ease;
}

.open-book-action:hover {
  background: rgba(200, 162, 104, 0.15);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(200, 162, 104, 0.2);
}

.open-book-action:hover::before {
  transform: translateX(200%);
}

.open-arrow {
  font-size: 0.9rem;
  transition: transform var(--transition-fast);
}

.open-book-action:hover .open-arrow {
  transform: translateY(3px);
}

.cover-hint {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   06. MAIN MONOGRAPH BODY & CHAPTER BASE
   -------------------------------------------------------------------------- */
.monograph-body {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s var(--ease-cinematic);
}

body.book-is-open .monograph-body {
  opacity: 1;
  visibility: visible;
}

.chapter {
  position: relative;
  padding: clamp(5rem, 9vw, 9rem) 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-margin-top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 1rem);
}

.chapter-container {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 3.5rem);
}

.chapter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.8rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.chapter-index {
  font-family: var(--font-fashion);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--accent-burgundy);
  white-space: nowrap;
}

body.theme-atelier .chapter-index {
  color: var(--accent-gold);
}

.chapter-category {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  color: var(--ink-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.chapter-volume-count {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent-burgundy);
  font-weight: 600;
  white-space: nowrap;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5.5vw, 4.8rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.chapter-title.light {
  color: var(--ink-light);
}

.chapter-title .italic {
  font-style: italic;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   07. CHAPTER I — THE READER (THE STORIES SHE READS)
   -------------------------------------------------------------------------- */
.chapter-reader {
  background: var(--bg-vellum);
}

.chapter-volume-count {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent-burgundy);
  font-weight: 600;
}

body.theme-atelier .chapter-volume-count {
  color: var(--accent-gold);
}

.chapter-headline-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: flex-end;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: clamp(2rem, 3.5vw, 3rem);
}

.quote-card-cluster {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 420px;
}

.reader-stat-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.4rem;
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-burgundy);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.stat-number-wrap {
  display: flex;
  align-items: baseline;
  color: var(--accent-burgundy);
}

.stat-approx {
  font-family: var(--font-fashion);
  font-size: 1.4rem;
  line-height: 1;
  font-weight: 400;
}

.stat-num {
  font-family: var(--font-fashion);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--accent-burgundy);
  font-weight: 600;
}

.stat-sub {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.35;
  color: var(--ink-secondary);
}

.quote-card {
  max-width: 420px;
  padding: 1.2rem 1.6rem;
  background: var(--bg-paper);
  border-left: 2px solid var(--accent-burgundy);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.literary-aphorism {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-primary);
  margin-bottom: 0.4rem;
}

.quote-annotation {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.reader-exposition {
  max-width: 720px;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.editorial-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.8;
  color: var(--ink-secondary);
  font-weight: 300;
}

/* Curation Shelf Grid */
.curation-label-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--ink-muted);
}

.curation-rule {
  flex-grow: 1;
  height: 1px;
  background: var(--border-light);
}

.books-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

/* Featured Book Card */
.book-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
  cursor: pointer;
  overflow: hidden;
}

.book-card:hover, .book-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px -10px rgba(30, 28, 26, 0.12);
  border-color: var(--accent-gold);
}

.book-object-wrapper {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.book-3d-model {
  position: relative;
  width: 220px;
  height: 310px;
  transform-style: preserve-3d;
  transition: transform 0.8s var(--ease-cinematic), box-shadow 0.8s var(--ease-cinematic);
  box-shadow: 10px 15px 30px rgba(0, 0, 0, 0.18);
  border-radius: 2px 4px 4px 2px;
}

.book-card:hover .book-3d-model {
  transform: rotateY(-18deg) rotateX(6deg) translateZ(15px);
  box-shadow: 20px 25px 45px rgba(0, 0, 0, 0.24);
}

.book-cover-face {
  position: absolute;
  inset: 0;
  border-radius: 2px 4px 4px 2px;
  overflow: hidden;
  background: #3e161c;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback Art if image is missing */
.book-cover-fallback {
  position: absolute;
  inset: 0;
  display: none;
  background: linear-gradient(135deg, #44171e 0%, #2c0f13 100%);
  padding: 1.5rem;
  color: var(--accent-gold);
  text-align: center;
}

.book-cover-img:not([src]), .book-cover-img[src=""] {
  display: none;
}
.book-cover-img:not([src]) + .book-cover-fallback,
.book-cover-img[src=""] + .book-cover-fallback {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.fallback-frame {
  border: 1px solid var(--accent-gold);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.fallback-author {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}

.fallback-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  letter-spacing: 0.14em;
  font-weight: 600;
  line-height: 1.2;
}

.fallback-year {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
}

.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 100%;
  background: linear-gradient(to right, #1d090d, #42171e, #1a080c);
  transform: rotateY(-90deg);
  transform-origin: left;
}

.book-leather-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,0.12) 0%, transparent 40%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}

.book-emboss-border {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(200, 162, 104, 0.4);
  pointer-events: none;
}

/* Dossier details */
.dossier-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  margin-bottom: 0.8rem;
}

.dossier-status {
  color: var(--accent-burgundy);
  font-weight: 600;
}

.dossier-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
  margin-bottom: 0.2rem;
}

.dossier-author {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-muted);
  margin-bottom: 1.2rem;
  letter-spacing: 0.05em;
}

.dossier-passage {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 1.2rem;
}

.dossier-quote-block {
  background: var(--bg-paper);
  border-radius: 2px;
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.script-quote {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-style: italic;
  color: var(--accent-burgundy);
}

.quote-sub {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.dossier-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border-light);
  padding-top: 0.8rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
}

.action-tag {
  color: var(--accent-burgundy);
  font-weight: 600;
}

/* Interactive Leaf Drawer inside card */
.book-leaf-drawer {
  position: absolute;
  inset: 0;
  background: var(--bg-paper);
  z-index: 30;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.6s var(--ease-cinematic), opacity 0.6s var(--ease-cinematic);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
}

.book-card.leaf-opened .book-leaf-drawer {
  transform: translateY(0);
  opacity: 1;
}

.leaf-paper-texture {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.close-leaf-btn {
  position: absolute;
  top: -1rem;
  right: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.close-leaf-btn:hover {
  color: var(--ink-primary);
}

.leaf-chapter-tag {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  color: var(--accent-burgundy);
  font-weight: 600;
}

.leaf-quote-uz {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-primary);
  border-left: 2px solid var(--accent-burgundy);
  padding-left: 1rem;
}

.leaf-reflection {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.leaf-folio {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}

/* Tribute Book Card for ~200 Books */
.book-card.tribute-card {
  background: #faf7f2;
}

.archive-stack-visual {
  width: 220px;
  height: 310px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 1.5rem 0.8rem;
}

.stack-book-layer {
  position: relative;
  height: 46px;
  border-radius: 3px 5px 5px 3px;
  box-shadow: 4px 6px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  border-left: 4px solid var(--accent-gold);
}

.stack-book-layer.layer-1 {
  background: linear-gradient(135deg, #4e1c25 0%, #301016 100%);
  transform: translateX(-6px);
}
.stack-book-layer.layer-2 {
  background: linear-gradient(135deg, #2b2522 0%, #1c1816 100%);
  transform: translateX(8px);
}
.stack-book-layer.layer-3 {
  background: linear-gradient(135deg, #3d332a 0%, #26201a 100%);
  transform: translateX(-3px);
}

.layer-title {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  color: var(--accent-gold-light);
  white-space: nowrap;
}

.stack-counter-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 35%, #7a2d39, #4a1c24);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 12px 28px rgba(78, 28, 37, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold-light);
  z-index: 10;
}

.counter-approx {
  font-size: 0.8rem;
  line-height: 1;
}

.counter-num {
  font-family: var(--font-fashion);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.counter-text {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  opacity: 0.85;
}


.reader-footer-notation {
  margin-top: 5rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-muted);
}

.notation-mark {
  color: var(--accent-burgundy);
}

/* --------------------------------------------------------------------------
   08. ACT II: THE WEAVING BRIDGE (TRANSITION FROM READING TO CREATING)
   -------------------------------------------------------------------------- */
.transition-bridge {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--bg-vellum) 0%, #302c29 45%, var(--bg-atelier) 100%);
  color: var(--ink-light);
}

.bridge-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.paper-fade-to-linen {
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0, rgba(255,255,255,0.015) 1px, transparent 0, transparent 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.015) 0, rgba(255,255,255,0.015) 1px, transparent 0, transparent 4px);
  opacity: 0.4;
}

.thread-canvas-container {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 300px;
  transform: translateY(-50%);
  pointer-events: none;
}

.thread-svg {
  width: 100%;
  height: 100%;
}

.thread-basting {
  fill: none;
  stroke: rgba(213, 181, 131, 0.35);
  stroke-width: 1.5;
  stroke-dasharray: 8, 8;
}

.thread-silk {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 1.8;
  stroke-dasharray: 2000;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.bridge-content {
  position: relative;
  z-index: 10;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.bridge-tag {
  font-size: 0.68rem;
  letter-spacing: 0.35em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.bridge-statement {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.statement-line {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #dfd7cc;
  line-height: 1.4;
}

.statement-line.emphasis {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-gold-light);
  font-weight: 400;
}

.bridge-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.stitch-divider {
  letter-spacing: 0.4em;
  color: var(--accent-gold);
  font-size: 0.8rem;
}

.bridge-cue {
  font-size: 0.65rem;
  letter-spacing: 0.26em;
  color: var(--ink-light-muted);
}

/* --------------------------------------------------------------------------
   09. CHAPTER II — THE CREATOR (THE THINGS SHE CREATES)
   -------------------------------------------------------------------------- */
.chapter-atelier {
  background: var(--bg-atelier);
  color: var(--ink-light);
}

.atelier-ambient-bg {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 60%;
  background: radial-gradient(circle, rgba(200, 162, 104, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.chapter-headline-group.dark {
  border-bottom: 1px solid var(--border-dark);
}

.atelier-sublead {
  max-width: 580px;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  line-height: 1.8;
  color: var(--ink-light-muted);
  font-weight: 300;
}

/* Editorial Asymmetric Fashion Gallery */
.atelier-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  margin-top: clamp(3rem, 6vw, 5.5rem);
}

.gallery-item {
  position: relative;
  cursor: pointer;
  outline: none;
}

/* Asymmetric Positioning */
.item-hero {
  grid-column: 1 / span 7;
}

.item-detail-wide {
  grid-column: 8 / span 5;
  align-self: center;
}

.item-vertical {
  grid-column: 1 / span 5;
  margin-top: 2rem;
}

.item-medium {
  grid-column: 6 / span 7;
  margin-top: -2rem;
}

.item-adras {
  grid-column: 1 / span 6;
  margin-top: 2.5rem;
}

.item-child {
  grid-column: 7 / span 6;
  margin-top: 4rem;
}

.item-macro {
  grid-column: 3 / span 8;
  margin-top: 3.5rem;
}

.item-visual-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-atelier-card);
  border: 1px solid var(--border-dark);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

.gallery-item:hover .item-visual-frame,
.gallery-item:focus-visible .item-visual-frame {
  transform: scale(1.02);
  border-color: var(--accent-gold);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.7);
}

.gallery-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 1s var(--ease-cinematic), filter 0.8s ease;
  filter: contrast(1.05) brightness(0.95);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.05);
  filter: contrast(1.08) brightness(1.02);
}

/* Specific aspect ratios for asymmetric harmony */
.item-hero .item-visual-frame { aspect-ratio: 4 / 5; }
.item-detail-wide .item-visual-frame { aspect-ratio: 3 / 4.2; }
.item-vertical .item-visual-frame { aspect-ratio: 3 / 4.4; }
.item-medium .item-visual-frame { aspect-ratio: 3 / 4.2; }
.item-adras .item-visual-frame { aspect-ratio: 3 / 4.2; }
.item-child .item-visual-frame { aspect-ratio: 3 / 4.2; }
.item-macro .item-visual-frame { aspect-ratio: 16 / 10; }

/* Atelier Tailor Markings & Chalk Crosshairs */
.item-chalk-crosshair {
  position: absolute;
  color: var(--accent-gold);
  opacity: 0.6;
  font-family: monospace;
  font-size: 1rem;
  line-height: 1;
  z-index: 5;
  pointer-events: none;
}
.cross-top-left { top: 12px; left: 12px; }
.cross-bottom-right { bottom: 12px; right: 12px; }

.item-measure-guide {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 5;
  pointer-events: none;
}

.measure-tick {
  width: 25px;
  height: 1px;
  background: var(--accent-gold);
}

.measure-label {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
  font-family: monospace;
}

.img-overlay-hover {
  position: absolute;
  inset: 0;
  background: rgba(18, 17, 16, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 6;
}

.gallery-item:hover .img-overlay-hover,
.gallery-item:focus-visible .img-overlay-hover {
  opacity: 1;
}

.hover-action {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.6rem 1.4rem;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(6px);
  transition: transform var(--transition-fast);
}

.gallery-item:hover .hover-action {
  transform: translateY(0);
}

/* Captions & Thread Connection */
.item-caption-wrap {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
}

.item-index-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
}

.item-num {
  font-family: var(--font-fashion);
  font-weight: 600;
  font-size: 0.9rem;
}

.item-thread-stitch {
  flex-grow: 1;
  height: 1px;
  background-image: linear-gradient(to right, var(--accent-gold) 50%, transparent 50%);
  background-size: 8px 1px;
  opacity: 0.35;
  transition: opacity var(--transition-medium);
}

.gallery-item:hover .item-thread-stitch {
  opacity: 0.9;
}

.item-category {
  font-size: 0.6rem;
  color: var(--ink-light-muted);
}

.item-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
}

.item-snippet {
  font-size: 0.85rem;
  color: var(--ink-light-muted);
  line-height: 1.6;
}

.item-atelier-tag {
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: var(--accent-gold);
  margin-top: 0.3rem;
  opacity: 0.75;
}

.atelier-footer-quote {
  margin-top: clamp(4rem, 8vw, 7rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.sewing-thread-line {
  width: 120px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.5;
}

.quote-editorial {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-style: italic;
  color: var(--ink-light-muted);
  max-width: 650px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   09b. CHAPTER III — THE SWEET ART (HER KITCHEN & BAKING)
   -------------------------------------------------------------------------- */
.chapter-kitchen {
  background: #171513;
  color: var(--ink-light);
  border-top: 1px solid var(--border-dark);
  position: relative;
  overflow: hidden;
}

.chapter-kitchen::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 50%;
  background: radial-gradient(ellipse at center, rgba(200, 162, 104, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 1060px;
  margin: 3.5rem auto 0;
}

.kitchen-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(200, 162, 104, 0.18);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.4s ease, 
              box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: none;
  position: relative;
}

.kitchen-card:hover,
.kitchen-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(200, 162, 104, 0.45);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(200, 162, 104, 0.08);
}

.kitchen-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #0f0e0d;
}

.kitchen-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.kitchen-card:hover .kitchen-img,
.kitchen-card:focus-visible .kitchen-img {
  transform: scale(1.04);
}

.kitchen-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(23, 21, 19, 0.8) 0%, rgba(23, 21, 19, 0.1) 40%, transparent 70%);
  pointer-events: none;
}

.kitchen-tap-hint {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(20, 18, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 162, 104, 0.25);
  color: var(--accent-gold);
  font-family: var(--font-fashion);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  padding: 0.35rem 0.65rem;
  border-radius: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.kitchen-card:hover .kitchen-tap-hint,
.kitchen-card:focus-visible .kitchen-tap-hint {
  opacity: 1;
  transform: translateY(0);
}

.kitchen-card-body {
  padding: 1.75rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kitchen-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kitchen-tag {
  font-family: var(--font-fashion);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.kitchen-year {
  font-family: var(--font-fashion);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--ink-light-muted);
}

.kitchen-item-title {
  font-family: var(--font-fashion);
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-light);
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.kitchen-item-snippet {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-light-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.kitchen-item-snippet em {
  color: var(--accent-gold);
  font-style: italic;
}

.kitchen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(200, 162, 104, 0.1);
}

.k-chip {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(245, 240, 230, 0.75);
  background: rgba(200, 162, 104, 0.07);
  border: 1px solid rgba(200, 162, 104, 0.15);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
}

.kitchen-footer-quote {
  margin-top: 4.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.baking-divider-line {
  display: block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* --------------------------------------------------------------------------
   10. CHAPTER IV — HER (SHAHZODA)
   -------------------------------------------------------------------------- */
.chapter-portrait {
  background: #141312;
  color: var(--ink-light);
  border-top: 1px solid var(--border-dark);
}

.portrait-date-stamp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.stamp-date {
  font-family: var(--font-fashion);
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  color: var(--accent-gold);
}

.stamp-label {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--ink-light-muted);
}

/* Editorial Monograph Spread */
.portrait-editorial-spread {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.portrait-primary-frame {
  position: relative;
}

.frame-matte {
  position: relative;
  padding: clamp(1rem, 2vw, 2rem);
  background: #1c1a18;
  border: 1px solid var(--border-dark);
  box-shadow: 0 30px 65px rgba(0, 0, 0, 0.7);
}

.portrait-corner-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-gold);
  border-style: solid;
  pointer-events: none;
}
.portrait-corner-marker.top-left {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}
.portrait-corner-marker.bottom-right {
  bottom: 8px;
  right: 8px;
  border-width: 0 1px 1px 0;
}

.portrait-hero-img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5.2;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) brightness(0.96);
  border-radius: 2px;
}

.portrait-hero-caption {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.caption-title {
  font-family: var(--font-fashion);
  font-size: 1.1rem;
  letter-spacing: 0.24em;
  color: var(--accent-gold);
}

.caption-sub {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--ink-light-muted);
}

/* Satellites */
.portrait-satellites {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 3.5vw, 3.5rem);
}

.satellite-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.sat-frame {
  width: 140px;
  height: 180px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-dark);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.sat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

.satellite-card:hover .sat-img {
  transform: scale(1.08);
}

.sat-caption {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sat-num {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
}

.sat-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: #dfd8cf;
  line-height: 1.4;
}

.portrait-poetic-card {
  background: rgba(30, 28, 26, 0.5);
  border-left: 2px solid var(--accent-gold);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.card-flourish {
  color: var(--accent-gold);
  font-size: 1.2rem;
}

.portrait-poem {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1.4vw, 1.3rem);
  font-style: italic;
  line-height: 1.7;
  color: #ede7dc;
}

.card-credit {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--ink-light-muted);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   11. ACT V: THE FINAL CHAPTER & THE BIRTHDAY REVEAL
   -------------------------------------------------------------------------- */
.chapter-finale {
  background: radial-gradient(circle at center, #fbf8f2 0%, #f4efe4 60%, #eae2d3 100%);
  color: var(--ink-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.finale-ambient {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vh;
  background: radial-gradient(circle, rgba(200, 162, 104, 0.1) 0%, rgba(78, 28, 37, 0.05) 45%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.finale-container {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.2rem, 4vw, 3rem);
  position: relative;
  z-index: 10;
}

/* Stage 1: The Closed Leaf */
.finale-leaf-closed {
  text-align: center;
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.finale-leaf-closed.is-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  display: none;
}

.leaf-stationery {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 4rem);
  box-shadow: 0 25px 60px rgba(30, 28, 26, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.final-leaf-num {
  font-family: var(--font-fashion);
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent-burgundy);
  line-height: 1;
}

.leaf-line {
  width: 40px;
  height: 1px;
  background: var(--accent-burgundy);
  opacity: 0.5;
}

.final-leaf-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  letter-spacing: 0.2em;
  font-weight: 300;
  text-transform: uppercase;
}

.final-leaf-sub {
  font-size: 0.95rem;
  color: var(--ink-secondary);
  font-style: italic;
  font-family: var(--font-serif);
}

.turn-page-action {
  margin-top: 1.5rem;
  background: var(--accent-burgundy);
  border: none;
  border-radius: 40px;
  padding: 1rem 2.6rem;
  cursor: pointer;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-medium);
  box-shadow: 0 10px 25px rgba(78, 28, 37, 0.25);
}

.turn-page-action:hover {
  background: var(--accent-burgundy-light);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(78, 28, 37, 0.35);
}

.turn-book-icon {
  font-size: 1.2rem;
  color: var(--accent-gold-light);
}

.turn-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  font-weight: 500;
}

.turn-sub {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

/* Stage 2: The Unfolded Reveal */
.finale-leaf-opened {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 1.2s var(--ease-cinematic), transform 1.2s var(--ease-cinematic);
  display: none;
}

.finale-leaf-opened.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal-paper-envelope {
  background: #ffffff;
  border: 1px solid rgba(200, 162, 104, 0.35);
  border-radius: 4px;
  padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.8rem, 4.5vw, 4rem);
  box-shadow: 0 30px 80px rgba(30, 28, 26, 0.12), inset 0 0 40px rgba(248, 245, 238, 0.4);
  position: relative;
}

.reveal-embossed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.reveal-stamp {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--ink-muted);
}

.reveal-wax-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #7a2d39, #4a1c24);
  color: var(--accent-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-fashion);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(74, 28, 36, 0.4), inset 0 2px 3px rgba(255, 255, 255, 0.2);
}

/* The Grand Birthday Greeting */
.reveal-greeting-section {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.birthday-salutation {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--ink-primary);
  letter-spacing: 0.04em;
}

.name-reveal {
  font-family: var(--font-serif);
  font-weight: 600;
  font-style: italic;
  color: var(--accent-burgundy);
  display: inline-block;
  margin-top: 0.2rem;
}

.greeting-gold-divider {
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
  margin: 1.5rem auto 0;
  border-radius: 1px;
}

/* The Personal Letter */
.personal-letter-body {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  line-height: 1.85;
  color: var(--ink-secondary);
  margin-bottom: 3rem;
}

.letter-intro {
  font-family: var(--font-hand);
  font-size: clamp(1.6rem, 2.2vw, 2.1rem);
  color: var(--ink-primary);
  margin-bottom: 1.5rem;
}

.letter-message-container {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.letter-p {
  text-indent: 1.8rem;
}


.letter-closing {
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  color: var(--ink-primary);
  margin-top: 2rem;
}

/* Understated Creator Colophon */
.reveal-colophon-signature {
  margin-top: clamp(2.5rem, 4vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
}

.sig-dedication {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.sig-date {
  font-family: var(--font-fashion);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--accent-burgundy);
}

.sig-author {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--ink-primary);
  font-weight: 500;
}

.reveal-actions {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.restart-action {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 30px;
  padding: 0.6rem 1.6rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
}

.restart-action:hover {
  border-color: var(--accent-burgundy);
  color: var(--accent-burgundy);
}

/* --------------------------------------------------------------------------
   12. HIGH-FASHION EDITORIAL LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.editorial-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-cinematic), visibility 0.4s var(--ease-cinematic);
}

.editorial-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  touch-action: none;
}

.modal-dialog-box {
  position: relative;
  z-index: 10;
  background: #191816;
  border: 1px solid var(--border-dark);
  touch-action: pan-y;
  border-radius: 4px;
  max-width: 1080px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.85);
  color: var(--ink-light);
  transform: scale(0.96) translateY(15px);
  transition: transform 0.45s var(--ease-cinematic);
}

.editorial-modal.is-active .modal-dialog-box {
  transform: scale(1) translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: transparent;
  border: 1px solid var(--border-dark);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  color: var(--ink-light-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  transition: all var(--transition-fast);
  z-index: 20;
}

.modal-close-btn:hover {
  color: #fff;
  border-color: var(--accent-gold);
  background: rgba(200, 162, 104, 0.1);
}

.modal-spread-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 3.5vw, 3rem);
  padding: clamp(2rem, 4vw, 3.5rem);
}

.modal-image-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-frame {
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  border: 1px solid var(--border-dark);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  background: #121110;
}

.modal-display-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-dossier-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
}

.modal-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--accent-gold);
}

.modal-piece-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 300;
  line-height: 1.2;
  color: #fff;
}

.modal-divider {
  width: 40px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.5;
}

.notes-heading {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  color: var(--ink-light-muted);
  margin-bottom: 0.5rem;
}

.modal-piece-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #d1c8bc;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--border-dark);
  border-bottom: 1px solid var(--border-dark);
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--ink-light-muted);
}

.spec-val {
  font-size: 0.82rem;
  color: #fff;
}

.modal-footer-flourish {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   13. RESPONSIVE DESIGN & IPHONE 11 / MOBILE OPTIMIZATIONS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .chapter-headline-group {
    grid-template-columns: 1fr;
  }
  
  .portrait-editorial-spread {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .portrait-satellites {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .satellite-card {
    flex: 1 1 calc(50% - 1.5rem);
  }

  .portrait-poetic-card {
    width: 100%;
  }

  /* Adjust fashion gallery for tablet */
  .item-hero { grid-column: 1 / span 12; }
  .item-detail-wide { grid-column: 1 / span 12; }
  .item-vertical { grid-column: 1 / span 6; margin-top: 0; }
  .item-medium { grid-column: 7 / span 6; margin-top: 0; }
  .item-adras { grid-column: 1 / span 6; margin-top: 0; }
  .item-child { grid-column: 7 / span 6; margin-top: 0; }
  .item-macro { grid-column: 1 / span 12; margin-top: 0; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 84px;
  }

  .site-header {
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(248, 245, 238, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  }

  body.theme-atelier .site-header {
    background: rgba(23, 22, 21, 0.96);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.9rem 0.25rem;
    height: 100%;
    box-sizing: border-box;
  }

  .header-colophon {
    order: 1;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }

  .sound-control {
    order: 2;
  }

  .sound-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.62rem;
  }

  /* Full interactive chapter ribbon on mobile */
  .chapter-ribbon {
    order: 3;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0.1rem;
    gap: 0.35rem;
    mask-image: linear-gradient(to right, black 86%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 86%, transparent 100%);
  }

  .chapter-ribbon::-webkit-scrollbar {
    display: none;
  }

  .ribbon-item {
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    border-radius: 14px;
    white-space: nowrap;
    color: var(--ink-muted);
    transition: all var(--transition-fast);
  }

  .ribbon-item.active {
    background: rgba(78, 28, 37, 0.1);
    color: var(--accent-burgundy);
    font-weight: 600;
  }

  body.theme-atelier .ribbon-item.active {
    background: rgba(200, 162, 104, 0.18);
    color: var(--accent-gold);
    font-weight: 600;
  }

  .ribbon-dot {
    font-size: 0.6rem;
    opacity: 0.35;
    flex-shrink: 0;
  }

  .chapter {
    padding: clamp(3.5rem, 8vw, 5rem) 0;
  }

  .chapter-container {
    padding: 0 1.25rem;
  }

  .chapter-meta {
    margin-bottom: 1.2rem;
  }

  .chapter-title {
    font-size: clamp(2rem, 7.5vw, 2.8rem);
    word-break: break-word;
  }

  .chapter-headline-group {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.8rem;
  }

  .reader-stat-card,
  .quote-card {
    width: 100%;
    max-width: 100%;
  }

  .bookshelf-curation .books-display-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .book-card {
    padding: 1.5rem 1.25rem;
    max-width: 100%;
  }

  .book-leaf-drawer {
    padding: 1.5rem 1.2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .close-leaf-btn {
    min-width: 44px;
    min-height: 44px;
    top: 0.5rem;
    right: 0.5rem;
  }

  /* Transition Bridge on mobile */
  .transition-bridge {
    min-height: 55vh;
    min-height: 55dvh;
    padding: 4rem 1.25rem;
  }

  .statement-line {
    font-size: clamp(1.2rem, 5vw, 1.6rem);
  }

  /* Single column on mobile fashion spread */
  .atelier-gallery {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    margin-top: 2rem;
  }

  .item-hero,
  .item-detail-wide,
  .item-vertical,
  .item-medium,
  .item-adras,
  .item-child,
  .item-macro {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .item-visual-frame {
    aspect-ratio: 3 / 4;
    border-radius: 6px;
  }

  .item-macro .item-visual-frame {
    aspect-ratio: 16 / 11;
  }

  /* Mobile Kitchen / Baking Grid */
  .kitchen-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
  }

  .kitchen-tap-hint {
    opacity: 1;
    transform: translateY(0);
  }

  .kitchen-card-body {
    padding: 1.35rem 1.25rem 1.6rem;
  }

  .kitchen-footer-quote {
    margin-top: 3rem;
  }

  /* Mobile bottom-sheet lightbox modal */
  .editorial-modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-dialog-box {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.35, 1);
  }

  .editorial-modal.is-active .modal-dialog-box {
    transform: translateY(0);
  }

  .modal-close-btn {
    position: sticky;
    top: 0.8rem;
    float: right;
    margin-right: 0.8rem;
    margin-bottom: -2.8rem;
    min-height: 38px;
    background: rgba(25, 24, 22, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: var(--accent-gold);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  }

  .modal-spread-content {
    grid-template-columns: 1fr;
    padding: 3.2rem 1.25rem 2rem;
    gap: 1.25rem;
  }

  .modal-image-frame {
    max-height: 38vh;
    max-height: 38dvh;
    border-radius: 6px;
    background: #0d0c0b;
  }

  .modal-display-img {
    max-height: 38vh;
    max-height: 38dvh;
    object-fit: contain;
  }

  .modal-piece-title {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  .modal-piece-text {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  .modal-specs-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem 0;
  }

  /* Chapter III: Her Portraits on mobile */
  .portrait-editorial-spread {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    margin-top: 2rem;
  }

  .portrait-primary-frame .frame-matte {
    padding: 0.85rem;
    border-radius: 6px;
  }

  .portrait-hero-img {
    aspect-ratio: 4 / 5;
    border-radius: 4px;
  }

  .portrait-satellites {
    flex-direction: column;
    gap: 1.25rem;
  }

  .satellite-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.1rem;
    padding: 0.85rem;
    background: rgba(28, 26, 24, 0.65);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
  }

  .sat-frame {
    width: 105px;
    height: 135px;
    flex-shrink: 0;
    border-radius: 4px;
  }

  .sat-caption {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .sat-num {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--accent-gold);
  }

  .sat-text {
    font-size: 0.82rem;
    line-height: 1.42;
    color: var(--ink-light-muted);
  }

  .portrait-poetic-card {
    padding: 1.5rem 1.25rem;
    border-radius: 6px;
  }

  .portrait-poem {
    font-size: 1rem;
    line-height: 1.65;
  }

  /* Act V Reveal on mobile */
  .leaf-stationery {
    padding: 2.5rem 1.25rem;
    border-radius: 6px;
  }

  .turn-page-action {
    padding: 0.9rem 2rem;
    min-height: 50px;
    border-radius: 25px;
  }

  .reveal-paper-envelope {
    padding: 2rem 1.25rem;
    border-radius: 6px;
  }

  .reveal-embossed-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.9rem;
    margin-bottom: 1.8rem;
  }

  .reveal-stamp {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }

  .reveal-wax-seal {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .birthday-salutation {
    font-size: 1.95rem;
    line-height: 1.2;
  }

  .personal-letter-body {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 2rem;
  }

  .letter-intro {
    font-size: 1.45rem;
    margin-bottom: 1rem;
  }

  .letter-p {
    text-indent: 1rem;
  }

  .letter-closing {
    font-size: 1.35rem;
    margin-top: 1.5rem;
  }

  .reveal-colophon-signature {
    margin-top: 2rem;
    padding-top: 1.5rem;
    align-items: center;
    text-align: center;
  }

  .restart-action {
    min-height: 48px;
    padding: 0.85rem 1.8rem;
    border-radius: 24px;
    font-size: 0.72rem;
  }
}

/* --------------------------------------------------------------------------
   Specialized iPhone 11 (414px x 896px) and Compact Phone Breakpoint
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .book-cover-stage {
    padding: calc(env(safe-area-inset-top, 0px) + 1.2rem) 1rem calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
    justify-content: space-evenly;
  }

  .book-perspective-wrapper {
    perspective: 1200px;
    margin-bottom: 1rem;
  }

  .book-3d {
    width: 250px;
    height: 360px;
  }

  .book-3d.opened {
    transform: translateX(18px);
  }

  .book-3d.opened .book-hardcover {
    transform: rotateY(-110deg);
  }

  .book-first-leaf {
    padding: 1.4rem 0.9rem;
  }

  .leaf-watermark {
    font-size: 5rem;
  }

  .leaf-preface {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .cover-monogram {
    font-size: 2.8rem;
  }

  .cover-main-title {
    font-size: 1.35rem;
  }

  .open-book-action {
    padding: 0.8rem 1.8rem;
    font-size: 0.72rem;
    min-height: 48px;
  }

  .cover-hint {
    font-size: 0.65rem;
  }

  .book-3d-model {
    width: 190px;
    height: 270px;
  }

  .archive-stack-visual {
    width: 190px;
    height: 270px;
  }

  .stack-counter-badge {
    bottom: 12px;
    right: 12px;
    padding: 0.5rem 0.7rem;
  }

  .counter-num {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   14. ACCESSIBILITY & PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
