:root {
  color-scheme: dark;
  --ink: #050505;
  --bone: #f5f1e8;
  --ash: #b6b0a6;
  --glow: rgba(245, 241, 232, 0.5);
  --ghost: rgba(245, 241, 232, 0.12);
  --sun: #f6c777;
  --bg-image: url("assets/whatif-bg.jpg");
  --display: "Unbounded", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --mx: 0.5;
  --my: 0.5;
  --intro: 0;
  --word-offset: 28vh;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: 50% 45%;
  background-repeat: no-repeat;
  color: var(--bone);
  font-family: var(--display);
  overflow: hidden;
}

.vignette {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      640px circle at calc(var(--mx) * 100%) calc(var(--my) * 100%),
      rgba(245, 241, 232, 0.12),
      transparent 55%
    ),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.8));
  mix-blend-mode: normal;
  pointer-events: none;
  z-index: -1;
}

.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23noise)' opacity='0.28'/%3E%3C/svg%3E");
  opacity: 0.12;
  mix-blend-mode: normal;
  pointer-events: none;
  z-index: 0;
}

.x-logo {
  position: fixed;
  top: 26px;
  left: 28px;
  width: 50px;
  height: 50px;
  color: rgba(255, 255, 255, 0.9);
  z-index: 3;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.x-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: translateY(calc(var(--intro) * 40px));
  opacity: calc(0.2 + (1 - var(--intro)) * 0.8);
  filter: blur(calc(var(--intro) * 4px));
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.35s ease,
    filter 0.35s ease;
}

.pump-logo {
  position: fixed;
  top: 26px;
  right: 28px;
  width: 56px;
  height: 56px;
  z-index: 3;
  pointer-events: none;
}

.pump-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: translateY(calc(var(--intro) * 40px));
  opacity: calc(0.2 + (1 - var(--intro)) * 0.8);
  filter: blur(calc(var(--intro) * 4px));
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.35s ease,
    filter 0.35s ease;
}

.blink {
  position: fixed;
  inset: 0;
  background: #050505;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.blink.is-active {
  animation: blink 0.12s ease;
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.snap {
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.snap::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.scene {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  position: relative;
  --progress: 0;
  --curve: 0;
}

.word {
  position: relative;
  font-size: clamp(1.9rem, 5.8vw, 6.1rem);
  letter-spacing: 0.1em;
  text-transform: none;
  line-height: 1;
  color: var(--sun);
  -webkit-text-stroke: 0.6px rgba(255, 230, 190, 0.6);
  text-shadow:
    0 0 14px rgba(255, 200, 120, 0.45),
    0 0 28px rgba(255, 180, 90, 0.35);
  transform: translateY(var(--word-offset))
    scale(calc(0.9 + (var(--progress) * 0.2) + (var(--intro) * 0.18)));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.word::after {
  content: attr(data-word);
  position: absolute;
  inset: 0;
  color: var(--sun);
  opacity: 0.85;
  filter: blur(8px);
  mix-blend-mode: screen;
  transform: translateY(1px);
  pointer-events: none;
}

.scroll-hint {
  position: absolute;
  bottom: 7vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sun);
  opacity: 0.7;
  transform: translateY(calc(var(--intro) * 18px));
  transition: opacity 0.35s ease, transform 0.35s ease;
  animation: hintFloat 1.8s ease-in-out infinite;
}

.scroll-hint svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 10px rgba(246, 199, 119, 0.35));
}

@keyframes hintFloat {
  0%,
  100% {
    transform: translateY(calc(var(--intro) * 18px));
  }
  50% {
    transform: translateY(calc(var(--intro) * 18px + 6px));
  }
}

.word::after {
  content: attr(data-word);
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px var(--ghost);
  filter: blur(1px);
  transform: translateY(
    calc((0.5 - var(--progress)) * 80px + (var(--intro) * 90px))
  );
  opacity: calc(0.6 - (var(--progress) * 0.2));
}

.word span {
  display: inline-block;
  color: var(--sun);
  transform:
    translateY(
      calc((0.5 - var(--progress)) * 60px + (var(--intro) * 80px))
    )
    rotate(calc(var(--curve) * (var(--spread) * 6deg)));
  opacity: calc(0.25 + var(--progress));
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease;
  will-change: transform, opacity;
}

.word span.space {
  width: 0.6em;
}

.scene--video {
  display: grid;
  place-items: center;
}

.scene--ca {
  display: grid;
  place-items: center;
}

.ca-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(246, 199, 119, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--sun);
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ca-label {
  font-size: 0.6rem;
  opacity: 0.7;
}

.ca-value {
  font-size: 0.75rem;
}

.ca-copy {
  border: 1px solid rgba(246, 199, 119, 0.45);
  background: rgba(246, 199, 119, 0.15);
  color: var(--sun);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.video-frame {
  position: relative;
  width: min(62vw, 360px);
  aspect-ratio: 9 / 16;
  max-height: 72vh;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mute-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .word {
    font-size: clamp(2.9rem, 11vw, 8rem);
    letter-spacing: 0.07em;
  }

  .word span.space {
    width: 0.45em;
  }

  .video-frame {
    width: min(80vw, 360px);
    max-height: 75vh;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .word,
  .word span {
    transform: none;
    filter: none;
  }
}
