/* The scroll story: the copy on the left, the sticky telly on the right (on top, on phones).
   Chapter lengths are --len × --beat; js/story.js times everything off them. */

.story {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.45fr);
  column-gap: clamp(24px,5vw,80px);
}
.hero {
  grid-column: 1;
  min-height: 100svh;
  max-width: 31rem;
  padding: 4svh 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ch {
  grid-column: 1;
  position: relative;
  height: calc(var(--len) * var(--beat));
}
/* Desktop: each chapter's copy sticks centred on the telly. story.js measures --copy-h. */
.copy {
  position: sticky;
  top: max(12px, calc(50svh - var(--copy-h, 50svh) / 2));
  max-width: 31rem;
  padding: 4vh 0;
}
#c1 {
  --len: 1.3;
}
#c2 {
  --len: 1.7;
}
#c3 {
  --len: 2.8;
}
#c4 {
  --len: 1.9;
}
.hero h1 {
  font-size: min(calc(clamp(4.2rem,10.5vw,9.5rem) * var(--ds) * var(--h1x,1)), 11svh);
}
.lede {
  font-size: clamp(1.05rem,1.3vw,1.2rem);
  margin-top: 1.4rem;
  max-width: 28rem;
}
.cue {
  display: inline-flex;
  gap: .6em;
  align-items: center;
  font-size: .95rem;
  color: var(--ink-2);
  margin-top: 1.6rem;
}
.cue i {
  display: block;
  width: 2px;
  height: 28px;
  background: currentColor;
  border-radius: 2px;
  animation: cue 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0% {
    transform: scaleY(.2);
  }
  50% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(.2);
    opacity: .2;
  }
}
.quote {
  font-size: clamp(1.6rem,2.6vw,2.1rem);
  line-height: 1.12;
  color: var(--ink);
  margin-top: 1.4em;
}
.name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em .75em;
  margin: 1.4em 0;
  font-size: .95rem;
}
.name input {
  font: inherit;
  font-size: 1.05rem;
  color: var(--night);
  background: rgba(255,255,255,.75);
  border: 2px solid rgba(20,32,63,.2);
  border-radius: 999px;
  padding: .45em 1em;
  width: 12em;
}
.name input:focus-visible {
  outline-offset: 2px;
  border-color: var(--night);
}

/* The telly's slot: spans every chapter so it can stay put while the copy scrolls. */
.stage {
  grid-column: 2;
  grid-row: 1 / span 5;
  position: relative;
}
.tvwrap {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width:860px) {
  .story {
    display: flex;
    flex-direction: column;
  }
  :root {
    --beat: 88svh;
  }
  .stage {
    order: 1;
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 calc(-1 * var(--gut));
    padding: 10px var(--gut) 22px;
    background: linear-gradient(var(--sky-top,#4FA9F0) 93%,transparent);
  }
  .tvwrap {
    position: static;
    height: auto;
  }
  .hero {
    order: 0;
    min-height: auto;
    padding: 9vh 0 6vh;
  }
  .ch {
    order: 2;
  }
  .copy {
    top: calc(var(--stage-h,60vw) + 12px);
    padding-top: 2vh;
  }
}
/* Thumbnail link to the home-screen screenshot, so it reads as an image, not just text. */
.shot {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1em;
  padding: .5rem .9rem .5rem .5rem;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 12px;
  text-decoration: none;
  max-width: 24rem;
}
.shot img {
  flex: none;
  width: 7.5rem;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}
.shot span {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.shot strong {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.shot small {
  color: var(--ink-2);
  font-size: .85rem;
}
.shot:hover strong {
  text-decoration-thickness: 2px;
}
