/* The voyage stage: the first screen, and the scroll playback that runs in it.
   Tokens come from styles.css. The strip along its bottom is in strip.css. */
@font-face {
  font-family: "Barlow Condensed";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/fonts/BarlowCondensed-SemiBold.woff2") format("woff2");
}

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Without script, and for a visitor who prefers reduced motion, the stage is
   one screen high and shows the finished voyage. Only a page that is playing
   (script has set .is-playing) is tall and sticky. */
.stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: calc(100svh - var(--bar));
  padding: 28px var(--gutter) 0;
  overflow: hidden;
}

.is-playing {
  position: relative;
  height: 330svh;
}

.is-playing .stage {
  position: sticky;
  top: var(--bar);
  height: calc(100svh - var(--bar));
}

/* The page is about to play: hold back what the script will redraw, so a visitor
   never sees the finished counters jump to zero. If the script never arrives,
   they appear after two seconds. */
.will-play .meta p,
.will-play .counters,
.will-play .caption,
.will-play .strip,
.will-play .map .ship,
.will-play .map .wake {
  visibility: hidden;
  animation: show-anyway 0s linear 2s forwards;
}

@keyframes show-anyway {
  to {
    visibility: visible;
  }
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.meta p {
  font-size: 14px;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(24px, 3.5vw, 56px);
  min-height: 0;
}

.pitch {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pitch h1 {
  font-size: clamp(34px, 3.3vw, 54px);
}

.pitch .lede {
  margin: 18px 0 24px;
}

/* Counters: three flat digit windows, in Barlow Condensed, side by side under the button. */
.counters {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 16px 28px;
  margin-top: clamp(24px, 4svh, 44px);
  padding-top: 20px;
  border-top: 1px solid var(--seam);
}

.counter {
  display: grid;
  align-content: start;
  gap: 0;
}

.counter small {
  margin-top: 6px;
}

.counter dt {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}

.counter dd {
  position: relative;
}

.counter small {
  font-size: 13px;
  line-height: 18px;
  color: var(--faint);
}

.digits {
  display: flex;
  gap: 3px;
  font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  font-size: clamp(30px, 2.7vw, 44px);
  font-weight: 600;
  line-height: 1;
}

.digits i {
  display: block;
  width: 0.62em;
  padding: 0.12em 0;
  border-top: 1px solid var(--seam-strong);
  border-bottom: 1px solid var(--seam-strong);
  background: var(--pane);
  color: var(--accent-text);
  font-style: normal;
  text-align: center;
}

.digits i.dot {
  width: 0.25em;
  border-color: transparent;
  background: none;
  color: var(--muted);
}

.digits i.lead {
  color: #3a3f47;
}

.caption {
  min-height: 64px;
  max-width: 58ch;
  margin-bottom: 4px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(160px, 1fr);
    gap: 12px;
  }

  /* While playing, the phone's one screen holds the headline, the button, the
     counters, the map and the strip. */
  .is-playing .pitch .lede {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 20px;
  }

  .is-playing .pitch h1 {
    margin-bottom: 14px;
    font-size: 28px;
  }

  .is-playing .counters {
    margin-top: 14px;
    padding-top: 12px;
  }

  /* The header's own "Ask for a pilot" stays on screen, so the stage drops its
     copy, and the notes under the counters and strip, to give the map room. The
     same facts are in the table below and in the text alternatives. */
  .is-playing .pitch .btn,
  .is-playing .counter small,
  .is-playing .strip .note {
    display: none;
  }

  .pitch .lede {
    margin: 8px 0 16px;
  }

  .stage {
    gap: 12px;
    padding-top: 12px;
  }

  .counters {
    gap: 12px 16px;
  }

  .counter dt,
  .counter small {
    font-size: 11px;
    line-height: 14px;
  }

  .counter dt {
    margin-bottom: 4px;
  }

  .digits {
    gap: 2px;
    font-size: 26px;
  }

  .caption {
    min-height: 70px;
    margin-bottom: 0;
    font-size: 16px;
  }
}

/* A short window: the same stage, tighter, so the caption and strip still fit. */
@media (max-height: 800px) {
  .stage {
    gap: 8px;
    padding-top: 16px;
  }

  .pitch h1 {
    font-size: clamp(30px, 3.4vw, 46px);
  }

  .pitch .lede {
    margin: 12px 0 16px;
    font-size: 16px;
    line-height: 24px;
  }

  .digits {
    font-size: clamp(26px, 2.5vw, 38px);
  }

  .counters {
    gap: 10px 24px;
    margin-top: 16px;
    padding-top: 14px;
  }

  .caption {
    min-height: 56px;
    font-size: 18px;
  }
}

@media (max-height: 800px) and (max-width: 900px) {
  .pitch h1 {
    font-size: 26px;
  }

  .caption {
    min-height: 66px;
    font-size: 15px;
    line-height: 1.35;
  }
}

/* A small, short phone: drop the notes; the table below carries the same facts. */
@media (max-height: 760px) and (max-width: 900px) {
  .counter small,
  .strip .note {
    display: none;
  }

  .stage {
    gap: 6px;
  }

  .pitch .lede {
    margin: 6px 0 10px;
    font-size: 14px;
    line-height: 20px;
  }
}
