:root {
  color-scheme: dark;
  --bg: #03030a;
  --fg: #fff8e8;
  --muted: #b6bac6;
  --line: rgba(255, 255, 255, 0.2);
  --glass: rgba(7, 9, 18, 0.58);
  --cyan: #42f2ff;
  --coral: #ff4e67;
  --gold: #f8c45c;
  --green: #5cff9d;
  --violet: #a855ff;
  --scene: #42f2ff;
  --scroll: 0%;
  --mouse-x: 50%;
  --mouse-y: 50%;
  --shadow: 0 36px 140px rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at center 18vh, rgba(66, 242, 255, 0.18), transparent 36rem),
    radial-gradient(circle at 50% 80vh, rgba(255, 78, 103, 0.14), transparent 42rem),
    linear-gradient(180deg, rgba(3, 3, 10, 0.18), rgba(3, 3, 10, 0.62));
  color: var(--fg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at center, transparent 0 38%, rgba(3, 3, 10, 0.5) 76%);
  background-size: 78px 78px, 78px 78px, 100% 100%;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

a {
  color: inherit;
}

.webgl-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #03030a;
  pointer-events: none;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 1rem;
  background:
    radial-gradient(circle at center, rgba(66, 242, 255, 0.12), transparent 24rem),
    #03030a;
  transition: opacity 900ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 900ms;
}

.is-ready .preloader {
  opacity: 0;
  visibility: hidden;
}

.preloader-mark {
  width: min(42vw, 220px);
  aspect-ratio: 1;
  position: relative;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
  animation: aperture-spin 2.6s linear infinite;
}

.preloader-mark span {
  position: absolute;
  inset: 12%;
  border: 1px solid rgba(66, 242, 255, 0.52);
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
}

.preloader-mark span:nth-child(2) {
  inset: 25%;
  transform: rotate(32deg);
  border-color: rgba(255, 78, 103, 0.64);
}

.preloader-mark span:nth-child(3) {
  inset: 38%;
  transform: rotate(-28deg);
  border-color: rgba(248, 196, 92, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

.preloader p {
  margin: 0;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.cursor-light {
  position: fixed;
  left: var(--mouse-x);
  top: var(--mouse-y);
  z-index: 1;
  width: 34rem;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(66, 242, 255, 0.18), rgba(255, 78, 103, 0.08) 36%, transparent 68%);
  filter: blur(12px);
  opacity: 0.82;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.stage-vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 38%, rgba(3, 3, 10, 0.26) 64%, rgba(3, 3, 10, 0.82) 100%),
    linear-gradient(90deg, rgba(3, 3, 10, 0.72), transparent 18%, transparent 82%, rgba(3, 3, 10, 0.72));
}

.cinema-frame {
  position: fixed;
  inset: 1rem;
  z-index: 18;
  pointer-events: none;
}

.cinema-frame span {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--scene), transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--scene), transparent 42%);
  opacity: 0.72;
}

.cinema-frame span:nth-child(1),
.cinema-frame span:nth-child(2) {
  left: 0;
  right: 0;
  height: 1px;
}

.cinema-frame span:nth-child(1) {
  top: 0;
}

.cinema-frame span:nth-child(2) {
  bottom: 0;
}

.cinema-frame span:nth-child(3),
.cinema-frame span:nth-child(4) {
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--scene), transparent);
}

.cinema-frame span:nth-child(3) {
  left: 0;
}

.cinema-frame span:nth-child(4) {
  right: 0;
}

.site-noise,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.site-noise {
  z-index: 4;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 18% 32%, rgba(255, 255, 255, 0.65) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 68%, rgba(255, 255, 255, 0.42) 0 1px, transparent 1px);
  background-size: 83px 89px, 57px 73px;
}

.scanline {
  z-index: 5;
  opacity: 0.12;
  background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.26) 5px 6px);
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 30;
  transform: translateY(-180%);
  background: var(--gold);
  color: #11131c;
  padding: 0.7rem 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 900;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.8rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(3, 3, 10, 0.74), rgba(3, 3, 10, 0.2));
  backdrop-filter: blur(20px) saturate(150%);
}

.site-header::after {
  content: "STATIC / WEBGL";
  justify-self: end;
  color: var(--scene);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 44px;
  color: var(--fg);
  font-size: 0.86rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-glyph {
  width: 32px;
  height: 32px;
  background: conic-gradient(from 90deg, var(--cyan), var(--violet), var(--coral), var(--gold), var(--cyan));
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 18% 100%, 0 34%);
  box-shadow: 0 0 28px color-mix(in srgb, var(--scene), transparent 42%);
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.09);
}

.progress-rail {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  z-index: 21;
  width: min(460px, calc(100vw - 2rem));
  height: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.18);
}

.scene-caption {
  position: fixed;
  right: clamp(1rem, 3vw, 3rem);
  top: 68%;
  z-index: 19;
  width: min(280px, 32vw);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-right: 5px solid var(--scene);
  background: rgba(7, 9, 18, 0.44);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
  transform: translateY(-50%);
  text-align: right;
}

