.hero {
  position: relative;
  height: calc(100vh - var(--nav-h) - var(--footer-h));
  margin-top: var(--nav-h);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__text-wrap {
  font-size: inherit;
  font-weight: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
}

/* --word-w / --word-h come from the word's SVG viewBox (set inline per page).
   --word-scale widens the box for longer words so the letter height matches BUILT,
   but never past the nav's content edges (--hero-max). */
.hero__more-container {
  --hero-image-opacity: 0.6; /* photos inside the letters; the outline stays at full strength */
  --hero-outline-width: 2; /* letter outline thickness in px */
  --word-scale: calc((var(--word-w) / var(--word-h)) / (614 / 186));
  --hero-max: calc(100vw * (1440 - 2 * 200) / 1440);
  position: relative;
  display: block;
  width: min(
    calc(846 / 1440 * 100vw * 0.85 * var(--word-scale)),
    calc((100vh - var(--nav-h) - var(--footer-h) - 60px) * 846 / 368 * var(--word-scale)),
    var(--hero-max)
  );
  aspect-ratio: var(--word-w) / var(--word-h);
  margin-bottom: 8px;
  flex-shrink: 0;
}

.hero__word {
  display: none;
}

#heroCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: grayscale(1);
}

.hero__subtitle {
  display: block;
  font-size: clamp(18px, 2.2vw, 32px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Fitted subtitle: one line whose font size hero.js sets to match the word's width */
.hero__subtitle--fit {
  width: max-content;
  white-space: nowrap;
}

/* Below 900px the nav switches to 24px side padding */
@media (max-width: 900px) {
  .hero__more-container {
    --hero-max: calc(100vw - 48px);
  }
}

@media (max-width: 768px) {
  .hero {
    align-items: flex-start;
  }

  .hero__text-wrap {
    position: relative;
    left: auto;
    top: auto;
    right: auto;
    width: 100%;
    padding: 15vh 24px 0;
  }

  .hero__more-container {
    width: 100%;
  }

  .hero__subtitle {
    font-size: 20px;
  }
}
