/* 摸索台灯 Moss & Otto · 24-Hour Light & Story Flagship Design System
   Forest Twilight -> Sunlit Morning Story -> Brass-Bead 3D/2D Curtain -> 3-Land Bead Road -> Midnight Velvet Indigo Lamp */

:root {
  /* Forest Twilight Prologue (Moss & Otto signature brand world) */
  --forest: #162820;
  --forest-deep: #0F1D17;
  --forest-card: #1E352B;
  --forest-ink: #F7F1E3;
  --forest-muted: #C2D4C8;
  --lamp-gold: #F8CA59;

  /* Morning Sprout Mist & Sunlit Birch Shelf */
  --mist: #F3F7EC;
  --birch: #FFF9EC;
  --birch-deep: #F6ECD6;
  --paper: #FBF7F0;
  --card: #FFFFFF;
  --ink: #1A231E;
  --ink-soft: #48564F;
  --ink-faint: #68766E;

  /* Companions & Golden Brass Bead */
  --accent: #08675F;
  --accent-fill: #0B7D74;
  --moss: #55704A;
  --moss-deep: #3D5434;
  --moss-tint: #E3F1CF;
  --rod: #2D4A8C;
  --rod-tint: #EDF2FA;
  --bead: #D4A21C;
  --bead-light: #EDCB6A;
  --bead-deep: #9C6F08;

  /* Playroom Crayon Spectrum */
  --teal: #1FB5A6;
  --sunflower: #FFC23D;
  --sunflower-ink: #8A5A00;
  --leaf: #4DB86A;
  --leaf-ink: #2A753F;
  --tangerine: #FF8A3D;
  --tangerine-ink: #B8550C;
  --sky: #4C9BE8;
  --sky-ink: #1F6DB8;
  --pink: #FF6F91;
  --lilac: #9B7BEA;

  /* Velvet Indigo Midnight Lamp */
  --night: #0C122B;
  --night-card: #162042;
  --night-fill: #1E2A54;
  --night-ink: #F4E7CC;
  --night-muted: #B6C0DA;
  --night-amber: #FFB547;
  --night-teal: #5CD8CC;

  /* Shadows & Rounded Playroom System Font (zero serif) */
  --shadow-soft:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -1px 0 rgba(26, 35, 30, 0.06),
    0 16px 34px -14px rgba(22, 40, 32, 0.14),
    0 4px 10px -2px rgba(22, 40, 32, 0.06);
  --shadow-dark:
    inset 0 1px 0 rgba(248, 202, 89, 0.16),
    0 22px 46px -14px rgba(0, 0, 0, 0.45);
  --font: "SF Pro Rounded", ui-rounded, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Maru Gothic ProN", "Helvetica Neue", sans-serif;
  --wrap: min(1140px, 100% - 2.25rem);
  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
  --spring: cubic-bezier(0.28, 1.32, 0.45, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background-color: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.03125rem;
  line-height: 1.66;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { padding: 0; }

:focus-visible {
  outline: 2.5px solid var(--lamp-gold);
  outline-offset: 3px;
  border-radius: 10px;
}

.wrap { width: var(--wrap); margin-inline: auto; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--lamp-gold);
  color: var(--forest-deep);
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

/* Rounded Display Typography */
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

h1 { font-size: clamp(2.35rem, 4.9vw, 3.85rem); }
h2 { font-size: clamp(1.72rem, 3.2vw, 2.55rem); }
h3 { font-size: clamp(1.125rem, 1.7vw, 1.34rem); line-height: 1.32; }

.lead {
  font-size: clamp(1.04rem, 1.45vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 48ch;
}

.chapter {
  padding-block: clamp(4rem, 8vw, 6.75rem);
  position: relative;
}

/* Montessori GoldBead Title Accent */
.chapter-head {
  max-width: 45rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.bead-title {
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.gold-bead {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 34% 28%, #FFFBE4 0%, var(--bead-light) 32%, var(--bead) 72%, var(--bead-deep) 100%);
  box-shadow: 0 2px 6px rgba(156, 111, 8, 0.35);
}

.chapter-head p {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  padding-left: 1.62rem;
}

/* Soft Vinyl Surfaces & Tactile Buttons */
.vinyl-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, #FFFFFF 70%, #FAF7F0 100%);
  border-radius: 28px;
  border: 1px solid rgba(22, 40, 32, 0.08);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.45rem, 3vw, 2.1rem);
}

.vinyl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.72rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, transparent 52%), var(--bead);
  color: #2A1D02;
  font-weight: 800;
  font-size: 0.96rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 251, 228, 0.65),
    0 10px 22px -8px rgba(248, 202, 89, 0.48);
  transition: transform 0.2s var(--spring), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.vinyl-btn:hover {
  background: var(--lamp-gold);
  transform: translateY(-1px);
}
.vinyl-btn:active {
  transform: translateY(1px) scaleX(1.02) scaleY(0.95);
}

.vinyl-btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.72rem 1.45rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px -6px rgba(11, 125, 116, 0.35);
  transition: transform 0.2s var(--spring), background-color 0.2s var(--ease);
}
.vinyl-btn-teal:hover { background: var(--accent); transform: translateY(-1px); }

