/*
  Homepage hero styles only (loaded from pages/home.html).

  Visual direction: deep slate water + safety-orange accent, pulled from the
  rescue-boat photo. Avoid purple gradients, cream/terracotta poster looks,
  and broadsheet newspaper layouts.
*/

:root {
  --home-ink: #0b1520;
  --home-mist: #f4f1e8;
  --home-orange: #e85d04;
  --home-orange-deep: #c44a00;
  --home-font-brand: "Barlow Condensed", "Arial Narrow", sans-serif;
  --home-font-tagline: "Fraunces", Georgia, serif;
}

/* Escape Bootstrap's .container so the hero can be true full-bleed. */
body.page-home > .container.mt-3 {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Messages (if any) still need a little inset on the full-bleed page. */
body.page-home > .container.mt-3 > .alert {
  margin: 1rem 1.25rem 0;
}

.home-hero {
  position: relative;
  /* Fill the first viewport under the sticky navbar. */
  min-height: calc(100dvh - 56px);
  overflow: hidden;
  background: var(--home-ink);
  color: var(--home-mist);
  display: flex;
  align-items: flex-end;
}

.home-hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Bias toward faces / boat mid-frame on wide screens. */
  object-position: center 35%;
  /* Motion 1: slow Ken Burns zoom — presence, not noise. */
  animation: home-hero-kenburns 22s ease-out forwards;
  will-change: transform;
}

.home-hero__veil {
  position: absolute;
  inset: 0;
  /* Bottom-weighted veil keeps the photo alive up top while copy stays legible. */
  background:
    linear-gradient(
      180deg,
      rgba(11, 21, 32, 0.15) 0%,
      rgba(11, 21, 32, 0.35) 42%,
      rgba(11, 21, 32, 0.88) 100%
    ),
    linear-gradient(
      90deg,
      rgba(11, 21, 32, 0.45) 0%,
      rgba(11, 21, 32, 0.1) 55%,
      rgba(11, 21, 32, 0.35) 100%
    );
  pointer-events: none;
}

.home-hero__copy {
  position: relative;
  z-index: 1;
  width: min(40rem, 92vw);
  padding: clamp(1.75rem, 5vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 8vh, 5rem);
}

.home-hero__brand {
  margin: 0 0 0.65rem;
  font-family: var(--home-font-brand);
  font-weight: 700;
  font-size: clamp(3rem, 12vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--home-mist);
  /* Motion 2: brand rises into place. */
  animation: home-hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/*
  Tagline rotator: inactive lines are taken out of flow (absolute) so only the
  active line sets the height. Fade-in is applied when .is-active is added.
*/
.home-hero__tagline-rotator {
  position: relative;
  margin: 0 0 1.75rem;
  max-width: 18ch;
  /* Motion 3: whole rotator rises once on first paint (with the brand). */
  animation: home-hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.home-hero__tagline {
  margin: 0;
  max-width: 18ch;
  font-family: var(--home-font-tagline);
  font-weight: 500;
  font-size: clamp(1.35rem, 3.4vw, 2.05rem);
  line-height: 1.25;
  color: rgba(244, 241, 232, 0.92);
}

/* Hidden siblings sit on top of the active slot without affecting layout. */
.home-hero__tagline-rotator .home-hero__tagline:not(.is-active) {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Active line is in normal flow and fades in when the class is applied. */
.home-hero__tagline-rotator .home-hero__tagline.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  animation: home-tagline-fade-in 0.85s ease both;
}

.home-hero__actions {
  /* Motion 3 cont.: CTA arrives last so hierarchy reads top → bottom. */
  animation: home-hero-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

.home-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.55rem;
  border-radius: 0.35rem;
  background: var(--home-orange);
  color: #fff;
  font-family: var(--home-font-brand);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.home-hero__cta:hover,
.home-hero__cta:focus-visible {
  background: var(--home-orange-deep);
  color: #fff;
  transform: translateY(-1px);
}

@keyframes home-hero-kenburns {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

@keyframes home-hero-rise {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Soft opacity-only fade when a language becomes active. */
@keyframes home-tagline-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero__photo,
  .home-hero__brand,
  .home-hero__tagline-rotator,
  .home-hero__actions {
    animation: none;
  }

  /* Instant show/hide — JS also stops the 10s cycle when this media query matches. */
  .home-hero__tagline-rotator .home-hero__tagline.is-active {
    animation: none;
  }
}

/* On very wide screens, keep copy from floating in empty mid-air. */
@media (min-width: 992px) {
  .home-hero {
    align-items: center;
  }

  .home-hero__copy {
    padding-left: clamp(2rem, 8vw, 7rem);
  }

  .home-hero__tagline-rotator,
  .home-hero__tagline {
    max-width: 22ch;
  }
}
