/* ==========================================================================
   Quà Tặng 20/11 V2 — Kính Tặng Cô Vũ Thị Huệ (Môn Thị Trường Tài Chính · HUIT)
   Cinematic Editorial Luxury × Step-by-Step Choreography × Animated Short Film
   ========================================================================== */

:root {
  --ivory: #FAF6F0;
  --ivory-deep: #F2EAE0;
  --paper: #FFFDF9;
  --emerald: #0F3D2E;
  --emerald-dark: #071F17;
  --emerald-mid: #195440;
  --emerald-soft: rgba(15, 61, 46, 0.07);
  --gold: #C69749;
  --gold-bright: #ECCD8A;
  --gold-pale: #F7E8C9;
  --gold-deep: #966B26;
  --blush: #D98982;
  --blush-soft: #F9EAE8;
  --ink: #1C2722;
  --ink-soft: #4B5B53;
  --ink-muted: #76857D;
  --border-gold: rgba(198, 151, 73, 0.36);
  --border-soft: rgba(15, 61, 46, 0.11);
  --shadow-paper: 0 26px 70px -22px rgba(15, 61, 46, 0.16), 0 6px 20px -6px rgba(15, 61, 46, 0.06);
  --shadow-emerald: 0 32px 80px -20px rgba(7, 31, 23, 0.52);
  --radius-lg: 26px;
  --radius-md: 18px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script: 'Dancing Script', cursive;
  --font-mono: 'IBM Plex Mono', monospace;
  --ease-cinematic: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--ivory);
  color: var(--ink);
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.locked {
  overflow: hidden;
  height: 100vh;
}

/* Fine paper grain texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient & Interactive FX Canvases */
#ambientCanvas,
#fxCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ambientCanvas { z-index: 1; }
#fxCanvas { z-index: 85; }

/* Top Shimmering Reading Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright), var(--blush), var(--gold-bright));
  background-size: 200% 100%;
  animation: shimmerBar 4s linear infinite;
  z-index: 75;
  transition: width 0.08s linear;
}

@keyframes shimmerBar {
  from { background-position: 0% 0%; }
  to { background-position: 200% 0%; }
}

/* ==========================================================================
   ACT 0: Starlit Velvet Sky + 3D Interactive Wax-Sealed Envelope
   ========================================================================== */
.envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background:
    radial-gradient(ellipse at 50% 34%, #18533E 0%, #0B2D21 56%, #051811 100%);
  transition: opacity 1.05s var(--ease-cinematic), transform 1.05s var(--ease-cinematic), visibility 1.05s ease;
  overflow: hidden;
}

#coverStarsCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.envelope-overlay::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(236, 205, 138, 0.24);
  border-radius: 22px;
  pointer-events: none;
  z-index: 1;
}

.envelope-overlay.is-hidden {
  opacity: 0;
  transform: scale(1.04);
  visibility: hidden;
  pointer-events: none;
}

/* Rotating Mandala Halo behind Envelope */
.envelope-mandala {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(560px, 95vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(236, 205, 138, 0.16);
  pointer-events: none;
  z-index: 1;
  animation: slowSpin 55s linear infinite;
}

.envelope-mandala::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1px solid rgba(236, 205, 138, 0.12);
}

.envelope-stage {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 470px;
  text-align: center;
  color: var(--ivory);
  animation: stageFloatIn 1s var(--ease-cinematic) both;
}

@keyframes stageFloatIn {
  from { opacity: 0; transform: translateY(28px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.envelope-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: 1px solid rgba(236, 205, 138, 0.42);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.06);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.envelope-top-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-bright);
}

/* Interactive 3D Envelope */
.envelope-wrapper {
  position: relative;
  width: min(370px, 86vw);
  height: min(240px, 56vw);
  margin: 0 auto 26px;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.envelope-glow {
  position: absolute;
  inset: -34px;
  background: radial-gradient(circle, rgba(236, 205, 138, 0.34) 0%, rgba(217, 137, 130, 0.12) 45%, transparent 72%);
  filter: blur(22px);
  z-index: 0;
  animation: gentleGlow 3.2s ease-in-out infinite;
}

@keyframes gentleGlow {
  0%, 100% { opacity: 0.72; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.06); }
}

.envelope-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(155deg, #FFFBF4 0%, #EFE4D2 100%);
  box-shadow:
    0 32px 75px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(236, 205, 138, 0.55),
    inset 0 0 32px rgba(198, 151, 73, 0.15);
  transform-style: preserve-3d;
  transition: transform 0.35s var(--ease-cinematic);
}

.envelope-wrapper:hover .envelope-body {
  transform: translateY(-6px) rotateX(3deg);
}

.envelope-letter-peek {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 10%;
  height: 80%;
  background: linear-gradient(180deg, #FFFDF9 0%, #FAF3E6 100%);
  border-radius: 10px;
  border: 1.5px solid rgba(198, 151, 73, 0.55);
  box-shadow: 0 12px 28px rgba(15, 61, 46, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2;
  transition: transform 0.95s var(--ease-cinematic) 0.22s, box-shadow 0.95s ease;
}

.envelope-letter-peek::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(198, 151, 73, 0.32);
  border-radius: 6px;
}

.peek-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.peek-title {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 3.6vw, 1.2rem);
  font-weight: 700;
  color: var(--emerald);
  margin: 0;
}

.peek-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}

.envelope-pocket::before,
.envelope-pocket::after {
  content: "";
  position: absolute;
  inset: 0;
}