.vinyl-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 46px;
  padding: 0.72rem 1.35rem;
  border-radius: 999px;
  background: rgba(247, 241, 227, 0.12);
  color: var(--forest-ink);
  border: 1px solid rgba(247, 241, 227, 0.22);
  font-weight: 700;
  font-size: 0.94rem;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--spring);
}
.vinyl-btn-ghost:hover { background: rgba(247, 241, 227, 0.19); transform: translateY(-1px); }

.pill-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid rgba(22, 40, 32, 0.12);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink-soft);
  box-shadow: 0 2px 6px rgba(22, 40, 32, 0.05);
  transition: transform 0.2s var(--spring), background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.pill-chip:hover { color: var(--ink); border-color: rgba(22, 40, 32, 0.26); }
.pill-chip.active {
  background: var(--accent-fill);
  border-color: var(--accent-fill);
  color: #FFFFFF;
}

/* Deep Forest-Moss Floating Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(22, 40, 32, 0.88);
  color: var(--forest-ink);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid rgba(247, 241, 227, 0.10);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.06rem;
  flex-shrink: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.45rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--forest-muted);
}
.nav-links a { transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--lamp-gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.nav .pill-chip {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(247, 241, 227, 0.18);
  color: var(--forest-ink);
  box-shadow: none;
}
.nav .pill-chip:hover { background: rgba(255, 255, 255, 0.18); }

.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(247, 241, 227, 0.18);
  color: var(--forest-ink);
  align-items: center;
  justify-content: center;
}

.mobile-drawer {
  display: none;
  border-bottom: 1px solid rgba(247, 241, 227, 0.12);
  background: var(--forest);
  padding: 0.75rem 1.25rem 1.25rem;
}
.mobile-drawer.open { display: grid; gap: 0.4rem; }
.mobile-drawer a {
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  font-weight: 700;
  color: var(--forest-ink);
}
.mobile-drawer a:hover { background: var(--forest-card); }

/* Chapter 1: Forest Twilight Theater with Cursor-Leaning Golden Spotlight & Hanging Pull-Cord */
.hero-theater {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(4.25rem, 8vw, 6.75rem);
  background:
    radial-gradient(640px circle at var(--lx, 72%) var(--ly, 34%), rgba(248, 202, 89, 0.25), rgba(248, 202, 89, 0.06) 44%, transparent 72%),
    radial-gradient(500px circle at 14% 84%, rgba(79, 216, 203, 0.08), transparent 60%),
    linear-gradient(170deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--forest-ink);
  transition: background 0.55s var(--ease), color 0.45s var(--ease);
}

.hero-theater .lead { color: var(--forest-muted); }

/* Toggled Morning Meadow mode when user pulls Otto's golden bulb */
.hero-theater.is-morning {
  background:
    radial-gradient(circle at 90% 6%, rgba(255, 227, 154, 0.72) 0%, rgba(255, 233, 168, 0.24) 36%, transparent 64%),
    radial-gradient(circle at 12% 78%, rgba(77, 184, 106, 0.14), transparent 52%),
    linear-gradient(180deg, #FBF8EF 0%, #EFF6E6 100%);
  color: var(--ink);
}
.hero-theater.is-morning .lead,
.hero-theater.is-morning .hero-fine { color: var(--ink-soft); }
.hero-theater.is-morning .vinyl-btn-ghost {
  background: rgba(11, 125, 116, 0.10);
  color: var(--accent);
  border-color: rgba(11, 125, 116, 0.20);
}

/* Interactive Hanging Brass Pull-Cord */
.pull-cord {
  position: absolute;
  top: 0;
  right: max(1.5rem, calc((100% - 1140px) / 2 + 1rem));
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.28s var(--spring);
}
.pull-cord:hover { transform: translateY(5px); }
.pull-cord.tugging { transform: translateY(20px); }

.cord-stem {
  width: 2.5px;
  height: clamp(46px, 6vw, 72px);
  background: linear-gradient(90deg, var(--bead-deep), var(--bead-light));
  border-radius: 2px;
}

.cord-bulb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFBE4 0%, var(--bead-light) 35%, var(--bead) 75%, var(--bead-deep) 100%);
  box-shadow: 0 0 26px 8px rgba(248, 202, 89, 0.55), 0 0 58px 18px rgba(248, 202, 89, 0.20);
}

