/* =============================================================================
   LocalSwarm.ai · 1 · Hero  (task: hero · prefix: hero-)
   Builds on base.css: .section--ink, .bp-grid--dark, .bp-glow, .chip, .blueprint-text,
   .btn, .text-link, .ticker, .model-code and @keyframes fadeUp.
   Everything invented here is hero-*; base classes are only re-tuned inside .hero.
   ============================================================================= */

/* ---------- Shell: one full-height drawing sheet on the drafting table ---------- */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(100vh, 1160px);            /* capped so portrait monitors and full-page captures stay sane */
  padding: calc(var(--header-h) + clamp(32px, 6vh, 72px)) 0 clamp(48px, 7vh, 96px);
  isolation: isolate;
}
@supports (min-height: 100svh) {
  .hero { min-height: min(100svh, 1160px); }
}
.hero > .bp-glow { top: var(--header-h); }   /* the light source starts under the fixed header, not behind it */

/* ---------- Ambient swarm (canvas drawn by hero.js, desktop only) ---------- */
.hero-swarm {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.8s var(--ease-out) .9s;
}
.hero-swarm--on { opacity: 1; }
.hero--still .hero-swarm { opacity: 0; transition: opacity .4s ease 0s; }

/* ---------- Drawing-sheet furniture (decorative, ≥1024px) ---------- */
.hero-sheet {
  position: absolute;
  z-index: 0;
  top: calc(var(--header-h) + 14px);         /* 124 + 14 = 138 = 3 × 46: the frame's top edge sits on a grid line */
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: none;
  border: 1px solid rgba(255, 255, 255, .05);
  pointer-events: none;
  animation: hero-sheet-in 1.4s var(--ease-out) .5s both;
}
@keyframes hero-sheet-in { from { opacity: 0; } to { opacity: 1; } }

.hero-sheet-ruler {                           /* minor tick on every 46px grid column, major tick every 5 cells */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .2) 0 1px, transparent 1px 230px) 23px 0 / 100% 10px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .11) 0 1px, transparent 1px 46px) 23px 0 / 100% 5px no-repeat;
}
.hero-sheet-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid rgba(255, 255, 255, .3);
}
.hero-sheet-corner--tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.hero-sheet-corner--tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.hero-sheet-corner--bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.hero-sheet-corner--br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

.hero-tblock {                                /* the drawing's title block, bottom-right like every real sheet */
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 248px;
  display: none;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(11, 14, 26, .72);
  font: 600 10px/1 var(--f-label);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(200, 206, 223, .55);
}
.hero-tblock-row { display: flex; }
.hero-tblock-row + .hero-tblock-row { border-top: 1px solid rgba(255, 255, 255, .08); }
.hero-tblock-cell { flex: 1 1 auto; padding: 9px 12px; white-space: nowrap; }
.hero-tblock-cell + .hero-tblock-cell { border-left: 1px solid rgba(255, 255, 255, .08); }
.hero-tblock-cell--fit { flex: 0 0 auto; }
.hero-tblock-brand { font: 800 11px/1 var(--f-code); letter-spacing: .16em; color: rgba(255, 255, 255, .72); }
.hero-tblock-brand b { font-weight: 800; color: var(--cyan); }
.hero-tblock-swarm { color: var(--yellow); }
.hero-tblock .model-code { margin-left: 6px; font-size: 9px; letter-spacing: .22em; color: rgba(255, 255, 255, .62); }

@media (min-width: 1024px) { .hero-sheet { display: block; } }
@media (min-width: 1440px) { .hero-tblock { display: block; } }   /* only where it clears the 820px ticker */

/* ---------- Content column ---------- */
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Load sequence: chip → H1 → sub → CTA → ticker (fadeUp .6s, 0 / .15 / .3 / .45 / .6s) */
.hero-in { animation: fadeUp .6s var(--ease-out) both; }
.hero-in--2 { animation-delay: .15s; }
.hero-in--3 { animation-delay: .3s; }
.hero-in--4 { animation-delay: .45s; }
.hero-in--5 { animation-delay: .6s; }

.hero-chip { max-width: 100%; }
.hero--still .hero-chip::before { animation-play-state: paused; }

/* ---------- H1 ---------- */
.hero-title {
  max-width: 100%;
  margin: 28px 0 26px;
  font-family: var(--f-display);
  font-weight: 400;                           /* Anton ships one weight; bold would fake it */
  /* Always two lines, scaled to the screen. The longer line, "exclusive termite leads", measures 9.48em
     in Anton, so .095 x the content width keeps it at ~90% of the column on any phone or tablet. Capped at
     84px on wide screens and at 10.5vh on short ones; never below 24px. If a fallback font ever runs wider,
     a line wraps rather than overflowing. */
  font-size: clamp(24px, min(calc((100vw - 2 * var(--gutter)) * .095), 10.5vh), 84px);
  line-height: 1.04;
  letter-spacing: -.005em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.hero-title .blueprint-text { font-weight: 400; }
@media (min-width: 601px) {                    /* tablets and up: ~80% of the column, so the headline never crowds the edges */
  .hero-title { font-size: clamp(24px, min(calc((100vw - 2 * var(--gutter)) * .085), 10.5vh), 84px); }
}
.hero-line { display: block; text-wrap: balance; }   /* no nowrap: a line can only ever wrap, never overflow */

/* ---------- Sub ---------- */
.hero-sub {
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, .86);
  text-wrap: pretty;
}
.hero-sub strong { font-weight: 700; color: var(--on-dark); }

