/* JrSSSY homepage 4.16.588 — closing zone: no radial mask (tall card + backdrop bug) */
/*
 * TECHNIQUE: carve a tight .text-zone around each copy block.
 * Only that region gets strong backdrop-blur + clear translucent fill.
 * Soft mask edges = spotlight on words, not a milky scene-covering card.
 * Rest of viewport stays open so Verdant is fully visible.
 * Type: deep forest ink on light zones / cream on dark zones. No outer glow.
 * Be Vietnam Pro + Literata. Pill nav from site.css untouched.
 */

body.jr-rebuild {
  color-scheme: light;
  --font-display: "Literata", "Be Vietnam Pro", Georgia, "Times New Roman", serif;
  --font-sans: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --page: #b7e4d2;
  /* Deep ink reads best on blurred forest + clear white glass */
  --ink: #071410;
  --ink-sub: #1a332a;
  --ink-mute: #3d5c52;
  --main: #0a7a5c;
  --main-2: #1a7f8a;
  --main-text: #ffffff;
  --button: #071410;
  --button-ink: #ffffff;
  --zone-fill: rgba(255, 255, 255, 0.42);
  --zone-fill-strong: rgba(255, 255, 255, 0.52);
  --zone-stroke: rgba(255, 255, 255, 0.55);
  --zone-shadow: 0 10px 36px rgba(7, 20, 16, 0.1);
  --display-tracking: -0.035em;
  --svg-sky-top: #a7daed;
  --svg-sky-bottom: #a1dbbf;
}

html[data-theme="dark"] body.jr-rebuild {
  color-scheme: dark;
  --page: #06141a;
  --ink: #f4faf7;
  --ink-sub: #c8ddd4;
  --ink-mute: #8eaea2;
  --main: #5ee0b0;
  --main-2: #5eb8c8;
  --main-text: #04241d;
  --button: #3dcea0;
  --button-ink: #031a15;
  --zone-fill: rgba(6, 18, 24, 0.48);
  --zone-fill-strong: rgba(6, 18, 24, 0.58);
  --zone-stroke: rgba(220, 255, 240, 0.16);
  --zone-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
  --svg-sky-top: #071829;
  --svg-sky-bottom: #134852;
}

body.jr-rebuild {
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" on, "kern" on;
}

html.jr-illu-home {
  scroll-padding-top: 0;
  scroll-behavior: auto;
  scroll-snap-type: y proximity;
  overflow-x: clip;
  max-width: 100%;
}
html.jr-illu-home.jr-illu-shot,
html.jr-illu-home.jr-illu-snap-off {
  scroll-snap-type: none;
  scroll-behavior: auto;
}
@media (hover: none) and (pointer: coarse) {
  html.jr-illu-home,
  html.jr-illu-home.jr-illu-shot {
    scroll-snap-type: y proximity;
  }
}
@media (prefers-reduced-motion: reduce) {
  html.jr-illu-home,
  html.jr-illu-home.jr-illu-shot {
    scroll-snap-type: y proximity;
  }
}

body.jr-rebuild a { color: inherit; text-decoration: none; }
body.jr-rebuild ::selection { background: var(--main); color: var(--main-text); }
body.jr-rebuild .illu-btn:focus-visible,
body.jr-rebuild .chapters-nav a:focus-visible,
body.jr-rebuild .motion-fab:focus-visible {
  outline: 3px solid var(--main-2);
  outline-offset: 4px;
}