.hero-theater.is-morning .cord-bulb {
  box-shadow: 0 4px 12px rgba(212, 162, 28, 0.35);
}

.cord-hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.68rem;
  border-radius: 999px;
  background: rgba(30, 53, 43, 0.88);
  color: var(--lamp-gold);
  border: 1px solid rgba(248, 202, 89, 0.26);
  white-space: nowrap;
}
.hero-theater.is-morning .cord-hint {
  background: rgba(255, 255, 255, 0.86);
  color: var(--sunflower-ink);
  border-color: rgba(138, 90, 0, 0.16);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(2rem, 5vw, 4.25rem);
  align-items: center;
  position: relative;
  z-index: 4;
}

.hero-actions {
  margin-top: 1.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
}

.hero-fine {
  margin-top: 1.05rem;
  font-size: 0.9rem;
  color: var(--forest-muted);
  font-weight: 600;
}

.hero-diorama {
  position: relative;
  border-radius: 34px;
  background: var(--forest-card);
  border: 1px solid rgba(248, 202, 89, 0.22);
  box-shadow: var(--shadow-dark);
  padding: 1.55rem 1.4rem 1.25rem;
  overflow: hidden;
  min-height: 416px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background-color 0.45s var(--ease), border-color 0.45s var(--ease);
}

.hero-theater.is-morning .hero-diorama {
  background: #F6EFE1;
  border-color: rgba(22, 40, 32, 0.12);
  box-shadow: var(--shadow-soft);
}

.diorama-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity 0.45s var(--ease);
}
.diorama-bg-day { opacity: 0; }
.hero-theater.is-morning .diorama-bg-day { opacity: 0.95; }

.diorama-companions {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
}

.sprite-moss {
  width: clamp(92px, 10.5vw, 132px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.34));
  animation: mossBreath 2.6s ease-in-out infinite;
}

.sprite-otto {
  width: clamp(102px, 11.5vw, 144px);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.36));
  animation: ottoBreath 3.8s ease-in-out infinite;
}

@keyframes mossBreath {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.028) translateY(-3px); }
}

@keyframes ottoBreath {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.018) translateY(-2px); }
}

/* Single Focal iPhone Window */
.phone-window {
  position: relative;
  z-index: 4;
  width: clamp(166px, 18.5vw, 218px);
  aspect-ratio: 780 / 1695;
  border-radius: 13% / 6%;
  background: #1B1E2B;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 28px 48px -18px rgba(0, 0, 0, 0.48);
  flex-shrink: 0;
}

.phone-window img {
  position: absolute;
  inset: 0.85% 1.85%;
  width: 96.3%;
  height: 98.3%;
  object-fit: cover;
  border-radius: 11.6% / 5.26%;
  background: var(--paper);
}

.phone-focus {
  width: min(290px, 76vw);
  margin-inline: auto;
}

/* Bottom Meadow Sill (subtle silhouette by night, bright fresh meadow by morning & finale) */
.meadow-sill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 54px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.18;
  transition: opacity 0.45s var(--ease);
}
.hero-theater.is-morning .meadow-sill,
.closing-meadow .meadow-sill {
  opacity: 0.92;
}
.meadow-sill svg { width: 100%; height: 100%; display: block; }

/* Chapter 2: Origin Story in Morning Sprout Mist (#F3F7EC) */
.chapter-story {
  background:
    radial-gradient(circle at 8% 15%, rgba(77, 184, 106, 0.10), transparent 46%),
    var(--mist);
}

.story-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.character-card {
  border-radius: 28px;
  padding: clamp(1.5rem, 3vw, 2.1rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.35rem;
  align-items: center;
  cursor: pointer;
  border: 1px solid rgba(22, 40, 32, 0.08);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--spring), box-shadow 0.25s var(--ease);
}
.character-card:hover { transform: translateY(-3px); }

