/* =====================================================================
   Hero — the band at the top of the home page
   ---------------------------------------------------------------------
   Three layouts, chosen by home.layout in site.config.mjs:
     none    text only
     behind  the image behind the text, darkened
     beside  the image beside the text
   ===================================================================== */

.hero-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 84px 24px 72px;
  max-width: 1120px;
}

/* ---------------------------------------------------------------------
   The image
   --------------------------------------------------------------------- */

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* With the image behind the text, it needs darkening so the words stay
   readable over any part of it. */
.hero-band-behind .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(8, 10, 14, 0.94) 0%,
    rgba(8, 10, 14, 0.82) 42%,
    rgba(8, 10, 14, 0.45) 100%
  );
}

/* ---------------------------------------------------------------------
   The text
   --------------------------------------------------------------------- */

/* With an image behind it, the hero sits on a dark picture whatever the
   colour scheme is, so the text is always light. Using --text here would
   give near-black text in light mode, on a dark image. */
.hero-band-behind .hero-headline,
.hero-band-beside .hero-headline {
  color: #f2f4f8;
}

.hero-band-behind .hero-subhead { color: #c3c9d4; }
.hero-band-behind .hero-stats { color: #98a0ad; }

.hero-band-beside .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0.1), rgba(8, 10, 14, 0.45));
}

.hero-headline {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5.6vw, 3.4rem);
  line-height: 1.06;
  letter-spacing: -.04em;
  font-weight: 850;
  max-width: 17ch;
}

.hero-subhead {
  margin: 0 0 28px;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 52ch;
}

.hero-actions {  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------
   Beside — the image sits to the right
   --------------------------------------------------------------------- */

.hero-band-beside .hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.hero-band-beside .hero-media {
  position: relative;
  inset: auto;
  height: 100%;
  min-height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-band-beside .hero-media img {
  position: absolute;
  inset: 0;
}

/* ---------------------------------------------------------------------
   None — a plain text hero
   --------------------------------------------------------------------- */

.hero-band-none {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

/* ---------------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------------- */

@media (max-width: 860px) {
  .hero-inner { padding: 56px 20px 48px; }

  .hero-band-beside .hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-band-beside .hero-media {
    min-height: 260px;
    order: -1;
  }

  /* Over a small screen the image is mostly cropped, so it needs a
     stronger wash or the words sit on a busy part of it. */
  .hero-band-behind .hero-media::after {
    background: linear-gradient(
      180deg,
      rgba(8, 10, 14, 0.8) 0%,
      rgba(8, 10, 14, 0.9) 60%,
      rgba(8, 10, 14, 0.95) 100%
    );
  }
}