.envelope-pocket::before {
  background: linear-gradient(135deg, #F8F0E4 0%, #EBDEC9 100%);
  clip-path: polygon(0 0, 50% 54%, 0 100%);
}

.envelope-pocket::after {
  background: linear-gradient(225deg, #F8F0E4 0%, #E7D8C1 100%);
  clip-path: polygon(100% 0, 50% 54%, 100% 100%);
}

.envelope-bottom-flap {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FDF8F0 0%, #EFE2CE 100%);
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  border-radius: 0 0 14px 14px;
  z-index: 4;
  pointer-events: none;
}

.envelope-trim {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.envelope-top-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58%;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 6;
}

.envelope-top-flap-face {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FFFBF4 0%, #EFE3CF 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 6px 12px rgba(15, 61, 46, 0.18));
  border-radius: 14px 14px 0 0;
}

/* Shimmering Gold Wax Seal with Shockwave Ring */
.wax-seal-btn {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: radial-gradient(circle at 30% 25%, #FAE4A8 0%, #D4A453 42%, #A07027 88%, #774F15 100%);
  box-shadow:
    0 14px 32px rgba(5, 24, 17, 0.55),
    0 0 24px rgba(236, 205, 138, 0.4),
    inset 0 2px 6px rgba(255, 250, 232, 0.75),
    inset 0 -4px 8px rgba(87, 55, 11, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3F2805;
  overflow: visible;
  transition: transform 0.35s var(--ease-cinematic), opacity 0.45s ease;
}

.wax-seal-btn::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 244, 212, 0.62);
}

.wax-seal-btn::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 205, 138, 0.65);
  animation: sealPulse 2s ease-out infinite;
}

@keyframes sealPulse {
  0% { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.48); opacity: 0; }
}

.wax-seal-btn:hover {
  transform: translate(-50%, -50%) scale(1.09);
}

.seal-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1;
  color: #3B2404;
}

.seal-sub {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.14em;
  margin-top: 3px;
  color: #533408;
  text-transform: uppercase;
}

/* Shockwave Ring on Open */
.shockwave-ring {
  position: fixed;
  border-radius: 50%;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 0 28px rgba(236, 205, 138, 0.7);
  pointer-events: none;
  z-index: 105;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 1;
  animation: shockwaveExpand 0.95s var(--ease-cinematic) forwards;
}

@keyframes shockwaveExpand {
  to {
    transform: translate(-50%, -50%) scale(7.5);
    opacity: 0;
  }
}

.envelope-overlay.is-opening .wax-seal-btn {
  transform: translate(-50%, -50%) scale(1.45);
  opacity: 0;
  pointer-events: none;
}

.envelope-overlay.is-opening .envelope-top-flap {
  transform: rotateX(176deg);
  z-index: 1;
}

.envelope-overlay.is-opening .envelope-letter-peek {
  transform: translateY(-56%) scale(1.03);
  box-shadow: 0 24px 50px rgba(236, 205, 138, 0.35);
  z-index: 5;
}

.envelope-recipient {
  font-family: var(--font-display);
  font-size: clamp(1.42rem, 5vw, 1.95rem);
  font-weight: 700;
  color: #FFFDF8;
  margin: 0 0 6px;
}

.envelope-subject {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.96rem;
  color: var(--gold-bright);
  margin: 0 0 22px;
}

.envelope-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #FFFDF8;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(236, 205, 138, 0.22), rgba(198, 151, 73, 0.14));
  border: 1px solid rgba(236, 205, 138, 0.45);
  cursor: pointer;
  transition: all 0.25s ease;
}

.envelope-hint:hover {
  background: rgba(236, 205, 138, 0.3);
  transform: translateY(-2px);
}

.envelope-silent-btn {
  display: block;
  margin: 13px auto 0;
  background: none;
  border: none;
  color: rgba(250, 246, 240, 0.56);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 6px 12px;
}

.envelope-silent-btn:hover { color: var(--gold-bright); }

/* ==========================================================================
   Top Sticky Bar & Floating Step Progress Dock
   ========================================================================== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 65;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(250, 246, 240, 0.86);
  border-bottom: 1px solid var(--border-soft);
}

.top-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--emerald);
}

.brand-emblem {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-mid));
  border: 1.5px solid var(--gold);
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

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

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--emerald);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: var(--paper);
  color: var(--emerald);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
  transform: translateY(-1px);
}

.pill-btn.is-playing {
  background: var(--emerald);
  color: var(--gold-bright);
  border-color: var(--emerald);
}

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

.eq-bars span {
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
}

.pill-btn.is-playing .eq-bars span:nth-child(1) { animation: eq 0.85s ease-in-out infinite 0s; }
.pill-btn.is-playing .eq-bars span:nth-child(2) { animation: eq 0.85s ease-in-out infinite 0.22s; }
.pill-btn.is-playing .eq-bars span:nth-child(3) { animation: eq 0.85s ease-in-out infinite 0.44s; }

@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

/* Floating Step-by-Step Story Navigator Dock */
.story-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 14px;
  border-radius: 999px;
  background: rgba(11, 45, 33, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(236, 205, 138, 0.35);
  box-shadow: 0 16px 40px rgba(7, 31, 23, 0.38);
  color: var(--ivory);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s var(--ease-cinematic);
}

.story-dock.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.dock-step-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  padding-right: 6px;
  white-space: nowrap;
}

.dock-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dock-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(250, 246, 240, 0.28);
  cursor: pointer;
  transition: all 0.3s var(--ease-cinematic);
}

.dock-dot.is-active {
  width: 24px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 10px rgba(236, 205, 138, 0.6);
}

.dock-next-btn {
  margin-left: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #2A1A04;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: transform 0.2s ease;
}

.dock-next-btn:hover { transform: scale(1.04); }

/* ==========================================================================
   Main Layout & Step-by-Step Choreographed Reveal System
   ========================================================================== */