.character-moss { background: linear-gradient(155deg, #F4F9EC 0%, var(--moss-tint) 100%); }
.character-otto { background: linear-gradient(155deg, #F6F9FE 0%, var(--rod-tint) 100%); }

.character-card img {
  width: clamp(92px, 11vw, 124px);
  filter: drop-shadow(0 12px 16px rgba(22, 40, 32, 0.16));
}

.tag-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.22rem 0.72rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.tag-moss { background: rgba(85, 112, 74, 0.14); color: var(--moss-deep); }
.tag-otto { background: rgba(45, 74, 140, 0.12); color: var(--rod); }

.character-card p { margin-top: 0.45rem; color: var(--ink-soft); font-size: 0.95rem; }

.character-hint {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.promises-strip {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.promise-pill {
  border-radius: 22px;
  padding: 1.25rem 1.4rem;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--teal);
}
.promise-pill.sunflower { border-top-color: var(--sunflower); }
.promise-pill.pink { border-top-color: var(--pink); }
.promise-pill h3 { font-size: 1.08rem; }
.promise-pill p { margin-top: 0.35rem; font-size: 0.92rem; color: var(--ink-soft); }

/* Chapter 3: Sunlit Birch Shelf & Brass-Bead 3D/2D Peel Curtain (#FFF9EC) */
.chapter-shelf {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 194, 61, 0.16), transparent 52%),
    var(--birch);
  border-block: 1px solid rgba(156, 111, 8, 0.10);
}

.curtain-wrap {
  max-width: 820px;
  margin-inline: auto;
}

.curtain-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 30px;
  overflow: hidden;
  background: var(--birch-deep);
  border: 1px solid rgba(156, 111, 8, 0.14);
  box-shadow: 0 24px 52px -18px rgba(122, 82, 48, 0.25);
  user-select: none;
  touch-action: pan-y;
}

.curtain-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.curtain-top {
  clip-path: inset(0 calc(100% - var(--split, 52%)) 0 0);
}

.curtain-label {
  position: absolute;
  top: 1rem;
  z-index: 4;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(22, 40, 32, 0.78);
  color: var(--forest-ink);
  pointer-events: none;
}
.curtain-label-left { left: 1rem; }
.curtain-label-right {
  right: 1rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.curtain-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 52%);
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 251, 228, 0.9), var(--bead-light), var(--bead));
  box-shadow: 0 0 14px rgba(212, 162, 28, 0.55);
  pointer-events: none;
  z-index: 5;
}

.curtain-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFFBE4 0%, var(--bead-light) 34%, var(--bead) 74%, var(--bead-deep) 100%);
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 6px 18px rgba(22, 40, 32, 0.28);
  display: grid;
  place-items: center;
}

.curtain-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 8;
}

.curtain-thumbs {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.curtain-thumb {
  background: var(--card);
  border-radius: 16px;
  padding: 0.5rem;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(122, 82, 48, 0.08);
  text-align: left;
  transition: transform 0.2s var(--spring), border-color 0.2s var(--ease);
}
.curtain-thumb:hover { transform: translateY(-2px); }
.curtain-thumb.active { border-color: var(--bead); }
.curtain-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}
.curtain-thumb span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.focal-split {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
}

.crayon-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

/* Chapter 4: Dynamic Three-Land 37-Bead Montessori Road */
.chapter-road {
  background: var(--paper);
}

.bead-road-card {
  border-radius: 30px;
  padding: clamp(1.45rem, 3.5vw, 2.3rem);
  box-shadow: var(--shadow-soft);
  background: #E8F4DC;
  transition: background-color 0.45s var(--ease);
}
.bead-road-card[data-land="forest"] { background: #FFF0DA; }
.bead-road-card[data-land="river"] { background: #E5F1FC; }

.lands-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.land-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  font-weight: 800;
}

.bead-rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.bead-rail::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  background: rgba(26, 35, 30, 0.14);
  transform: translateY(-50%);
}

