/* ============================================================
   Tree page — scroll-scrubbed video + diagonal card trio
   ============================================================ */

#tree-video-layer {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  overflow: hidden;
}

#tree-video-layer.is-visible {
  visibility: visible;
}

#tree-scroll-video,
.tree-video-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.tree-video-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#tree-cards-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#tree-cards-overlay.is-visible {
  visibility: visible;
  opacity: var(--tree-zone-alpha, 1);
}

body.tree-card-fish-active,
body.tree-card-fish-active * {
  cursor: none !important;
}

/* ── Diagonal stage: top-left → center → bottom-right ─────── */
.tree-cards-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.world-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vw, 440px);
  font-family: var(--font-hero);
  pointer-events: none;
  user-select: none;
  transform-origin: center center;
  opacity: 0;
  visibility: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.world-card.is-focused .world-card__frame {
  border-color: rgba(185, 225, 255, 0.85);
  box-shadow:
    0 0 64px rgba(90, 165, 255, 0.4),
    0 0 120px rgba(70, 140, 240, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.world-card.is-focused .world-card__title {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.world-card.is-ahead .world-card__frame,
.world-card.is-behind .world-card__frame {
  border-color: rgba(130, 165, 210, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.world-card__frame {
  padding: 3px;
  border-radius: 14px;
  border: 1px solid rgba(150, 195, 245, 0.5);
  background:
    radial-gradient(ellipse 85% 65% at 22% 38%, rgba(140, 185, 255, 0.1) 0%, transparent 58%),
    linear-gradient(168deg, rgba(5, 12, 28, 0.92) 0%, rgba(8, 18, 40, 0.88) 100%);
  box-shadow: 0 0 32px rgba(60, 120, 200, 0.15);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.world-card__inner {
  padding: clamp(20px, 4vw, 32px) clamp(22px, 4.5vw, 36px) clamp(18px, 3.5vw, 28px);
  border-radius: 11px;
  border: 1px solid rgba(150, 190, 240, 0.2);
  text-align: center;
}

.world-card__title {
  font-size: clamp(1.35rem, 3.6vw, 2.05rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0.025em;
  color: #ffffff;
  margin: 0 0 12px;
}

/* Hero title — no card frame, crisp standalone headline */
.world-card--title-only {
  width: auto;
  max-width: min(92vw, 720px);
  text-align: center;
}

.world-card--title-only .world-card__title--hero {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.015em;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.world-card--opening .world-card__title--hero,
.world-card--closing .world-card__title--hero {
  font-size: clamp(2rem, 6vw, 3.75rem);
  line-height: 1.18;
  max-width: min(92vw, 820px);
}

.world-card--closing .world-card__title--hero {
  line-height: 1.28;
}

.world-card__stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
  margin: 0 0.04em;
  vertical-align: baseline;
  white-space: nowrap;
}

.world-card__stat-num {
  font-size: 1.55em;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.world-card__stat-unit {
  font-size: 1.2em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
}

.world-card--title-only.is-focused .world-card__title--hero {
  color: #ffffff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 0 1px rgba(255, 255, 255, 0.6);
}

.world-card__subtitle {
  font-size: clamp(0.68rem, 1.55vw, 0.82rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: rgba(210, 222, 245, 0.94);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.world-card.is-focused .world-card__subtitle {
  color: rgba(225, 235, 255, 0.98);
}

/* ── Scroll hint ───────────────────────────────────────────── */
.tree-cards-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(40px, 8vh, 80px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.tree-cards-hint.is-visible {
  visibility: visible;
}

.tree-cards-hint__text {
  font-family: var(--font-hero);
  font-size: clamp(0.9rem, 2.1vw, 1.05rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  -webkit-font-smoothing: antialiased;
}

.tree-cards-hint__arrow {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 14px rgba(120, 190, 255, 0.7),
    0 1px 3px rgba(0, 0, 0, 0.5);
  animation: tree-cards-hint-bob 1.8s ease-in-out infinite;
}

@keyframes tree-cards-hint-bob {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(8px); opacity: 1; }
}

@media (max-width: 620px) {
  .world-card {
    width: min(88vw, 380px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tree-cards-hint__arrow {
    animation: none;
  }
}
