/* ==================================================
   Surf & Soul — estilos propios de la plantilla (la historia original de cuatro capítulos, elevada)
   Barra, botones, secciones comunes, similares, CTA y WhatsApp vienen de themes/_kit/am-kit.css
   Paleta del original: arena (#f2ab5f), océano profundo (#182226) y blanco; títulos escritos a mano
   sf.js anima con GSAP ScrollTrigger los valores de clip-path y escala de cada capa
   ================================================== */

.sf-page { --sand: #f2ab5f; --sand-d: #e0913f; --deep: #182226; --foam: #f7f1e8; }

.sf-story { position: relative; z-index: 1; background: var(--deep); color: #fff; }
.sf-ch { position: relative; }
.sf-pin { position: relative; display: flex; height: 100vh; height: 100svh; min-height: 620px; padding-top: 68px; overflow: hidden; background: var(--deep); }
.sf-ch--full .sf-pin { background: var(--sand); }
.sf-ch--rev .sf-pin { flex-direction: row-reverse; }
/* grano de película y viñeta */
.sf-pin::after { content: ''; position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: .14; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.sf-pin::before { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .35)); }

/* ---------- Mitades ---------- */
.sf-half { position: relative; flex: 0 0 50%; height: 100%; overflow: hidden; }
.sf-ch--full .sf-half { flex-basis: 100%; }
.sf-half--b { display: grid; place-items: center; background: var(--deep); }

/* Fotos de la mitad principal: la grande (se abre y se cierra) y la enmarcada que queda debajo */
.sf-ph { position: absolute; inset: 0; margin: 0; }
.sf-ph img, .sf-ph video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.sf-ph video { opacity: 0; transition: opacity .8s linear; }
.sf-ph video.is-on { opacity: 1; }
.sf-ph--main { z-index: 2; clip-path: inset(0 0 0 0); will-change: clip-path; }
.sf-ph--main img, .sf-ph--main video { will-change: transform; }
.sf-ph--main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 18, 22, .25), rgba(10, 18, 22, 0) 35%, rgba(10, 18, 22, .1) 60%, rgba(10, 18, 22, .55)); }
.sf-ph--frame { z-index: 1; display: grid; place-items: center; }
.sf-ph__mat { position: absolute; inset: 0; background: var(--sand); transform: scale(.65); will-change: transform; }
.sf-ph--frame img { position: relative; inset: auto; width: 100%; height: 100%; transform: scale(.9); box-shadow: 0 30px 70px rgba(0, 0, 0, .35); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -14px; will-change: transform; }

/* La caja enmarcada de la otra mitad */
.sf-box { position: relative; display: grid; place-items: center; width: 100%; height: 100%; margin: 0; }
.sf-box__frame { position: absolute; inset: 0; background: var(--sand); transform: scale(.65); box-shadow: 0 40px 90px rgba(0, 0, 0, .45); will-change: transform; }
.sf-box__img { position: absolute; inset: 0; overflow: hidden; transform: scale(.55); clip-path: inset(0 0 0 0); will-change: transform, clip-path; }
.sf-box__img img { width: 100%; height: 100%; max-width: none; object-fit: cover; will-change: transform; }
.sf-box__tag { position: absolute; z-index: 2; left: 22.5%; bottom: 22.5%; padding: 6px 10px; font-family: var(--mb-mono); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--deep); background: var(--foam); transform: translate(0, 50%); white-space: nowrap; }

