/* Hero and pinned story. js/journey.js writes --h (0 hero, 1 story) and --hue. */
@property --hue {
  syntax: '<color>';
  inherits: true;
  initial-value: #9b7bff;
}

.journey {
  position: relative;
  height: 100vh;
  height: 100svh;
  --h: 0;
}
.js .journey {
  height: calc((var(--n) + 1.5) * 100vh);
  height: calc((var(--n) + 1.5) * 100svh);
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--void);
  transition: --hue 1s ease;
}

/* Film */
.stage-video {
  position: absolute;
  inset: 0;
  opacity: calc(1 - var(--h) * 1.25);
  transform: scale(calc(1 + var(--h) * 0.1));
}
.stage-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stage-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 34%, rgba(4, 5, 10, 0.42), transparent 70%),
    linear-gradient(rgba(4, 5, 10, 0.5) 0%, rgba(4, 5, 10, 0.08) 34%, rgba(4, 5, 10, 0.2) 62%, rgba(4, 5, 10, 0.82) 100%);
}

/* The phone rises out of the dark, so the hero buttons stay readable on top of it. */
.stage::after {
  content: '';
  position: absolute;
  inset: 60% 0 0;
  z-index: 3;
  background: linear-gradient(rgba(4, 5, 10, 0), rgba(4, 5, 10, 0.8) 85%);
  opacity: calc(1 - var(--h) * 2.5);
  pointer-events: none;
}

/* Hero copy */
.hero-copy,
.hero-foot {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 var(--gutter);
  text-align: center;
  opacity: calc(1 - var(--h) * 3);
}
.hero-copy {
  top: clamp(100px, 15vh, 176px);
  z-index: 3;
  transform: translate3d(0, calc(var(--h) * -110px), 0);
}
.hero-copy h1 {
  font-size: clamp(44px, 6.5vw, 104px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.052em;
  text-shadow: 0 2px 40px rgba(4, 5, 10, 0.45);
  animation: hero-up 1.3s var(--ease) both;
}
.hero-copy p {
  max-width: 660px;
  margin: clamp(16px, 2.4vh, 28px) auto 0;
  font-size: clamp(18px, 1.75vw, 27px);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.035em;
  text-wrap: balance;
  text-shadow: 0 1px 24px rgba(4, 5, 10, 0.7);
  animation: hero-up 1.3s 0.12s var(--ease) both;
}
.hero-foot {
  bottom: clamp(18px, 4.2vh, 46px);
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.6vh, 28px);
  animation: hero-up 1.3s 0.4s var(--ease) both;
}
.hero-soon {
  display: none;
}
/* The buttons sit over the phone in the hero: the main one solid, the
   other a dark tint, so the app's text never shows through them (a blur
   alone is not drawn everywhere). */
.hero-foot .store-btn {
  background: rgba(14, 15, 20, 0.92);
}
.hero-foot .store-btn:hover {
  background: rgba(24, 25, 32, 0.86);
}
.hero-foot .store-btn[data-install] {
  color: var(--day-ink);
  background: var(--day);
  border-color: transparent;
}
.hero-foot .store-btn[data-install]:hover {
  background: var(--day);
  filter: brightness(0.96);
}
.is-story .hero-copy,
.is-story .hero-foot {
  visibility: hidden;
}
.scroll-cue {
  position: absolute;
  left: clamp(16px, 2vw, 28px);
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.scroll-cue svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes hero-up {
  from {
    opacity: 0;
    transform: translateY(34px);
  }
}
@keyframes cue {
  50% {
    transform: translateY(6px);
  }
}

/* Phone */
.phone-rig {
  --ph: min(76vh, 820px);
  --px: min(25vw, 380px);
  --py0: 45vh;
  --py1: 1vh;
  --s0: 1.08;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: calc(var(--ph) * 0.4617);
  height: var(--ph);
  margin: calc(var(--ph) / -2) 0 0 calc(var(--ph) * -0.2308);
  transform: translate3d(calc(var(--h) * var(--px)), calc(var(--py0) + (var(--py1) - var(--py0)) * var(--h)), 0)
    scale(calc(var(--s0) + (1 - var(--s0)) * var(--h)));
  will-change: transform;
}
.phone-rig::before {
  content: '';
  position: absolute;
  inset: -30% -130%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--hue) 34%, transparent),
    color-mix(in srgb, var(--hue) 13%, transparent) 52%,
    transparent
  );
  opacity: var(--h);
  pointer-events: none;
}
.phone {
  position: relative;
  height: 100%;
  padding: calc(var(--ph) * 0.0125);
  border-radius: calc(var(--ph) * 0.082);
  background: linear-gradient(140deg, #4b4f60 0%, #101119 22%, #0a0b11 55%, #23252f 82%, #555a6c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 0 0 3px #05060a,
    0 70px 130px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  animation: phone-in 1.6s 0.15s var(--ease) both;
}
@keyframes phone-in {
  from {
    opacity: 0;
    transform: translateY(16vh);
  }
}
.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--ph) * 0.07);
  background: #05060d;
}
.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.6s ease, transform 1.3s var(--ease);
}
.phone-screen img.is-active {
  opacity: 1;
  transform: none;
}
.phone-island {
  position: absolute;
  top: calc(var(--ph) * 0.03);
  left: 50%;
  z-index: 2;
  width: 29%;
  height: calc(var(--ph) * 0.036);
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}
.phone-status {
  position: absolute;
  top: calc(var(--ph) * 0.03);
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--ph) * 0.036);
  padding: 0 10.5% 0 13%;
  font-size: calc(var(--ph) * 0.0215);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.phone-status svg {
  /* The app's own menu button sits in this corner of the screenshots. */
  display: none;
  height: calc(var(--ph) * 0.0165);
  fill: currentColor;
}
.phone-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 26%);
  pointer-events: none;
}

