/** Homepage hero with viewport-aware height, fluid content spacing, and an optional slider. */
.hero {
  --hero-min-height: max(38rem, calc(100svh - 6.5rem));
  --hero-fade: 600ms ease;

  position: relative;
  display: flex;
  min-height: var(--hero-min-height);
  overflow: hidden;
  background: var(--color-ink);
  color: var(--color-white);
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% center;
  opacity: 0.9;
}

.hero::after,
.hero-slide::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 15, 27, 0.05) 20%, rgba(4, 15, 27, 0.9) 76%, rgba(4, 15, 27, 0.98));
  content: '';
}

.hero-inner { position: relative; z-index: 1; display: flex; align-items: flex-end; }
.hero-copy { width: min(100%, 33.125rem); padding-block: clamp(10rem, 32vh, 14.375rem) clamp(3.5rem, 8vh, 5.5rem); }
.hero-title { font-size: clamp(2.75rem, 1.85rem + 4.5vw, 6.8rem); letter-spacing: -0.055em; }
.hero p { max-width: 46ch; margin: var(--space-5) 0 var(--space-6); color: rgba(255, 255, 255, 0.82); font-size: clamp(1rem, 0.97rem + 0.15vw, 1.05rem); }

/* Custom heroes: every slide stacks in one grid cell, so the tallest slide sets the height. */
.hero--custom { display: block; }
.hero--custom::after { content: none; }
.hero-slides { display: grid; }
.hero-slide { position: relative; display: flex; grid-area: 1 / 1; min-height: var(--hero-min-height); overflow: hidden; }
.hero-slide::after { z-index: 0; }

.hero--slider .hero-slide { opacity: 0; visibility: hidden; transition: opacity var(--hero-fade), visibility 0s linear 600ms; }
.hero--slider .hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity var(--hero-fade); }
/* Leave room under the copy for the slider controls on phones. */
.hero--slider .hero-copy { padding-block-end: calc(clamp(3.5rem, 8vh, 5.5rem) + var(--tap-target)); }

.hero-controls {
  position: absolute;
  inset-block-end: calc(var(--space-4) + env(safe-area-inset-bottom));
  inset-inline: var(--page-gutter);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.hero-control {
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-round);
  background: rgba(4, 15, 27, 0.4);
  color: var(--color-white);
  cursor: pointer;
  transition: background-color var(--motion-fast), border-color var(--motion-fast);
}

.hero-control:hover { border-color: var(--color-white); background: rgba(4, 15, 27, 0.7); }
.hero-control .icon { width: 1.125rem; height: 1.125rem; }
.hero-control .hero-icon-play,
.hero-control[data-playing='false'] .hero-icon-pause { display: none; }
.hero-control[data-playing='false'] .hero-icon-play { display: block; }

.hero-dots { display: flex; align-items: center; }

.hero-dot {
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* The current dot stretches into a pill, so state is shown by shape as well as fill. */
.hero-dot::before {
  width: 0.625rem;
  height: 0.625rem;
  border: 0.125rem solid var(--color-white);
  border-radius: var(--radius-round);
  content: '';
  transition: width var(--motion-fast), background-color var(--motion-fast);
}

.hero-dot[aria-current='true']::before { width: 1.5rem; background: var(--color-white); }
.hero-dot:hover::before { background: rgba(255, 255, 255, 0.6); }

@media (min-width: 48rem) {
  .hero { --hero-min-height: max(38.75rem, calc(100svh - 7rem)); }
  .hero-media { object-position: 60% center; }
  .hero::after,
  .hero-slide::after { background: linear-gradient(90deg, rgba(4, 15, 27, 0.98) 0%, rgba(4, 15, 27, 0.85) 36%, rgba(4, 15, 27, 0.12) 72%, rgba(4, 15, 27, 0.06)); }
  .hero-inner { align-items: center; }
  .hero-copy,
  .hero--slider .hero-copy { padding-block: var(--space-9); }
}

@media (min-width: 64rem) {
  .hero-controls {
    inset-inline: max(var(--page-gutter), calc((100% - var(--content-default)) / 2));
    justify-content: flex-end;
  }
}