.main-content {
  position: relative;
  z-index: 10;
}

.section {
  padding: clamp(58px, 8vw, 96px) 20px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
}

.container-narrow {
  max-width: 840px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}

/* Multi-Stage Choreography Inside `.step-reveal` */
.step-reveal [data-stagger] {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 0.85s var(--ease-cinematic),
    transform 0.85s var(--ease-cinematic);
}

.step-reveal.is-in [data-stagger] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.step-reveal.is-in [data-stagger="1"] { transition-delay: 0.05s; }
.step-reveal.is-in [data-stagger="2"] { transition-delay: 0.18s; }
.step-reveal.is-in [data-stagger="3"] { transition-delay: 0.32s; }
.step-reveal.is-in [data-stagger="4"] { transition-delay: 0.46s; }
.step-reveal.is-in [data-stagger="5"] { transition-delay: 0.60s; }
.step-reveal.is-in [data-stagger="6"] { transition-delay: 0.74s; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 12px;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  transform: scaleX(0);
  transition: transform 0.8s var(--ease-cinematic) 0.2s;
}

.eyebrow::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.step-reveal.is-in .eyebrow::before,
.step-reveal.is-in .eyebrow::after {
  transform: scaleX(1);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.22;
  color: var(--emerald);
  margin: 0 0 14px;
}

.section-desc {
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0;
}

/* Shimmering Liquid Gold Accent Text (high contrast on ivory cotton paper) */
.gold-shimmer-text {
  background: linear-gradient(110deg, #875A16 0%, #C6933A 28%, #E5BC66 50%, #B37E2A 72%, #875A16 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: liquidGold 5.2s linear infinite;
}

@keyframes liquidGold {
  0% { background-position: 0% 50%; }
  100% { background-position: 240% 50%; }
}

/* Step Continuation Cue */
.step-next-wrap {
  display: flex;
  justify-content: center;
  margin-top: 34px;
}

.step-next-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px dashed var(--border-gold);
  background: rgba(255, 253, 249, 0.7);
  color: var(--emerald);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.step-next-link:hover {
  border-style: solid;
  background: var(--gold-pale);
  transform: translateY(2px);
}

.step-next-link svg {
  animation: bounceDown 1.8s ease-in-out infinite;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

/* ==========================================================================
   ACT I: HERO SECTION (Kinetic Staggered Reveal + 3D Bouquet)
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(36px, 5.5vw, 72px) 20px clamp(42px, 5.5vw, 68px);
  overflow: hidden;
}

.hero-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(30px, 5vw, 56px);
}

/* Hero elements wait until envelope opens, then choreograph smoothly */
.hero-anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-cinematic), transform 0.9s var(--ease-cinematic);
}

body.hero-ready .hero-anim {
  opacity: 1;
  transform: translateY(0);
}

body.hero-ready .hero-anim.d1 { transition-delay: 0.12s; }
body.hero-ready .hero-anim.d2 { transition-delay: 0.28s; }
body.hero-ready .hero-anim.d3 { transition-delay: 0.44s; }
body.hero-ready .hero-anim.d4 { transition-delay: 0.60s; }
body.hero-ready .hero-anim.d5 { transition-delay: 0.76s; }
body.hero-ready .hero-anim.d6 { transition-delay: 0.36s; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(15, 61, 46, 0.06);
  border: 1px solid var(--border-gold);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--emerald);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(198, 151, 73, 0.25);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.2vw, 3.55rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--emerald);
  margin: 0 0 16px;
}

.hero-title em {
  font-style: italic;
  font-weight: 700;
  display: block;
  margin-top: 6px;
}

/* Classroom Memory Meta Pills (B407 · 140 Lê Trọng Tấn · Tiết 7-9 · 16DHNH05) */
.memory-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.memory-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid rgba(15, 61, 46, 0.14);
  box-shadow: 0 4px 12px rgba(15, 61, 46, 0.05);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--emerald);
}

.memory-pill strong { color: var(--gold-deep); }

.hero-lead {
  font-size: clamp(0.96rem, 2.2vw, 1.06rem);
  color: var(--ink-soft);
  line-height: 1.84;
  margin: 0 0 26px;
  max-width: 575px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-mid) 100%);
  color: #FFFDF8;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 16px 34px -10px rgba(15, 61, 46, 0.5), inset 0 1px 0 rgba(236, 205, 138, 0.42);
  transition: transform 0.25s var(--ease-cinematic), box-shadow 0.25s ease;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 224, 0.28), transparent);
  transform: skewX(-22deg);
  transition: left 0.7s ease;
}

.btn-primary:hover::after { left: 160%; }

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px -10px rgba(15, 61, 46, 0.58);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(135deg, #FFFDF8 0%, #F7ECDA 100%);
  color: var(--emerald);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #261904;
  transform: translateY(-2px);
}

/* Hero Floral Medallion with Rotating Sunburst & Orbiting Sparkles */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bouquet-medallion {
  position: relative;
  width: min(415px, 86vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out;
}

.medallion-sunburst {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(236, 205, 138, 0.14) 0deg 8deg,
    transparent 8deg 24deg
  );
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,0.85) 20%, transparent 72%);
  mask-image: radial-gradient(circle, rgba(0,0,0,0.85) 20%, transparent 72%);
  animation: slowSpin 50s linear infinite;
  pointer-events: none;
}

.medallion-ring-outer {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(198, 151, 73, 0.44);
  animation: slowSpin 38s linear infinite;
}

.medallion-ring-outer::before,
.medallion-ring-outer::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-bright);
}

.medallion-ring-outer::before { top: -4.5px; left: 50%; transform: translateX(-50%); }
.medallion-ring-outer::after { bottom: -4.5px; left: 50%; transform: translateX(-50%); background: var(--blush); }

