:root {
  --bg-top: #0e1a2f;
  --bg-mid: #13243a;
  --bg-bottom: #081321;
  --paper: #f4e7ca;
  --paper-strong: #efdfbb;
  --paper-edge: #b79256;
  --ink: #25180a;
  --ink-soft: #4b3820;
  --accent: #9a6a20;
  --accent-deep: #6f4815;
  --line: rgba(92, 67, 33, 0.28);
  --panel-shadow: 0 20px 48px rgba(6, 13, 28, 0.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1120px;
  --font-title: "Eagle Lake", "Times New Roman", serif;
  --font-script: "Great Vibes", cursive;
  --font-body: "EB Garamond", "Noto Serif JP", serif;
}

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

/* Smooth scrolling only when the flipbook is NOT active.
   body.has-flipbook uses overflow:hidden + wheel-driven rAF animation,
   and scroll-behavior:smooth on <html> fights the behavior:"auto" scrollTo
   calls made during flipbook initialisation, producing a double-scroll. */
html:not(:has(body.has-flipbook)) {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
  line-height: 1.7;
  background:
    radial-gradient(880px 420px at 14% 12%, rgba(249, 217, 148, 0.12), transparent 65%),
    radial-gradient(760px 400px at 88% 26%, rgba(142, 181, 255, 0.12), transparent 66%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bottom) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.4px);
  background-size: 240px 240px;
  opacity: 0.22;
  z-index: -1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-title);
  color: var(--ink);
  line-height: 1.28;
  letter-spacing: 0.015em;
}

h1 {
  font-size: clamp(1.95rem, 5.3vw, 3.2rem);
}

h2 {
  font-size: clamp(1.45rem, 3.8vw, 2.3rem);
}

h3 {
  font-size: clamp(1.08rem, 2.4vw, 1.4rem);
}

p,
li {
  color: var(--ink-soft);
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

.container {
  width: min(var(--container), calc(100% - 2.2rem));
  margin-inline: auto;
}

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

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 40;
  background: #fff8e7;
  color: #1f1406;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(236, 210, 164, 0.28);
  backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(9, 19, 35, 0.82), rgba(9, 19, 35, 0.74));
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}

.brand-main {
  color: #f5deb0;
  font-family: var(--font-title);
  font-size: 1.16rem;
  letter-spacing: 0.06em;
}

.brand-sub {
  color: #f4d99e;
  font-family: var(--font-script);
  font-size: 1rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.56rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  white-space: nowrap;
  text-decoration: none;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 208, 150, 0.32);
  background: rgba(255, 238, 204, 0.08);
  color: #f5e3c2;
  font-size: 0.84rem;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: rgba(250, 226, 179, 0.22);
  border-color: rgba(242, 208, 150, 0.62);
}

.lang-toggle {
  display: inline-flex;
  padding: 0.2rem;
  gap: 0.22rem;
  border-radius: 999px;
  border: 1px solid rgba(236, 210, 164, 0.34);
  background: rgba(255, 244, 218, 0.08);
}

.lang-btn {
  min-height: 30px;
  padding: 0.28rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #edd9b3;
  font-size: 0.76rem;
  font-family: var(--font-title);
  cursor: pointer;
}

