/* The hero: the headline and the launcher's view on one character grid,
   with the sky the flock crosses drawn behind both.
   @decision(DL-004) @decision(DL-006) */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(3 * var(--rh));
  padding-bottom: calc(1 * var(--rh));
}
.sky {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  pointer-events: none;
  user-select: none;
  font-family: var(--mono);
  font-size: var(--cell-fs);
  line-height: var(--rh);
  white-space: pre;
  font-kerning: none;
  font-variant-ligatures: none;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: calc(50 * var(--cw)) calc(8 * var(--cw)) calc(54 * var(--cw));
  align-items: center;
  padding-top: calc(1 * var(--rh));
  padding-bottom: calc(2 * var(--rh));
}
.hero-text { grid-column: 1; }
/* The view never changes size: 54 by 25 cells, or 39 by 32 on phones.
   The script reads the layout from --view. */
.view-slot {
  grid-column: 3;
  position: relative;
  width: calc(54 * var(--cw));
  height: calc(25 * var(--rh));
  margin-top: calc(3 * var(--rh));
  --view: wide;
}

/* The headline is set on the grid at double size, two cells by two
   rows a character, as a VT100 sets a double-width, double-height line. */
h1 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: calc(2 * var(--cell-fs));
  line-height: calc(2 * var(--rh));
  letter-spacing: 0;
  font-kerning: none;
  text-wrap: balance;
}
/* The headline breaks only between these phrases: three lines on a
   desktop and a phone, two in between, and never a word alone. */
h1 .nb { white-space: nowrap; }
.lede {
  margin-top: calc(1 * var(--rh));
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 34em;
}
.lede + .lede { margin-top: 0.6em; color: var(--soft); }
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 12px;
  margin-top: calc(1.5 * var(--rh));
}

/* The still frame: what a reader without scripts sees, one per layout.
   Once the script runs, the sky draws the view and the still is hidden. */
.still {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--cell-fs);
  line-height: var(--rh);
  white-space: pre;
  overflow: hidden;
  color: var(--bird);
  font-kerning: none;
  font-variant-ligatures: none;
}
.still-narrow { display: none; }
.hero-live .still { visibility: hidden; }

/* The pause control: shown while motion runs, hidden with reduced motion. */
.motion {
  position: absolute;
  right: 0;
  bottom: calc(-1.5 * var(--rh));
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--soft);
  font: 400 0.8125rem/1.4 var(--sans);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
  cursor: pointer;
  display: none;
}
.hero-live .motion { display: block; }
.motion:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .hero-live .motion { display: none; } }

/* Painted cells */
.k1 { color: var(--bird); }
.k2 { color: var(--flock); }
.k3 { color: var(--earth); }
.k4 { color: var(--ink); font-weight: 700; }
.k5 { color: var(--olive-b); }
.k6 { color: var(--gold-t); }
.k7 { color: var(--faint); }
.k8 { color: var(--soft); }
.k9 { color: var(--ink); }
.k11 { color: var(--paper); }
.k12 { color: var(--rust); }
.k13 { color: var(--rule); }
.k14 { color: var(--raised); }
/* Cell backgrounds, for the TUI's panels. A row is the face's own
   content box, so an inline background fills it with no seam. */
.b1 { background: var(--raised); }
.b2 { background: var(--tui-del); }
.b3 { background: var(--tui-add); }
.b4 { background: var(--rule); }
.b5 { background: var(--rule-2); }

@media (max-width: 1139px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-text { max-width: calc(64 * var(--cw)); }
  .view-slot { grid-column: 1; margin-top: calc(3 * var(--rh)); }
}
@media (max-width: 639px) {
  .view-slot {
    --view: narrow;
    width: calc(39 * var(--cw));
    height: calc(32 * var(--rh));
    margin-top: calc(3 * var(--rh));
  }
  .still-wide { display: none; }
  .still-narrow { display: block; }
  .lede { font-size: 1.0625rem; }
}

/* The 404 page shows the curlew on its ground alone, so its view is
   only as tall as the drawing. */
.hero-still .view-slot { height: calc(25 * var(--rh)); }
