/* ==========================================================================
   Section: hero-slider  →  assets/section-hero-slider.css
   Geometry measured at 1440×840 (Figma 1089-3014 · 851-2007 · 853-2149)
   ========================================================================== */
.hero {
  position: relative;
  height: var(--hero-height);
  overflow: hidden;
  background: var(--color-page-bg);
  color: var(--color-text-inverse);
}

.hero[data-height="screen"] {
  height: calc(100svh - var(--announcement-height, 0px));
}

.hero__slider {
  display: block;
  position: relative;
  height: 100%;
  touch-action: pan-y;
}

.hero__track {
  position: relative;
  height: 100%;
}

/* Slides stack; only .is-active (and .is-leaving during a cross-fade) are visible */
.hero__slide {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
}

.hero__slide.is-leaving {
  z-index: 1;
  opacity: 1;
  visibility: visible;
}

.hero__slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
}

.hero__panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* Split layout: 1px rgba(255,255,255,.16) line between the two panels */
.hero__slide[data-layout="split"] .hero__panel + .hero__panel::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--color-line-inverse-soft);
}

/* Media — object-position sets the focal point; scaling about the same point
   reproduces the Figma crop (see the spec for how --focal/--zoom are derived) */
.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__media > img,
.hero__media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
}

/* Split layout: the two photos meet at the divider, so by default each one is anchored to
   that edge — left panel shows the right side of its image, right panel the left side.
   An inline --focal-x on .hero__media still wins. */
.hero__slide[data-layout="split"] .hero__panel:first-child .hero__media {
  --focal-x: 100%;
}

.hero__slide[data-layout="split"] .hero__panel:last-child .hero__media {
  --focal-x: 0%;
}

/* Overlays */
.hero__overlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: var(--overlay-opacity, 1);
  pointer-events: none;
}

.hero__panel[data-overlay="none"] .hero__overlay {
  display: none;
}

.hero__panel[data-overlay="flat"] .hero__overlay {
  background: rgba(0, 0, 0, 0.24);
}

.hero__panel[data-overlay="gradient-a"] .hero__overlay {
  /* The flat 3.8% veil is measured from Figma's render (a constant 0.962 ratio over the source
     photo at every brightness); Figma's generated code lists only the gradient. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.038), rgba(0, 0, 0, 0.038)),
    linear-gradient(153.753deg, rgba(0, 0, 0, 0.192) 17.798%, rgba(0, 0, 0, 0.019) 26.104%, rgba(0, 0, 0, 0) 45.86%, rgba(0, 0, 0, 0.288) 72.906%);
}

.hero__panel[data-overlay="gradient-b"] .hero__overlay {
  background: linear-gradient(156.528deg, rgba(0, 0, 0, 0) 4.3225%, rgba(0, 0, 0, 0.6) 56.303%);
}

/* Content — bottom-left, one gutter from the panel edge, 40px from the bottom.
   Per-panel overrides (set on .hero__panel): --content-bottom, --cta-gap, --text-max-width */
.hero__content {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--cta-gap, 40px);
  padding: var(--page-gutter);
  padding-bottom: var(--content-bottom, 40px);
}

.hero__slide[data-layout="full"] .hero__content {
  max-width: var(--page-max);
  margin-inline: auto;
}

/* Split panels keep their copy inside the same centred page container as the full slides:
   on screens wider than --page-max the left panel's text starts at the container's left edge and
   the right panel's text stops at its right edge. 100% = panel width (half the viewport). */
.hero__slide[data-layout="split"] .hero__panel:first-child .hero__content {
  padding-left: max(var(--page-gutter), calc(100% - var(--page-max) / 2 + var(--page-gutter)));
}

.hero__slide[data-layout="split"] .hero__panel:last-child .hero__content {
  padding-right: max(var(--page-gutter), calc(100% - var(--page-max) / 2 + var(--page-gutter)));
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--text-max-width, 600px);
}

.hero__panel[data-heading-style="serif-alt"] .hero__text,
.hero__panel[data-heading-style="sans"] .hero__text {
  gap: 12px;
}

/* Heading styles */
.hero__heading {
  font-family: var(--font-display);
  font-size: clamp(34px, 3.889vw, var(--text-display-m-size)); /* 56px at 1440 */
  font-weight: 500;
  line-height: 1.2;
}

.hero__panel[data-heading-style="serif-alt"] .hero__heading {
  font-family: var(--font-display-alt);
  font-size: clamp(30px, 3.333vw, var(--text-display-alt-size)); /* 48px at 1440 */
  font-weight: 600;
  line-height: 1;
}

.hero__panel[data-heading-style="sans"] .hero__heading {
  font-family: var(--font-body);
  font-size: clamp(34px, 3.889vw, var(--text-display-sans-size));
  font-weight: 500;
  line-height: 1.2;
}

.hero__subheading {
  font-size: var(--text-body-m-size);
  font-weight: 400;
  line-height: 1.4;
}

.hero__panel[data-text-size="lg"] .hero__subheading {
  font-size: var(--text-body-l-size);
  line-height: 1.2;
}

