/* ============================================================
   Global reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Helvetica, Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-hero: var(--font-sans);
  --font-ui: var(--font-sans);

  /* Galaxy immersion palette — spiral galaxy (shared with Floaty page) */
  --cosmos-void:    #050510;
  --cosmos-deep:    #0a0a20;
  --cosmos-mid:     #0e1228;
  --cosmos-stellar-purple: rgba(30, 144, 255, 0.12);
  --cosmos-stellar-blue:   rgba(0, 200, 255, 0.14);
  --cosmos-stellar-pink:   rgba(255, 20, 147, 0.06);
  --cosmos-core-glow:     rgba(255, 235, 200, 0.12);
  --cosmos-star:          rgba(220, 240, 255, 0.9);
  --cosmos-dust:          rgba(160, 200, 255, 0.35);

  /* Floating nav — tuned to night-sky / cosmos palette */
  --nav-width:            clamp(300px, 33vw, 520px);
  --nav-radius:           999px;
  --nav-ease:             cubic-bezier(0.22, 1, 0.36, 1);
  --nav-bg:               rgba(8, 13, 24, 0.38);
  --nav-bg-hover:         rgba(11, 18, 32, 0.62);
  --nav-border:           rgba(130, 195, 255, 0.1);
  --nav-blur:             24px;
  --nav-mark:             rgba(245, 248, 252, 0.94);
  --nav-mark-hover:       rgba(210, 230, 255, 1);
  --nav-link:             rgba(180, 205, 230, 0.42);
  --nav-link-hover:       rgba(200, 220, 245, 0.72);
  --nav-link-active:      rgba(230, 240, 252, 0.92);
  --nav-shadow:           0 8px 32px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(130, 195, 255, 0.06);
  --nav-shadow-expanded:  0 14px 40px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(130, 195, 255, 0.14);
  --nav-offset-x:         14px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-hero);
  font-weight: 400;
  background: #0b1120;
  color: #e8edf5;
}

/* ============================================================
   Pages container — vertical scroll-snap
   ============================================================ */
.pages-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y proximity;
  scrollbar-width: none;
}
.pages-container::-webkit-scrollbar { display: none; }

.pages-container:not(.on-bubble-page):not(.on-journey-scroll):not(.on-contact-page) {
  overflow: hidden;
  scroll-snap-type: none;
}

.pages-container.on-journey-scroll {
  overflow-y: scroll;
  scroll-snap-type: none;
}

.pages-container.on-bubble-page:not(.on-journey-scroll):not(.on-contact-page) {
  overflow: hidden;
}

.pages-container.on-contact-page {
  overflow-y: scroll;
  scroll-snap-type: none;
}

.pages-container.is-transitioning:not(.on-journey-scroll):not(.on-contact-page) {
  overflow: hidden;
  scroll-snap-type: none;
}

body.is-transitioning {
  overflow: hidden;
}

body.is-blur-revealing {
  pointer-events: none;
}

body.is-blur-revealing #page-1,
body.is-blur-revealing .page-floaty.is-revealed {
  will-change: filter, opacity, transform;
}

@media (max-width: 768px) {
  body.is-blur-revealing #page-1,
  body.is-blur-revealing .page-floaty.is-revealed {
    will-change: opacity, transform;
  }
}

/* Hero → fish cursor (matches floaty/fish.css) */
#heroFishCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
  display: none;
}

body.fish-cursor-hidden,
body.fish-cursor-hidden *,
body.story-fish-cursor,
body.story-fish-cursor * {
  cursor: none !important;
}

body.is-nav-hover,
body.is-nav-hover * {
  cursor: auto !important;
}

body.is-nav-hover .site-nav__link,
body.is-nav-hover .site-nav__mark,
body.is-nav-hover .site-logo,
body.is-nav-hover button,
body.is-nav-hover a[href] {
  cursor: pointer !important;
}

body.is-waitlist-open,
body.is-waitlist-open * {
  cursor: auto !important;
}

body.is-waitlist-open button,
body.is-waitlist-open a[href],
body.is-waitlist-open select,
body.is-waitlist-open .waitlist-modal__backdrop {
  cursor: pointer !important;
}

body.story-fish-cursor .story-awake,
body.story-fish-cursor .story-awake * {
  cursor: none !important;
}

body.story-fish-cursor .story-link,
body.story-fish-cursor .btn-back {
  cursor: pointer !important;
}

body.story-fish-cursor .story-awake.is-visible,
body.story-fish-cursor .story-awake.is-visible .story-awake__btn {
  cursor: pointer !important;
}

/* ============================================================
   Transition overlay — Hero → bubble crossfade
   ============================================================ */
#transitionOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
  background:
    radial-gradient(ellipse 42% 28% at 50% 42%, var(--cosmos-core-glow) 0%, transparent 58%),
    radial-gradient(ellipse 55% 38% at 48% 48%, var(--cosmos-stellar-blue) 0%, transparent 62%),
    linear-gradient(
      180deg,
      var(--cosmos-void) 0%,
      var(--cosmos-deep) 28%,
      var(--cosmos-mid) 62%,
      #0e1228 100%
    );
}

.page-floaty {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  position: relative;
  background: transparent;
}

.page-floaty.is-revealed {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-floaty.is-revealed.is-blur-revealing {
  transition: none;
}

/* After reveal: hero hidden, scroll continues to later pages */
.pages-container.on-bubble-page #page-1 {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #transitionOverlay,
  .page-floaty {
    transition-duration: 0.01ms;
  }
}

/* ============================================================
   Individual pages — full viewport sections
   ============================================================ */