.caption-number {
  display: block;
  color: var(--scene);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  font-weight: 950;
  line-height: 0.86;
}

.scene-caption p {
  max-width: none;
  margin: 0.4rem 0 0;
}

.caption-title {
  color: var(--fg);
  font-size: 0.84rem;
  font-weight: 950;
  text-transform: uppercase;
}

.caption-copy {
  font-size: 0.9rem;
  line-height: 1.5;
}

.progress-rail span {
  display: block;
  width: var(--scroll);
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--coral));
  box-shadow: 0 0 22px var(--scene);
}

main {
  position: relative;
  z-index: 2;
}

.scene,
.finale {
  min-height: 100vh;
  width: min(1380px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(7rem, 12vh, 9rem) clamp(0rem, 3vw, 2rem);
}

.scene {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: clip;
}

.hero-aura {
  position: absolute;
  inset: 11vh 13vw;
  z-index: -1;
  pointer-events: none;
}

.hero-aura span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: conic-gradient(from 180deg, transparent, rgba(66, 242, 255, 0.18), transparent, rgba(255, 78, 103, 0.14), transparent);
  clip-path: polygon(50% 0, 92% 18%, 100% 62%, 72% 100%, 24% 94%, 0 48%, 18% 12%);
  animation: aura-drift 18s linear infinite;
}

.hero-aura span:nth-child(2) {
  inset: 8%;
  animation-duration: 23s;
  animation-direction: reverse;
  opacity: 0.65;
}

.hero-aura span:nth-child(3) {
  inset: 17%;
  animation-duration: 31s;
  opacity: 0.45;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 15vh 8vw;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    conic-gradient(from 180deg, transparent, rgba(66, 242, 255, 0.14), transparent, rgba(255, 78, 103, 0.12), transparent),
    radial-gradient(circle, transparent 0 55%, rgba(255, 255, 255, 0.04) 55.5% 56%, transparent 56.5%);
  clip-path: polygon(50% 0, 92% 18%, 100% 62%, 72% 100%, 24% 94%, 0 48%, 18% 12%);
  filter: blur(0.2px);
  opacity: 0.72;
  animation: slow-turn 26s linear infinite;
}

.hero-scene {
  min-height: 112vh;
  align-content: center;
  gap: 2rem;
}

.scene-index,
.chapter {
  position: absolute;
  top: clamp(6.4rem, 13vh, 8rem);
  left: 50%;
  transform: translateX(-50%);
  color: var(--scene);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  text-align: center;
}

.chapter {
  display: grid;
  gap: 0.25rem;
}

.chapter span {
  font-size: 2.6rem;
  line-height: 0.82;
}

.kicker {
  margin: 0 0 1rem;
  color: var(--scene);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  max-width: 9ch;
  margin: 0 auto 1.25rem;
  font-size: clamp(5rem, 16vw, 16rem);
  line-height: 0.72;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
  filter: drop-shadow(0 0 42px color-mix(in srgb, var(--scene), transparent 64%));
  text-shadow:
    0 0 22px rgba(66, 242, 255, 0.24),
    0.035em 0.02em 0 rgba(66, 242, 255, 0.32),
    -0.035em 0.055em 0 rgba(255, 78, 103, 0.28);
}

h1::before,
h1::after {
  display: none;
}

h1::before {
  color: var(--cyan);
  clip-path: polygon(0 0, 100% 0, 100% 28%, 0 18%);
  transform: translate(0.04em, -0.02em);
  animation: glitch-a 2.9s steps(2, end) infinite;
}

h1::after {
  color: var(--coral);
  clip-path: polygon(0 66%, 100% 58%, 100% 100%, 0 92%);
  transform: translate(-0.032em, 0.024em);
  animation: glitch-b 3.7s steps(2, end) infinite;
}

h2 {
  max-width: 12ch;
  margin: 0 auto 1.2rem;
  font-size: clamp(3.4rem, 9vw, 8.8rem);
  line-height: 0.84;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.25rem, 2vw, 1.95rem);
  line-height: 0.95;
  text-transform: uppercase;
}

p {
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.75;
}

.hero-copy {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding-top: 2vh;
}

.hero-copy p:last-child {
  max-width: 700px;
  color: #fff6df;
  font-size: clamp(1.08rem, 2vw, 1.5rem);
}

.hero-panel,
.metric-wall,
.route-list article {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03)),
    var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
}

.hero-panel {
  width: min(860px, 100%);
  min-height: 0;
  display: grid;
  grid-template-columns: 0.75fr 1fr 1.25fr;
  align-items: center;
  gap: 1rem;
  margin: 1.4rem auto 0;
  padding: 1rem;
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 34px 100%, 0 calc(100% - 34px));
  text-align: left;
  transform: translateY(14px);
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1), border-color 400ms ease;
}

.is-ready .hero-panel {
  transform: translateY(0);
}

