/* ==========================================================
   01 Hero — the SeaBreeze plate that gets pulled into the page.

   How the effect works (mirrors pier88coast.com's hero):
   - The plate is position: fixed to the bottom of the viewport.
   - The hero is its own stacking context (isolation: isolate), so every
     section after it paints *over* the fixed plate.
   - A front wave sits above the plate, and js/hero.js pushes the plate
     down via --plate-exit-y as the hero scrolls away. The plate therefore
     looks like it is dragged down beneath the wave and into the page.
   ========================================================== */
.sw-hero {
  --headline-top: min(44%, 30vw);
  --headline-align-y: 0px;
  --wave-front-h: clamp(28px, 4.2vw, 64px);
  --hero-bg-y: 0px;
  --plate-exit-y: 0px;
  --plate-spin: 0deg;
  --plate-visible: 0.6;
  --plate-size: min(calc((50vh + var(--wave-front-h)) / var(--plate-visible)), 124vw);

  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #2f73b5;
  color: var(--white);
}

.sw-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(6, 22, 42, 0.34) 0%, rgba(6, 22, 42, 0.14) 38%, rgba(6, 22, 42, 0.3) 100%);
  pointer-events: none;
}

.sw-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../assets/img/hero-sea.webp") center 50% / cover no-repeat;
  transform: translate3d(0, var(--hero-bg-y), 0) scale(1.08);
  will-change: transform;
  animation:
    sw-fade-in 1.4s var(--ease-out) 0.1s both,
    sw-sea-drift 28s ease-in-out 1.5s infinite alternate;
}

/* ---------- Arched headline ---------- */
.sw-hero__headline {
  position: absolute;
  left: 50%;
  top: var(--headline-top);
  z-index: 2;
  width: min(98vw, 1280px);
  height: clamp(240px, 32vw, 430px);
  overflow: visible;
  transform: translate(-50%, calc(-50% + var(--headline-align-y)));
  filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.3));
  animation: sw-fade-in 1.15s var(--ease-out) 0.6s both;
}

.sw-hero__headline text {
  fill: currentColor;
  font-family: var(--font-display);
  font-size: clamp(76px, 5.2vw, 94px);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sw-hero__mobile-headline {
  display: none;
}

.sw-hero__meta {
  position: absolute;
  left: 50%;
  top: calc(var(--header-h) + 18px);
  z-index: 2;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0.86;
  white-space: nowrap;
  animation: sw-fade-in 1s var(--ease-out) 0.9s both;
}

/* ---------- The plate ---------- */
.sw-hero .sw-hero__plate {
  position: fixed;
  left: 50%;
  bottom: calc(var(--plate-size) * (var(--plate-visible) - 1));
  z-index: 2;
  width: var(--plate-size);
  height: var(--plate-size);
  max-width: none;
  transform: translate3d(-50%, var(--plate-exit-y), 0) rotate(var(--plate-spin));
  will-change: transform;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 -14px 40px rgba(0, 0, 0, 0.28));
  animation: sw-plate-rise 1.5s var(--ease-out) 0.75s both;
}

/* ---------- Waves ---------- */
.sw-hero__wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  display: block;
  width: 100%;
  height: clamp(110px, 15vw, 220px);
  color: var(--paper);
  pointer-events: none;
}

.sw-hero__wave--front {
  z-index: 3;
  height: var(--wave-front-h);
}

.sw-hero__wave path {
  fill: currentColor;
}

@keyframes sw-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sw-plate-rise {
  from { opacity: 0; translate: 0 22%; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes sw-sea-drift {
  from { background-position: 46% 48%; }
  to { background-position: 54% 52%; }
}

@media (min-width: 761px) and (max-width: 1280px) {
  .sw-hero {
    --headline-top: 40%;
  }
}

@media (max-width: 760px) {
  .sw-hero {
    --plate-visible: 0.56;
    --plate-size: 128vw;
    height: 100svh;
    contain: paint;
  }

  .sw-hero__bg {
    background-image: url("../assets/img/hero-sea-mobile.webp");
    background-position: 55% 40%;
    animation: sw-fade-in 1.4s var(--ease-out) 0.1s both;
  }

  .sw-hero__headline {
    display: none;
  }

  .sw-hero__mobile-headline {
    position: absolute;
    left: 50%;
    top: 34%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(96vw, 460px);
    margin: 0;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: clamp(44px, 13vw, 64px);
    font-weight: 300;
    line-height: 0.9;
    text-align: center;
    text-transform: uppercase;
    filter: drop-shadow(0 7px 18px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    animation: sw-fade-in 1.15s var(--ease-out) 0.6s both;
  }

  .sw-hero__script {
    margin: 0 0 0.12em;
    color: var(--accent-soft);
    font-family: var(--font-script);
    font-size: 1.2em;
    line-height: 1;
    text-transform: none;
    transform: rotate(-5deg);
  }

  .sw-hero .sw-hero__plate {
    position: absolute;
  }

  .sw-hero__wave {
    height: clamp(84px, 22vw, 140px);
  }

  .sw-hero__wave--front {
    height: clamp(24px, 6vw, 42px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sw-hero .sw-hero__plate {
    position: absolute;
    transform: translateX(-50%);
  }

  .sw-hero__bg {
    transform: scale(1.08);
  }
}