.lang-btn.is-active {
  background: linear-gradient(180deg, #faedcf, #e7cb94);
  color: #3d2a10;
}

.story-main {
  padding: 2.2rem 0 2.6rem;
}

/* ================================================================
   FLIPBOOK ANIMATION STYLES — DO NOT MODIFY THIS SECTION
   Everything from here until "END FLIPBOOK STYLES" drives the
   page-flip animation. Edit page content styles above this line.
   ================================================================ */

.flipbook-shell {
  position: relative;
}

.flipbook-sticky {
  position: sticky;
  top: 84px;
  height: calc(100svh - 100px);
  display: grid;
  place-items: center;
  perspective: 2800px;
}

.flipbook-book {
  /* Portrait book — roughly A4/B5 proportions (3:4 ratio) */
  width: min(620px, calc(100vw - 3rem));
  height: min(820px, calc(100svh - 145px));
  transform-style: preserve-3d;
  filter: drop-shadow(0 34px 62px rgba(5, 11, 22, 0.36));
}

.flipbook-pages {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.flipbook-hint {
  margin: 0;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(238, 208, 149, 0.38);
  background: rgba(9, 19, 35, 0.68);
  color: #f7deb0;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* Fade out after a few seconds */
  animation: hintFade 4s ease-in-out forwards;
}

@keyframes hintFade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

body.has-flipbook .story-main {
  padding-top: 1rem;
  padding-bottom: 1.4rem;
}

/* Nav-actions is moved to body by JS — position it at the top-right
   on desktop to match where the header normally shows it */
body.has-flipbook > .nav-actions {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 31;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.2rem 1.4rem;
  pointer-events: auto;
}

body.has-flipbook {
  overflow: hidden;
}

body.has-flipbook .section.chapter {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  --flip-shadow: 0;
}

/* ── Book-page edge structure ────────────────────────────────────
   Gives each flipbook page a visible border and stacked-page
   depth so it reads as a physical book page, not a flat panel. */

body.has-flipbook .chapter .container {
  border: 2.5px solid #6b4a1f;
  border-left: 4px solid #4a3010;
  box-shadow:
    /* inner highlight along top/right for paper feel */
    inset 2px 2px 6px rgba(255, 248, 228, 0.5),
    inset -1px -1px 4px rgba(139, 98, 42, 0.12),
    /* stacked pages — thick book effect */
    2px 2px 0 0 #ddd0ac,
    2.5px 2.5px 0 0 #7a5a28,
    4px 4px 0 0 #d6c89e,
    4.5px 4.5px 0 0 #6b4a1f,
    6px 6px 0 0 #d1be90,
    6.5px 6.5px 0 0 #5e3f18,
    8px 8px 0 0 #ccb886,
    8.5px 8.5px 0 0 #543614,
    10px 10px 0 0 #c7b27e,
    10.5px 10.5px 0 0 #4a3010,
    12px 12px 0 0 #c2ac76,
    12.5px 12.5px 0 0 #422a0e,
    14px 14px 0 0 #bda66e,
    14.5px 14.5px 0 0 #3b2508,
    /* final depth shadow */
    18px 20px 30px rgba(30, 18, 6, 0.35);
  border-radius: 4px 18px 18px 4px;
  position: relative;
}

/* Spine edge — a dark strip on the left mimicking the book binding */
body.has-flipbook .chapter .container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 100%;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(
    to right,
    #3a2410 0%,
    #4e3215 12%,
    #6a4d28 28%,
    rgba(140, 108, 58, 0.35) 50%,
    rgba(183, 146, 86, 0.15) 70%,
    rgba(210, 180, 120, 0.06) 85%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

body.has-flipbook .section.chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 4px 18px 18px 4px;
  z-index: 3;
  /* Diagonal fold shadow — the gradient angle sweeps from 225 deg (↙)
     toward 135 deg (↗) as --flip-shadow goes 0 → 1, so the dark band
     tracks the diagonal fold line created by the rotate3d tilt. */
  background:
    linear-gradient(
      calc(225deg - var(--flip-shadow, 0) * 90deg),
      transparent 38%,
      rgba(0, 0, 0, calc(var(--flip-shadow, 0) * 0.14)) 49%,
      rgba(0, 0, 0, calc(var(--flip-shadow, 0) * 0.10)) 51%,
      transparent 62%
    ),
    /* Subtle spine-edge highlight on the facing page */
    linear-gradient(
      to right,
      rgba(255, 248, 230, calc((1 - var(--flip-shadow, 0)) * 0.15)),
      transparent 8%
    );
}

body.has-flipbook .section.chapter .container {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 72, 21, 0.25) transparent;
}

/* Suppress duplicate stacked-page shadows and spine on cloned containers
   inside bend slices. Keep the border so content area matches the original. */
.bend-slice .container {
  box-shadow: none !important;
}
.bend-slice .container::after {
  display: none !important;
}

/* Dark edges on the bend slices during page flip */
.bend-slice {
  border-right: 2.5px solid #4a3010;
  border-top: 1.5px solid rgba(74, 48, 16, 0.5);
  border-bottom: 1.5px solid rgba(74, 48, 16, 0.5);
}

/* The outermost bend slice gets the full page frame so the
   stacked-page edges and spine travel with the flipping page.
   No border here — the cloned container inside already has one. */
.bend-slice-frame {
  border-radius: 4px 18px 18px 4px;
  box-shadow:
    inset 2px 2px 6px rgba(255, 248, 228, 0.5),
    inset -1px -1px 4px rgba(139, 98, 42, 0.12),
    2px 2px 0 0 #ddd0ac,
    2.5px 2.5px 0 0 #7a5a28,
    4px 4px 0 0 #d6c89e,
    4.5px 4.5px 0 0 #6b4a1f,
    6px 6px 0 0 #d1be90,
    6.5px 6.5px 0 0 #5e3f18,
    8px 8px 0 0 #ccb886,
    8.5px 8.5px 0 0 #543614,
    10px 10px 0 0 #c7b27e,
    10.5px 10.5px 0 0 #4a3010,
    12px 12px 0 0 #c2ac76,
    12.5px 12.5px 0 0 #422a0e,
    14px 14px 0 0 #bda66e,
    14.5px 14.5px 0 0 #3b2508,
    18px 20px 30px rgba(30, 18, 6, 0.35);
}
.bend-slice-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 38px;
  height: 100%;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(
    to right,
    #3a2410 0%,
    #4e3215 12%,
    #6a4d28 28%,
    rgba(140, 108, 58, 0.35) 50%,
    rgba(183, 146, 86, 0.15) 70%,
    rgba(210, 180, 120, 0.06) 85%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

body.has-flipbook .section.chapter .reveal {
  opacity: 1;
  transform: none;
}

/* Portrait-book content layout — stack everything vertically */
body.has-flipbook .hero-grid {
  grid-template-columns: 1fr;
}

body.has-flipbook .hero-visual {
  max-width: 280px;
  margin-inline: auto;
}

body.has-flipbook .hero-points {
  grid-template-columns: 1fr;
}

body.has-flipbook .two-col,
body.has-flipbook .pillars {
  grid-template-columns: 1fr;
}

body.has-flipbook .flow-grid {
  grid-template-columns: 1fr;
}

body.has-flipbook .pricing-grid {
  grid-template-columns: 1fr;
}

body.has-flipbook .chapter .container {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 72, 21, 0.3) transparent;
}

/* Smaller text in flipbook to fit portrait pages */
body.has-flipbook h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

body.has-flipbook h2 {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
}

body.has-flipbook h3 {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
}

body.has-flipbook p,
body.has-flipbook li {
  font-size: 0.88rem;
}

body.has-flipbook .cta-row {
  flex-direction: column;
  align-items: flex-start;
}

/* ============== END FLIPBOOK STYLES — safe to edit below ============== */

.section {
  position: relative;
  padding: clamp(2.4rem, 6vw, 4rem) 0;
  scroll-margin-top: 90px;
}

.chapter .container {
  padding: clamp(1rem, 2.8vw, 1.8rem);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(246, 216, 162, 0.44);
  box-shadow: var(--panel-shadow);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.33), transparent 36%),
    radial-gradient(circle at 84% 76%, rgba(178, 126, 48, 0.12), transparent 48%),
    repeating-linear-gradient(108deg, rgba(130, 94, 36, 0.035) 0px, rgba(130, 94, 36, 0.035) 1px, transparent 2px, transparent 5px),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-strong) 100%);
}