.hero-panel span,
.route-list article span {
  color: var(--scene);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.hero-panel strong {
  display: block;
  color: var(--fg);
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 0.82;
  white-space: nowrap;
}

.hero-panel p {
  max-width: 100%;
  margin: 0;
  overflow-wrap: break-word;
}

.split-scene {
  gap: 2rem;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(2rem, 6vh, 4rem);
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.scroll-cue span {
  width: 1px;
  height: 52px;
  display: block;
  background: linear-gradient(180deg, var(--scene), transparent);
  animation: cue-drop 1.4s ease-in-out infinite;
}

.scroll-cue p {
  margin: 0;
  font-size: inherit;
  line-height: 1;
}

.scene-copy {
  width: min(900px, 100%);
  position: relative;
}

.scene-copy::before,
.route-copy::before {
  content: "";
  display: block;
  width: min(520px, 70vw);
  height: 8px;
  margin: 0 auto 1.6rem;
  background: linear-gradient(90deg, transparent, var(--scene), transparent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--scene), transparent 48%);
}

.metric-wall {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
  border-bottom: 6px solid var(--scene);
}

.metric-wall div {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.metric-wall div:last-child {
  border-right: 0;
}

.metric-wall span {
  color: var(--fg);
  font-size: clamp(3rem, 8vw, 7.5rem);
  font-weight: 950;
  line-height: 0.82;
}

.metric-wall strong {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.media-scene {
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
}

.artifact {
  width: min(980px, 100%);
  position: relative;
  min-height: min(62vh, 700px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  clip-path: polygon(6% 0, 86% 0, 100% 18%, 94% 100%, 14% 100%, 0 82%);
}

.artifact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(120deg, rgba(66, 242, 255, 0.3), transparent 32%),
    linear-gradient(300deg, rgba(255, 78, 103, 0.26), transparent 42%),
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255, 255, 255, 0.16) 42px 43px);
  mix-blend-mode: screen;
}

.artifact img {
  width: 100%;
  height: 100%;
  min-height: min(62vh, 700px);
  display: block;
  object-fit: cover;
  filter: saturate(1.25) contrast(1.14);
  transform: scale(1.04);
}

.route-scene {
  gap: 2rem;
}

.route-copy {
  width: min(960px, 100%);
}

.route-list {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.route-list article {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  padding: 1.2rem;
  text-align: center;
  transition: transform 220ms ease, border-color 220ms ease;
}

.route-list article::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -1px;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--scene), var(--gold), var(--coral), transparent);
}

.route-list article:hover {
  border-color: color-mix(in srgb, var(--scene), white 20%);
  transform: translateY(-10px);
}

.metric-wall,
.route-list article,
.hero-panel,
.artifact {
  will-change: transform;
}

.finale {
  min-height: 86vh;
  display: grid;
  place-content: center;
  text-align: center;
}

.finale h2 {
  max-width: 10ch;
}

.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.3rem clamp(1rem, 3vw, 2.8rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(3, 3, 10, 0.82);
  font-size: 0.86rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  transition: opacity 800ms ease, transform 800ms ease;
}

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

@keyframes slow-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes aperture-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes aura-drift {
  to {
    transform: rotate(360deg) scale(1.06);
  }
}

@keyframes cue-drop {
  0%,
  100% {
    opacity: 0.28;
    transform: scaleY(0.45);
    transform-origin: top;
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
    transform-origin: top;
  }
}

@keyframes glitch-a {
  0%,
  68%,
  100% {
    transform: translate(0.04em, -0.02em);
  }
  69% {
    transform: translate(-0.018em, 0.008em);
  }
}

@keyframes glitch-b {
  0%,
  58%,
  100% {
    transform: translate(-0.032em, 0.024em);
  }
  59% {
    transform: translate(0.018em, -0.012em);
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .site-header::after {
    display: none;
  }

  .brand {
    justify-self: center;
  }

  .nav-links {
    justify-content: center;
    overflow-x: auto;
  }

  .hero-panel,
  .route-list {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .scene-caption {
    display: none;
  }
}

@media (max-width: 680px) {
  .scene,
  .finale {
    width: min(100% - 1rem, 1380px);
    padding-top: 8rem;
  }

  .brand span:last-child {
    display: none;
  }

  .nav-links a {
    padding-inline: 0.62rem;
  }

  .progress-rail {
    display: none;
  }

  .scene-index,
  .chapter {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin-bottom: 1rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(3.6rem, 18vw, 5.8rem);
  }

  h1::before,
  h1::after {
    display: none;
  }

  h2 {
    max-width: 12ch;
    font-size: clamp(2.4rem, 13vw, 4.4rem);
  }

  .finale h2,
  .finale p {
    max-width: 100%;
  }

  .hero-panel {
    width: min(100%, 390px);
  }

  .hero-panel strong {
    white-space: normal;
  }

  .metric-wall {
    grid-template-columns: 1fr;
  }

  .metric-wall div {
    min-height: 140px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric-wall div:last-child {
    border-bottom: 0;
  }

  .artifact,
  .artifact img {
    min-height: 440px;
  }

  .site-footer {
    display: grid;
    gap: 0.35rem;
  }

  .cursor-light,
  .cinema-frame,
  .scroll-cue {
    display: none;
  }

  .hero-aura {
    inset: 16vh 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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