.medallion-ring-inner {
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #FFFDF8 0%, #F5ECDF 68%, rgba(245, 236, 223, 0) 100%);
  border: 1px dashed rgba(15, 61, 46, 0.16);
}

@keyframes slowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-bouquet-img {
  position: relative;
  z-index: 2;
  width: 88%;
  height: auto;
  filter: drop-shadow(0 22px 30px rgba(15, 61, 46, 0.16));
  animation: gentleBob 5s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-9px); }
}

.medallion-tag {
  position: absolute;
  bottom: 3%;
  right: 2%;
  z-index: 4;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  color: var(--gold-bright);
  border: 1px solid rgba(236, 205, 138, 0.58);
  border-radius: 14px;
  padding: 10px 15px;
  box-shadow: 0 16px 32px rgba(7, 31, 23, 0.3);
  text-align: left;
}

.medallion-tag-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  opacity: 0.85;
  text-transform: uppercase;
}

.medallion-tag-val {
  display: block;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  color: #FFFDF8;
}

/* ==========================================================================
   LIVE GRATITUDE TICKER BAND
   ========================================================================== */
.ticker-band {
  position: relative;
  background: linear-gradient(90deg, var(--emerald-dark), var(--emerald), var(--emerald-dark));
  border-top: 1px solid rgba(236, 205, 138, 0.38);
  border-bottom: 1px solid rgba(236, 205, 138, 0.38);
  padding: 14px 0;
  overflow: hidden;
  user-select: none;
}

.ticker-band::before,
.ticker-band::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 2;
  pointer-events: none;
}

.ticker-band::before { left: 0; background: linear-gradient(90deg, var(--emerald-dark), transparent); }
.ticker-band::after { right: 0; background: linear-gradient(270deg, var(--emerald-dark), transparent); }

.ticker-track {
  display: flex;
  width: max-content;
  gap: 34px;
  animation: tickerScroll 36s linear infinite;
}

.ticker-band:hover .ticker-track { animation-play-state: paused; }

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.77rem;
  white-space: nowrap;
}

.ticker-code { color: #FFFDF8; font-weight: 600; letter-spacing: 0.06em; }
.ticker-arrow { color: #79E0AD; font-size: 0.68rem; }
.ticker-val { color: var(--gold-bright); font-weight: 600; }
.ticker-sep { color: rgba(236, 205, 138, 0.35); margin-left: 14px; }

/* ==========================================================================
   ACT II: CINEMATIC ANIMATED SHORT FILM ("NẮNG CHIỀU PHÒNG B407")
   ========================================================================== */
.cinema-shell {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(236, 205, 138, 0.14), transparent 55%),
    linear-gradient(165deg, #09251C 0%, #0E372A 55%, #071C15 100%);
  border-radius: 30px;
  padding: clamp(24px, 4.5vw, 44px) clamp(16px, 4vw, 40px);
  border: 1px solid rgba(236, 205, 138, 0.3);
  box-shadow: var(--shadow-emerald);
  color: var(--ivory);
  position: relative;
  overflow: hidden;
}

.cinema-shell .eyebrow { color: var(--gold-bright); }
.cinema-shell .section-title { color: #FFFDF8; }
.cinema-shell .section-desc { color: rgba(250, 246, 240, 0.78); }

.cinema-viewport {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: #051610;
  border: 2px solid rgba(236, 205, 138, 0.45);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 42px rgba(236, 205, 138, 0.14);
}

#animeClipCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Cinema Play Poster Overlay */
.cinema-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(7, 28, 21, 0.35) 0%, rgba(5, 22, 16, 0.76) 100%);
  cursor: pointer;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.cinema-poster-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cinema-play-circle {
  width: clamp(66px, 12vw, 88px);
  height: clamp(66px, 12vw, 88px);
  border-radius: 50%;
  border: 2px solid #FFF7DF;
  background: radial-gradient(circle at 30% 25%, #F8E0A0 0%, #C89643 70%, #92631C 100%);
  color: #2A1903;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 12px rgba(236, 205, 138, 0.18), 0 18px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease-cinematic), box-shadow 0.3s ease;
  margin-bottom: 16px;
}

.cinema-poster-overlay:hover .cinema-play-circle {
  transform: scale(1.1);
  box-shadow: 0 0 0 18px rgba(236, 205, 138, 0.24), 0 22px 46px rgba(0, 0, 0, 0.55);
}

.cinema-poster-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.85rem);
  font-weight: 700;
  color: #FFFDF8;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
  margin: 0 0 6px;
}

.cinema-poster-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.66rem, 1.8vw, 0.78rem);
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* Cinema Subtitle & Control Deck */
.cinema-deck {
  max-width: 920px;
  margin: 18px auto 0;
}

.cinema-subtitle-box {
  background: rgba(255, 253, 249, 0.06);
  border: 1px solid rgba(236, 205, 138, 0.24);
  border-left: 3px solid var(--gold-bright);
  border-radius: 14px;
  padding: 15px 18px;
  margin-bottom: 14px;
  min-height: 86px;
  transition: opacity 0.3s ease;
}

.cinema-sub-badge {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cinema-sub-text {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2.1vw, 1.01rem);
  color: rgba(255, 253, 248, 0.94);
  margin: 0;
  line-height: 1.65;
}

.cinema-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cinema-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(236, 205, 138, 0.42);
  background: rgba(255, 253, 249, 0.08);
  color: #FFFDF8;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cinema-btn:hover {
  background: rgba(236, 205, 138, 0.22);
  border-color: var(--gold-bright);
}

.cinema-btn.is-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #2A1903;
  border-color: transparent;
}