/* ---------- Palabras ---------- */
.sf-words { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 0 6%; pointer-events: none; }
.sf-words > * { grid-area: 1 / 1; }
.sf-page .sf-t { margin: 0; font-family: 'Permanent Marker', cursive; font-size: clamp(50px, 6.6vw, 120px); font-weight: 400; line-height: .98; letter-spacing: .01em; text-align: center; text-transform: none; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .35); will-change: transform, opacity; }
.sf-ch--full .sf-t { font-size: clamp(56px, 9vw, 150px); }
.sf-t__in { display: inline-block; }
.sf-sub { margin: 0; max-width: 14ch; font-family: 'Permanent Marker', cursive; font-size: clamp(36px, 4.6vw, 84px); line-height: 1.02; text-align: center; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .4); opacity: 0; transform: scale(0); will-change: transform, opacity; }
.sf-ch--full .sf-sub { max-width: 16ch; font-size: clamp(40px, 5.8vw, 100px); }
.ak-page .sf-join { align-self: end; justify-self: center; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: clamp(40px, 9vh, 100px); padding: 0 26px; font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--deep); background: var(--foam); border: 2px solid var(--deep); box-shadow: 6px 6px 0 var(--sand); clip-path: inset(0 100% 0 0); pointer-events: auto; transition: box-shadow .15s var(--ease), transform .15s var(--ease); }
.ak-page .sf-join:hover, .ak-page .sf-join:focus-visible { color: var(--deep); transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--accent); }
.ak-page .sf-join:focus-visible { clip-path: none; outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Capa fija: logo, "scroll" e índice ---------- */
.sf-hud { position: fixed; z-index: 30; inset: 68px 0 0 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .35s linear, visibility .35s; }
.sf-story.is-in .sf-hud { opacity: 1; visibility: visible; }
.sf-logo { position: absolute; left: 50%; top: 18px; width: clamp(120px, 11vw, 170px); height: auto; transform: translateX(-50%); filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35)); }
.sf-cue { position: absolute; left: clamp(18px, 2.4vw, 34px); bottom: 30px; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.sf-cue span { transform: rotate(-90deg) translateX(-14px); transform-origin: 50% 50%; }
.sf-cue i { display: block; width: 2px; height: 80px; background: #fff; animation: sf-cue 3s ease-in-out infinite; }
@keyframes sf-cue { 50% { transform: translateY(20px); } }
.sf-num { position: absolute; right: clamp(18px, 2.4vw, 34px); bottom: 26px; margin: 0; font-family: var(--mb-mono); font-size: 13px; color: rgba(255, 255, 255, .75); }
.sf-num b { font-family: 'Permanent Marker', cursive; font-size: 34px; font-weight: 400; color: #fff; }
.sf-index { position: fixed; z-index: 31; right: clamp(18px, 2.4vw, 34px); top: 50%; display: flex; flex-direction: column; gap: 6px; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .35s linear, visibility .35s; }
.sf-story.is-in .sf-index { opacity: 1; visibility: visible; }
.ak-page .sf-index__b { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-height: 30px; font-family: var(--mb-mono); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: rgba(255, 255, 255, .7); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.sf-index__b span { max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .45s var(--ease); }
.sf-index__b i { display: grid; background: rgba(24, 34, 38, .35); place-items: center; width: 30px; height: 30px; font-style: normal; border: 1.5px solid rgba(255, 255, 255, .6); border-radius: 50%; transition: background .25s linear, color .25s linear, border-color .25s linear; }
.ak-page .sf-index__b:hover span, .ak-page .sf-index__b:focus-visible span { max-width: 22ch; }
.ak-page .sf-index__b:hover span, .ak-page .sf-index__b:focus-visible span { padding: 4px 8px; background: rgba(24, 34, 38, .85); }
.sf-index__b.is-on { color: #fff; }
.sf-index__b.is-on i { color: var(--deep); background: #fff; border-color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.ak-page .sf-index__b:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sf-status, .ak-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Pie ---------- */
.sf-foot { position: relative; z-index: 8; display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 14px clamp(20px, 3vw, 44px); align-items: center; padding: 18px calc(var(--gutter) + 140px) 20px var(--gutter); background: rgba(10, 10, 10, .96); border-top: 3px solid var(--accent); }
.sf-foot__meta { margin: 0 0 4px; font-family: var(--mb-mono); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.sf-foot__lead { max-width: 60ch; margin: 0; font-size: clamp(14px, 1.1vw, 17px); line-height: 1.5; color: rgba(245, 245, 240, .86); }

/* ---------- Celular: las mitades se apilan ---------- */
@media (max-width: 800px) {
	.sf-ch--split .sf-pin, .sf-ch--rev .sf-pin { flex-direction: column; }
	.sf-half { flex-basis: 50%; }
	.sf-ch--full .sf-half { flex-basis: 100%; }
	.sf-page .sf-t { font-size: clamp(40px, 12vw, 70px); }
	.sf-ch--full .sf-t { font-size: clamp(48px, 15vw, 90px); }
	.sf-sub { font-size: clamp(28px, 8.5vw, 48px); }
	.ak-page .sf-join { margin-bottom: 22px; min-height: 46px; font-size: 12px; padding: 0 18px; }
	.sf-index { display: none; }
	.sf-cue { display: none; }
	.sf-logo { top: 12px; width: 110px; }
	.sf-box__tag { font-size: 10px; }
	.sf-foot { grid-template-columns: 1fr; padding: 14px var(--gutter) 88px; }
	.sf-foot .ak-actions .ak-btn { flex: 1 1 auto; }
}
@media (max-width: 700px) {
	.sf-pin { padding-top: 60px; }
	.sf-hud { inset: 60px 0 0 0; }
}

/* ---------- Movimiento reducido (y respaldo sin JS) ---------- */
.sf-story.is-static .sf-sub { opacity: 1; transform: none; margin-top: 1.2em; }
.sf-story.is-static .sf-words { align-content: center; gap: 14px; }
.sf-story.is-static .sf-words > * { grid-area: auto; }
.sf-story.is-static .sf-t { font-size: clamp(44px, 5.4vw, 96px); }
.sf-story.is-static .sf-join { clip-path: none; align-self: auto; margin-bottom: 0; }
.sf-story.is-static .sf-box__frame { transform: scale(.82); }
.sf-story.is-static .sf-box__img { transform: scale(.72); }
@media (prefers-reduced-motion: reduce) {
	.sf-cue i { animation: none; }
	.sf-hud, .sf-index, .sf-index__b span, .ak-page .sf-join, .sf-ph video { transition: none; }
}
