/* The quote marks that make room: a dark page with a heading; scrolling, an amber wipe rises over it, a black frame
   opens between two pairs of quote marks and pushes them apart, a choir rises into the frame and the closing marks
   slide away to uncover the quote. */
:root {
  --night: #10132e;
  --amber: #ffb81c;
  --cream: #fff3da;
  --pad: 24px;
  /* the height of the marks and of the frame, and the gaps */
  --bar: 11vw;
  --quote-gap: 0.9vw;
  --col-gap: 2.4vw;
}

@media (min-width: 62em) {
  :root {
    --pad: 56px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: 'Newsreader Variable', Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

.top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: clamp(18px, 3.4vh, 30px) var(--pad);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
}

.brand {
  margin: 0;
  font-size: 17px;
  font-weight: 720;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.top__line {
  margin: 0;
  color: rgba(255, 243, 218, 0.62);
  font-size: 13px;
}

/* ------------------------------------------------------------------ the tall section and its stage */
.quote {
  position: relative;
  height: 460vh;
}

.quote__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: clip;
}

/* the page before: it stays under the wipe and drifts up a little while it is covered */
.before {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 90px var(--pad) 70px;
  background: var(--night);
  text-align: center;
}

.before__title {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--amber);
  font-family: 'Big Shoulders Variable', 'Arial Narrow', sans-serif;
  font-size: clamp(96px, 21vw, 330px);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.before__text {
  max-width: 30ch;
  margin: 0;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.35;
}

.before__hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  margin: 0;
  translate: -50% 0;
  color: rgba(255, 243, 218, 0.62);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 560;
}

/* the wipe: the script draws it up from the bottom edge */
.wipe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background: var(--amber);
  color: var(--night);
}

/* ------------------------------------------------------------------ the row: marks, frame, quote, marks */
.row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: end;
  column-gap: var(--col-gap);
  width: 100%;
  padding-inline: var(--pad);
}

.marks {
  position: relative;
  z-index: 2;
  display: flex;
  gap: var(--quote-gap);
}

/* the frame sits closer to the opening marks than the grid gap */
.marks:not(.marks--close) .mark:last-child {
  margin-inline-end: calc(var(--quote-gap) - var(--col-gap));
}

/* the closing marks carry an amber block that runs off to the right: while they sit on the quote, it hides it */
.marks--close {
  flex-direction: row-reverse;
  isolation: isolate;
  background: var(--amber);
}

.marks--close::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--quote-gap));
  width: calc(100% + var(--quote-gap) + 100vw);
  background: var(--amber);
  pointer-events: none;
}

.marks--close .mark {
  rotate: 180deg;
}

.mark {
  display: block;
  width: auto;
  height: var(--bar);
  min-height: 64px;
  fill: var(--night);
}

/* the frame: at its own height everything is cut on its edges; above it the singers may rise, and lean out a
   little on either side */
.cutout {
  position: relative;
  z-index: 3;
  width: calc(var(--bar) * 2.5);
  height: var(--bar);
  clip-path: polygon(-12% -200%, 112% -200%, 112% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, -12% 0%);
}

@media (min-width: 96em) {
  .cutout {
    width: calc(var(--bar) * 3.2);
  }
}

.cutout__frame {
  position: absolute;
  inset: 0;
  background: var(--night);
  transform-origin: 50% 50%;
}

.cutout__choir {
  position: absolute;
  left: -14%;
  bottom: 0;
  width: 128%;
}

.cutout__choir svg {
  display: block;
  width: 100%;
  height: auto;
}

.copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: var(--bar);
  margin: 0;
}

.copy p {
  margin: 0;
  font-size: max(1.05rem, 1.55vw);
  line-height: 1.22;
  text-wrap: pretty;
}

.copy footer {
  margin-top: 0.9em;
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 560;
}

/* ------------------------------------------------------------------ phones: one column */
@media (max-width: 47.99em) {
  :root {
    --bar: 22vw;
    --quote-gap: 2vw;
  }

  .row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }

  .marks:not(.marks--close) .mark:last-child {
    margin-inline-end: 0;
  }

  .marks--close {
    align-self: flex-end;
  }

  .marks--close::after {
    content: none;
  }

  .mark {
    min-height: 0;
  }

  .cutout {
    width: 100%;
    height: auto;
    aspect-ratio: 2.4 / 1;
  }

  .cutout__choir {
    left: -4%;
    width: 108%;
  }

  .copy {
    min-height: 0;
  }

  .copy p {
    font-size: 22px;
  }
}

.outro {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 80px var(--pad);
  background: var(--night);
}

.outro__text {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.2;
  text-align: center;
}

/* with reduced motion: the page before, then the quote, both open */
@media (prefers-reduced-motion: reduce) {
  .quote {
    height: auto;
  }

  .quote__stage {
    position: relative;
    height: auto;
  }

  .before,
  .wipe {
    position: relative;
    min-height: 100vh;
  }

  .before__hint {
    display: none;
  }
}