.cinema-progress-wrap {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cinema-scrubber {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  overflow: hidden;
}

.cinema-scrubber-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright), #F5B8B0);
  transition: width 0.08s linear;
}

.cinema-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  white-space: nowrap;
}

.scene-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.scene-pill {
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(236, 205, 138, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(250, 246, 240, 0.75);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
}

.scene-pill:hover {
  background: rgba(236, 205, 138, 0.12);
  color: #FFFDF8;
}

.scene-pill.is-active {
  background: rgba(236, 205, 138, 0.2);
  border-color: var(--gold-bright);
  color: #FFFDF8;
}

.scene-pill-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--gold-bright);
  margin-bottom: 2px;
}

/* ==========================================================================
   ACT III: STATIONERY LETTER (Step-by-Step Paragraph Reveal)
   ========================================================================== */
.letter-card {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(30px, 6vw, 62px) clamp(24px, 6vw, 64px);
  box-shadow: var(--shadow-paper);
  border: 1px solid rgba(198, 151, 73, 0.34);
  overflow: hidden;
}

.letter-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(198, 151, 73, 0.25);
  border-radius: 14px;
  pointer-events: none;
}

.corner-ornament {
  position: absolute;
  width: 34px;
  height: 34px;
  color: var(--gold);
  opacity: 0.74;
  pointer-events: none;
}
.corner-ornament.tl { top: 20px; left: 20px; }
.corner-ornament.tr { top: 20px; right: 20px; transform: scaleX(-1); }
.corner-ornament.bl { bottom: 20px; left: 20px; transform: scaleY(-1); }
.corner-ornament.br { bottom: 20px; right: 20px; transform: scale(-1, -1); }

.letter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px dashed rgba(198, 151, 73, 0.38);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  color: var(--gold-deep);
  text-transform: uppercase;
}

.letter-salutation {
  font-family: var(--font-display);
  font-size: clamp(1.36rem, 3.4vw, 1.78rem);
  font-weight: 700;
  color: var(--emerald);
  margin: 0 0 22px;
}

.letter-body p {
  font-family: var(--font-serif);
  font-size: clamp(0.98rem, 2.2vw, 1.08rem);
  line-height: 1.94;
  color: #29352F;
  margin: 0 0 18px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.85s var(--ease-cinematic), transform 0.85s var(--ease-cinematic);
}

.step-reveal.is-in .letter-body p:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.32s; }
.step-reveal.is-in .letter-body p:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.56s; }
.step-reveal.is-in .letter-body p:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.80s; }

.letter-closing {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  color: var(--emerald);
  font-size: 1.05rem;
  margin: 26px 0 28px;
}

.letter-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 10px;
}

.letter-signature {
  text-align: right;
  margin-left: auto;
}

.signature-script {
  font-family: var(--font-script);
  font-size: clamp(1.82rem, 4.8vw, 2.3rem);
  color: var(--emerald);
  line-height: 1.2;
  margin: 0;
}

.signature-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.flower-action-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.flower-counter {
  font-size: 0.8rem;
  color: var(--ink-muted);
  min-height: 1.3em;
}

.flower-counter strong { color: var(--emerald); }

/* ==========================================================================
   ACT IV: TTTC 4-CHAPTER JOURNEY CHART & KPI CARDS
   ========================================================================== */
.tttc-showcase {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(35, 110, 83, 0.42) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 88%, rgba(198, 151, 73, 0.18) 0%, transparent 50%),
    linear-gradient(160deg, var(--emerald-dark) 0%, var(--emerald) 55%, #0C3326 100%);
  color: var(--ivory);
  border-radius: 32px;
  padding: clamp(32px, 5.5vw, 60px) clamp(20px, 4.5vw, 52px);
  box-shadow: var(--shadow-emerald);
  border: 1px solid rgba(236, 205, 138, 0.28);
  position: relative;
  overflow: hidden;
}

.tttc-showcase .eyebrow { color: var(--gold-bright); }
.tttc-showcase .section-title { color: #FFFDF8; }
.tttc-showcase .section-desc { color: rgba(250, 246, 240, 0.78); }

.chart-panel {
  background: rgba(6, 26, 19, 0.6);
  border: 1px solid rgba(236, 205, 138, 0.24);
  border-radius: 20px;
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 26px;
}

.chart-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(236, 205, 138, 0.16);
}

.chart-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chart-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.07em;
  color: var(--gold-bright);
}

.chart-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(121, 224, 173, 0.14);
  color: #8CF0BE;
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.chart-live-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8CF0BE;
  animation: blinkDot 1.6s ease-in-out infinite;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chart-status-right {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(250, 246, 240, 0.72);
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-curve-path {
  stroke-dasharray: 920;
  stroke-dashoffset: 920;
  transition: stroke-dashoffset 2s var(--ease-cinematic);
}

.chart-svg.is-drawn .chart-curve-path { stroke-dashoffset: 0; }

.chart-area-path {
  opacity: 0;
  transition: opacity 1.5s ease 0.45s;
}

.chart-svg.is-drawn .chart-area-path { opacity: 1; }

.chart-node { cursor: pointer; outline: none; }

.chart-node-ring {
  transform-box: fill-box;
  transform-origin: center;
}

.chart-node.is-active .chart-node-ring {
  animation: nodePulse 1.8s ease-out infinite;
}

@keyframes nodePulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.milestone-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.milestone-tab {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(236, 205, 138, 0.2);
  border-radius: 12px;
  padding: 10px 11px;
  color: rgba(250, 246, 240, 0.78);
  font-family: var(--font-sans);
  font-size: 0.77rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
}

.milestone-tab:hover {
  background: rgba(236, 205, 138, 0.14);
  color: #FFFDF8;
}

.milestone-tab.is-active {
  background: linear-gradient(135deg, rgba(236, 205, 138, 0.24), rgba(198, 151, 73, 0.12));
  border-color: var(--gold-bright);
  color: #FFFDF8;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.milestone-tab-step {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  color: var(--gold-bright);
  margin-bottom: 2px;
}

.milestone-readout {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.065);
  border-left: 3px solid var(--gold-bright);
}