.page {
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

/* ============================================================
   PAGE 1 — Night-sky grass hero
   ============================================================ */
.page-grass {
  display: flex;
  flex-direction: column;
  perspective: 1400px;
  perspective-origin: 50% 42%;
  background:
    radial-gradient(ellipse 80% 35% at 50% 42%, rgba(40, 70, 110, 0.55) 0%, transparent 70%),
    /* sky — unchanged, fades out above the water band */
    linear-gradient(
      170deg,
      #080d18 0%,
      #0d1628 18%,
      #111e35 38%,
      #152540 52%,
      rgba(21, 37, 64, 0.45) 58%,
      transparent 64%
    ),
    /* water = starfield beneath; shallow tint at top, clear at bottom */
    linear-gradient(
      180deg,
      transparent 0%,
      transparent 58%,
      rgba(14, 18, 40, 0.14) 66%,
      rgba(10, 10, 32, 0.05) 76%,
      transparent 88%
    );
}

/* Interactive lens — mouse-driven tilt + layered parallax */
.hero-lens {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transform-origin: 50% 42%;
  will-change: transform;
  backface-visibility: hidden;
}

.hero-lens__float {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

[data-depth] {
  will-change: transform;
}

/* ── Stars ────────────────────────────────────────────────── */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Moon ─────────────────────────────────────────────────── */
.moon-wrap {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  width: clamp(400px, 68vw, 880px);
  transform: translateX(-50%);
  transform-origin: center top;
  opacity: 0;
}

.moon {
  width: 100%;
  aspect-ratio: 763 / 327;
  position: relative;
  margin: 0 auto;
  background: url('../assets/moon.png?v=1.1.0') center top / contain no-repeat;
  filter: drop-shadow(0 0 32px rgba(130, 195, 255, 0.35));
}

.moon-wrap::after {
  content: '';
  position: absolute;
  top: 42%;
  left: 8%;
  width: clamp(50px, 8vw, 110px);
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,210,100,0.9) 55%, rgba(255,255,200,1) 80%, transparent 100%);
  border-radius: 2px;
  box-shadow: 0 0 6px 2px rgba(255,200,80,0.5), 0 0 14px 4px rgba(255,190,60,0.25);
  transform: rotate(-28deg);
  opacity: 0;
}

/* Hero scene — hold moon / copy / grass until assets ready, then enter together */
#page-1.is-preparing .moon-wrap,
#page-1.is-preparing .hero,
#page-1.is-preparing .grass-wrap {
  opacity: 0;
  visibility: hidden;
}

#page-1.is-revealed .moon-wrap {
  visibility: visible;
  animation: moonEnter 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

#page-1.is-revealed .hero,
#page-1.is-revealed .grass-wrap {
  visibility: visible;
  animation: heroSceneFade 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

#page-1.is-revealed .moon {
  animation: moonBreathe 5s ease-in-out 1.1s infinite;
}

#page-1.is-revealed .moon-wrap::after {
  animation: shootingStar 1.2s ease-out 2.5s forwards;
}

@keyframes heroSceneFade {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* Full-page loading — blocks interaction until all critical assets are ready */
.page-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050810;
  color: rgba(180, 205, 230, 0.72);
  font-family: var(--font-hero);
  font-size: 14px;
  letter-spacing: 0.04em;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

.page-loading__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: min(280px, 72vw);
}

.page-loading__bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(180, 205, 230, 0.12);
  overflow: hidden;
}

.page-loading__bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(120, 180, 255, 0.55), rgba(200, 230, 255, 0.95));
  transition: width 0.2s ease;
}

.page-loading__pct {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.page-loading[hidden] {
  display: none;
  pointer-events: none;
}

html.is-mobile-boot #page-loading[hidden] {
  display: none !important;
  pointer-events: none !important;
}

body:has(#page-1.is-revealed) .page-loading {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  #page-1.is-preparing .moon-wrap,
  #page-1.is-preparing .hero,
  #page-1.is-preparing .grass-wrap {
    opacity: 1;
    visibility: visible;
  }

  #page-1.is-revealed .moon-wrap {
    animation: none;
    opacity: 1;
    transform: translateX(-50%);
  }

  #page-1.is-revealed .hero,
  #page-1.is-revealed .grass-wrap,
  #page-1.is-revealed .moon,
  #page-1.is-revealed .moon-wrap::after {
    animation: none;
    opacity: 1;
  }

  #page-1.is-revealed .hero,
  #page-1.is-revealed .grass-wrap {
    transform: none;
  }
}

@keyframes moonEnter {
  0%   { opacity: 0; transform: translateX(-50%); }
  100% { opacity: 1; transform: translateX(-50%); }
}

@media (min-width: 768px) {
  .moon-wrap {
    width: clamp(400px, 68vw, 880px);
  }

  #page-1.is-revealed .moon-wrap {
    animation: moonEnter 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }
}

@keyframes moonBreathe {
  0%, 100% { filter: brightness(1)   drop-shadow(0 0 28px rgba(130, 200, 255, 0.35)); }
  50%       { filter: brightness(1.06) drop-shadow(0 0 48px rgba(130, 200, 255, 0.55)); }
}

@keyframes shootingStar {
  0%   { opacity: 0; transform: rotate(-28deg) translateX(-20px); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(-28deg) translateX(30px); }
}

/* ── Site logo (fixed top-left) ─────────────────────────────── */
.site-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: block;
  line-height: 0;
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 0.3s ease, transform 0.45s var(--nav-ease);
}

.site-logo:hover {
  opacity: 0.88;
  transform: scale(1.02);
}

.site-logo__img {
  display: block;
  width: auto;
  height: clamp(28px, 4.2vw, 40px);
  object-fit: contain;
}

