﻿[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 520ms var(--easing), transform 520ms var(--easing);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-transition {
  animation: route-fade 420ms var(--easing) both;
}

@keyframes route-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.china-map__river {
  animation: map-flow 8.8s linear infinite;
}

.region-glow__flow {
  animation: map-flow 9.4s linear infinite;
}

@keyframes map-flow {
  from {
    stroke-dashoffset: 0;
    opacity: 0.62;
  }
  to {
    stroke-dashoffset: -36;
    opacity: 0.78;
  }
}

.home-focus-card,
.home-compare-card,
.home-guide-card {
  animation: panel-fade-in 560ms var(--easing) both;
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.finale-river span {
  animation: river-flow 6.4s linear infinite;
}

@keyframes river-flow {
  from {
    transform: translateX(-1.4%);
    opacity: 0.42;
  }
  50% {
    opacity: 0.94;
  }
  to {
    transform: translateX(1.4%);
    opacity: 0.42;
  }
}

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

@keyframes route-progress {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

@keyframes curtain-lift {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-102%);
    opacity: 0;
  }
}

@keyframes mist-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, -2%, 0) scale(1.04);
  }
}

@keyframes glow-breathe {
  0%,
  100% {
    opacity: 0.46;
    filter: brightness(1);
  }
  50% {
    opacity: 0.82;
    filter: brightness(1.18);
  }
}

@keyframes ink-reveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0.2;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

@keyframes scan-sheen {
  from {
    transform: translateX(-45%);
  }
  to {
    transform: translateX(45%);
  }
}

@keyframes water-pulse {
  0%,
  100% {
    transform: scaleX(0.98) translateX(-0.2%);
    opacity: 0.34;
  }
  50% {
    transform: scaleX(1.02) translateX(0.2%);
    opacity: 0.62;
  }
}

.bg-decoration__mist,
.home-hero__mist {
  animation: mist-drift 18s ease-in-out infinite;
}

.bg-decoration__scan {
  animation: scan-sheen 12s linear infinite;
}

.bg-decoration__waterline,
.home-hero__river {
  animation: water-pulse 7.6s ease-in-out infinite;
}

.home-hero h1,
.bridge-hero__title {
  animation: ink-reveal 780ms var(--ease-out-expo) both;
}

.bridge-hero__diagram-core,
.finale-stage__crest,
.gj-lab-command__kpis b {
  animation: glow-breathe 4.8s ease-in-out infinite;
}

.is-reduced-motion *,
.is-reduced-motion *::before,
.is-reduced-motion *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 1ms !important;
}

/* Home Rebuild Motion */

.bg-decoration__river {
  animation: home-river-drift 16s linear infinite;
}

.bg-decoration__spark {
  animation: home-spark-shift 22s ease-in-out infinite;
}

.china-map__terrain {
  animation: china-map-hover 18s ease-in-out infinite;
}

.china-map__river,
.region-glow__flow {
  animation: map-flow 9.2s linear infinite;
}

@keyframes home-river-drift {
  from {
    transform: translateX(-0.25%);
    opacity: 0.3;
  }
  50% {
    opacity: 0.46;
  }
  to {
    transform: translateX(0.25%);
    opacity: 0.3;
  }
}

@keyframes home-spark-shift {
  from {
    transform: translateY(0);
    opacity: 0.08;
  }
  50% {
    transform: translateY(-0.2%);
    opacity: 0.16;
  }
  to {
    transform: translateY(0);
    opacity: 0.08;
  }
}

@keyframes china-map-hover {
  0%,
  100% {
    transform: perspective(980px) rotateX(0.6deg) rotateZ(-0.18deg) translateY(0);
  }
  50% {
    transform: perspective(980px) rotateX(0.45deg) rotateZ(-0.12deg) translateY(-0.04%);
  }
}

/* Second Optimization Book Motion */

.hero-stage__mist {
  animation: mist-drift 20s ease-in-out infinite;
}

.hero-stage__riverline,
.bridge-prelude__flow,
.finale-stage__riverline > span {
  animation: riverline-drift 14s linear infinite;
}

.hero-stage__spark {
  animation: glow-breathe 5.2s ease-in-out infinite;
}

.hero-stage__node-ring {
  animation: hero-node-breathe 3.8s ease-in-out infinite;
}

.bridge-prelude__node {
  animation: prelude-node-breathe 8.4s ease-in-out infinite;
}

.finale-stage__riverline i {
  animation: finale-node-breathe 6.2s ease-in-out infinite;
}

@keyframes riverline-drift {
  from {
    background-position: 0 0;
    opacity: 0.52;
  }
  50% {
    opacity: 0.88;
  }
  to {
    background-position: 220px 0;
    opacity: 0.52;
  }
}

@keyframes hero-node-breathe {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--bridge-accent) 34%, transparent);
    transform: scale(0.94);
  }
  50% {
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--bridge-accent) 4%, transparent);
    transform: scale(1);
  }
}

@keyframes prelude-node-breathe {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.72;
  }
  50% {
    transform: translateY(-2px);
    opacity: 0.98;
  }
}

@keyframes finale-node-breathe {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.74;
  }
  50% {
    transform: translateY(-1px);
    opacity: 0.98;
  }
}

/* Third Optimization Book Motion */

.hero-immersive h1 {
  animation: heroTitleReveal 860ms var(--ease-out-expo) both;
}

.hero-immersive__mist {
  animation: mistFloat 18s ease-in-out infinite;
}

.hero-immersive__riverline,
.river-axis__line,
.china-map__waterway {
  animation: riverGlowSweep 11s linear infinite;
}

.home-scene-card {
  animation: sceneCardRise 520ms var(--ease-out-expo) both;
}

.labs-overview__card {
  animation: labPanelBreath 5.6s ease-in-out infinite;
}

@keyframes heroTitleReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
    letter-spacing: 0.08em;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.02em;
  }
}

@keyframes mistFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.24;
  }
  50% {
    transform: translate3d(2%, -2%, 0) scale(1.04);
    opacity: 0.3;
  }
}

@keyframes riverGlowSweep {
  from {
    background-position: 0 0;
    stroke-dashoffset: 0;
    opacity: 0.48;
  }
  50% {
    opacity: 0.82;
  }
  to {
    background-position: 220px 0;
    stroke-dashoffset: -38;
    opacity: 0.48;
  }
}

@keyframes sceneCardRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes labPanelBreath {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  }
  50% {
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
  }
}

/* Finale Rebuild Motion */

.finale-layer--mist {
  animation: finale-mist-drift 16s ease-in-out infinite;
}

.finale-seal-mark {
  animation: finale-seal-pulse 7.6s ease-in-out infinite;
}

@keyframes finale-mist-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.4%, -1.8%, 0) scale(1.03);
  }
}

@keyframes finale-axis-breathe {
  0%,
  100% {
    opacity: 0.7;
    filter: drop-shadow(0 0 10px rgba(164, 133, 87, 0.24));
  }
  50% {
    opacity: 0.92;
    filter: drop-shadow(0 0 15px rgba(189, 155, 103, 0.4));
  }
}

@keyframes finale-seal-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(212, 175, 127, 0.14) inset,
      0 0 0 8px rgba(183, 154, 99, 0.06),
      0 24px 48px rgba(3, 6, 10, 0.48);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(232, 199, 151, 0.28) inset,
      0 0 0 16px rgba(183, 154, 99, 0.12),
      0 30px 56px rgba(3, 6, 10, 0.58);
  }
}

@keyframes finale-node-enter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 20px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