/* Chapters */
.chapters {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: calc((var(--h) - 0.55) * 2.4);
  pointer-events: none;
}
.chapter {
  --hue: #9b7bff;
  position: absolute;
  left: max(var(--gutter), calc(50% - 640px));
  top: 50%;
  width: min(560px, 43vw);
  opacity: 0;
  transform: translateY(calc(-50% + 34px));
  transition: opacity 0.45s ease, transform 0.9s var(--ease);
}
.chapter.is-past {
  transform: translateY(calc(-50% - 34px));
}
.chapter.is-active {
  opacity: 1;
  transform: translateY(-50%);
  transition-delay: 0.14s;
}
.chapter h2 {
  margin: 22px 0 26px;
  font-size: clamp(36px, 4.5vw, 70px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.048em;
}
.chapter > p:last-child {
  max-width: 480px;
  font-size: clamp(17px, 1.5vw, 23px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.032em;
}

/* Progress */
.dots {
  position: absolute;
  right: clamp(12px, 2.6vw, 46px);
  top: 50%;
  z-index: 4;
  display: grid;
  gap: 8px;
  padding: 10px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  opacity: calc((var(--h) - 0.55) * 2.4);
  transform: translateY(-50%);
}
.dots button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.dots button::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  transition: background-color 0.4s ease, transform 0.5s var(--ease), box-shadow 0.4s ease;
}
.dots button:hover::before {
  background: rgba(255, 255, 255, 0.5);
}
.dots .is-active button::before {
  background: var(--hue);
  box-shadow: 0 0 18px var(--hue);
  transform: scale(1.15);
}
.journey:not(.is-story) .dots {
  pointer-events: none;
  /* Out of the keyboard's way too while hidden (website audit W-5). */
  visibility: hidden;
}

@media (max-width: 900px) {
  .phone-rig {
    --ph: 58vh;
    --ph: 58svh;
    --px: 0px;
    --py0: 36svh;
    --py1: 26svh;
    --s0: 1;
  }
  .phone-rig::before {
    inset: -10% -80%;
  }
  .hero-copy {
    top: 96px;
  }
  .hero-copy h1 {
    font-size: clamp(40px, 11.4vw, 64px);
  }
  .scroll-cue {
    display: none;
  }
  .hero-foot {
    padding: 0 12px;
  }
  .hero-foot .store-row {
    flex-wrap: nowrap;
    gap: 8px;
  }
  /* Both buttons share the row on a phone; a fixed width cut the second
     one off the screen edge. */
  .hero-foot .store-row {
    width: 100%;
  }
  .hero-foot .store-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
    padding: 8px 14px;
    justify-content: center;
    background: rgba(30, 32, 44, 0.72);
  }
  .hero-foot .store-btn span {
    white-space: normal;
    text-align: center;
    font-size: 16.5px;
  }
  .hero-foot .store-btn small {
    font-size: 11.5px;
  }
  .hero-foot .store-btn svg {
    display: none;
  }
  .hero-foot .is-soon {
    display: none;
  }
  .hero-foot .store-btn[data-install] span {
    text-align: center;
  }
  .hero-foot .store-btn[data-install] {
    min-width: 0;
    justify-content: center;
    color: var(--day-ink);
    background: var(--day);
    border-color: transparent;
  }
  .hero-foot {
    gap: 10px;
  }
  .hero-soon {
    display: block;
    color: rgba(244, 246, 255, 0.8);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .hero-foot .store-btn span {
    font-size: 15.5px;
  }
  .hero-foot .store-btn small {
    font-size: 11px;
  }
  .chapter,
  .chapter.is-past,
  .chapter.is-active {
    left: var(--gutter);
    right: 50px;
    top: 84px;
    width: auto;
  }
  .chapter {
    transform: translateY(22px);
  }
  .chapter.is-past {
    transform: translateY(-22px);
  }
  .chapter.is-active {
    transform: none;
  }
  .chapter h2 {
    margin: 12px 0 12px;
    font-size: clamp(30px, 8.6vw, 44px);
  }
  .chapter > p:last-child {
    font-size: 16.5px;
  }
  .eyebrow {
    font-size: 11.5px;
  }
  .dots {
    top: 26%;
    right: 6px;
    gap: 2px;
    padding: 6px 2px;
  }
  .dots button::before {
    width: 9px;
    height: 9px;
  }
}

@media (max-width: 900px) and (max-height: 720px) {
  .chapter > p:last-child {
    font-size: 15px;
    line-height: 1.26;
  }
  .phone-rig {
    --py1: 30svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy h1,
  .hero-copy p,
  .hero-foot,
  .phone,
  .scroll-cue svg {
    animation: none;
  }
  .chapter,
  .phone-screen img,
  .stage {
    transition: none;
  }
}