/* ===== Verdant stage — fully visible ===== */
.world-stage,
body.jr-rebuild .world-stage {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  background: linear-gradient(180deg, #a7daed 0%, #d4f4ea 44%, #cae8d1 79%, #a1dbbf 100%) !important;
  transform: none !important;
}
body.jr-rebuild .world-stage > svg,
body.jr-rebuild .world-3d-canvas,
body.jr-rebuild .world-3d-status,
body.jr-rebuild .world-shafts,
body.jr-rebuild .world-3d-orbit,
body.jr-rebuild .world-3d-plane {
  display: none !important;
}
/* Never flash the old Illustrator mountain poster on F5 */
body.jr-rebuild .world-stage .vw-poster,
body.jr-rebuild .world-stage .vw-poster svg {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

body.jr-rebuild .ambient,
body.jr-rebuild #warpCanvas,
body.jr-rebuild .noise,
body.jr-rebuild .grid-lines,
body.jr-rebuild #jrPreloader,
body.jr-rebuild .site-nav,
body.jr-rebuild > .footer {
  display: none !important;
}

/* Pill nav shields */
body.jr-rebuild .nav-wrap .brand-mark {
  background: none !important;
  transform: none !important;
  box-shadow: none !important;
  display: block !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
}
@media (min-width: 769px) {
  body.jr-rebuild .nav-wrap .nav-links { display: flex !important; }
}
@media (max-width: 768px) {
  body.jr-rebuild .nav-wrap .nav-links.nav-menu-panel { display: none !important; }
  body.jr-rebuild .nav-wrap.is-menu-open .nav-links.nav-menu-panel { display: flex !important; }
}
body.jr-rebuild .nav-wrap > .nav {
  background: rgba(255, 255, 255, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 12px 40px rgba(10, 18, 16, 0.1) !important;
  backdrop-filter: blur(28px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.35) !important;
  animation: jrNavBarIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
html[data-theme="dark"] body.jr-rebuild .nav-wrap > .nav {
  background: rgba(7, 20, 26, 0.55) !important;
  border-color: rgba(220, 255, 240, 0.16) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35) !important;
}
@keyframes jrNavBarIn {
  from { opacity: 0; transform: translateY(-22px) scale(0.96); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  body.jr-rebuild .nav-wrap > .nav {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ===== Chapters ===== */
body.jr-rebuild main.illu-main {
  position: relative;
  z-index: 1;
  background: transparent !important;
  max-width: 100%;
}

.chapter {
  min-height: 100svh;
  min-height: 100dvh;
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 32px 72px;
  scroll-margin-top: 0;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  box-sizing: border-box;
  background: transparent;
}

.chapter-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}
/* Reserve a fixed Leaf slot to the RIGHT of the 3 Nghiên cứu cards */
#discover .chapter-inner {
  max-width: min(1180px, calc(100vw - 48px));
  padding-right: clamp(168px, 18vw, 280px);
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.78fr);
}
.chapter-inner--hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(4px, 1.5vw, 28px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  position: relative;
}
.hero-mascot {
  position: relative;
  flex: 1 1 auto;
  align-self: center;
  min-width: min(240px, 32vw);
  max-width: min(400px, 38vw);
  min-height: min(42vh, 360px);
  height: min(46vh, 400px);
  margin-left: clamp(-8px, -0.5vw, 0);
  margin-top: clamp(12px, 2.5vh, 36px);
  padding: 12px 8px 4px;
  box-sizing: border-box;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  --dragon-x: 0px;
  --dragon-y: 0px;
  --dragon-op: 1;
  --dragon-scale: 1;
  z-index: 2;
}
/* Fixed flight layer — size via --dragon-w/h (hero dock or mini corner) */
.hero-mascot.is-ready.is-flight {
  position: fixed;
  top: var(--dragon-top, 120px);
  left: var(--dragon-left, 48%);
  right: auto;
  bottom: auto;
  width: var(--dragon-w, min(340px, 26vw));
  height: var(--dragon-h, min(380px, 40vh));
  min-width: 0;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 8px;
  box-sizing: border-box;
  flex: none;
  z-index: 6; /* under nav (~25+) */
  opacity: var(--dragon-op, 1);
  transform: translate3d(var(--dragon-x, 0px), var(--dragon-y, 0px), 0) scale(var(--dragon-scale, 1));
  will-change: top, left, width, height, transform, opacity;
  transition: none;
  overflow: visible;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.hero-mascot.is-ready.is-flight.is-mini {
  z-index: 1140; /* above content, just under .currency-fab (1150) */
  padding: 4px;
}
/* Leaf-Explorer — same flight chrome as dragon; slightly greener glow */
.leaf-mascot {
  z-index: 5;
}
.leaf-mascot.is-ready.is-flight {
  z-index: 7;
  /* Default frozen; .is-layout-tween / .is-appearing unlock exclusive CSS tweens */
  transition: none;
}
.leaf-mascot.is-ready.is-flight.is-layout-tween {
  transition:
    top 480ms cubic-bezier(0.22, 1, 0.36, 1),
    left 480ms cubic-bezier(0.22, 1, 0.36, 1),
    width 480ms cubic-bezier(0.22, 1, 0.36, 1),
    height 480ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: top, left, width, height;
  pointer-events: none !important;
}
.leaf-mascot.is-ready.is-flight.is-appearing {
  transition:
    opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: opacity, transform;
  pointer-events: none !important;
}
.leaf-mascot.is-ready.is-flight.is-mini {
  z-index: 1138; /* beside dragon mini on perch */
}
.leaf-mascot.is-ready.is-flight.is-gone,
.leaf-mascot.is-gone,
.leaf-mascot[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.leaf-mascot canvas {
  filter:
    drop-shadow(0 0 12px rgba(130, 230, 150, 0.36))
    drop-shadow(0 0 20px rgba(180, 240, 160, 0.16))
    drop-shadow(0 10px 16px rgba(18, 48, 36, 0.16));
}
.leaf-mascot.is-mini canvas {
  filter:
    drop-shadow(0 0 8px rgba(120, 210, 140, 0.3))
    drop-shadow(0 6px 10px rgba(18, 48, 36, 0.16));
}
.hero-mascot.is-ready.is-flight.is-mini .dragon-bubble {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate3d(6px, 8px, 0) scale(0.86) !important;
  animation: none !important;
}

/* Hero-only greeting bubble near mascot head */
.dragon-bubble {
  position: absolute;
  top: 6%;
  right: -4%;
  z-index: 3;
  max-width: min(160px, 42%);
  padding: 10px 14px 11px;
  border-radius: 18px 18px 18px 6px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 252, 247, 0.9) 100%);
  box-shadow:
    0 10px 24px rgba(28, 48, 36, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  color: #1a2e24;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: clamp(13px, 1.15vw, 15px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(8px, 10px, 0) scale(0.88);
  transform-origin: 20% 100%;
  will-change: opacity, transform;
}
.dragon-bubble::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0 0 4px 0;
  transform: rotate(45deg);
  box-shadow: 2px 2px 6px rgba(28, 48, 36, 0.08);
}
.dragon-bubble__text {
  display: block;
  white-space: nowrap;
}
.hero-mascot.is-ready.is-flight:not(.is-mini) .dragon-bubble.is-on {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}
.hero-mascot.is-ready.is-flight:not(.is-mini) .dragon-bubble.is-on.is-enter {
  animation: dragonBubbleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: none;
}
@keyframes dragonBubbleIn {
  0% {
    opacity: 0;
    transform: translate3d(8px, 14px, 0) scale(0.82);
  }
  70% {
    opacity: 1;
    transform: translate3d(0, -2px, 0) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
html[data-theme="dark"] .dragon-bubble {
  border-color: rgba(180, 220, 190, 0.28);
  background:
    linear-gradient(165deg, rgba(36, 48, 42, 0.94) 0%, rgba(22, 32, 28, 0.92) 100%);
  color: #e8f5ec;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot.is-ready.is-flight:not(.is-mini) .dragon-bubble.is-on.is-enter {
    animation: none;
  }
}

/* Wood perch — width set by JS from mascot count (1 slot now; grows later) */
.dragon-perch {
  --perch-wood-hi: #d4a86a;
  --perch-wood-mid: #b07a3e;
  --perch-wood-lo: #6e4320;
  --perch-wood-edge: #4a2c14;
  position: fixed;
  z-index: 1135;
  width: 164px; /* 1×132 + pad — JS overrides */
  height: 24px;
  right: 78px;
  bottom: 14px;
  left: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  filter: drop-shadow(0 8px 12px rgba(24, 36, 18, 0.32));
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    bottom 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.dragon-perch.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dragon-perch__plank {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 5px 7px 6px 4px / 8px 6px 9px 7px;
  border: 1px solid rgba(72, 44, 18, 0.45);
  background:
    radial-gradient(ellipse at 18% 40%, rgba(255, 230, 180, 0.28), transparent 42%),
    radial-gradient(ellipse at 78% 60%, rgba(60, 32, 12, 0.22), transparent 48%),
    repeating-linear-gradient(
      93deg,
      rgba(80, 48, 20, 0.16) 0 1.5px,
      transparent 1.5px 11px
    ),
    linear-gradient(
      180deg,
      var(--perch-wood-hi) 0%,
      var(--perch-wood-mid) 42%,
      var(--perch-wood-lo) 78%,
      var(--perch-wood-edge) 100%
    );
  box-shadow:
    0 1px 0 rgba(255, 236, 200, 0.4) inset,
    0 -3px 0 rgba(40, 22, 8, 0.28) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.dragon-perch__grain {
  position: absolute;
  inset: 3px 6px;
  pointer-events: none;
  border-radius: 4px;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 16px,
      rgba(55, 30, 10, 0.2) 16px 17px,
      transparent 17px 33px,
      rgba(90, 52, 20, 0.14) 33px 34px
    ),
    radial-gradient(ellipse at 30% 50%, rgba(90, 50, 20, 0.18), transparent 55%);
}
.dragon-perch__branches {
  position: absolute;
  left: -10px;
  right: -10px;
  top: -16px;
  height: 40px;
  width: calc(100% + 20px);
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}
.dragon-perch__twig {
  fill: none;
  stroke: #6b4224;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}
.dragon-perch__twig--top {
  stroke-width: 1.4;
  opacity: 0.8;
}
.dragon-perch__leaf {
  fill: #6faf5a;
  stroke: rgba(40, 90, 40, 0.35);
  stroke-width: 0.4;
  opacity: 0.9;
}
.dragon-perch__moss {
  position: absolute;
  left: 12%;
  right: 18%;
  top: -2px;
  height: 4px;
  pointer-events: none;
  opacity: 0.65;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(100, 170, 90, 0.5) 30%,
    rgba(70, 140, 70, 0.35) 55%,
    transparent
  );
  filter: blur(0.35px);
  z-index: 1;
}
html[data-theme="dark"] .dragon-perch {
  --perch-wood-hi: #8f6a42;
  --perch-wood-mid: #5e4128;
  --perch-wood-lo: #3a2818;
  --perch-wood-edge: #24180e;
}
html[data-theme="dark"] .dragon-perch__twig {
  stroke: #a67c4e;
}
html[data-theme="dark"] .dragon-perch__leaf {
  fill: #5a9a4e;
}
.hero-mascot.is-ready.is-flight.is-layout-tween {
  pointer-events: none !important;
  cursor: default;
}
.hero-mascot.is-ready.is-flight.is-dragging {
  cursor: grabbing;
}
.hero-mascot.is-ready.is-flight.is-panning {
  cursor: move;
}
.hero-mascot.is-ready:not(.is-flight) {
  opacity: 1;
}
.hero-mascot.is-skipped,
.hero-mascot.is-failed,
.hero-mascot[hidden] {
  display: none !important;
}
.hero-mascot canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  /* No blur() — glow via drop-shadow only (sharp on return from mini) */
  filter:
    drop-shadow(0 0 12px rgba(120, 220, 160, 0.34))
    drop-shadow(0 0 22px rgba(255, 220, 150, 0.18))
    drop-shadow(0 10px 16px rgba(18, 48, 36, 0.18));
  image-rendering: auto;
}
.hero-mascot.is-mini canvas {
  filter:
    drop-shadow(0 0 8px rgba(120, 220, 160, 0.36))
    drop-shadow(0 6px 10px rgba(18, 48, 36, 0.18));
}
.hero-mascot.is-ready.is-flight:not(.is-mini) canvas {
  /* Force hero filter after leaving mini — kills sticky soft state */
  filter:
    drop-shadow(0 0 12px rgba(120, 220, 160, 0.34))
    drop-shadow(0 0 22px rgba(255, 220, 150, 0.18))
    drop-shadow(0 10px 16px rgba(18, 48, 36, 0.18));
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot {
    display: none !important;
  }
}
.chapter-inner--stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: stretch;
}
.chapter--reverse .chapter-inner > .text-zone { order: 2; }
.chapter--reverse .chapter-inner > .feature-rail,
.chapter--reverse .chapter-inner > .pillar-grid { order: 1; }

.chapter-home {
  align-items: flex-start;
  padding-top: clamp(120px, 16vh, 168px);
  padding-bottom: clamp(64px, 10vh, 100px);
}

/* =========================================================
   TEXT-ZONE — local blur spotlight (core technique)
   ========================================================= */
.text-zone {
  position: relative;
  display: block;
  width: fit-content;
  max-width: min(560px, 100%);
  padding: 22px 26px 24px;
  border-radius: 28px;
  color: var(--ink);
  isolation: isolate;
  /* Soft spotlight edge — fade the zone, not a hard card */
  -webkit-mask-image: radial-gradient(
    120% 110% at 40% 40%,
    #000 42%,
    rgba(0, 0, 0, 0.92) 62%,
    rgba(0, 0, 0, 0.55) 82%,
    transparent 100%
  );
  mask-image: radial-gradient(
    120% 110% at 40% 40%,
    #000 42%,
    rgba(0, 0, 0, 0.92) 62%,
    rgba(0, 0, 0, 0.55) 82%,
    transparent 100%
  );
}
.text-zone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--zone-fill);
  border: 1px solid var(--zone-stroke);
  box-shadow: var(--zone-shadow);
  /* Strong blur ONLY behind this zone */
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
  pointer-events: none;
}

.text-zone--hero {
  max-width: min(620px, 100%);
  padding: 26px 30px 28px;
  border-radius: 32px;
}
.text-zone--hero::before {
  background: var(--zone-fill-strong);
  backdrop-filter: blur(34px) saturate(1.3);
  -webkit-backdrop-filter: blur(34px) saturate(1.3);
}

.text-zone--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  max-width: min(720px, 100%);
  padding: 24px 32px 26px;
  -webkit-mask-image: radial-gradient(
    100% 100% at 50% 45%,
    #000 48%,
    rgba(0, 0, 0, 0.9) 68%,
    rgba(0, 0, 0, 0.45) 86%,
    transparent 100%
  );
  mask-image: radial-gradient(
    100% 100% at 50% 45%,
    #000 48%,
    rgba(0, 0, 0, 0.9) 68%,
    rgba(0, 0, 0, 0.45) 86%,
    transparent 100%
  );
}