.chapter-panel .container {
  background:
    radial-gradient(circle at 84% 16%, rgba(120, 163, 214, 0.16), transparent 38%),
    radial-gradient(circle at 20% 78%, rgba(178, 126, 48, 0.15), transparent 46%),
    repeating-linear-gradient(108deg, rgba(130, 94, 36, 0.04) 0px, rgba(130, 94, 36, 0.04) 1px, transparent 2px, transparent 5px),
    linear-gradient(180deg, #f4e6c7 0%, #ecd9b3 100%);
}

.chapter-label {
  margin: 0 0 0.64rem;
  width: fit-content;
  padding: 0.14rem 0.66rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 72, 21, 0.35);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--accent-deep);
  background: rgba(255, 247, 228, 0.72);
}

.hero {
  padding-top: clamp(2.4rem, 7vw, 4.6rem);
}

.hero .container {
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: center;
}

.hero-copy {
  position: relative;
  padding: 1rem 0.95rem;
}

.hero-mark {
  margin: 0 0 0.6rem;
  font-family: var(--font-script);
  font-size: 1.35rem;
  color: #8b5e1d;
}

.eyebrow {
  margin: 0 0 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-family: var(--font-title);
  color: #83561a;
}

.hero-copy strong {
  color: #563815;
}

.hero-points {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.hero-points li {
  padding: 0.44rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 247, 228, 0.82);
  color: #3f2c12;
  font-size: 0.88rem;
}