@media (max-width: 768px) {
  .site-logo {
    top: 12px;
    left: 12px;
  }

  .site-logo__img {
    height: 20px;
    width: auto;
    max-width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-logo {
    transition-duration: 0.01ms;
  }
}

/* ── Site nav (NorthGarden-style floating pill) ─────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  width: 100%;
  max-width: 100vw;
  transform: translateX(calc(-50% + var(--nav-offset-x)));
  display: flex;
  justify-content: center;
  padding: 20px 0 0;
  pointer-events: none;
}

.site-nav__shell {
  pointer-events: auto;
  transform: scale(0.88);
  transform-origin: center top;
  transition: transform 0.55s var(--nav-ease);
  will-change: transform;
}

.site-nav.is-expanded .site-nav__shell {
  transform: scale(1);
}

.site-nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: auto;
  min-width: unset;
  margin: 0 auto;
  padding: 10px 20px;
  background: var(--nav-bg);
  border-radius: var(--nav-radius);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  overflow: hidden;
  transition:
    width 0.55s var(--nav-ease),
    min-width 0.55s var(--nav-ease),
    padding 0.55s var(--nav-ease),
    gap 0.55s var(--nav-ease),
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.55s var(--nav-ease);
}

.site-nav.is-expanded .site-nav__inner {
  justify-content: space-between;
  gap: 0;
  width: var(--nav-width);
  min-width: var(--nav-width);
  padding: 12px 24px;
  background: var(--nav-bg-hover);
  border-color: rgba(130, 195, 255, 0.16);
  box-shadow: var(--nav-shadow-expanded);
}

.site-nav__bloom {
  position: absolute;
  inset: -20%;
  border-radius: inherit;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(130, 195, 255, 0.14) 0%,
    rgba(80, 140, 220, 0.04) 42%,
    transparent 68%
  );
  opacity: 0;
  transform: scale(0.72);
  filter: blur(10px);
  pointer-events: none;
  transition:
    opacity 0.45s ease,
    transform 0.55s var(--nav-ease),
    filter 0.55s var(--nav-ease);
}

.site-nav.is-expanded .site-nav__bloom {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.site-nav[data-zone="contact"] .site-nav__inner {
  --nav-bg: rgba(10, 16, 30, 0.44);
  --nav-bg-hover: rgba(14, 22, 40, 0.68);
  --nav-border: rgba(150, 195, 240, 0.12);
}

.site-nav__mark {
  position: relative;
  z-index: 1;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--nav-mark);
  text-decoration: none;
  letter-spacing: 0;
  flex: 0 0 1.125rem;
  width: 1.125rem;
  text-align: center;
  transition: color 0.3s ease, transform 0.45s var(--nav-ease);
}

.site-nav.is-expanded .site-nav__mark {
  flex: 0 0 1.125rem;
}

.site-nav__mark:hover {
  color: var(--nav-mark-hover);
}

.site-nav__mark--right {
  text-align: center;
}

.site-nav__wordmark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 1.125rem;
}

.site-nav__wordmark--left {
  justify-content: flex-start;
}

.site-nav__wordmark--right {
  justify-content: flex-end;
}

.site-nav__wordmark-extra {
  display: inline-flex;
  align-items: center;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;
  transition:
    max-width 0.55s var(--nav-ease),
    opacity 0.4s ease 0.06s;
}

.site-nav__glyph {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--nav-mark);
  flex: 0 0 auto;
}

.site-nav__glyph--dot {
  font-weight: 400;
  font-size: 10px;
  color: rgba(200, 220, 245, 0.42);
  margin-inline: 7px;
}

.site-nav__glyph--letter {
  letter-spacing: 0.04em;
}

@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
  .site-nav.is-expanded .site-nav__wordmark {
    gap: 8px;
  }

  .site-nav.is-expanded .site-nav__wordmark--left .site-nav__wordmark-extra {
    max-width: 10rem;
    opacity: 1;
  }

  .site-nav.is-expanded .site-nav__wordmark--right .site-nav__wordmark-extra {
    max-width: 3.75rem;
    opacity: 1;
  }
}

.site-nav__star {
  position: relative;
  left: auto;
  top: auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  transform: none;
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.55s var(--nav-ease),
    filter 0.45s ease;
  animation: navStarTwinkleCollapsed 2.4s ease-in-out infinite;
}

.site-nav__star::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 248, 230, 0.55) 0%,
    rgba(160, 210, 255, 0.35) 38%,
    transparent 72%
  );
  z-index: -1;
  animation: navStarHalo 2.4s ease-in-out infinite;
}

.site-nav__star-icon {
  width: 100%;
  height: 100%;
  display: block;
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 1))
    drop-shadow(0 0 8px rgba(200, 230, 255, 0.95))
    drop-shadow(0 0 16px rgba(130, 195, 255, 0.75));
}

.site-nav.is-expanded .site-nav__star {
  position: absolute;
  left: 50%;
  top: 50%;
  flex: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.35);
  animation: none;
}

.site-nav.is-expanded .site-nav__star::before {
  opacity: 0;
}

.site-nav.is-expanded .site-nav__star-icon {
  filter: none;
}

@keyframes navStarTwinkleCollapsed {
  0%, 100% {
    opacity: 0.92;
    transform: scale(0.96) rotate(0deg);
  }
  35% {
    opacity: 1;
    transform: scale(1.18) rotate(14deg);
  }
  65% {
    opacity: 0.98;
    transform: scale(1.08) rotate(-8deg);
  }
}

@keyframes navStarHalo {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.site-nav__links {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition:
    max-width 0.55s var(--nav-ease),
    gap 0.55s var(--nav-ease),
    opacity 0.35s ease 0.06s;
}

.site-nav.is-expanded .site-nav__links {
  max-width: 360px;
  gap: clamp(16px, 3vw, 32px);
  opacity: 1;
  pointer-events: auto;
}

.site-nav__link {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nav-link);
  transition: color 0.3s ease, opacity 0.3s ease, transform 0.45s var(--nav-ease);
  white-space: nowrap;
  transform: translateY(2px) scale(0.92);
  opacity: 0;
}

.site-nav.is-expanded .site-nav__link {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.site-nav.is-expanded .site-nav__link:nth-child(1) { transition-delay: 0.04s; }
.site-nav.is-expanded .site-nav__link:nth-child(2) { transition-delay: 0.08s; }
.site-nav.is-expanded .site-nav__link:nth-child(3) { transition-delay: 0.12s; }

.site-nav:not(.is-expanded) .site-nav__link {
  transition-delay: 0s;
}

.site-nav__link:hover {
  color: var(--nav-link-hover);
}

.site-nav__link.is-active {
  color: var(--nav-link-active);
}

.site-nav__link[aria-disabled="true"] {
  cursor: default;
  pointer-events: none;
}

.site-nav__link[aria-disabled="true"]:hover {
  color: var(--nav-link);
}

/* Touch / small screens — always expanded */
@media (max-width: 640px), (hover: none) {
  .site-nav__shell {
    transform: scale(1);
  }

  .site-nav__inner {
    justify-content: space-between;
    gap: 0;
    width: min(var(--nav-width), calc(100vw - 32px));
    min-width: min(var(--nav-width), calc(100vw - 32px));
    padding: 11px 18px;
  }

  .site-nav__star {
    position: absolute;
    left: 50%;
    top: 50%;
    flex: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
    animation: none;
  }

  .site-nav__links {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 360px;
    gap: 14px;
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav__link {
    transform: none;
    opacity: 1;
    font-size: 10px;
  }

  .site-nav__bloom {
    opacity: 0.6;
    transform: scale(1);
    filter: blur(0);
  }

  .site-nav__star {
    opacity: 0;
    animation: none;
  }

  .site-nav__wordmark-extra {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .site-nav__mark {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__shell,
  .site-nav__inner,
  .site-nav__bloom,
  .site-nav__mark,
  .site-nav__wordmark-extra,
  .site-nav__glyph,
  .site-nav__star,
  .site-nav__links,
  .site-nav__link {
    transition-duration: 0.01ms;
    transition-delay: 0ms;
  }

  .site-nav__glyph {
    transition-duration: 0.01ms;
    transition-delay: 0ms;
  }

  .site-nav__star {
    animation: none;
  }

  .site-nav__star::before {
    animation: none;
  }

  .site-nav__shell {
    transform: scale(1);
  }

  .site-nav__inner {
    justify-content: space-between;
    gap: 0;
    width: min(var(--nav-width), calc(100vw - 32px));
    min-width: min(var(--nav-width), calc(100vw - 32px));
  }

  .site-nav__links {
    max-width: 360px;
    gap: clamp(16px, 3vw, 32px);
    margin: 0 clamp(10px, 2vw, 18px);
    opacity: 1;
    pointer-events: auto;
  }

  .site-nav__link {
    transform: none;
    opacity: 1;
  }

  .site-nav__star {
    opacity: 0;
  }
}

/* ── Hero text ────────────────────────────────────────────── */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 0;
  gap: 20px;
  position: relative;
  z-index: 2;
}
.hero h1 {
  font-family: var(--font-hero);
  font-size: clamp(2rem, 10vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #f5f8fc;
  text-shadow: none;
}
.hero p {
  font-family: var(--font-hero);
  font-size: clamp(0.75rem, 1.75vw, 1.05rem);
  font-weight: 300;
  font-style: normal;
  color: rgba(220, 228, 238, 0.82);
  max-width: min(540px, 88vw);
  line-height: 1.25;
  letter-spacing: 0;
}
.cta {
  display: inline-block;
  background: rgba(255,255,255,0.10);
  color: #d8eaf8;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(150,195,240,0.28);
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
}
.cta:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(150,195,240,0.55);
}

/* ── Grass canvas ─────────────────────────────────────────── */
.grass-wrap {
  width: 100%;
  height: clamp(210px, 32vw, 340px);
  flex-shrink: 0;
  margin-top: 12px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: transparent;
}
#grassCanvas {
  display: block;
  width: 110%;
  height: 100%;
  margin-left: -5%;
  background: transparent;
}

/* ============================================================
   PAGE 2 — Floaty fluid simulation (original WebGL + WASM)
   ============================================================ */

/**
 * The original Floaty simulation runs in a full-page iframe.
 * border: none removes the default iframe border.
 * pointer-events: all ensures mouse/touch events reach the simulation.
 */
#floatyFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  z-index: 2;
}

/* Back button */
.btn-back {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: var(--font-hero);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(150, 190, 230, 0.28);
  color: rgba(200, 220, 240, 0.75);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.04em;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-back:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(150, 195, 240, 0.55);
  color: #d8eaf8;
}

/* Journey zone — extended scroll + shared atmosphere (js/journey-atmosphere.js) */
:root {
  --journey-blank-h: 150vh;
  --journey-tree-h: 198vh;
  --journey-bridge-h: 100vh;
}

@media (max-width: 767px) {
  :root {
    --journey-bridge-h: 110vh;
  }
}

#journey-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  will-change: background, opacity;
}

