:root {
  color-scheme: dark;
  --yz-bg: #050505;
  --yz-blue: #3b78b8;
  --yz-text: rgba(245, 245, 242, 0.96);
  --yz-muted: rgba(245, 245, 242, 0.42);
  font-family: Inter, Geist, "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--yz-bg);
}

button {
  font: inherit;
}

.experience,
.hero,
.chapter,
.desktop-guard {
  position: fixed;
  inset: 0;
}

.experience {
  min-width: 1200px;
  background: var(--yz-bg);
  color: var(--yz-text);
}

.hero {
  isolation: isolate;
  overflow: hidden;
  background: var(--yz-bg);
}

.hero__media,
.hero__poster,
.hero__image,
.hero__water-motion,
.hero__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__media {
  z-index: 1;
  opacity: 0;
  -webkit-mask: url("#riverRevealMask");
  mask: url("#riverRevealMask");
  will-change: opacity;
}

.hero__media::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 10, 17, 0.08), rgba(0, 0, 0, 0.13)),
    radial-gradient(ellipse at 74% 62%, transparent 34%, rgba(2, 4, 8, 0.12) 100%);
}

.hero__media.is-reveal-complete {
  -webkit-mask: none;
  mask: none;
}

.hero__poster {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.06), rgba(5, 5, 5, 0.36)),
    radial-gradient(ellipse at 56% 68%, rgba(75, 124, 163, 0.55) 0 7%, rgba(28, 66, 94, 0.5) 14%, transparent 34%),
    linear-gradient(138deg, #071018 0%, #132937 43%, #31566b 58%, #0a161e 73%, #050708 100%);
}

.hero__poster::before,
.hero__poster::after {
  position: absolute;
  inset: -16%;
  content: "";
  background: linear-gradient(112deg, transparent 35%, rgba(120, 169, 196, 0.12) 48%, transparent 61%);
  transform: rotate(-5deg);
}

.hero.has-poster .hero__poster {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.05), rgba(5, 5, 5, 0.26)),
    var(--hero-poster) center / cover no-repeat;
}

.hero__poster::after {
  opacity: 0.45;
  transform: translate3d(8%, 5%, 0) rotate(7deg);
}

.hero__image {
  z-index: 1;
  opacity: 0;
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.9) contrast(1.05) brightness(0.96);
  transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
  transform-origin: 50% 50%;
  will-change: transform;
}

.hero.has-image .hero__image {
  opacity: 1;
}

.hero.has-image .hero__poster {
  opacity: 0;
}