/* Calls to action */
.hero__ctas {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Figma Button/M carries 4% tracking (the solid buttons; the text links have none) */
.hero__ctas .button:not(.button--tertiary) {
  letter-spacing: 0.04em;
}

/* Figma's whole-pixel label box leaves out the tracking after the last letter */
.hero__ctas .button:not(.button--tertiary) > span {
  width: calc-size(max-content, round(up, size - 0.04em, 1px));
}

/* Figma's 40px button has no border, so the shared 1px border comes out of the padding */
.hero__ctas .button:not(.button--lg) {
  --button-padding-x: 15px;
}

.hero__panel[data-cta-style="links"] .hero__content {
  gap: var(--cta-gap, 32px);
}

/* Text-link CTAs (data-cta-style="links", Figma 853-2149): the shared tertiary button with the
   dot/arrow swap, in white, 2px from icon to label as Figma spaces these links. Its 1px hover
   underline hangs below the 16px row, so the row keeps Figma's height. */
.hero__ctas .button--tertiary {
  --button-gap: 2px;
  margin-bottom: -1px;
  color: var(--color-text-inverse);
}

.hero__separator {
  display: block;
  color: var(--color-separator);
}

/* Content positions */
.hero__panel[data-content-position="bottom-center"] .hero__content {
  align-items: center;
  text-align: center;
}

.hero__panel[data-content-position="center"] .hero__content {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero__panel[data-content-position="bottom-center"] .hero__ctas,
.hero__panel[data-content-position="center"] .hero__ctas {
  justify-content: center;
}

/* Pagination — 48×2 bars, 8px apart, 40px from the bottom, one gutter from the right */
.hero__controls {
  position: absolute;
  z-index: 4;
  inset: 0;
  max-width: var(--page-max);
  margin-inline: auto;
  pointer-events: none;
}

.hero__pagination {
  position: absolute;
  right: var(--page-gutter);
  bottom: 32px; /* 8px hit-area padding below the 2px bar → bar bottom at 40px */
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

/* 8px of hit area above and below the 2px bar. On hover the bar grows to 6px while the padding
   shrinks by the same amount, so the row keeps its height and the bar its centre line. */
.hero__bullet {
  display: block;
  padding: 8px 0;
  transition: padding var(--duration-fast) ease;
}

.hero__bullet:hover,
.hero__bullet:focus-visible {
  padding: 6px 0;
}

.hero__bullet-track {
  display: block;
  position: relative;
  width: 48px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--color-bullet-track);
  transition: height var(--duration-fast) ease;
}

.hero__bullet:hover .hero__bullet-track,
.hero__bullet:focus-visible .hero__bullet-track {
  height: 6px;
}

.hero__bullet-fill {
  display: block;
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: var(--color-white);
  transform: scaleX(0);
  transform-origin: left center;
}

.hero__slider.is-static .hero__bullet[aria-selected="true"] .hero__bullet-fill {
  transform: scaleX(1);
}

.hero__bullet:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 0;
}

/* First-load entrance — CSS keyframes, so it starts on the very first painted frame. A JS/GSAP
   intro could only start after the deferred scripts (and the GSAP CDN file) arrive, by which time the
   copy is already on screen, so it blinked out and back in. Nothing here waits on JS: if a script
   fails, the animation still finishes and the copy stays visible.
   .is-intro is in the markup; hero-slider.js removes it on the first slide change so these never
   replay or fight GSAP's slide-change tweens. Drop the class to turn the entrance off. */
@media (prefers-reduced-motion: no-preference) {
  .hero__slider.is-intro .hero__slide.is-active .hero__media {
    animation: hero-intro-settle 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; /* GSAP power2.out */
  }

  /* Same move as the slide-change tween: rise 24px and fade in, one line every 80ms */
  .hero__slider.is-intro .hero__slide.is-active :is(.hero__text > *, .hero__ctas) {
    animation: hero-intro-rise 0.9s cubic-bezier(0.215, 0.61, 0.355, 1) both; /* GSAP power3.out */
    animation-delay: calc(0.2s + (var(--intro-step, 0) + var(--intro-panel, 0)) * 80ms);
  }

  .hero__slider.is-intro .hero__text > :nth-child(2) {
    --intro-step: 1;
  }

  .hero__slider.is-intro .hero__ctas {
    --intro-step: 2;
  }

  /* Split slide: the second panel's lines follow the first panel's */
  .hero__slider.is-intro .hero__panel + .hero__panel {
    --intro-panel: 3;
  }

  /* The bullets are built by JS, so they fade in whenever they are inserted */
  .hero__slider.is-intro .hero__bullet {
    animation: hero-intro-fade 0.6s ease-out both;
  }
}

@keyframes hero-intro-settle {
  from {
    transform: scale(1.06);
  }
}

@keyframes hero-intro-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes hero-intro-fade {
  from {
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 749px) {
  .hero__slide[data-layout="split"] {
    flex-direction: column;
  }

  .hero__slide[data-layout="split"] .hero__panel + .hero__panel::before {
    right: 0;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .hero__content {
    padding-bottom: 64px; /* keep CTAs clear of the pagination */
  }

  .hero__slide[data-layout="split"] .hero__panel:first-child .hero__content {
    padding-bottom: 24px;
  }

  .hero__pagination {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__bullet,
  .hero__bullet-track {
    transition: none;
  }
}