#journey-atmosphere.is-active {
  opacity: 1;
}

#journey-atmosphere.is-fading-out {
  opacity: 0.55;
  transition: opacity 1.1s ease;
}

#journey-atmosphere.is-video-zone {
  opacity: 0 !important;
}

#journey-atmosphere.is-suppressed {
  opacity: 0 !important;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

html.tree-journey-active #cosmos-shared-bg {
  opacity: 0 !important;
  visibility: hidden;
}

/* ============================================================
   Blank spacer page (between Floaty and Tree)
   ============================================================ */
.page-blank {
  height: var(--journey-blank-h);
  min-height: var(--journey-blank-h);
  background: transparent;
  overflow: visible;
  z-index: 1;
  scroll-snap-align: none;
}

/* Hero → bubble dive transition hint */
.hero-dive-hint {
  position: fixed;
  left: 50%;
  bottom: 22vh;
  z-index: 35;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(0.875rem, 2.2vw, 1.05rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: rgba(200, 225, 245, 0.55);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.5s ease, color 0.5s ease;
}

.hero-dive-hint.is-visible {
  opacity: 1;
  color: rgba(238, 248, 255, 0.98);
  text-shadow:
    0 0 12px rgba(170, 220, 255, 0.95),
    0 0 28px rgba(130, 195, 255, 0.62),
    0 0 52px rgba(90, 165, 255, 0.32);
  animation: hero-dive-hint-glow 2.4s ease-in-out infinite;
}

@keyframes hero-dive-hint-glow {
  0%, 100% {
    opacity: 0.9;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dive-hint.is-visible {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .hero-dive-hint {
    bottom: 18vh;
    font-size: clamp(0.8rem, 3.4vw, 0.95rem);
    letter-spacing: 0.12em;
  }
}

.tree-journey-hint {
  position: fixed;
  left: 50%;
  top: 42vh;
  z-index: 14;
  transform: translate(-50%, -50%);
  font-family: var(--font-hero);
  font-size: clamp(0.875rem, 2.2vw, 1.05rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: rgba(200, 225, 245, 0.55);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.45s ease, color 0.45s ease;
}

.tree-journey-hint.is-awaiting {
  opacity: 1;
  color: rgba(238, 248, 255, 0.98);
  text-shadow:
    0 0 12px rgba(170, 220, 255, 0.95),
    0 0 28px rgba(130, 195, 255, 0.62),
    0 0 52px rgba(90, 165, 255, 0.32);
  animation: tree-journey-hint-glow 2.4s ease-in-out infinite;
}

@keyframes tree-journey-hint-glow {
  0%, 100% {
    opacity: 0.9;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.18);
  }
}

/* blank 顶：legacy veil removed — tree video replaces iframe bleed */

@media (prefers-reduced-motion: reduce) {
  .tree-journey-hint.is-awaiting {
    animation: none;
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .tree-journey-hint {
    display: block;
    top: 38vh;
    font-size: clamp(0.8rem, 3.4vw, 0.95rem);
    letter-spacing: 0.12em;
  }
}

/* Swipe / wheel zone on page 2 — iframe has touch-action: none */
.page-scroll-edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  z-index: 15;
  touch-action: pan-y;
  cursor: ns-resize;
}

/* ============================================================
   PAGE 3 — 倒置的树 (TREE)
   视觉方向：根在顶部，树枝在底部。
   ============================================================ */
.page-tree {
  height: var(--journey-tree-h);
  min-height: var(--journey-tree-h);
  background: transparent;
  position: relative;
  overflow: visible;
  z-index: 2;
  scroll-snap-align: none;
}

.page-tree .btn-back {
  top: 20px;
  left: auto;
  right: 32px;
  transform: none;
  z-index: 25;
}

/* ============================================================
   Bridge page — Tree → Story
   ============================================================ */
.page-bridge {
  height: var(--journey-bridge-h);
  min-height: var(--journey-bridge-h);
  background: transparent;
  position: relative;
  z-index: 3;
  scroll-snap-align: none;
}

/* ============================================================
   Scroll-drawn line (Ironhill-style, tree journey zone)
   ============================================================ */
/* ── Scroll-line container ───────────────────────────────────────────── */
#scroll-line {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  /* sit above tree iframe so mix-blend-mode composites with it */
  z-index: 15;
  opacity: 0;
  transition: opacity 0.55s ease;
}

#scroll-line.is-active {
  opacity: 1;
  transition: opacity 0.65s ease;
}

/* Fade only the blank SVG stroke once the 3D helix has taken over */
#scroll-line.is-card-zone .scroll-line__stroke.scroll-line__draw--pre,
#scroll-line.is-card-zone .scroll-line__draw--pre {
  opacity: calc((1 - var(--helix-blend, 0)) * (1 - var(--pre-line-bridge-fade, 0)));
  transition: opacity 0.55s ease;
}