.hero__water-motion {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(104deg, transparent 12%, rgba(177, 205, 216, 0.34) 26%, transparent 40%) 0 0 / 42% 100%,
    repeating-linear-gradient(96deg, transparent 0 11%, rgba(143, 181, 198, 0.14) 13%, transparent 16%);
  clip-path: polygon(58% 34%, 66% 34%, 100% 45%, 100% 100%, 56% 100%, 56% 55%);
  -webkit-mask-image: radial-gradient(ellipse at 77% 70%, #000 18%, rgba(0, 0, 0, 0.72) 58%, transparent 86%);
  mask-image: radial-gradient(ellipse at 77% 70%, #000 18%, rgba(0, 0, 0, 0.72) 58%, transparent 86%);
  filter: blur(7px);
  mix-blend-mode: screen;
  will-change: opacity, transform, background-position;
}

.hero__shade {
  z-index: 3;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.12);
}

.trajectory {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.trajectory__line,
.trajectory__glow {
  fill: none;
  stroke: var(--yz-blue);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.trajectory__line {
  stroke: url("#trajectoryStroke");
  stroke-width: 2px;
}

.trajectory__glow {
  opacity: 0.15;
  filter: url(#lineGlow);
  stroke-width: 7px;
}

.trajectory__highlight {
  fill: none;
  stroke: url("#flowGradient");
  stroke-linecap: round;
  stroke-width: 5px;
  opacity: 0;
  vector-effect: non-scaling-stroke;
}

.trajectory__point {
  fill: var(--yz-blue);
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(59, 120, 184, 0.55));
}

.trajectory__ripple {
  fill: none;
  stroke: var(--yz-blue);
  stroke-width: 1px;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.hero__meta {
  position: absolute;
  z-index: 4;
  bottom: clamp(28px, 4vh, 50px);
  left: 50%;
  margin: 0;
  color: var(--yz-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  opacity: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hero__identity {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(820px, 76vw);
  text-align: center;
  transform: translate3d(-50%, -46%, 0);
}

.hero__identity h1 {
  margin: 0;
  font-size: clamp(72px, 10vw, 160px);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.92;
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(0, 24px, 0) scale3d(1, 1, 1);
  transform-origin: center;
  will-change: transform, opacity, filter;
}

.hero__latin {
  margin: 18px 0 0;
  color: rgba(245, 245, 242, 0.6);
  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 500;
  letter-spacing: 0.6em;
  opacity: 0;
}

.hero__tagline {
  margin: clamp(24px, 3.5vh, 42px) 0 0;
  color: rgba(245, 245, 242, 0.72);
  font-size: clamp(14px, 1.05vw, 18px);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.9;
  opacity: 0;
  transform: translate3d(0, 12px, 0);
}

.hero__cta {
  position: relative;
  display: inline-flex;
  gap: 18px;
  align-items: center;
  margin-top: clamp(22px, 3vh, 34px);
  padding: 8px 2px 12px;
  border: 0;
  color: var(--yz-text);
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  letter-spacing: 0.18em;
  opacity: 0;
  transform: translate3d(0, 10px, 0);
}

.hero__cta:disabled {
  pointer-events: none;
}

.hero__cta::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--yz-blue);
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 340ms ease;
}

.hero__cta span:last-child {
  transition: transform 340ms ease;
}

.hero__cta:hover::after,
.hero__cta:focus-visible::after {
  transform: scaleX(1);
}

.hero__cta:hover span:last-child,
.hero__cta:focus-visible span:last-child {
  transform: translateX(5px);
}

.hero__cta:focus-visible,
.sound-toggle:focus-visible,
.p1__progress button:focus-visible,
.debug button:focus-visible {
  outline: 1px solid var(--yz-blue);
  outline-offset: 5px;
}

.chapter {
  z-index: 8;
  background: var(--yz-bg);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.chapter.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.p1__screen,
.p1__media,
.p1__media img,
.p1__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.p1__screen {
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1100ms cubic-bezier(0.4, 0, 0.2, 1), visibility 1100ms;
}

.p1__screen.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.p1__media {
  overflow: hidden;
}

.p1__media img {
  object-fit: cover;
  object-position: 50% 50%;
  filter: saturate(0.84) contrast(1.05) brightness(0.76);
  transform: scale3d(1.02, 1.02, 1);
  will-change: transform;
}

.p1__screen.is-active .p1__media img {
  animation: p1-camera-push 8s linear both;
}

@keyframes p1-camera-push {
  from {
    transform: scale3d(1.02, 1.02, 1) translate3d(0, 0, 0);
  }
  to {
    transform: scale3d(1.055, 1.055, 1) translate3d(-0.35%, -0.2%, 0);
  }
}

.p1__overlay {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4, 6, 10, 0.82) 0%, rgba(4, 6, 10, 0.28) 46%, rgba(4, 6, 10, 0.12) 72%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.1) 35%, rgba(4, 6, 10, 0.76) 100%);
}

.p1__content {
  position: absolute;
  z-index: 2;
  bottom: clamp(78px, 11vh, 128px);
  left: clamp(54px, 7vw, 140px);
  max-width: min(720px, 54vw);
}

.p1__number,
.p1__copy,
.p1__chaptermark,
.p1__hint {
  margin: 0;
}

.p1__number {
  margin-bottom: 20px;
  color: #d9ad52;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.32em;
}

.p1__content h2 {
  margin: 0;
  font-size: clamp(72px, 10vw, 168px);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.p1__copy {
  margin-top: 28px;
  color: rgba(245, 245, 242, 0.76);
  font-size: clamp(15px, 1.15vw, 19px);
  letter-spacing: 0.12em;
  line-height: 1.8;
}

.p1__screen--champions .p1__overlay {
  background:
    linear-gradient(270deg, rgba(4, 6, 10, 0.78) 0%, rgba(4, 6, 10, 0.18) 48%, transparent 72%),
    linear-gradient(180deg, rgba(4, 6, 10, 0.06) 40%, rgba(4, 6, 10, 0.68) 100%);
}

.p1__screen--champions .p1__media img {
  object-position: 50% 42%;
  filter: saturate(0.82) contrast(1.06) brightness(0.82);
}

.p1__screen--champions .p1__content {
  right: clamp(54px, 7vw, 140px);
  left: auto;
  text-align: right;
}

.p1__screen--city .p1__overlay {
  background:
    linear-gradient(90deg, rgba(3, 8, 14, 0.8) 0%, rgba(3, 8, 14, 0.18) 52%, rgba(3, 8, 14, 0.18) 100%),
    linear-gradient(180deg, rgba(3, 8, 14, 0.08) 38%, rgba(3, 8, 14, 0.72) 100%);
}

.p1__screen--future .p1__media img {
  object-position: 62% 42%;
  filter: saturate(0.76) contrast(1.04) brightness(0.7);
}

.p1__screen--future .p1__overlay {
  background:
    radial-gradient(ellipse at 66% 24%, rgba(217, 173, 82, 0.09), transparent 32%),
    linear-gradient(180deg, rgba(3, 8, 14, 0.18), rgba(3, 8, 14, 0.72));
}

.p1__screen--future .p1__content {
  top: 50%;
  bottom: auto;
  left: 50%;
  max-width: min(900px, 72vw);
  text-align: center;
  transform: translate3d(-50%, -44%, 0);
}

.p1__chaptermark {
  position: absolute;
  z-index: 3;
  top: 32px;
  left: 38px;
  color: rgba(245, 245, 242, 0.48);
  font-size: 11px;
  letter-spacing: 0.26em;
}

.p1__progress {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 34px;
  display: grid;
  gap: 16px;
  transform: translateY(-50%);
}

.p1__progress button {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 0;
  border: 0;
  color: rgba(245, 245, 242, 0.28);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.12em;
  transition: color 280ms ease;
}

.p1__progress button::after {
  width: 18px;
  height: 1px;
  content: "";
  background: currentColor;
  transition: width 280ms ease, background 280ms ease;
}

.p1__progress button.is-active {
  color: #d9ad52;
}

.p1__progress button.is-active::after {
  width: 34px;
}

.p1__hint {
  position: absolute;
  z-index: 3;
  bottom: 32px;
  left: 38px;
  color: rgba(245, 245, 242, 0.32);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.p1__hint span {
  margin-right: 12px;
  color: #d9ad52;
}

.sound-toggle {
  position: fixed;
  top: 30px;
  right: 34px;
  padding: 7px;
  border: 0;
  color: var(--yz-muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.p1 .sound-toggle {
  z-index: 4;
}

.desktop-guard {
  z-index: 20;
  display: none;
  place-content: center;
  min-width: 0;
  padding: 32px;
  background:
    radial-gradient(circle at 50% 44%, rgba(59, 120, 184, 0.12), transparent 32%),
    var(--yz-bg);
  text-align: center;
}

.desktop-guard h1 {
  margin: 0 0 24px;
  font-size: clamp(56px, 10vw, 92px);
  letter-spacing: -0.07em;
}

.desktop-guard p {
  margin: 0;
  color: var(--yz-muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

.debug {
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 18px;
  width: 230px;
  padding: 12px;
  border: 1px solid rgba(245, 245, 242, 0.14);
  background: rgba(5, 5, 5, 0.82);
  color: rgba(245, 245, 242, 0.72);
  font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  backdrop-filter: blur(10px);
}

.debug dl {
  margin: 0 0 10px;
}

.debug dl div {
  display: flex;
  justify-content: space-between;
}

.debug dt,
.debug dd {
  margin: 0;
}

.debug dd button {
  padding: 0;
  border: 0;
  color: var(--yz-blue);
}

.debug__actions {
  display: grid;
  gap: 5px;
}

.debug__scrub {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}

.debug__scrub span {
  color: rgba(245, 245, 242, 0.48);
}

.debug__scrub input {
  width: 100%;
  accent-color: var(--yz-blue);
}

.debug button {
  padding: 5px 7px;
  border: 1px solid rgba(245, 245, 242, 0.18);
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

@media (max-width: 1199px) {
  .experience {
    min-width: 0;
  }

  .desktop-guard {
    display: grid;
  }

  .hero,
  .chapter,
  .debug {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__media,
  .hero__image,
  .hero__water-motion,
  .hero__identity h1,
  .hero__tagline,
  .hero__cta,
  .hero__cta::after,
  .hero__cta span:last-child {
    transition: none !important;
  }

  .trajectory {
    display: none;
  }

  .hero__media {
    -webkit-mask: none;
    mask: none;
  }

  .hero__image {
    transform: none !important;
  }

  .hero__water-motion {
    display: none;
  }

  .chapter,
  .p1__screen,
  .p1__progress button,
  .p1__progress button::after {
    transition: none !important;
  }

  .p1__screen.is-active .p1__media img {
    animation: none;
    transform: none;
  }
}