.readout-meta {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 4px;
}

.readout-title {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  color: #FFFDF8;
  margin: 0 0 6px;
}

.readout-desc {
  font-size: 0.93rem;
  color: rgba(250, 246, 240, 0.88);
  margin: 0;
  line-height: 1.76;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-card {
  background: rgba(255, 253, 249, 0.06);
  border: 1px solid rgba(236, 205, 138, 0.24);
  border-top: 2px solid var(--gold-bright);
  border-radius: 16px;
  padding: 20px 18px;
  transition: transform 0.3s var(--ease-cinematic), background 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 253, 249, 0.1);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.kpi-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.76rem;
  font-weight: 700;
  color: #FFFDF8;
  line-height: 1.12;
  margin-bottom: 8px;
}

.kpi-title {
  font-weight: 600;
  font-size: 0.89rem;
  color: var(--gold-pale);
  margin-bottom: 6px;
}

.kpi-desc {
  font-size: 0.81rem;
  color: rgba(250, 246, 240, 0.76);
  line-height: 1.65;
  margin: 0;
}

/* ==========================================================================
   ACT V: 3D GIFT BOX & 4 TTTC FINANCIAL TOOL FLIP CARDS
   ========================================================================== */
.gift-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gift-box-container {
  position: relative;
  width: 248px;
  height: 248px;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin: 8px auto 16px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gift-aura {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 205, 138, 0.42) 0%, rgba(217, 137, 130, 0.16) 48%, transparent 72%);
  animation: gentleGlow 2.6s ease-in-out infinite;
}

.gift-box {
  position: relative;
  width: 160px;
  height: 150px;
  transition: transform 0.35s var(--ease-cinematic);
  animation: giftIdle 2.5s ease-in-out infinite;
}

@keyframes giftIdle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-7px) rotate(-1.8deg); }
  75% { transform: translateY(-5px) rotate(1.8deg); }
}

.gift-box-container:hover .gift-box {
  animation: none;
  transform: translateY(-10px) scale(1.06);
}

.gift-base {
  position: absolute;
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 106px;
  border-radius: 8px 8px 14px 14px;
  background: linear-gradient(145deg, #175742 0%, #0D3527 65%, #071F17 100%);
  box-shadow:
    0 24px 40px -8px rgba(7, 31, 23, 0.46),
    inset 0 2px 0 rgba(236, 205, 138, 0.38);
  overflow: hidden;
}

.gift-ribbon-v {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  background: linear-gradient(90deg, #B78536 0%, #F6DFAA 48%, #C99642 100%);
}

.gift-lid {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1E6950 0%, #103F2F 100%);
  box-shadow: 0 10px 20px rgba(7, 31, 23, 0.38);
  z-index: 3;
  transition: transform 0.8s var(--ease-cinematic), opacity 0.6s ease;
}

.gift-lid::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  background: linear-gradient(90deg, #B78536 0%, #F7E1AD 50%, #C69342 100%);
}

.gift-bow {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 32px;
  z-index: 4;
}

.bow-loop {
  position: absolute;
  bottom: 2px;
  width: 38px;
  height: 25px;
  border-radius: 50% 50% 20% 50%;
  border: 5px solid #ECCD8A;
  background: linear-gradient(135deg, rgba(248, 228, 178, 0.55), rgba(198, 151, 73, 0.22));
}

.bow-loop.left { left: 4px; transform: rotate(-16deg); }
.bow-loop.right { right: 4px; transform: scaleX(-1) rotate(-16deg); }

.bow-knot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(135deg, #F8E0A4, #B58131);
}

.gift-box-container.is-opened .gift-box { animation: none; }
.gift-box-container.is-opened .gift-lid {
  transform: translateY(-84px) rotate(-20deg) scale(0.92);
  opacity: 0;
}
.gift-box-container.is-opened { cursor: default; }

.gift-prompt {
  font-size: 0.92rem;
  color: var(--emerald);
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--gold);
  box-shadow: 0 8px 20px rgba(15, 61, 46, 0.1);
}

.gift-prompt.is-hidden { display: none; }

.gift-reveal {
  width: 100%;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(24px);
  transition: max-height 1.1s var(--ease-cinematic), opacity 0.85s ease, transform 0.85s ease;
}

.gift-reveal.is-visible {
  max-height: 2400px;
  opacity: 1;
  transform: translateY(0);
  overflow: visible;
}

.gift-bouquet-banner {
  max-width: 680px;
  margin: 0 auto 38px;
  padding: 30px 24px;
  border-radius: 24px;
  background: var(--paper);
  border: 1.5px solid var(--border-gold);
  box-shadow: var(--shadow-paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.gift-bouquet-banner img {
  width: min(255px, 68vw);
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(15, 61, 46, 0.15));
  animation: bouquetBloom 1s var(--ease-cinematic) both;
}

@keyframes bouquetBloom {
  from { opacity: 0; transform: scale(0.72) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.gift-bouquet-title {
  font-family: var(--font-display);
  font-size: 1.48rem;
  font-weight: 700;
  color: var(--emerald);
  margin: 0;
}

.gift-bouquet-note {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin: 0;
  max-width: 500px;
}

.flip-intro {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 18px;
}

.flip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.flip-card {
  perspective: 1100px;
  height: 276px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.75s var(--ease-cinematic);
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card-inner { transform: rotateY(180deg); }

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.flip-front {
  background: linear-gradient(155deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  border: 1px solid rgba(236, 205, 138, 0.48);
  color: var(--ivory);
  box-shadow: 0 20px 36px -14px rgba(7, 31, 23, 0.5);
}

.flip-front::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(236, 205, 138, 0.26);
  border-radius: 12px;
  pointer-events: none;
}

.flip-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--gold-bright);
}

.flip-front-center { text-align: center; margin: auto 0; }

.flip-icon-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: rgba(236, 205, 138, 0.15);
  border: 1px solid rgba(236, 205, 138, 0.48);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
}

.flip-front-title {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  color: #FFFDF8;
  margin: 0 0 5px;
}

.flip-front-sub {
  font-size: 0.77rem;
  color: rgba(250, 246, 240, 0.74);
  margin: 0;
}

.flip-tap-hint {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-align: center;
}

.flip-back {
  background: linear-gradient(160deg, #FFFDF9 0%, #F7EFE2 100%);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  transform: rotateY(180deg);
  box-shadow: var(--shadow-paper);
}

.flip-back::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(198, 151, 73, 0.3);
  border-radius: 12px;
  pointer-events: none;
}

.flip-back-title {
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--emerald);
  margin: 4px 0 10px;
}

.flip-back-text {
  font-family: var(--font-serif);
  font-size: 0.87rem;
  line-height: 1.72;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}

.flip-back-foot {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  color: var(--gold-deep);
  text-transform: uppercase;
  padding-top: 10px;
  border-top: 1px dashed rgba(198, 151, 73, 0.35);
}

/* ==========================================================================
   ACT VI: CERTIFICATE & INTERACTIVE FIREWORKS FINALE
   ========================================================================== */
.cert-wrapper { max-width: 840px; margin: 0 auto; }

.certificate-card {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #FFFDF8 40%, #F5ECDD 100%);
  border-radius: 20px;
  padding: clamp(28px, 5vw, 54px) clamp(22px, 5vw, 56px);
  box-shadow: var(--shadow-paper);
  border: 2px solid var(--emerald);
  text-align: center;
  overflow: hidden;
}

.certificate-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  pointer-events: none;
}

