/* ═══════════════════════════════════════════════════════════
   HERO — a title block on a topographic sheet.

   The map is a WebGL canvas behind everything (terrain.js); the
   type sits on top and never depends on it. Then a ticker, and
   the figure parts that Fig. 02 in the research section reuses.
   ═══════════════════════════════════════════════════════════ */

.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + 8px);
  overflow: hidden;
}
.hero__map {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  opacity: 0; transition: opacity 1.6s var(--ease);
  touch-action: pan-y;
}
.hero__map.is-on { opacity: 1; }
.hero__wrap {
  display: flex; flex-direction: column;
  min-height: calc(100svh - var(--nav-h) - 8px);
}

.strip {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--s-3);
  padding: 16px 0; border-bottom: 1px solid var(--hair);
  color: var(--ink-3);
}
.strip__mid { text-align: center; }
.strip__end { justify-self: end; display: inline-flex; align-items: center; gap: 10px; }
@media (max-width: 900px) {
  .strip { grid-template-columns: 1fr auto; }
  .strip__mid { display: none; }
}
@media (max-width: 480px) {
  .strip > :first-child { display: none; }
  .strip { grid-template-columns: 1fr; }
  .strip__end { justify-self: start; }
}

/* ── the headline ───────────────────────────────────────── */
.hero__title {
  margin-top: auto;
  padding-top: clamp(40px, 7vh, 96px);
  font-size: var(--fs-hero);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: var(--track-display);
  color: var(--ink);
  font-feature-settings: 'ss01', 'kern';
}
/* the headline's box hugs its text */
.hero__title { width: fit-content; max-width: 100%; }
.hero__title .line { display: block; width: fit-content; overflow: hidden; padding-bottom: 0.07em; margin-bottom: -0.07em; }
.hero__title .line > span { display: block; }

/* transform only: the headline is the LCP element */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__title .line > span { animation: rise 1.1s var(--ease) both; }
  .js .hero__title .line:nth-child(3) > span { animation-delay: 0.08s; }
}
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }

.hero__sub {
  margin-top: clamp(14px, 1.6vw, 24px);
  font-size: var(--fs-sub);
  font-weight: 500; line-height: 0.98;
  letter-spacing: var(--track-tight);
  color: var(--ink);
  max-width: 27ch;
}
/* the sub line streams in word by word; each word is a span made by hero.js */
.hero__sub .tok { display: inline-block; white-space: pre; }
@media (prefers-reduced-motion: no-preference) {
  .hero__sub .tok { animation: tok 0.5s var(--ease) both; animation-delay: calc(var(--n) * 38ms + 0.45s); }
}
@keyframes tok { from { opacity: 0; filter: blur(6px); transform: translateY(0.12em); } to { opacity: 1; filter: none; transform: none; } }
.caret {
  display: inline-block; width: 0.06em; height: 0.9em; margin-left: 0.08em;
  background: var(--accent); vertical-align: -0.08em;
}
@media (prefers-reduced-motion: no-preference) { .caret { animation: blink 1.1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }

.hero__notes { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: var(--s-4); color: var(--ink-3); }
.sq { display: inline-block; width: 6px; height: 6px; border: 1px solid var(--accent); }
.hero__notes li { display: inline-flex; align-items: center; gap: 10px; }
/* written in capitals at the source so φ can stay a lowercase phi */
.hero__read { font-variant-numeric: tabular-nums; text-transform: none; }
.mass { text-transform: none; }
html:not(.js) .hero__read { display: none; }

.hero__foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  margin-top: clamp(28px, 4vh, 56px);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--hair);
}
.hero__lede { font-size: var(--fs-lede); color: var(--ink-3); max-width: 30ch; line-height: 1.35; letter-spacing: -0.015em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 560px) {
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 auto; }
}

/* ── the compile intro ──────────────────────────────────────
   Once per session: blueprint boxes are drawn around the hero's
   parts, labelled with their size, then lifted away. Built by
   hero.js; it is an overlay, so nothing under it moves or fades. */
.compile { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.compile__box {
  position: absolute;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  animation: compile-box 1.9s var(--ease) both;
}
.compile__box::before {
  content: attr(data-label);
  position: absolute; left: -1px; bottom: 100%;
  padding: 2px 6px; background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.04em; white-space: nowrap;
}
.compile__rule { position: absolute; background: var(--accent-line); animation: compile-rule 1.9s var(--ease) both; }
.compile__rule--h { left: 0; right: 0; height: 1px; transform-origin: left; }
.compile__rule--v { top: 0; bottom: 0; width: 1px; transform-origin: top; }
@keyframes compile-box {
  0% { clip-path: inset(0 100% 100% 0); opacity: 1; }
  35% { clip-path: inset(0 0 0 0); opacity: 1; }
  70% { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 0; }
}
@keyframes compile-rule {
  0% { transform: scale(0); opacity: 1; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ── the ticker ─────────────────────────────────────────── */
.ticker {
  overflow: hidden; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track { display: flex; width: max-content; padding: 16px 0; color: var(--ink-3); }
.ticker__track span { display: inline-flex; align-items: center; gap: 48px; padding-right: 48px; white-space: nowrap; }
.ticker__track span::after { content: ''; width: 5px; height: 5px; background: var(--accent); transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .ticker__track { animation: marquee 48s linear infinite; }
  .ticker:hover .ticker__track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* corner registration ticks, on any framed figure */
.tick { position: absolute; width: 10px; height: 10px; pointer-events: none; z-index: 2; }
.tick::before, .tick::after { content: ''; position: absolute; background: var(--ink-3); }
.tick::before { width: 10px; height: 1px; }
.tick::after { width: 1px; height: 10px; }
.tick--tl { top: 6px; left: 6px; }
.tick--tr { top: 6px; right: 6px; } .tick--tr::before { right: 0; } .tick--tr::after { right: 0; }
.tick--bl { bottom: 6px; left: 6px; } .tick--bl::before { bottom: 0; } .tick--bl::after { bottom: 0; }
.tick--br { bottom: 6px; right: 6px; } .tick--br::before { right: 0; bottom: 0; } .tick--br::after { right: 0; bottom: 0; }

/* a mass dropped on the field: a crosshair and its label */
.mass {
  position: absolute; z-index: 1; pointer-events: none;
  width: 0; height: 0;
  color: var(--accent);
  transition: opacity 0.3s linear;
}
.mass i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; }
.mass i::before, .mass i::after { content: ''; position: absolute; background: currentColor; }
.mass i::before { left: 0; right: 0; top: 50%; height: 1px; }
.mass i::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.mass b {
  position: absolute; left: 14px; top: -22px; white-space: nowrap;
  font-weight: 400; color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .mass i { animation: mass-in 0.6s var(--ease) both; }
}
@keyframes mass-in { from { transform: scale(2.4) rotate(45deg); opacity: 0; } to { transform: none; opacity: 1; } }
