/* Dyshell homepage hero (docs/docs-plan-overhaul-dec1.md 2.7, 3.7; docs/docs-plan-revision-dec2.md 1.1 to 1.3).
   Headline, one line on what we do and Get a quote on the left; the star in its ring of panels on the right (canvas:
   js/swarm.js mounted by js/hero.js); a halftone statue head bottom left and a planet limb bottom right (1-bit masks
   tinted with the art tones). Without JS or with reduced motion the still image shows. The hero starts under the
   transparent nav, so the art runs behind it. hero.js sets --p (0 to 1, how far the hero has scrolled out) on
   .hero-art: the art drifts up and dims with it. */

.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: start; background: var(--ink);
  min-height: max(40rem, min(100svh, 62rem)); margin-top: calc(var(--header-h) * -1);
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  --statue-c: var(--tone-2b); --planet-c: var(--tone-2);
  --art: url("../img/art-dark.webp"); --statue: url("../img/hero-statue.png"); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero { --statue-c: var(--tone-3); --art: url("../img/art-light.webp"); --statue: url("../img/hero-statue-ink.png"); }
}
:root[data-theme="light"] .hero { --statue-c: var(--tone-3); --art: url("../img/art-light.webp"); --statue: url("../img/hero-statue-ink.png"); }

/* ---------- Art layers ---------- */
.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateY(calc(var(--p, 0) * -6%)); }
.hero-art > * { position: absolute; display: block; }
/* The still: the canvas captured with the same layout (star at 70% / 43% on wide screens), so it lines up under cover */
.hero-still { inset: 0; background: var(--art) 70% 43% / cover no-repeat; }
.hero-canvas { inset: 0; width: 100%; height: 100%; display: none; }
.hero[data-live] .hero-canvas { display: block; }
.hero[data-live] .hero-still { visibility: hidden; }
/* Planet limb, bottom right: a 1-bit mask (2000 x 900, shown at 1000 x 450 CSS px on wide screens) */
.hero-planet { right: -4%; bottom: 0; width: min(62%, 62rem); aspect-ratio: 20 / 9; background: var(--planet-c);
  -webkit-mask: url("../img/hero-planet.png") right bottom / contain no-repeat; mask: url("../img/hero-planet.png") right bottom / contain no-repeat; }
/* Statue head, bottom left, cut by the frame. Two masks: lit planes on the dark ground, the ink file on the light ground */
.hero-statue { left: -2%; bottom: 0; height: 34%; aspect-ratio: 1549 / 1100; background: var(--statue-c);
  -webkit-mask: var(--statue) left bottom / contain no-repeat; mask: var(--statue) left bottom / contain no-repeat; }
/* the statue and the planet dim with the ring as the hero scrolls out */
.hero-planet, .hero-statue { opacity: calc(1 - var(--p, 0) * .35); }
/* A soft pool of ground behind the copy so the headline never sits on art */
.hero-in::before { content: ""; position: absolute; z-index: -1; inset: 0 auto auto 0; width: min(46rem, 80%); height: 70%; pointer-events: none;
  background: radial-gradient(60% 55% at 30% 45%, color-mix(in srgb, var(--ink) 70%, transparent), transparent 72%); }
/* The art settles into the page at the bottom edge instead of stopping on a line */
.hero-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: clamp(4rem, 14svh, 9rem); pointer-events: none;
  background: linear-gradient(transparent, color-mix(in srgb, var(--ink) 85%, transparent) 75%, var(--ink)); }

/* ---------- Copy ---------- */
.hero-in { position: relative; width: 100%; padding-top: clamp(3rem, 12svh, 9rem); }
.hero-copy { display: grid; justify-items: start; max-width: 40rem; }
.hero-lede { margin: var(--s-5) 0 var(--s-6); max-width: min(26rem, 44vw); }
.hero h1 { font-size: clamp(2.75rem, 1.2rem + 5.2vw, 5.75rem); line-height: .98; letter-spacing: -.045em; max-width: 11ch; }
.hero h1 span { display: block; }
/* The headline comes in once, softly (no JS needed) */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 span, .hero-lede, .hero-cta { animation: hero-in var(--t-slow) var(--ease) both; }
  .hero h1 span:nth-child(2) { animation-delay: 60ms; } .hero h1 span:nth-child(3) { animation-delay: 120ms; }
  .hero-lede { animation-delay: 180ms; } .hero-cta { animation-delay: 240ms; }
}
@keyframes hero-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Phones: copy on top, the ring below it ---------- */
@media (max-width: 49.99rem) {
  /* tall enough that the statue sits below the ring (its top under the ring's lowest panels) */
  .hero { min-height: max(44rem, 100svh, calc(40rem + 80vw)); --art: url("../img/art-phone-dark.webp"); }
  :root[data-theme="light"] .hero { --art: url("../img/art-phone-light.webp"); }
  .hero-still { background-position: 50% 58.5%; }
  .hero-statue { height: 30%; left: -10%; }
  .hero-planet { display: none; }
  .hero-in { padding-top: clamp(2rem, 8svh, 4rem); }
  .hero-in::before { width: 100%; height: 55%; }
  .hero-lede { max-width: 34rem; }
}
@media (max-width: 49.99rem) and (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hero { --art: url("../img/art-phone-light.webp"); } }
@media (forced-colors: active) { .hero-art { display: none; } }