.text-zone--chip {
  width: 100%;
  max-width: none;
  padding: 14px 16px;
  border-radius: 18px;
  -webkit-mask-image: none;
  mask-image: none;
}
.text-zone--chip::before {
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  background: rgba(255, 255, 255, 0.36);
}
html[data-theme="dark"] .text-zone--chip::before {
  background: rgba(6, 18, 24, 0.42);
}

.text-zone--action {
  width: 100%;
  max-width: none;
  padding: 22px 22px 20px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  -webkit-mask-image: none;
  mask-image: none;
}
.text-zone--action::before {
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.text-zone--action h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: var(--display-tracking);
  color: var(--ink);
}
.text-zone--action p {
  margin: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-sub);
  font-weight: 500;
}
.text-zone--action .illu-btn { align-self: flex-start; margin-top: auto; }

.text-zone--plan {
  width: 100%;
  max-width: none;
  padding: 22px 20px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  text-align: left;
  -webkit-mask-image: none;
  mask-image: none;
}
.text-zone--plan::before {
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.text-zone--featured {
  transform: translateY(-6px);
}
.text-zone--featured::before {
  background: var(--zone-fill-strong);
  border-color: color-mix(in srgb, var(--main) 35%, var(--zone-stroke));
}

.text-zone--closing {
  max-width: min(760px, 100%);
  padding: 28px 32px 26px;
  /* Tall install card: radial mask + backdrop-filter can composite as an empty
     frosted rectangle with only the bottom CTA/footer surviving (intermittent). */
  -webkit-mask-image: none;
  mask-image: none;
}

/* Type inside zones — high contrast, zero glow */
.hero-brand,
.headline,
.section-title,
.summary,
.chapter-label,
.hero-proof,
.scroll-hint,
.text-zone strong,
.text-zone span,
.text-zone h3,
.text-zone p,
.plan-name,
.onboard-steps,
.site-end {
  text-shadow: none !important;
  filter: none !important;
}

.hero-brand {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 68px);
  letter-spacing: var(--display-tracking);
  line-height: 1;
  color: var(--ink);
}

