:root {
  color-scheme: dark;
  --bg: #09090b;
  --text: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.66);
  --line: rgba(244, 241, 234, 0.16);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(ellipse 60% 36% at 50% 0%, rgba(58, 68, 78, 0.18), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

a {
  font: inherit;
  color: inherit;
}

.back {
  position: fixed;
  z-index: 5;
  top: 18px;
  left: 22px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
}

.back:hover,
.back:focus-visible {
  color: var(--text);
}

.app {
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  padding: 88px 0 0;
}

.intro {
  text-align: center;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 560;
  letter-spacing: -0.03em;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.track {
  height: 260vh;
}

.stage {
  position: sticky;
  top: 14vh;
  padding-bottom: 8vh;
}

.frame {
  position: relative;
  height: min(62vh, 520px);
  margin: 28px 0 0;
  border-radius: 18px;
  overflow: hidden;
  background: #14120f;
}

.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center center;
  animation-name: uncover;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: scroll(root block);
  animation-range: 12% 88%;
}

figcaption {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

figcaption span {
  animation-name: arrive;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: scroll(root block);
}

figcaption span:nth-child(1) {
  animation-range: 28% 58%;
}

figcaption span:nth-child(2) {
  animation-range: 48% 82%;
}

.meter {
  height: 2px;
  margin-top: 16px;
  background: var(--line);
}

.meter i {
  display: block;
  height: 100%;
  background: var(--text);
  transform-origin: left center;
  animation-name: fill;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: scroll(root block);
  animation-range: 0% 100%;
}

@keyframes uncover {
  from {
    clip-path: inset(16% 18% 16% 18% round 18px);
    transform: scale(1.14);
  }
  to {
    clip-path: inset(0 round 0px);
    transform: scale(1);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fill {
  from {
    transform: scaleX(0.04);
  }
  to {
    transform: scaleX(1);
  }
}

.back:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .photo,
  figcaption span,
  .meter i {
    animation: none;
  }

  .photo {
    clip-path: none;
    transform: none;
  }

  figcaption span {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  .back {
    top: 14px;
    left: 14px;
  }

  .app {
    width: calc(100% - 28px);
    padding-top: 72px;
  }

  .frame {
    height: 58vh;
    border-radius: 14px;
  }
}