.hero-note {
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  color: #694921;
}

.hero-visual {
  margin: 0;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(183, 146, 86, 0.55);
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: linear-gradient(150deg, #f7ecd2 0%, #ecd7ad 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 228, 0.45);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
  opacity: 0.8;
}

.hero-glow-a {
  width: min(52vw, 420px);
  aspect-ratio: 1;
  top: -14%;
  right: -12%;
  background: radial-gradient(circle, rgba(248, 223, 170, 0.36), transparent 66%);
  animation: drift 11s ease-in-out infinite;
}

.hero-glow-b {
  width: min(47vw, 360px);
  aspect-ratio: 1;
  left: -16%;
  bottom: -14%;
  background: radial-gradient(circle, rgba(138, 171, 232, 0.28), transparent 70%);
  animation: drift 15s ease-in-out infinite reverse;
}

.section-head {
  margin-bottom: clamp(1.2rem, 2.5vw, 1.7rem);
  max-width: 74ch;
}

.card-grid,
.flow-grid,
.pillars,
.pricing-grid {
  display: grid;
  gap: 0.95rem;
}

.card,
.flow-card,
.pillar,
.price-card,
.cta-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 250, 238, 0.8);
  box-shadow: 0 10px 24px rgba(84, 58, 18, 0.11);
  padding: clamp(0.95rem, 2.5vw, 1.35rem);
}

.flow-card img {
  width: 2.4rem;
  height: 2.4rem;
  margin-bottom: 0.5rem;
}

.pillar {
  border-radius: var(--radius-md);
}

.pricing-grid {
  margin-top: 1rem;
}

.price-card {
  position: relative;
  overflow: hidden;
}

.price-card .price {
  font-family: var(--font-title);
  color: var(--accent-deep);
  font-size: 1.58rem;
}

.price-card.featured {
  border-color: rgba(154, 106, 32, 0.48);
  background: linear-gradient(180deg, #f8ebce 0%, #ecd5a8 100%);
}

.badge {
  position: absolute;
  top: 0.8rem;
  right: 0.82rem;
  margin: 0;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 72, 21, 0.32);
  background: rgba(255, 247, 228, 0.72);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-family: var(--font-title);
}

.section-cta {
  padding-bottom: clamp(3rem, 8vw, 5.5rem);
}