#scroll-line.is-complete {
  opacity: 0;
  transition: opacity 0.9s ease 0.3s;
}

#scroll-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  mix-blend-mode: screen;
}

#scroll-line .scroll-line__layer--parallax {
  transform: translateY(calc(var(--map-parallax, 0) * -0.06));
}

@media (prefers-reduced-motion: reduce) {
  #scroll-line .scroll-line__layer--parallax {
    transform: none;
  }
}

/* ── Fine vine tendrils (scroll-sprouted from main path) ─────────────── */
#scroll-line .scroll-line__layer--vines {
  pointer-events: none;
}

#scroll-line .scroll-line__vine {
  --vine-o: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  fill: none;
  opacity: var(--vine-o);
  filter: url(#scroll-line-soft);
}

#scroll-line .scroll-line__vine--t1 {
  stroke: rgba(210, 235, 255, 0.72);
  stroke-width: 0.55;
}

#scroll-line .scroll-line__vine--t2 {
  stroke: rgba(185, 218, 248, 0.55);
  stroke-width: 0.38;
}

#scroll-line .scroll-line__vine--t3 {
  stroke: rgba(165, 205, 238, 0.42);
  stroke-width: 0.26;
  filter: none;
}

/* ── Waypoint dots ──────────────────────────────────────────────────── */
#scroll-line .scroll-line__waypoint {
  fill: transparent;
  stroke: rgba(180, 215, 250, 0.28);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.4;
  transition: opacity 0.4s ease, stroke 0.4s ease;
  r: 3;
}

#scroll-line .scroll-line__waypoint.is-reached {
  stroke: rgba(220, 240, 255, 0.70);
  opacity: 0.85;
}

#scroll-line .scroll-line__waypoint.is-current {
  stroke: rgba(255, 255, 255, 0.90);
  fill: rgba(220, 238, 255, 0.30);
  opacity: 1;
}

/* ── Per-card stops on the fixed tree helix (synced with world cards) ─ */
#scroll-line .scroll-line__card-stop {
  fill: transparent;
  stroke: rgba(160, 200, 240, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.35s ease, stroke 0.35s ease, fill 0.35s ease;
}

#scroll-line.is-tree-segment .scroll-line__card-stop {
  opacity: 0.55;
}

#scroll-line .scroll-line__card-stop.is-reached {
  stroke: rgba(200, 228, 255, 0.55);
  opacity: 0.75;
}

#scroll-line .scroll-line__card-stop.is-current {
  stroke: rgba(255, 255, 255, 0.95);
  fill: rgba(240, 248, 255, 0.35);
  opacity: 1;
}

/* ── Main drawn line ────────────────────────────────────────────────── */
#scroll-line .scroll-line__stroke {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

#scroll-line .scroll-line__aura {
  stroke: url(#scroll-line-aura);
  stroke-width: 4.8;
  opacity: 0.55;
  filter: url(#scroll-line-bloom);
}

#scroll-line .scroll-line__glow {
  stroke: rgba(210, 235, 255, 0.38);
  stroke-width: 2.4;
  opacity: 0.72;
  filter: url(#scroll-line-bloom);
}

#scroll-line .scroll-line__active {
  stroke: url(#scroll-line-gradient);
  stroke-width: 1.05;
}

#scroll-line .scroll-line__shine {
  stroke: url(#scroll-line-shine);
  stroke-width: 0.85;
  opacity: 0.48;
}

#scroll-line .scroll-line__sparkle {
  fill: rgba(255, 255, 255, 0.95);
  filter: url(#scroll-line-glow);
  opacity: 0;
  pointer-events: none;
}

@keyframes scroll-line-breathe {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 0.92; }
}

@keyframes scroll-line-shine-pulse {
  0%, 100% { opacity: 0.34; }
  50% { opacity: 0.58; }
}

@keyframes scroll-line-sparkle-pulse {
  0%, 100% { transform: scale(0.85); }
  50% { transform: scale(1.15); }
}

@media (prefers-reduced-motion: no-preference) {
  #scroll-line.is-active .scroll-line__aura {
    animation: scroll-line-breathe 5.5s ease-in-out infinite;
  }

  #scroll-line.is-active .scroll-line__glow {
    animation: scroll-line-breathe 4.2s ease-in-out infinite reverse;
  }

  #scroll-line.is-active .scroll-line__shine {
    animation: scroll-line-shine-pulse 4.5s ease-in-out infinite;
  }

  #scroll-line.is-active .scroll-line__sparkle {
    animation: scroll-line-sparkle-pulse 2.8s ease-in-out infinite;
    animation-delay: calc(var(--sparkle-i, 0) * -0.35s);
  }
}

