:root {
  --paper: #f2efe6;
  --ink: #1a1d18;
  --black: #050505;
  --red: #c23a2a;
  --progress: 0;
  --scene-scale: 0.16;
  --scene-blur: 28px;
  --scene-brightness: 0.5;
  --scene-contrast: 0.75;
  --scene-opacity: 0.66;
  --scene-radius: 64px;
  --reticle-opacity: 0;
  --finder-opacity: 0;
  --chrome-opacity: 1;
  --cue-opacity: 1;
  --logo-y: -62vh;
  --logo-opacity: 0;
  --logo-rotate: -1deg;
  --final-opacity: 0;
  color-scheme: dark;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--paper);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.scroll-story {
  position: relative;
  height: 700vh;
  height: 700svh;
}

.experience {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: var(--black);
}

.ambient-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(80vw, 1000px);
  aspect-ratio: 1.6;
  border-radius: 50%;
  background: rgba(211, 155, 91, 0.08);
  filter: blur(90px);
  transform: translate(-50%, -50%);
}

.site-chrome {
  position: absolute;
  inset: clamp(22px, 3.5vw, 52px) clamp(22px, 4vw, 68px) auto;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  opacity: var(--chrome-opacity);
  pointer-events: none;
  will-change: opacity;
}

.brand-lockup {
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  line-height: 0.78;
}

.brand-lockup span {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 900;
  letter-spacing: -0.075em;
}

.brand-lockup small {
  padding-left: 0.52em;
  font-family: "DM Sans", sans-serif;
  font-weight: 600;
  letter-spacing: 0.48em;
  line-height: 1;
}

.brand-lockup--corner {
  pointer-events: auto;
}

.brand-lockup--corner span {
  font-size: clamp(2.6rem, 4vw, 4.25rem);
}

.brand-lockup--corner small {
  font-size: clamp(0.68rem, 0.85vw, 0.9rem);
}

.instruction {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: rgba(242, 239, 230, 0.8);
  font-family: "DM Mono", monospace;
  font-size: clamp(0.58rem, 0.77vw, 0.78rem);
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.scene-shell {
  position: absolute;
  inset: clamp(12px, 2vw, 32px);
  z-index: 2;
  overflow: hidden;
  border: 1px solid rgba(242, 239, 230, calc(0.04 + var(--progress) * 0.12));
  border-radius: var(--scene-radius);
  background: #12100c;
  opacity: var(--scene-opacity);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 30px 100px rgba(0, 0, 0, 0.6);
  transform: scale(var(--scene-scale));
  transform-origin: 50% 50%;
  will-change: transform, border-radius, opacity;
}

.scene-image {
  position: absolute;
  inset: -3%;
  width: 106%;
  height: 106%;
  object-fit: cover;
  object-position: center center;
  filter:
    blur(var(--scene-blur))
    brightness(var(--scene-brightness))
    contrast(var(--scene-contrast))
    saturate(0.86);
  transform: scale(1.04);
  will-change: filter;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.23), transparent 24%, transparent 70%, rgba(0, 0, 0, 0.48)),
    radial-gradient(circle at center, transparent 48%, rgba(0, 0, 0, 0.54) 112%);
  pointer-events: none;
}

.film-grain {
  position: absolute;
  inset: -50%;
  opacity: 0.13;
  pointer-events: none;
  background-image:
    repeating-radial-gradient(circle at 17% 23%, rgba(255, 255, 255, 0.18) 0 0.5px, transparent 0.8px 3px),
    repeating-linear-gradient(113deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 4px);
  background-size: 5px 5px, 7px 7px;
  mix-blend-mode: soft-light;
  animation: grain-shift 0.22s steps(2) infinite;
}

.focus-reticle {
  position: absolute;
  top: 52%;
  left: 50%;
  width: clamp(84px, 9vw, 126px);
  aspect-ratio: 1.25;
  opacity: var(--reticle-opacity);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
  will-change: opacity;
}

.corner {
  position: absolute;
  width: 24%;
  height: 30%;
  border-color: rgba(255, 255, 255, 0.94);
  border-style: solid;
}

.corner--tl { inset: 0 auto auto 0; border-width: 1.5px 0 0 1.5px; }
.corner--tr { inset: 0 0 auto auto; border-width: 1.5px 1.5px 0 0; }
.corner--bl { inset: auto auto 0 0; border-width: 0 0 1.5px 1.5px; }
.corner--br { inset: auto 0 0 auto; border-width: 0 1.5px 1.5px 0; }

.focus-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.viewfinder-data {
  position: absolute;
  right: 24px;
  left: 24px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.68);
  font-family: "DM Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  opacity: var(--finder-opacity);
}