.bead-node {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.92rem;
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.48),
    0 5px 12px rgba(22, 40, 32, 0.16);
  transition: transform 0.25s var(--spring), background 0.25s var(--ease);
}
.bead-node.meadow { background: radial-gradient(circle at 32% 28%, #8CE0A2, var(--leaf)); }
.bead-node.forest { background: radial-gradient(circle at 32% 28%, #FFB785, var(--tangerine)); }
.bead-node.river { background: radial-gradient(circle at 32% 28%, #85C1F5, var(--sky)); }

.bead-node.active {
  transform: scale(1.22);
  color: #4A3300;
  background: radial-gradient(circle at 34% 28%, #FFFBE4 0%, var(--bead-light) 34%, var(--bead) 75%, var(--bead-deep) 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.90), 0 8px 18px rgba(212, 162, 28, 0.36);
}

.road-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1.5rem;
  align-items: center;
}

.road-cover {
  border-radius: 22px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.road-cover img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.road-detail {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 1.45rem 1.55rem;
  box-shadow: var(--shadow-soft);
}
.road-detail p { margin-top: 0.45rem; color: var(--ink-soft); }

.road-plays {
  list-style: none;
  margin-top: 1rem;
  display: grid;
  gap: 0.5rem;
}
.road-plays li {
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  background: var(--paper);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Chapter 5: Velvet Indigo Midnight Lamp World (#0C122B) & Live BPM Palm-Pat Aura */
.lamp-world {
  background:
    radial-gradient(ellipse 68% 48% at 86% 6%, rgba(255, 181, 71, 0.34), rgba(255, 181, 71, 0.09) 46%, transparent 68%),
    radial-gradient(ellipse 52% 42% at 8% 92%, rgba(255, 181, 71, 0.12), transparent 58%),
    var(--night);
  color: var(--night-ink);
  position: relative;
  overflow: hidden;
}

.lamp-world .chapter-head p { color: var(--night-muted); }

.lamp-motes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(3px 3px at 14% 24%, rgba(255, 241, 201, 0.65), transparent),
    radial-gradient(2px 2px at 28% 72%, rgba(255, 181, 71, 0.6), transparent),
    radial-gradient(3px 3px at 46% 36%, rgba(255, 241, 201, 0.55), transparent),
    radial-gradient(2px 2px at 72% 18%, rgba(255, 241, 201, 0.72), transparent),
    radial-gradient(3px 3px at 84% 58%, rgba(255, 181, 71, 0.6), transparent),
    radial-gradient(2px 2px at 62% 84%, rgba(255, 241, 201, 0.5), transparent);
}

.lamp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.98fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: center;
  position: relative;
  z-index: 3;
}

/* Live Silent Palm-Pat Concentric Pulse Aura */
.pat-widget {
  background: var(--night-card);
  border: 1px solid rgba(255, 181, 71, 0.22);
  border-radius: 24px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-dark);
}

.pat-aura-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pat-ring-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pat-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 181, 71, 0.42), rgba(255, 181, 71, 0) 70%);
  animation: patBeat var(--pat-dur, 1.00s) ease-in-out infinite;
}

.pat-core {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #FFFBE4 0%, var(--bead-light) 35%, var(--bead) 75%);
  box-shadow: 0 0 18px rgba(255, 181, 71, 0.65);
  z-index: 2;
}

@keyframes patBeat {
  0%, 100% { transform: scale(0.76); opacity: 0.42; }
  40% { transform: scale(1.24); opacity: 0.96; }
}

.bpm-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.bpm-btn {
  padding: 0.35rem 0.78rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--night-fill);
  color: var(--night-muted);
  border: 1px solid rgba(255, 181, 71, 0.16);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.bpm-btn.active {
  background: var(--night-amber);
  color: #2A1D02;
  border-color: var(--night-amber);
}

.lamp-cards { display: grid; gap: 0.85rem; }

.lamp-card-btn {
  text-align: left;
  width: 100%;
  border-radius: 22px;
  padding: 1.2rem 1.35rem;
  background: var(--night-card);
  border: 1px solid rgba(255, 181, 71, 0.14);
  box-shadow: var(--shadow-dark);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.lamp-card-btn:hover { transform: translateX(3px); border-color: rgba(255, 181, 71, 0.36); }
.lamp-card-btn.active {
  background: var(--night-fill);
  border-color: var(--night-amber);
}
.lamp-card-btn h3 { color: var(--night-ink); font-size: 1.06rem; }
.lamp-card-btn p { margin-top: 0.3rem; color: var(--night-muted); font-size: 0.91rem; }

/* Chapter 6: Sanctuary Dual Cards & FAQ */
.chapter-sanctuary { background: #F5F8F2; }

.sanctuary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.sanctuary-vault {
  background:
    radial-gradient(circle at 86% 16%, rgba(248, 202, 89, 0.22), transparent 55%),
    var(--forest);
  color: var(--forest-ink);
  border-radius: 28px;
  padding: clamp(1.5rem, 3vw, 2.15rem);
  box-shadow: var(--shadow-dark);
}
.sanctuary-vault p, .sanctuary-vault li { color: var(--forest-muted); }

.check-list {
  list-style: none;
  margin-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
}
.check-list li {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  font-size: 0.94rem;
}
.check-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.sanctuary-vault .check-list li::before { background: var(--lamp-gold); }

.faq-stack { margin-top: 2.25rem; display: grid; gap: 0.75rem; }

.faq-card {
  background: var(--card);
  border-radius: 20px;
  padding: 1.1rem 1.35rem;
  box-shadow: var(--shadow-soft);
}
.faq-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
}
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card summary::after { content: "+"; font-size: 1.25rem; color: var(--accent); }
.faq-card[open] summary::after { content: "-"; }
.faq-card p {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(22, 40, 32, 0.10);
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Chapter 7: Sunlit Meadow Finale & Forest-Deep Footer */
.closing-meadow {
  position: relative;
  text-align: center;
  padding: clamp(4.5rem, 8vw, 7rem) 0 clamp(5.5rem, 9vw, 8rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 227, 154, 0.42), transparent 58%),
    var(--mist);
}

.closing-sprites {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.35rem;
}
.closing-sprites .icon-main {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(22, 40, 32, 0.18);
}
.closing-sprites .closing-pet {
  width: 64px;
  filter: drop-shadow(0 8px 12px rgba(22, 40, 32, 0.16));
}
.closing-meadow p { margin: 0.8rem auto 0; color: var(--ink-soft); max-width: 42ch; }

.footer {
  background: var(--forest-deep);
  color: var(--forest-muted);
  padding: 3rem 0 2.5rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.footer h4 { font-size: 0.9rem; color: var(--forest-ink); margin-bottom: 0.65rem; }
.footer ul { list-style: none; display: grid; gap: 0.45rem; }
.footer a:hover { color: var(--lamp-gold); }

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(247, 241, 227, 0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
}

/* Subpages Deep Forest-Moss Header Banner + Soft Vinyl Document */
.doc-hero-moss {
  background:
    radial-gradient(480px circle at 84% 20%, rgba(248, 202, 89, 0.22), transparent 64%),
    linear-gradient(170deg, var(--forest) 0%, var(--forest-deep) 100%);
  color: var(--forest-ink);
  padding: clamp(2.5rem, 5vw, 3.75rem) 0 clamp(3rem, 6vw, 4.25rem);
}
.doc-hero-moss .lead { color: var(--forest-muted); margin-top: 0.85rem; }

.doc-main {
  margin-top: -1.75rem;
  padding-bottom: clamp(3rem, 6vw, 4.5rem);
  position: relative;
  z-index: 5;
}

.doc-sheet {
  max-width: 50rem;
  margin-inline: auto;
}
.doc-sheet h2 {
  font-size: 1.32rem;
  margin-top: 2rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.doc-sheet h2:first-child { margin-top: 0.25rem; }
.doc-sheet p, .doc-sheet li { color: var(--ink-soft); font-size: 0.96rem; margin-top: 0.45rem; }
.doc-sheet ul { padding-left: 1.25rem; display: grid; gap: 0.45rem; }
.doc-sheet table { width: 100%; border-collapse: collapse; margin-block: 1rem; font-size: 0.92rem; }
.doc-sheet th, .doc-sheet td {
  text-align: left;
  padding: 0.72rem 0.65rem;
  border-bottom: 1px solid rgba(22, 40, 32, 0.12);
  vertical-align: top;
}
.doc-sheet th { color: var(--ink); font-weight: 700; background: var(--mist); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .story-duo,
  .focal-split,
  .road-stage-grid,
  .lamp-split,
  .sanctuary-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .curtain-thumbs,
  .promises-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-links, .nav .vinyl-btn { display: none; }
  .menu-btn { display: inline-flex; }

  .curtain-thumbs,
  .promises-strip {
    grid-template-columns: 1fr;
  }

  .character-card { grid-template-columns: 1fr; }

  .hero-diorama {
    flex-direction: column;
    align-items: center;
    min-height: 360px;
  }

  .phone-window { width: 176px; }
  .phone-focus { width: 236px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sprite-moss, .sprite-otto, .pat-halo { animation: none; }
  .vinyl-btn, .vinyl-btn-teal, .vinyl-btn-ghost, .pill-chip, .character-card, .bead-node, .pull-cord, .curtain-thumb { transition: none; }
}