/* ── Draw head pulse ────────────────────────────────────────────────── */
#scroll-line .scroll-line__head-halo {
  fill: rgba(200, 228, 255, 0.22);
  filter: url(#scroll-line-glow);
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  transform-box: fill-box;
}

#scroll-line .scroll-line__head {
  fill: rgba(240, 248, 255, 0.95);
  filter: url(#scroll-line-glow);
  opacity: 0;
  transition: opacity 0.2s ease;
  transform-origin: center;
  transform-box: fill-box;
}

/* ── Tree-zone aura ring ─────────────────────────────────────────────── */
#scroll-line .scroll-line__tree-ring {
  stroke: rgba(160, 205, 245, 0.14);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 16;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#scroll-line.is-tree-segment .scroll-line__tree-ring {
  opacity: 1;
}

#scroll-line.is-card-zone {
  pointer-events: none;
}

#scroll-line.is-card-zone .scroll-line__head,
#scroll-line.is-card-zone .scroll-line__head-halo {
  opacity: 0 !important;
  animation: none !important;
}

/* tree 淡出 → bridge 白线淡入 */
#scroll-line .scroll-line__draw--post {
  opacity: 0;
  transition: opacity 0.55s ease;
}

#scroll-line.is-bridge-segment .scroll-line__draw--post {
  opacity: var(--post-line-alpha, 0);
}

#scroll-line.is-bridge-segment:not(.is-card-zone) .scroll-line__head.is-drawing {
  animation: scroll-line-head-pulse 2s ease-in-out infinite;
}

#scroll-line.is-bridge-segment:not(.is-card-zone) .scroll-line__head.is-drawing + .scroll-line__head-halo {
  animation: scroll-line-halo-pulse 2s ease-in-out infinite;
}

#scroll-line.is-exiting {
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  #scroll-line.is-tree-segment .scroll-line__vine.is-grown {
    animation: scroll-line-vine-sway 4.8s ease-in-out infinite;
  }

  #scroll-line.is-tree-segment .scroll-line__vine--t2.is-grown {
    animation-duration: 3.8s;
    animation-direction: reverse;
  }

  #scroll-line.is-tree-segment .scroll-line__vine--t3.is-grown {
    animation-duration: 3.2s;
    animation-delay: -1.4s;
  }

  #scroll-line .scroll-line__head.is-drawing {
    animation: scroll-line-head-pulse 2s ease-in-out infinite;
  }

  #scroll-line .scroll-line__head.is-drawing + .scroll-line__head-halo {
    animation: scroll-line-halo-pulse 2s ease-in-out infinite;
  }
}

@keyframes scroll-line-head-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@keyframes scroll-line-halo-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.15); }
}

@keyframes scroll-line-vine-sway {
  0%, 100% { opacity: calc(var(--vine-o, 0) * 0.82); }
  50% { opacity: calc(var(--vine-o, 0) * 1); }
}

@media (max-width: 767px) {
  #scroll-line .scroll-line__vine--t1 { stroke-width: 0.48; }
  #scroll-line .scroll-line__vine--t2 { stroke-width: 0.34; }
  #scroll-line .scroll-line__vine--t3 { stroke-width: 0.22; }
}

@media (prefers-reduced-motion: reduce) {
  #scroll-line .scroll-line__head {
    animation: none;
  }
}

/* Journey copy — fixed overlay, scroll-revealed across blank → bridge */
.journey-copy {
  position: fixed;
  inset: 0;
  z-index: 17;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.journey-copy.is-active {
  opacity: 1;
}

.journey-copy__lines {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vh, 24px);
  width: min(88vw, 640px);
  padding: clamp(16px, 2.5vh, 28px) clamp(16px, 4vw, 28px);
  text-align: center;
  isolation: isolate;
}

.journey-copy__row {
  font-family: var(--font-hero);
  font-size: clamp(1.75rem, 6.5vw, 3.25rem);
  font-weight: 300;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.14;
  color: #f5f8fc;
  text-shadow: 0 1px 20px rgba(8, 20, 48, 0.35);
  text-wrap: balance;
  padding: clamp(10px, 1.6vh, 18px) 0;
  opacity: 0;
  max-width: min(92vw, 680px);
}

.journey-copy__row--last {
  margin-top: 0;
}

@media (min-width: 768px) {
  .journey-copy__lines {
    gap: clamp(8px, 1.5vh, 16px);
    padding: clamp(11px, 1.7vh, 19px) clamp(16px, 4vw, 28px);
  }

  .journey-copy__row {
    padding: clamp(7px, 1.1vh, 12px) 0;
  }
}

@media (max-width: 767px) {
  .journey-copy__lines {
    padding-left: clamp(16px, 4vw, 28px);
  }

  .journey-copy__row {
    font-size: clamp(1.5rem, 5.5vw, 2.5rem);
  }

  .journey-copy--mobile {
    z-index: 22;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: clamp(46vh, 52dvh, 58vh);
  }

  .journey-copy--mobile .journey-copy__lines {
    gap: clamp(10px, 1.8vh, 18px);
    width: min(92vw, 640px);
  }

  .journey-copy--mobile .journey-copy__row {
    font-size: clamp(1.32rem, 5vw, 1.85rem);
    line-height: 1.18;
    text-shadow:
      0 2px 18px rgba(6, 14, 36, 0.72),
      0 0 36px rgba(6, 14, 36, 0.48);
  }

  /* Bridge 文案出现时收起 tree 收尾标题，避免两段大字叠在一起 */
  html.journey-copy-active #tree-cards-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .journey-copy__row {
    opacity: 1;
  }
}

/* ============================================================
   PAGE 4 — Our Story 星空（色调对齐 page 1 hero + 行星视频黑底）
   ============================================================ */
.page-starry {
  --color-story-deep: #080d18;
  --color-story-mid: #111e35;
  --color-story-soft: #152540;
  --color-story-text: #e8edf5;
  --color-story-muted: rgba(180, 205, 230, 0.72);
  --color-story-accent: rgba(150, 195, 240, 0.28);
  background:
    radial-gradient(ellipse 80% 35% at 50% 100%, rgba(40, 70, 110, 0.55) 0%, transparent 70%),
    linear-gradient(
      170deg,
      #080d18 0%,
      #0d1628 20%,
      #111e35 42%,
      #152540 62%,
      #1a2d4a 78%,
      #1e3450 100%
    );
  position: relative;
}