.headline,
.section-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 650;
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
  color: var(--ink);
  margin: 0 0 14px;
}
.headline {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.2;
  font-weight: 600;
}
.section-title {
  font-size: clamp(28px, 3.6vw, 48px);
  line-height: 1.14;
}
.headline em,
.section-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--main);
  letter-spacing: -0.02em;
}

.summary {
  margin: 0;
  font-size: clamp(14.5px, 1.25vw, 17px);
  line-height: 1.65;
  max-width: 48ch;
  color: var(--ink-sub);
  font-weight: 500;
}
.text-zone--center .summary {
  margin-left: auto;
  margin-right: auto;
}

.chapter-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.chapter-label span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(10, 122, 92, 0.1);
  color: var(--main);
  letter-spacing: 0.04em;
  border: 1px solid rgba(10, 122, 92, 0.18);
}
.text-zone--center .chapter-label { justify-content: center; }
html[data-theme="dark"] .chapter-label span {
  background: rgba(94, 224, 176, 0.12);
  border-color: rgba(94, 224, 176, 0.22);
}

.hero-proof {
  margin: 20px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.text-zone--center .button-row,
.text-zone--closing .button-row {
  justify-content: center;
}

body.jr-rebuild .illu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 13px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s, background 0.22s, border-color 0.22s;
}
body.jr-rebuild .illu-btn:hover { transform: translateY(-2px); }
body.jr-rebuild .illu-btn.primary {
  background: var(--button);
  color: var(--button-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 8px 22px rgba(7, 20, 16, 0.18);
}
body.jr-rebuild .illu-btn.outline {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border-color: rgba(7, 20, 16, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html[data-theme="dark"] body.jr-rebuild .illu-btn.outline {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--zone-stroke);
  color: var(--ink);
}

/* Feature / pillar lists */
.feature-rail,
.pillar-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-rail strong,
.pillar-grid strong {
  display: block;
  font-size: 14.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 3px;
}
.feature-rail span,
.pillar-grid span {
  display: block;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-sub);
  font-weight: 500;
}

.surface-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.chapter--plans { min-height: 110svh; }
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}
.plan-name {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: var(--display-tracking);
  color: var(--ink);
}
.plan-name .tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--main);
  color: var(--main-text);
  padding: 6px 9px;
  border-radius: 7px;
  white-space: nowrap;
}
.text-zone--plan > p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-sub);
  min-height: 40px;
}
.text-zone--plan ul {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  flex: 1;
}
.text-zone--plan li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-sub);
}
.text-zone--plan li::before {
  content: "✓";
  color: var(--main);
  font-weight: 900;
}
.text-zone--plan .illu-btn { width: 100%; }

