/* The hero: the headline, the subtitle, the one accented word, the thin outline on
 * both, and the feathered dark ground under the headline. Every colour is a token from
 * tokens.css, copied from holding-site; this file writes no colour value of its own.
 *
 * THE OUTLINE IS ONE TECHNIQUE, USED TWICE. A text stroke painted UNDER the fill
 * (paint-order: stroke fill), so only the outer half of the stroke shows and the letter
 * shapes do not get any heavier. The same two custom properties drive both the headline
 * and "ecosystem"; only the width scales with each one's own size, with a floor so the
 * smaller word still carries a visible line.
 *
 * THE SOURCE PALETTE HAS NO TRUE BLACK. The outline is --surface-ground (#0a0e1a), the
 * darkest opaque value the palette holds; --scrim-1 is the same colour at .97 and
 * --rim-edge is lighter and bluer. No new colour is added for it.
 *
 * THE GREEN ON "ecosystem" IS --blend-sage, a banner-site blend declared in tokens.css
 * with the reasoning for it. It is mint by the owner's choice: it keeps the green and
 * gives up some of the wireframe's lightness, mixing to oklab L 0.74 and chroma 0.069
 * against the wireframe's L 0.89 and 0.086, because no blend of this palette holds that
 * much chroma that light.
 *
 * THE HERO'S PLACE IS ITS OWN. It is centred between the header and the foot, and it is
 * lifted by a bottom padding written here as a fixed figure; it reads nothing from
 * header.css. A taller or shorter header still moves it, by half the change, because
 * that is what centring in the space left over does. */

.hero {
  --hero-outline-color: var(--surface-ground);
  --hero-outline-width: max(1.6px, .026em);
  /* The lift: how much further the bottom padding runs than the top. */
  --hero-lift: clamp(1rem, min(13.6vh, 7vw), 8rem);
  position: relative;
  padding: clamp(1.5rem, 6vh, 4rem) 1rem;
  /* LIFTED ONTO THE WIREFRAME'S ROWS. The hero is centred in the space between the
     header and the foot, which left the headline about 55px below the wireframe's rows
     at the reference size, on the big wheel's hub. The extra bottom padding moves it up
     by half of --hero-lift: about 61px at 1737x905, which lands the headline's glyphs
     on the wireframe's rows, and about 12px on a phone, where 7vw sets the lift. The
     figure is this file's own and does not follow the header. */
  padding-bottom: calc(clamp(1.5rem, 6vh, 4rem) + var(--hero-lift));
  text-align: center;
}

.hero__title,
.hero__accent {
  -webkit-text-stroke: var(--hero-outline-width) var(--hero-outline-color);
  paint-order: stroke fill;
}

.hero__title {
  position: relative;
  isolation: isolate;
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: min(8.4vw, 6.6rem, max(5.6vw + .55rem, 2.05rem));
  line-height: 1.08;
  letter-spacing: -.018em;
  white-space: nowrap;
  color: var(--text-primary);
}

/* THE FEATHERED DARK SPACE. A separate treatment from the outline: an ellipse of the
   page's own ground that is densest just above and below the line and fades to nothing
   well before its edge, so it quiets the linework behind the words without becoming a
   bar or blanking the drawing. It sits behind the text inside the headline's own
   stacking context and takes no pointer events. */
.hero__title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.42em -.32em;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--scrim-2) 0%, var(--scrim-2) 30%, var(--scrim-3) 100%);
  opacity: .72;
}

/* THE PAGE'S POINTER LIGHT LIES OVER THIS GROUND, as holding-site's lies over its scrim.
   This ground is the one the light is restored over, and this layer is the one that
   restores it. The ground above sits in the page, over the backdrop, so on its own it
   would hide the light exactly where the headline stands. This layer paints --sheen-over
   -- the light's own gradient (pointer-light.css), fixed to the viewport so it lines up
   with the backdrop's copy -- over the ground and under the words, masked by the
   ground's own gradient and held at the ground's own .72, so the light is put back
   exactly as strongly as the ground took it away and has no edge of its own.
   IT FADES IN WITH THE BACKDROP'S LIGHT. --sheen-over is unset (none) until the root is
   marked [data-lit], and a background image cannot transition, so the layer's opacity
   carries the fade: 0 until the mark, then .72, on the backdrop light's own 620ms curve,
   so the copy over the headline arrives with the light around it and not ahead of it. */
.hero__title::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -.42em -.32em;
  pointer-events: none;
  background-image: var(--sheen-over, none);
  background-attachment: fixed;
  -webkit-mask-image: radial-gradient(closest-side, var(--scrim-2) 0%, var(--scrim-2) 30%, var(--scrim-3) 100%);
  mask-image: radial-gradient(closest-side, var(--scrim-2) 0%, var(--scrim-2) 30%, var(--scrim-3) 100%);
  opacity: 0;
  transition: opacity 620ms cubic-bezier(.16,1,.3,1);
}
[data-lit] .hero__title::after { opacity: .72; }

.hero__lede {
  margin: clamp(.7rem, 2.2vh, 1.4rem) auto 0;
  max-width: 26em;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1rem, .7rem + 1vw, 1.85rem);
  line-height: 1.45;
  color: var(--text-primary);
  text-wrap: balance;
  /* A SHADOW CAST AWAY FROM THE DRAWING'S LIGHT. The light in the drawing is the middle
     wheel's hub, the lit node and the small wheel, all above and to the right of the
     subtitle: at 1737x905 they stand at 52, 35 and 37 degrees above the horizontal from
     its middle, and between 17 and 53 degrees at every size checked. The shadow falls the
     other way, down and to the left at about 41 degrees, a twentieth of an em out and a
     tenth of an em soft, in the page's own ground at 60 percent: enough to set each
     letter off the faded linework behind it, never a halo and never a raised look. The
     drawing's quiet zone behind the subtitle is artwork.js's (quiet()). */
  --lede-shadow: color-mix(in oklab, var(--surface-ground) 60%, transparent);
  text-shadow: -.045em .04em .1em var(--lede-shadow);
}

.hero__accent { color: var(--text-primary); }

@supports (color: color-mix(in oklab, red, blue)) {
  .hero__accent { color: var(--blend-sage); }
  /* "your" in the headline: the same mint hue as "ecosystem", a little darker, by the
     owner's ruling. It sits inside the headline, so it takes the headline's outline too. */
  .hero__accent--deep { color: var(--blend-sage-deep); }
}

/* "ecosystem" in the subtitle is violet by the owner's ruling ("ecosystem should just be a
   purple of some sort"): the palette's own --accent-text, the violet of the artwork's fine
   work. "you" beside it takes "your"'s darker mint. */
.hero__accent--violet { color: var(--accent-text); }