.page-starry .btn-back {
  top: 20px;
  left: auto;
  right: 32px;
  transform: none;
  z-index: 20;
}

.page-starry .story-block {
  background: transparent;
  color: var(--color-story-text);
  height: 100%;
  overflow: hidden;
  padding: clamp(72px, 14vh, 120px) clamp(24px, 6vw, 64px) clamp(48px, 8vh, 80px);
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 601px) {
  .page-starry .story-block {
    padding: clamp(88px, 12vh, 140px) clamp(48px, 8vw, 96px) clamp(56px, 8vh, 96px);
  }
}

.page-starry .story-container {
  max-width: min(540px, 88vw);
  margin: 0;
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(20px, 3vh, 28px);
  position: relative;
  z-index: 2;
}

@media (min-width: 601px) {
  .page-starry .story-container {
    max-width: min(640px, 90vw);
  }
}

.page-starry .story-lines {
  margin: 0;
  padding: 0;
  border: none;
}

.page-starry .story-lines__row {
  font-family: var(--font-hero);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--color-story-muted);
  text-shadow: 0 0 32px rgba(130, 190, 255, 0.2);
  padding: 0.5em 0;
  border-bottom: 1px solid var(--color-story-accent);
}

.page-starry .story-lines__row--lead {
  color: var(--color-story-text);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  line-height: 1;
  text-shadow: 0 0 40px rgba(130, 190, 255, 0.25);
  border-bottom: none;
  padding-bottom: 0.65em;
}

.page-starry .story-lines__row--last {
  border-bottom: none;
  color: var(--color-story-text);
  font-size: clamp(1.35rem, 3.5vw, 2rem);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1.25;
  text-shadow: 0 0 40px rgba(130, 190, 255, 0.28);
  margin-top: 0.2em;
  max-width: 22em;
}

.page-starry .story-lines__row--last::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  margin: 1.25em 0 0;
  background: var(--color-story-accent);
}

.page-starry .story-title {
  font-family: var(--font-hero);
  font-size: clamp(2rem, 9vw, 3.8rem);
  font-weight: 300;
  font-style: normal;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  color: #f5f8fc;
  text-shadow: none;
  white-space: nowrap;
}

.page-starry .story-body {
  font-family: var(--font-hero);
  font-size: clamp(0.9rem, 1.9vw, 1.12rem);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0.01em;
  max-width: min(540px, 88vw);
  margin: 0;
  color: rgba(220, 228, 238, 0.82);
  text-align: center;
}

.page-starry .story-link {
  display: inline-block;
  margin-top: clamp(4px, 1vh, 12px);
  background: rgba(255, 255, 255, 0.10);
  color: #d8eaf8;
  font-family: var(--font-hero);
  font-size: 15px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(150, 195, 240, 0.28);
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: none;
  backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
}

.page-starry .story-link:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(150, 195, 240, 0.55);
  color: #eef6ff;
}

.page-starry .story-meta {
  position: absolute;
  bottom: clamp(20px, 3.5vh, 36px);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  text-align: center;
  pointer-events: auto;
}

.page-starry .story-meta__line {
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-story-muted);
  letter-spacing: 0.02em;
}

.page-starry .story-meta__label {
  margin-right: 0.45em;
}

.page-starry .story-meta__link {
  color: rgba(200, 220, 245, 0.88);
  text-decoration: none;
  transition: color 0.2s;
}

.page-starry .story-meta__link:hover {
  color: #eef6ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-starry .story-meta__icp {
  margin: 0.5em 0 0;
  font-family: var(--font-hero);
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  font-weight: 400;
  line-height: 1.4;
  color: rgba(160, 185, 215, 0.55);
  letter-spacing: 0.03em;
}

.page-starry .story-background {
  background: transparent;
  position: relative;
  right: auto;
  top: auto;
  width: min(80.59vw, 634px);
  height: min(80.59vw, 634px);
  margin-top: clamp(28px, 5vh, 56px);
  transform: translate(calc(clamp(-120px, -8vw, -60px) + 160px), 30px);
  z-index: 1;
}

.story-background.is-path-follow {
  pointer-events: none;
  position: fixed;
  right: auto;
  z-index: 28;
}

.story-background.is-path-follow .story-awake {
  pointer-events: auto;
}

.page-starry .story-video-source {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.page-starry .story-video,
.page-starry .story-video-canvas {
  backface-visibility: hidden;
  height: 100%;
  object-fit: contain;
  object-position: center 58%;
  transform: translateZ(0);
  width: 100%;
}

.story-background.is-awake-running {
  z-index: 40;
}

.story-awake {
  align-items: center;
  display: flex;
  inset: auto;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.42s ease;
  visibility: hidden;
  z-index: 50;
}

.story-awake.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.story-awake.is-locked {
  cursor: default;
  z-index: 51;
}

.story-awake__glow {
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 252, 255, 0.98) 0%, rgba(200, 230, 255, 0.55) 24%, rgba(140, 195, 255, 0.18) 48%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 48px rgba(160, 215, 255, 0.45);
  filter: blur(18px);
  height: min(42%, 240px);
  pointer-events: none;
  position: absolute;
  transform: translateY(-2%);
  width: min(42%, 240px);
}

.story-awake__btn {
  animation: story-awake-breathe 2.8s ease-in-out infinite;
  background: none;
  border: none;
  color: #f5fbff;
  cursor: pointer;
  font-family: var(--font-hero);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 300;
  letter-spacing: 0.38em;
  padding: 0;
  position: relative;
  text-shadow:
    0 0 24px rgba(200, 235, 255, 0.95),
    0 0 48px rgba(150, 210, 255, 0.55),
    0 0 2px rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1;
}

.story-awake__btn:hover:not(:disabled) {
  animation-duration: 2.2s;
  opacity: 1;
  transform: scale(1.04);
}

.story-awake__btn:disabled {
  animation: none;
  cursor: default;
  opacity: 0.78;
}