.viewfinder-data--top { top: 22px; }
.viewfinder-data--bottom { bottom: 20px; }

.logo-card {
  position: absolute;
  top: clamp(28px, 7vh, 76px);
  left: 50%;
  z-index: 5;
  min-width: min(58vw, 560px);
  padding: clamp(25px, 3.2vw, 44px) clamp(42px, 6vw, 96px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  background:
    linear-gradient(104deg, rgba(255, 255, 255, 0.35), transparent 32%),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  opacity: var(--logo-opacity);
  transform: translate(-50%, var(--logo-y)) rotate(var(--logo-rotate));
  will-change: transform, opacity;
}

.brand-lockup--hero span {
  font-size: clamp(4.25rem, 8.8vw, 8.5rem);
  line-height: 0.72;
}

.brand-lockup--hero small {
  font-size: clamp(0.86rem, 1.6vw, 1.6rem);
}

.final-copy {
  position: absolute;
  right: 0;
  bottom: clamp(18px, 5.5vh, 58px);
  left: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(86px, 15vh, 160px);
  color: white;
  opacity: var(--final-opacity);
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
  will-change: opacity;
}

.final-copy p {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

.final-copy span {
  font-family: "DM Mono", monospace;
  font-size: clamp(0.5rem, 0.68vw, 0.68rem);
  letter-spacing: 0.2em;
}

.scroll-cue {
  position: absolute;
  bottom: clamp(28px, 4vw, 56px);
  left: clamp(24px, 4vw, 68px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(242, 239, 230, 0.64);
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  opacity: var(--cue-opacity);
  will-change: opacity;
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 40px;
  overflow: hidden;
  background: rgba(242, 239, 230, 0.22);
}

.scroll-cue i::after {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--paper);
  transform: translateY(-100%);
  animation: cue-line 1.8s ease-in-out infinite;
}

.progress-rail {
  position: absolute;
  right: clamp(18px, 2.2vw, 36px);
  top: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(242, 239, 230, 0.48);
  font-family: "DM Mono", monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  opacity: var(--cue-opacity);
  transform: translateY(-50%);
}

.progress-rail i {
  position: relative;
  width: 1px;
  height: min(22vh, 180px);
  overflow: hidden;
  background: rgba(242, 239, 230, 0.18);
}

.progress-rail b {
  position: absolute;
  inset: 0;
  background: var(--paper);
  transform: scaleY(var(--progress));
  transform-origin: top;
}

.progress-index {
  color: var(--paper);
}

.accessibility-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes grain-shift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(3%, -4%, 0); }
  50% { transform: translate3d(-5%, 2%, 0); }
  75% { transform: translate3d(4%, 5%, 0); }
  100% { transform: translate3d(-2%, -3%, 0); }
}

@keyframes cue-line {
  0% { transform: translateY(-100%); }
  50%, 100% { transform: translateY(100%); }
}

@media (max-width: 700px) {
  .scroll-story {
    height: 560svh;
  }

  .site-chrome {
    inset: 20px 20px auto;
  }

  .brand-lockup--corner span {
    font-size: 2.6rem;
  }

  .brand-lockup--corner small {
    font-size: 0.62rem;
  }

  .instruction {
    max-width: 170px;
    font-size: 0.5rem;
    line-height: 1.55;
    text-align: right;
  }

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

  .scene-shell {
    inset: 10px;
  }

  .scene-image {
    object-position: 53% center;
  }

  .logo-card {
    top: 6vh;
    min-width: min(88vw, 480px);
    padding: 28px 36px;
  }

  .brand-lockup--hero span {
    font-size: clamp(4rem, 20vw, 6.2rem);
  }

  .brand-lockup--hero small {
    font-size: 0.88rem;
  }

  .final-copy {
    bottom: 5vh;
    gap: 45vh;
  }

  .final-copy p {
    font-size: 0.82rem;
    letter-spacing: 0.36em;
    text-indent: 0.36em;
  }

  .scroll-cue {
    bottom: 24px;
    left: 20px;
  }

  .progress-rail {
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-story {
    height: 100svh;
  }

  .scene-shell {
    --scene-scale: 1;
    --scene-blur: 0px;
    --scene-brightness: 1;
    --scene-contrast: 1.02;
    --scene-opacity: 1;
    --scene-radius: 28px;
  }

  .site-chrome,
  .scroll-cue,
  .progress-rail,
  .focus-reticle,
  .viewfinder-data {
    display: none;
  }

  .logo-card {
    --logo-y: 0px;
    --logo-opacity: 1;
    --logo-rotate: 0deg;
  }

  .final-copy {
    --final-opacity: 1;
  }

  .film-grain {
    animation: none;
  }
}