.certificate-card::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed rgba(15, 61, 46, 0.25);
  border-radius: 8px;
  pointer-events: none;
}

.cert-top-serial {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  color: var(--gold-deep);
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.cert-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold-deep);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cert-heading {
  font-family: var(--font-display);
  font-size: clamp(1.58rem, 4.2vw, 2.35rem);
  font-weight: 700;
  color: var(--emerald);
  margin: 0 0 12px;
}

.cert-divider {
  width: 150px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0 auto 20px;
}

.cert-recipient-label { font-size: 0.85rem; color: var(--ink-muted); margin-bottom: 4px; }

.cert-recipient-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.48rem, 4vw, 2.15rem);
  font-weight: 700;
  color: var(--emerald);
  margin: 0 0 14px;
}

.cert-body {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 28px;
}

.cert-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(198, 151, 73, 0.32);
  position: relative;
  z-index: 2;
}

.cert-col-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cert-col-val {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--emerald);
}

.cert-seal-medallion {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #F8E2A8 0%, #C69444 65%, #8F621E 100%);
  border: 2px solid #FFF8E6;
  box-shadow: 0 8px 20px rgba(150, 107, 38, 0.35), inset 0 0 0 3px rgba(255, 248, 224, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3D2605;
  margin: 0 auto;
}

.cert-seal-grade { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1; }
.cert-seal-sub { font-family: var(--font-mono); font-size: 0.5rem; letter-spacing: 0.1em; margin-top: 3px; }

.cert-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.finale-card {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 56px) 24px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(236, 205, 138, 0.16), transparent 60%),
    linear-gradient(160deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  color: var(--ivory);
  border: 1px solid rgba(236, 205, 138, 0.35);
  box-shadow: var(--shadow-emerald);
}

.finale-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3.6vw, 1.88rem);
  line-height: 1.48;
  color: #FFFDF8;
  margin: 0 0 14px;
}

.finale-sub {
  font-size: 0.95rem;
  color: rgba(250, 246, 240, 0.8);
  margin: 0 0 26px;
}

.site-footer {
  position: relative;
  z-index: 10;
  padding: 28px 20px 88px;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}

.footer-link {
  color: var(--emerald);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed var(--gold);
  padding-bottom: 2px;
}

.footer-link:hover { color: var(--gold-deep); }

/* Toast */
.toast {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: var(--emerald-dark);
  color: #FFFDF8;
  border: 1px solid var(--gold);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   QR STUDIO PAGE (/qr.html)
   ========================================================================== */
.qr-page {
  min-height: 100vh;
  padding: 28px 20px 64px;
  position: relative;
  z-index: 10;
}

.qr-studio-grid {
  max-width: 1040px;
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.qr-panel {
  background: var(--paper);
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  padding: clamp(22px, 3.5vw, 34px);
  box-shadow: var(--shadow-paper);
}

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--emerald); margin-bottom: 6px; }

.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 61, 46, 0.2);
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.92rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 151, 73, 0.18);
  background: #FFFFFF;
}

.form-hint { font-size: 0.76rem; color: var(--ink-muted); margin-top: 5px; }

.qr-url-preview {
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--ivory-deep);
  border: 1px dashed rgba(15, 61, 46, 0.22);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--emerald);
  word-break: break-all;
  margin-bottom: 18px;
}

