/* ==========================================================================
   Portada: la costa vista desde arriba y el mar que sube y se la come.
   Capas: costa · gaviotas · ola (espuma + mar) · nubes · titular
   Al terminar la ola, la información del cliente sube sobre el mar.
   Solo se mueven transform y opacity (fluido en móvil).
   ========================================================================== */

.costa { --mar: #026b6e; --ow: max(100vw, 1100px); position: relative; background: var(--mar); }
.costa-stage { position: sticky; top: var(--header-h); height: calc(100svh - var(--header-h)); overflow: hidden; isolation: isolate; contain: paint; }
.costa-espacio { height: 115svh; }

/* fondo: la costa */
.costa-bg { position: absolute; inset: -2%; z-index: 1; will-change: transform; transform-origin: 50% 40%; }
.costa-bg picture, .costa-bg img { display: block; width: 100%; height: 100%; }
.costa-bg img { object-fit: cover; object-position: 50% 50%; }

/* gaviotas */
.costa-sprite { position: absolute; will-change: transform; pointer-events: none; }
.costa-sprite img { width: 100%; height: auto; }
.costa-gav { z-index: 2; filter: drop-shadow(0 18px 14px rgba(0,30,35,.22)); }
.costa-gav-1 { width: clamp(80px, 10vw, 170px); left: 8%;  top: 18%; }
.costa-gav-2 { width: clamp(64px, 7.5vw, 130px); left: 76%; top: 30%; }
.costa-gav-3 { width: clamp(44px, 4.6vw, 84px);  left: 60%; top: 9%; }
.costa-gav-in { display: block; animation: gavFloat 7s ease-in-out infinite; }
.costa-gav-2 .costa-gav-in { animation-duration: 8.5s; animation-delay: -3s; }
.costa-gav-3 .costa-gav-in { animation-duration: 6s;   animation-delay: -1.5s; }
@keyframes gavFloat { 50% { transform: translate(6px, -8px) rotate(-1.5deg); } }

/* la ola: espuma arriba y mar debajo, empieza justo por debajo de la pantalla */
.costa-ola { position: absolute; left: 0; right: 0; top: 100%; z-index: 3; will-change: transform; }
.costa-ola-espuma { display: block; width: var(--ow); max-width: none; height: auto; position: relative; left: 50%; transform: translateX(-50%); }
.costa-ola-cuerpo { height: 120svh; margin-top: -1px;
  background:
    linear-gradient(180deg, rgba(2,107,110,0) 0%, rgba(6,52,56,.55) 70%, rgba(6,44,46,.7) 100%),
    url(../img/costa/mar-tile.webp) center calc(var(--ow) * -0.15625) / var(--ow) auto repeat-y,
    var(--mar); }

/* nubes */
.costa-nube { z-index: 4; opacity: .8; }
.costa-nube-1 { width: clamp(380px, 46vw, 900px); left: -14%; top: -14%; }
.costa-nube-2 { width: clamp(260px, 30vw, 560px); right: -9%; top: 0; }
.costa-nube-3 { width: clamp(240px, 26vw, 500px); right: -8%; bottom: -12%; }

/* titular, siempre delante */
.costa-titulo { position: absolute; z-index: 5; left: 0; right: 0; top: 34%; text-align: center; padding: 0 var(--gutter); will-change: transform; pointer-events: none; }
.costa-titulo::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: min(1100px, 120%); height: 220%; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(6,32,30,.46), rgba(6,32,30,0)); }
.costa-titulo h1 { font-family: var(--f-display); font-weight: 300; color: #fff; margin: 0 auto;
  font-size: clamp(2.6rem, 5.2vw, 5.6rem); line-height: 1.02; letter-spacing: -.01em; max-width: 22ch;
  text-shadow: 0 2px 30px rgba(4,30,34,.5); }
.costa-titulo h1 em { font-style: italic; color: #f6d9a6; }

.costa-hint { position: absolute; z-index: 6; left: 50%; bottom: 22px; transform: translateX(-50%); color: rgba(255,255,255,.9); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 8px; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.costa-hint::after { content: ""; width: 1px; height: 34px; background: linear-gradient(rgba(255,255,255,.9), rgba(255,255,255,0)); animation: hint 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* la información del cliente sube sobre el mar */
.hero.costa-info { position: relative; z-index: 2; min-height: 0; display: block; background: transparent; overflow: visible; margin-top: -58svh; }
.hero.costa-info::after { display: none; }
.hero.costa-info .wrap { padding-top: 0; padding-bottom: clamp(56px, 8vw, 110px); }
.hero.costa-info .hero-kicker { margin-bottom: 18px; }

@media (max-width: 640px) {
  .costa-espacio { height: 100svh; }
  .costa-titulo { top: 30%; }
  .costa-titulo h1 { font-size: 2.6rem; max-width: 11ch; }
  .costa-hint { display: none; }
  .costa-gav-1 { left: 4%; top: 22%; } .costa-gav-2 { left: 70%; top: 40%; } .costa-gav-3 { left: 64%; top: 12%; }
  .costa-nube-1 { left: -40%; top: -6%; } .costa-nube-2 { right: -38%; } .costa-nube-3 { right: -30%; }
  .hero.costa-info { margin-top: -50svh; }
}

@media (prefers-reduced-motion: reduce) {
  .costa-stage { position: relative; top: 0; }
  .costa-espacio, .costa-ola, .costa-hint { display: none; }
  .hero.costa-info { margin-top: 0; padding-top: 40px; }
  .costa-gav-in, .costa-hint::after { animation: none; }
}