.chapter-final {
  min-height: 100svh;
  min-height: 100dvh;
  padding-bottom: 48px;
}
.chapter-final::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(22vh, 160px);
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--page) 28%, transparent));
  z-index: 0;
}
.chapter-final .chapter-inner { position: relative; z-index: 1; }

.onboard-steps {
  list-style: none;
  margin: 18px auto 0;
  padding: 0;
  max-width: 520px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: onboard;
}
.onboard-steps li {
  position: relative;
  padding: 10px 12px 10px 40px;
  border-radius: 12px;
  background: rgba(7, 20, 16, 0.04);
  border: 1px solid rgba(7, 20, 16, 0.06);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-sub);
  font-weight: 550;
  counter-increment: onboard;
}
html[data-theme="dark"] .onboard-steps li {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(220, 255, 240, 0.1);
}
.onboard-steps li::before {
  content: counter(onboard);
  position: absolute;
  left: 10px;
  top: 10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(10, 122, 92, 0.12);
  color: var(--main);
  font-size: 11px;
  font-weight: 850;
}

.site-end {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(7, 20, 16, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
html[data-theme="dark"] .site-end {
  border-top-color: rgba(220, 255, 240, 0.12);
}
.site-end-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.site-end-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
}
.site-end-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  font-size: 12px;
  font-weight: 700;
}
.site-end-links a { color: var(--ink-mute); transition: color 0.2s; }
.site-end-links a:hover { color: var(--main); }
.site-end-copy {
  margin: 0;
  font-size: 11px;
  color: var(--ink-mute);
  font-weight: 600;
}