.qr-canvas-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.qr-card-preview-canvas {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 24px 60px -16px rgba(15, 61, 46, 0.28);
  border: 1px solid rgba(198, 151, 73, 0.35);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .memory-pills { justify-content: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-cta-row { justify-content: center; }
  .kpi-grid, .flip-grid { grid-template-columns: repeat(2, 1fr); }
  .qr-studio-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .milestone-tabs, .scene-pills { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid, .flip-grid { grid-template-columns: 1fr; }
  .flip-card { height: 230px; }
  .cert-footer { grid-template-columns: 1fr; gap: 18px; }
  .letter-footer-row { flex-direction: column-reverse; align-items: stretch; }
  .flower-action-box { align-items: center; }
  .dock-step-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ==========================================================================
   V3: SEQUENTIAL SCENE-BY-SCENE STAGE (NO SCROLL-SKIPPING!)
   ========================================================================== */
.main-content.stage-mode {
  min-height: calc(100vh - 64px);
  padding-bottom: 108px;
}

.story-scene {
  display: none;
  opacity: 0;
  will-change: opacity, transform;
}

.story-scene.is-active {
  display: block;
  animation: sceneRevealIn 0.78s var(--ease-cinematic) forwards;
}

.story-scene.is-leaving {
  display: block;
  animation: sceneFadeOut 0.34s ease forwards;
  pointer-events: none;
}

@keyframes sceneRevealIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sceneFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-18px) scale(0.985);
  }
}

/* Golden Veil Transition Flash Between Scenes */
.scene-transition-veil {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, rgba(248, 226, 168, 0.38) 0%, rgba(15, 61, 46, 0.16) 65%, transparent 100%);
  transition: opacity 0.34s ease;
}

.scene-transition-veil.is-flashing {
  opacity: 1;
}

/* Scene-Specific Tighten Padding so Each Scene Fits Elegantly */
.stage-mode .section {
  padding-top: clamp(28px, 4.5vw, 52px);
  padding-bottom: clamp(24px, 4vw, 44px);
}

/* Unlock Gate Footer Inside Every Scene */
.scene-gate {
  max-width: 680px;
  margin: 34px auto 0;
  padding: 20px 22px;
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.92);
  border: 1.5px solid rgba(198, 151, 73, 0.34);
  box-shadow: 0 18px 46px -18px rgba(15, 61, 46, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  text-align: center;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.scene-gate.is-unlocked {
  border-color: var(--gold);
  box-shadow: 0 22px 54px -16px rgba(198, 151, 73, 0.34);
}

.gate-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(15, 61, 46, 0.06);
  border: 1px solid rgba(15, 61, 46, 0.12);
}

.gate-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: blinkDot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.scene-gate.is-unlocked .gate-status {
  color: var(--emerald);
  background: rgba(121, 224, 173, 0.18);
  border-color: rgba(25, 118, 78, 0.32);
  font-weight: 600;
}

.scene-gate.is-unlocked .gate-status-dot {
  background: #1B8754;
  animation: none;
}

.btn-scene-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: all 0.35s var(--ease-cinematic);
}

.btn-scene-next.is-locked {
  background: #EAE4DA;
  color: #828C85;
  border-color: rgba(15, 61, 46, 0.12);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-scene-next.is-unlocked {
  background: linear-gradient(135deg, var(--emerald) 0%, #195944 55%, var(--emerald) 100%);
  color: #FFFDF8;
  border-color: var(--gold-bright);
  cursor: pointer;
  box-shadow:
    0 16px 36px -10px rgba(15, 61, 46, 0.55),
    0 0 0 0 rgba(236, 205, 138, 0.6);
  animation: unlockedPulse 2.1s ease-out infinite;
}

.btn-scene-next.is-unlocked:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 44px -10px rgba(15, 61, 46, 0.62);
}

@keyframes unlockedPulse {
  0% { box-shadow: 0 16px 36px -10px rgba(15, 61, 46, 0.55), 0 0 0 0 rgba(236, 205, 138, 0.65); }
  70% { box-shadow: 0 16px 36px -10px rgba(15, 61, 46, 0.55), 0 0 0 14px rgba(236, 205, 138, 0); }
  100% { box-shadow: 0 16px 36px -10px rgba(15, 61, 46, 0.55), 0 0 0 0 rgba(236, 205, 138, 0); }
}

/* Enhanced Story Dock (Locked / Unlocked / Prev / Next) */
.dock-prev-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(236, 205, 138, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dock-prev-btn:hover:not(:disabled) {
  background: rgba(236, 205, 138, 0.2);
}

.dock-prev-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.dock-dot.is-done {
  background: rgba(236, 205, 138, 0.72);
}

.dock-dot.is-locked {
  background: rgba(250, 246, 240, 0.16);
  cursor: not-allowed;
}

.dock-next-btn.is-locked {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(250, 246, 240, 0.5);
  cursor: not-allowed;
}

.story-dock.is-shaking {
  animation: dockShake 0.42s ease;
}

@keyframes dockShake {
  0%, 100% { transform: translateX(-50%); }
  22% { transform: translateX(calc(-50% - 7px)); }
  45% { transform: translateX(calc(-50% + 7px)); }
  68% { transform: translateX(calc(-50% - 4px)); }
  85% { transform: translateX(calc(-50% + 4px)); }
}

/* Scene 2 Letter Paragraph Step Reveal (tied to active scene) */
.story-scene.is-active .letter-body p {
  opacity: 1;
  transform: translateY(0);
}

.story-scene.is-active .letter-body p:nth-child(1) { transition-delay: 0.45s; }
.story-scene.is-active .letter-body p:nth-child(2) { transition-delay: 1.35s; }
.story-scene.is-active .letter-body p:nth-child(3) { transition-delay: 2.25s; }
