.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-top: 12vh;
  padding-bottom: var(--sp-9);
  overflow: hidden;
  isolation: isolate;
  background: var(--c-field);
  color: var(--c-text); /* dark window in both themes: roles re-declared in tokens.css */
  touch-action: pan-y; /* the finger pulls the dots sideways; vertical drags stay the page's scroll */
}

/* The planet (plan 31, Р6 — Paul's choice Q-7 «а»): hero-planet.js draws it in WebGL; weak phones and reduced
   motion get the still with SVG bolts instead (main.js sets data-mode="quiet" / "still" on .hero). Wherever it is
   drawn — right of the text on a wide screen, above it on a portrait one (hero-geometry.js) — the glow, the mask and
   the halo follow it through --px / --py. --travel (0..1, WebGL only) opens the mask as the planet travels to the mark
   in the header, so it does not fade out on the way. */
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at var(--px, 50%) var(--py, 48%),
    rgba(115, 0, 139, 0.50) 0%,
    rgba(115, 0, 139, 0.26) 22%,
    rgba(115, 0, 139, 0.10) 40%,
    transparent 60%);
  -webkit-mask-image: radial-gradient(circle at var(--px, 50%) var(--py, 48%),
    #000 0%, #000 calc(38% + var(--travel, 0) * 140%), transparent calc(64% + var(--travel, 0) * 140%));
  mask-image: radial-gradient(circle at var(--px, 50%) var(--py, 48%),
    #000 0%, #000 calc(38% + var(--travel, 0) * 140%), transparent calc(64% + var(--travel, 0) * 140%));
}

.hero__canvas canvas { width: 100% !important; height: 100% !important; display: block; }

/* The still: one frame of the same WebGL planet with the field and this glow baked in (www-lab/hero-still.py), a
   1400 px square with the mark at ±630 px whose edge is the field colour — no blending, so no edge of the square
   shows on any renderer (plan 31 audit §8). The canvas's own glow and mask step aside for it. main.js sets its place
   and size (--still-cx, --still-cy, --still-size) from hero-geometry.js. The image is lazy: outside these modes
   (display: none) it is never fetched. */
.hero__poster,
.hero__lightning { display: none; }
.hero[data-mode] .hero__poster,
.hero[data-mode] .hero__lightning { display: block; }
.hero[data-mode] .hero__canvas { background: none; -webkit-mask-image: none; mask-image: none; }
.hero__poster img,
.hero__lightning {
  position: absolute;
  left: var(--still-cx, 50%);
  top: var(--still-cy, 50%);
  width: var(--still-size, 100svh);
  height: var(--still-size, 100svh);
  max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* The bolts of В3: four small SVGs pinned at the core and turned by --a, as long as the WebGL bolts. Each grows out
   of the core and fades (transform and opacity only, every few seconds); under reduced motion they rest, dim. */
.hero__bolt-defs { position: absolute; }
.hero__bolt {
  position: absolute;
  left: 50%;
  top: calc(50% - 3.5714%); /* viewBox 320 × 100 of the 1400 square: half its height above the core */
  width: 22.857%;
  height: 7.1429%;
  overflow: visible;
  transform-origin: 0 50%;
  transform: rotate(var(--a, 0deg));
  opacity: 0.4;
}
.hero__bolt path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hero[data-mode="quiet"] .hero__bolt {
  opacity: 0;
  animation: heroBolt var(--d, 6s) var(--ease-out-expo) var(--delay, 0s) infinite;
}
@keyframes heroBolt {
  0%   { opacity: 0; transform: rotate(var(--a, 0deg)) scaleX(0.7); }
  5%   { opacity: 1; transform: rotate(var(--a, 0deg)) scaleX(1); }
  16%  { opacity: 0; transform: rotate(var(--a, 0deg)) scaleX(1.08); }
  100% { opacity: 0; transform: rotate(var(--a, 0deg)) scaleX(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .hero[data-mode] .hero__bolt { animation: none; opacity: 0.4; }
}

/* Halo behind the planet: fades in once and rests (the 5 s pulse is gone — a slow endless loop, plan 31 audit §7). */
.hero__planet {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: calc(1 - var(--travel, 0)); /* leaves with the planet (hero-planet.js) */
}

.hero__planet-halo {
  position: absolute;
  left: var(--px, 50%);
  top: var(--py, 50%);
  width: clamp(420px, 70vw, 980px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background:
    radial-gradient(circle, rgba(244, 222, 248, 0.18) 0%, rgba(196, 0, 173, 0.18) 25%, rgba(115, 0, 139, 0.08) 55%, transparent 72%);
  filter: blur(8px);
  opacity: 0;
  animation: heroPlanetHaloIn 2400ms var(--ease-out-expo) 100ms forwards;
}

@keyframes heroPlanetHaloIn {
  from { opacity: 0; }
  to   { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__planet-halo { animation: none; opacity: 0.9; }
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--sp-7);
}

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
}

.hero__title {
  font-size: var(--fs-900);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 144, "SOFT" 50, "wght" 400;
  margin-bottom: var(--sp-5);
}

/* "matter." — one solid colour (audit §2: 6.05:1 to the field), not a gradient. */
.hero__title .matter {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 400;
  color: var(--c-accent);
  padding-right: 0.05em;
}

.hero__subhead {
  font-size: var(--fs-500);
  color: var(--c-text-2);
  max-width: 38ch;
  line-height: var(--lh-snug);
  letter-spacing: -0.005em;
  margin-bottom: var(--sp-6);
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
}

.hero__meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-200);
  color: var(--c-muted);
  text-align: right;
  align-self: end;
}

.hero__meta strong { color: var(--c-text); font-weight: 500; }

@media (max-width: 720px) {
  .hero__meta { display: none; }
}