.cta-panel {
  text-align: center;
  background: linear-gradient(180deg, #f8ebce 0%, #ead2a3 100%);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.72rem;
  margin-top: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  text-decoration: none;
  padding: 0.66rem 1.15rem;
  border: 1px solid transparent;
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff9ec;
  border-color: rgba(69, 45, 15, 0.65);
  background: linear-gradient(180deg, #7a5218 0%, #5d3c12 100%);
  box-shadow: 0 8px 20px rgba(78, 50, 15, 0.28);
  font-family: var(--font-title);
}

.btn-secondary {
  color: #3b290f;
  border-color: rgba(111, 72, 21, 0.44);
  background: rgba(255, 247, 228, 0.78);
}

.fine-print {
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid rgba(239, 206, 148, 0.4);
  background: linear-gradient(180deg, rgba(9, 19, 35, 0.86), rgba(7, 15, 28, 0.96));
  padding: 2.2rem 0 1.2rem;
}

.footer-grid {
  display: grid;
  gap: 0.8rem;
}

.footer-brand {
  color: #f7e1b6;
  font-family: var(--font-title);
}

.site-footer p,
.site-footer a {
  color: #e7d4b1;
}

.copyright {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  color: #d1b98d;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 680ms ease, transform 680ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (min-width: 760px) {
  .nav-list {
    gap: 0.78rem;
    overflow: visible;
  }

  .hero-grid {
    grid-template-columns: 1.06fr 0.94fr;
  }

  .hero-copy {
    padding: 1.35rem 1.18rem;
  }

  .hero-points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .hero-points li {
    text-align: center;
    border-radius: 12px;
  }

  .two-col,
  .pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

@media (max-width: 759px) {
  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.7rem 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }

  .chapter .container {
    padding: 1rem 0.9rem;
  }
}

/* ── Mobile flipbook adjustments ──────────────────────────────── */
@media (max-width: 768px) {
  /* Full-screen book — dark background, no scroll */
  body.has-flipbook {
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    overscroll-behavior: none;
    touch-action: none;
    background:
      radial-gradient(600px 300px at 14% 12%, rgba(249, 217, 148, 0.08), transparent 65%),
      linear-gradient(180deg, #0e1a2f 0%, #13243a 42%, #081321 100%);
  }

  /* Header: fully transparent overlay, brand top-left */
  body.has-flipbook .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    min-height: 0;
    padding: 0;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
    pointer-events: none;
  }

  body.has-flipbook .brand {
    pointer-events: auto;
    padding: 0.25rem 0.6rem;
  }

  body.has-flipbook .nav-wrap {
    min-height: 0;
    padding: 0.1rem 0;
    flex-direction: row;
    align-items: center;
  }

  /* Nav buttons: override desktop position → fixed at bottom */
  body.has-flipbook > .nav-actions {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: center;
    padding: 0.4rem 0.4rem 0.5rem;
    background: linear-gradient(
      0deg,
      rgba(9, 19, 35, 0.92) 0%,
      rgba(9, 19, 35, 0.7) 60%,
      transparent 100%
    );
    gap: 0.25rem;
    width: 100%;
  }

  body.has-flipbook .nav-list {
    gap: 0.2rem;
  }

  body.has-flipbook .nav-list a {
    font-size: 0.58rem;
    padding: 0.12rem 0.35rem;
    min-height: 24px;
  }

  body.has-flipbook .lang-toggle {
    padding: 0.1rem;
  }

  body.has-flipbook .lang-btn {
    min-height: 22px;
    padding: 0.1rem 0.35rem;
    font-size: 0.56rem;
  }

  /* Story main fills the screen */
  body.has-flipbook .story-main {
    padding: 0;
    height: 100svh;
  }

  .flipbook-shell {
    width: 100%;
    height: 100%;
  }

  /* Book starts from the very top */
  .flipbook-sticky {
    top: 0;
    height: 100svh;
    padding: 0.15rem 0 2rem;
  }

  .flipbook-book {
    width: calc(100vw - 0.6rem);
    height: calc(100svh - 2.4rem);
  }

  /* Extra top padding so content clears the brand overlay */
  body.has-flipbook .chapter .container {
    padding: 2rem 0.7rem 0.8rem 1.3rem;
  }

  /* Thinner spine on mobile */
  body.has-flipbook .chapter .container::after {
    width: 16px;
  }

  /* Fewer stacked pages on mobile */
  body.has-flipbook .chapter .container {
    box-shadow:
      inset 2px 2px 4px rgba(255, 248, 228, 0.4),
      2px 2px 0 0 #ddd0ac,
      2.5px 2.5px 0 0 #7a5a28,
      4px 4px 0 0 #d6c89e,
      4.5px 4.5px 0 0 #6b4a1f,
      6px 6px 0 0 #d1be90,
      6.5px 6.5px 0 0 #5e3f18,
      10px 12px 20px rgba(30, 18, 6, 0.3);
  }

  body.has-flipbook h1 {
    font-size: 1.3rem;
  }

  body.has-flipbook h2 {
    font-size: 1.1rem;
  }

  body.has-flipbook p,
  body.has-flipbook li {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .flipbook-hint {
    font-size: 0.7rem;
    position: fixed;
    bottom: 2.4rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