@keyframes story-awake-breathe {
  0%, 100% {
    opacity: 0.62;
    text-shadow:
      0 0 18px rgba(190, 228, 255, 0.75),
      0 0 36px rgba(140, 200, 255, 0.38),
      0 0 2px rgba(255, 255, 255, 0.75);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 32px rgba(220, 245, 255, 1),
      0 0 64px rgba(160, 220, 255, 0.72),
      0 0 3px rgba(255, 255, 255, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-awake__btn {
    animation: none;
    opacity: 0.92;
  }
}

body.is-awake-transition {
  overflow: hidden;
  pointer-events: none;
}

body.is-awake-transition .story-awake.is-locked {
  pointer-events: auto;
  z-index: 51;
}

/* ── Awake wake-up — single stellar veil, driven by --awake-stellar-p ── */
#transitionOverlay.is-awake-active {
  --awake-stellar-p: 0;
  background:
    radial-gradient(
      ellipse 68% 54% at 50% 43%,
      rgba(95, 125, 185, calc(0.05 + var(--awake-stellar-p) * 0.11)) 0%,
      rgba(45, 62, 105, calc(var(--awake-stellar-p) * 0.07)) 42%,
      transparent 76%
    ),
    radial-gradient(
      ellipse 105% 88% at 50% 48%,
      rgba(16, 14, 30, calc(0.58 + var(--awake-stellar-p) * 0.22)) 0%,
      rgba(5, 4, 12, 0.96) 100%
    );
  filter: blur(calc(var(--awake-stellar-p) * 3px));
  transition: none;
}

body.is-awake-waking #page-1 {
  will-change: filter, opacity;
}

body.is-awake-revealed #page-1 {
  will-change: filter, opacity;
}

@media (min-width: 601px) {
  .page-starry .story-background {
    width: min(60.45vw, 664px);
    height: min(60.45vw, 664px);
  }
}

/* ============================================================
   Mobile performance: reduce expensive CSS effects on small screens
   ============================================================ */
@media (max-width: 768px) {
  :root {
    /* Reduce backdrop-filter blur cost on mobile GPU compositor */
    --nav-blur: 10px;
  }

  /* No 3D lens on mobile — flat layout, grass stays in view */
  .page-grass {
    perspective: none;
  }

  .hero-lens {
    transform: none !important;
    transform-style: flat;
    will-change: auto;
  }

  [data-depth]:not(.moon-wrap) {
    transform: none !important;
    will-change: auto;
  }

  .moon-wrap {
    left: 50%;
    right: auto;
    width: min(92vw, 720px);
    max-width: 100vw;
    transform: translateX(-50%) !important;
  }

  /* Skip long fade-in — show grass immediately once revealed; hero copy fades with moon */
  #page-1.is-revealed .grass-wrap {
    animation: none;
    opacity: 1;
  }

  #page-1:not(.is-revealed) .hero {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  #page-1.is-revealed .hero {
    animation: heroSceneFade 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }

  .pages-container {
    height: 100dvh;
  }

  .pages-container.on-journey-scroll,
  .pages-container.on-contact-page {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .page {
    height: 100dvh;
    min-height: 100dvh;
  }

  .page-starry .story-video,
  .page-starry .story-video-canvas {
    display: none !important;
  }

  .page-starry .story-background {
    width: min(68vw, 280px);
    height: min(68vw, 280px);
    margin-top: clamp(16px, 3vh, 28px);
    margin-left: auto;
    margin-right: auto;
    transform: none;
    flex-shrink: 0;
    position: relative;
  }

  .page-starry .story-background::before {
    content: '';
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    border: 1px solid rgba(150, 195, 240, 0.32);
    box-shadow:
      0 0 28px rgba(130, 175, 235, 0.14),
      inset 0 0 36px rgba(130, 175, 235, 0.08);
    pointer-events: none;
  }

  .page-starry .story-background::after {
    content: '';
    position: absolute;
    inset: 24% 20%;
    border-radius: 50%;
    border: 1px dashed rgba(150, 195, 240, 0.16);
    pointer-events: none;
  }

  .page-starry .story-background.is-mobile-orbit-only.is-path-follow {
    transform: none;
  }

  .pages-container:not(.on-bubble-page):not(.on-journey-scroll):not(.on-contact-page) .page:not(#page-1) {
    visibility: hidden;
    pointer-events: none;
  }

  #page-2:not(.is-revealed):not(.is-blur-revealing) #floatyFrame {
    visibility: hidden;
    pointer-events: none;
  }

  .pages-container.on-bubble-page #page-2.page-floaty.is-revealed {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
  }

  .pages-container.on-bubble-page #page-2.is-revealed #floatyFrame {
    visibility: visible !important;
    pointer-events: auto;
  }

  /* Swipe hint — tree + transition zone only (not bubble / story / hero) */
  .pages-container:not(.on-journey-scroll) .tree-journey-hint {
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
  }

  body:not(.on-journey-scroll) .tree-cards-hint {
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
  }

  .pages-container:not(.on-journey-scroll) .journey-copy {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Journey scroll line — mobile only after journey entry (not page 1 / page 2) */
  body:not(.on-journey-scroll) #scroll-line,
  body.is-trace-origin-entry #scroll-line {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #page-1.is-revealed .moon-wrap {
    animation: moonEnterMobile 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }

  /* Remove will-change on depth layers — saves GPU memory on mobile */
  .moon {
    will-change: auto;
  }
}

@media (max-width: 767px) {
  .page-grass {
    background:
      radial-gradient(ellipse 80% 35% at 50% 42%, rgba(40, 70, 110, 0.55) 0%, transparent 70%),
      linear-gradient(
        170deg,
        #080d18 0%,
        #0d1628 18%,
        #111e35 38%,
        #152540 32%,
        rgba(21, 37, 64, 0.45) 38%,
        transparent 44%
      ),
      linear-gradient(
        180deg,
        transparent 0%,
        transparent 36%,
        rgba(14, 18, 40, 0.14) 44%,
        rgba(10, 10, 32, 0.05) 54%,
        transparent 66%
      );
  }

  .grass-wrap {
    height: clamp(280px, 44vw, 420px);
    margin-top: -36px;
  }

  @keyframes moonEnterMobile {
    0%   { opacity: 0; transform: translateX(-50%); }
    100% { opacity: 1; transform: translateX(-50%); }
  }

  .moon-wrap {
    width: min(92vw, 720px);
    max-width: 100vw;
    left: 50%;
    transform: translateX(-50%) !important;
  }

  #page-1.is-revealed .moon-wrap {
    animation: moonEnterMobile 1.1s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  }

  .story-awake--mobile .story-awake__glow {
    display: none;
  }
}