/* Chapter dots */
.chapters-nav {
  position: fixed;
  z-index: 25;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.chapters-nav a {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 12px rgba(7, 20, 16, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s;
  position: relative;
}
.chapters-nav a:hover,
.chapters-nav a.active {
  height: 22px;
  border-radius: 6px;
  background: var(--main);
  border-color: var(--main);
}
.chapters-nav a::after {
  content: attr(aria-label);
  position: absolute;
  right: 18px;
  white-space: nowrap;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--ink);
  font-weight: 700;
  background: var(--zone-fill-strong);
  border: 1px solid var(--zone-stroke);
  padding: 5px 8px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.chapters-nav a:hover::after { opacity: 1; }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(7, 20, 16, 0.55);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
}
html[data-theme="dark"] .scroll-hint {
  color: rgba(244, 250, 247, 0.7);
  background: rgba(6, 18, 24, 0.4);
  border-color: rgba(220, 255, 240, 0.14);
}
.scroll-hint svg {
  height: 16px;
  width: 16px;
  animation: hint-bounce 1.8s ease-in-out infinite;
}
@keyframes hint-bounce {
  50% { translate: 0 7px; }
}

.progress { z-index: 90; }
html[data-theme="light"] body.jr-rebuild .progress span,
html[data-theme="dark"] body.jr-rebuild .progress span {
  background: linear-gradient(90deg, var(--main), var(--main-2));
}

body.jr-rebuild .motion-fab {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--zone-stroke);
  background: var(--zone-fill);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--zone-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
body.jr-rebuild .motion-fab svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.js-ready .reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.65s ease, transform 0.75s cubic-bezier(0.17, 0.67, 0.3, 1);
}
/* Accept either home.js (.is-visible) or site.js (.show) — dual systems must agree */
.js-ready .reveal.is-visible,
.js-ready .reveal.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.js-ready .reveal.delay-1,
.js-ready .delay-1 { transition-delay: 0.1s; }
.js-ready .reveal.delay-2,
.js-ready .delay-2 { transition-delay: 0.18s; }
.js-ready .reveal.delay-3,
.js-ready .delay-3 { transition-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
  .scroll-hint svg { animation: none !important; }
  .js-ready .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .illu-btn,
  .motion-fab,
  .text-zone--featured { transition: none !important; }
}