/* ---------- CTA group ---------- */
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 38px;
}
.hero-cta-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}
.hero-cta-down {
  display: inline-block;
  margin-left: 4px;
  transition: transform .2s var(--ease-out);
}
.hero-cta-link:hover .hero-cta-down,
.hero-cta-link:focus-visible .hero-cta-down { transform: translateY(3px); }
.hero-cta-rule {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, .16);
}
.hero-cta-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 13px/1.2 var(--f-label);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}
.hero-cta-hex {
  flex-shrink: 0;
  width: 12px;
  height: 14px;
  color: var(--yellow);
}

/* ---------- Ticker ---------- */
.hero-ticker-block {
  width: 100%;
  max-width: 820px;
  margin-top: clamp(40px, 6vh, 56px);
  text-align: left;
}
.hero-ticker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  margin-bottom: 12px;
}
.hero-ticker-label {
  font: 600 12px/1.3 var(--f-label);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}
.hero-ticker-label span { margin-left: 4px; color: var(--yellow); }

.hero-ticker-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  font: 600 11px/1 var(--f-label);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--on-dark-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: color .2s, box-shadow .2s;
}
.hero-ticker-toggle[hidden] { display: none; }
.hero-ticker-toggle:hover { color: var(--on-dark); box-shadow: inset 0 0 0 1px rgba(247, 198, 0, .55); }
.hero-ticker-toggle-icon {                     /* pause bars; becomes a play triangle when paused */
  flex-shrink: 0;
  width: 8px;
  height: 10px;
  background: linear-gradient(90deg, currentColor 0 3px, transparent 3px 5px, currentColor 5px);
}
.hero-ticker-toggle[data-state="paused"] .hero-ticker-toggle-icon {
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.hero-ticker { --ticker-edge: var(--ink); }
.hero-ticker-viewport { overflow: hidden; }
.hero-ticker-viewport:focus-visible { outline-offset: -2px; }
.hero-ticker .ticker__track { animation-duration: 72s; }   /* hero.js re-paces this to a steady reading speed */
.hero-ticker-list { display: flex; flex-shrink: 0; }
.hero-tick-icon { display: inline-block; margin-right: 2px; font-size: 14px; line-height: 1; }
.hero-tick-sep { margin: 0 2px; color: rgba(255, 255, 255, .24); }

.hero--offscreen .hero-ticker .ticker__track,
.hero--still .hero-ticker .ticker__track { animation-play-state: paused; }

/* ---------- ≤900px: stacked H1, no full-height lock, no canvas ---------- */
@media (max-width: 900px) {
  .hero {
    min-height: 0;
    padding: calc(var(--header-h) + 48px) 0 64px;
  }
  .hero-swarm { display: none; }
  .hero-title {
    margin: 24px 0 22px;
    line-height: 1.05;
  }
  .hero-sub { font-size: 17px; }
  .hero-ticker-block { margin-top: 48px; }
}

/* ---------- ≤600px ---------- */
@media (max-width: 600px) {
  .hero { padding: calc(var(--header-h) + 36px) 0 52px; }
  .hero .hero-chip {
    padding: 7px 14px;
    font-size: 12px;
    letter-spacing: .08em;
  }
  .hero-title { margin: 20px 0 18px; line-height: 1.06; }
  .hero-sub { font-size: 16.5px; line-height: 1.65; }
  .hero-cta { width: 100%; gap: 20px; margin-top: 30px; }
  .hero .hero-cta-btn {
    width: 100%;
    max-width: 420px;
    padding: 20px 22px;
    font-size: 18px;
    white-space: normal;
    text-align: center;
  }
  .hero-cta-meta { flex-direction: column; gap: 14px; }
  .hero-cta-rule { display: none; }
  .hero-cta-note { font-size: 12px; }
  .hero-ticker-block { margin-top: 44px; }
  .hero-ticker-label { font-size: 11px; letter-spacing: .16em; }
  .hero-ticker::before,
  .hero-ticker::after { width: 36px; }
  .hero-ticker .ticker__item { padding: 0 24px; font-size: 14px; }
}

/* ---------- Reduced motion: everything lands in place; the ticker becomes a still, scrollable strip ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-in,
  .hero-sheet { animation: none; }
  .hero-swarm,
  .hero-ticker-toggle { display: none; }
  .hero-ticker .ticker__track { animation: none; }
  .hero-ticker-list[aria-hidden="true"] { display: none; }
  .hero-ticker-viewport {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(247, 198, 0, .4) transparent;
  }
}

/* ---------- Forced colours: drop the graph-paper fill so the headline stays readable ---------- */
@media (forced-colors: active) {
  .hero .blueprint-text {
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
    background: none;
    -webkit-text-stroke: 0;
    filter: none;
    text-shadow: none;
  }
  .hero-swarm,
  .hero-sheet { display: none; }
}