/* Mobile */
@media (max-width: 1080px) {
  .chapter { padding-left: 28px; padding-right: 28px; }
  .plans { grid-template-columns: 1fr; }
  .text-zone--featured { transform: none; }
}

@media (max-width: 768px) {
  body.jr-rebuild .nav-wrap {
    z-index: 120;
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }
  body.jr-rebuild .nav-wrap > .nav {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.jr-rebuild .nav-wrap.is-menu-open .nav-links.nav-menu-panel {
    display: flex !important;
    max-height: min(58dvh, 420px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.jr-rebuild,
  body.jr-rebuild main.illu-main {
    overflow-x: clip;
    max-width: 100%;
  }

  .chapter,
  .chapter-home {
    min-height: 100svh;
    min-height: 100dvh;
    padding: 96px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .chapter-inner {
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  /* Beat desktop #discover leaf-slot rules (same specificity, later in cascade) */
  #discover .chapter-inner,
  #create .chapter-inner,
  #deploy .chapter-inner,
  #plans .chapter-inner,
  #install .chapter-inner {
    grid-template-columns: 1fr;
    padding-right: 0;
    padding-left: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .chapter-inner--hero {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-mascot,
  .leaf-mascot {
    display: none !important;
  }
  .chapter--reverse .chapter-inner > .text-zone,
  .chapter--reverse .chapter-inner > .feature-rail,
  .chapter--reverse .chapter-inner > .pillar-grid {
    order: 0;
  }
  .text-zone,
  .text-zone--hero,
  .text-zone--center {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    padding: 18px 18px 20px;
    border-radius: 22px;
    box-sizing: border-box;
    -webkit-mask-image: radial-gradient(
      130% 120% at 50% 40%,
      #000 50%,
      rgba(0, 0, 0, 0.85) 72%,
      transparent 100%
    );
    mask-image: radial-gradient(
      130% 120% at 50% 40%,
      #000 50%,
      rgba(0, 0, 0, 0.85) 72%,
      transparent 100%
    );
  }
  .text-zone--closing {
    max-width: 100%;
    width: 100%;
    padding: 18px 18px 20px;
    border-radius: 22px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .text-zone--chip,
  .text-zone--action,
  .text-zone--plan {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .feature-rail,
  .pillar-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .feature-rail > .text-zone,
  .pillar-grid > .text-zone,
  .feature-rail > li,
  .pillar-grid > li {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .feature-rail strong,
  .feature-rail span,
  .pillar-grid strong,
  .pillar-grid span,
  .summary,
  .section-title {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }
  .hero-brand { font-size: clamp(34px, 10vw, 52px); }
  .headline { font-size: clamp(22px, 6vw, 30px); }
  .section-title { font-size: clamp(24px, 6.5vw, 36px); }
  .summary { font-size: 14px; max-width: 100%; }
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
  .illu-btn {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  .surface-row { grid-template-columns: 1fr; }
  .text-zone--action { min-height: 0; }
  .plans { grid-template-columns: 1fr; }
  .chapters-nav {
    right: max(12px, env(safe-area-inset-right, 0px));
    gap: 10px;
  }
  .chapters-nav a::after { display: none; }
  .motion-fab {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    width: 40px;
    height: 40px;
  }
  .scroll-hint { bottom: 12px; font-size: 8px; }

  body.jr-rebuild .world-stage.world-stage--verdant .vw-boot { display: none !important; }
  body.jr-rebuild .world-stage.world-stage--verdant .vw-poster {
    display: none !important;
    opacity: 0 !important;
  }
  body.jr-rebuild.jr-verdant-fallback .world-stage.world-stage--verdant #scene,
  body.jr-rebuild.jr-verdant-mobile-lite:not(.jr-verdant-ready) .world-stage.world-stage--verdant #scene {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .chapter,
  .chapter-home {
    padding: 88px max(14px, env(safe-area-inset-right, 0px)) 40px max(14px, env(safe-area-inset-left, 0px));
  }
  .chapters-nav { display: none; }
  .text-zone--plan ul { display: none; }
  .text-zone,
  .text-zone--hero,
  .text-zone--center,
  .text-zone--chip {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (min-width: 761px) and (max-height: 760px) {
  .chapter-home { padding-top: 108px; }
  .hero-brand { font-size: clamp(34px, 6.5vh, 52px); }
  .headline { font-size: clamp(22px, 4vh, 32px); }
  .text-zone--hero { padding: 20px 24px; }
}
