/* Bloque A: intro (cortina), manifiesto (relato por fases), capítulo y menú.
   Regla: todo es visible sin JS. Las clases .a-relato / .a-listo las pone js/bloque-a.js. */

/* ---------- utilidades de split ---------- */
.a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.a-pal { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.15em; margin-bottom: -0.15em; }
.a-car { display: inline-block; }
.a-w { display: inline-block; }

/* ---------- intro (cortina) ---------- */
.intro { position: relative; z-index: 0; }
.intro .titulo-intro .l { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.intro .titulo-intro .l > span { display: block; }
.intro .etiqueta { display: inline-block; }
.intro-cont { transform-origin: 50% 40%; }

/* ---------- manifiesto: estado base (sin JS) = contenido en flujo normal ---------- */
.manifiesto { z-index: 2; min-height: auto; }
.manifiesto .fijo { position: relative; height: auto; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; gap: 6vh 4vw; padding: 18vh var(--gutter) 14vh; align-items: center; }
.manifiesto .t1 { grid-area: 1 / 1; }
.manifiesto .fotos { grid-area: 1 / 2 / 3 / 3; }
.manifiesto .t2 { grid-area: 2 / 1; }
.manifiesto .texto .etiqueta { color: var(--arena); margin-bottom: 22px; display: block; }
.manifiesto .texto p { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 56px); line-height: 1.08; }
.manifiesto .f3 { opacity: 1; }
.manifiesto .f1 .b { display: none; }
.manifiesto figure img { transform: none; }
.manifiesto .cierre, .manifiesto .hojas, .manifiesto .avance { display: none; }

/* ---------- manifiesto: modo relato (lo activa el JS) ---------- */
.manifiesto.a-relato { height: 500vh; min-height: 0; }
.manifiesto.a-relato .fijo { position: sticky; top: 0; height: 100vh; padding: 0 var(--gutter); grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; gap: 6vw; background: var(--olivo); isolation: isolate; }
.manifiesto.a-relato .t1 { grid-area: 1 / 1; align-self: center; position: relative; z-index: 2; }
.manifiesto.a-relato .t2 { grid-area: 1 / 2; align-self: center; position: relative; z-index: 1; }
.manifiesto.a-relato .fotos { grid-area: 1 / 2; position: relative; z-index: 3; height: 74vh; align-self: center; will-change: transform; }
.manifiesto.a-relato .f1 .b { display: block; position: absolute; inset: 0; opacity: 0; }
.manifiesto.a-relato .fotos figure { will-change: border-radius, transform; }
.manifiesto.a-relato .cierre { display: flex; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; pointer-events: none; z-index: 4; }
.manifiesto .cierre .etiqueta { color: var(--arena); }
.manifiesto .cierre-palabra { font-family: var(--serif); font-style: italic; font-size: clamp(64px, 9vw, 150px); line-height: 1; }
.manifiesto .cierre-linea { display: block; width: 1px; height: 26vh; background: var(--arena); transform-origin: 50% 0; position: absolute; left: 50%; bottom: 0; }
.manifiesto.a-relato .hojas { display: block; position: absolute; inset: -12%; background: url(../img/rama.webp) center / cover no-repeat; filter: grayscale(1) contrast(1.3); mix-blend-mode: multiply; opacity: 0.3; pointer-events: none; z-index: 0; }
.manifiesto.a-relato .avance { display: block; z-index: 5; }
.manifiesto .f1 img, .manifiesto .f2 img, .manifiesto .f3 img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- capítulo ---------- */
.capitulo { position: relative; z-index: 2; }
.capitulo > .etiqueta { color: var(--arena); display: block; }
.capitulo h2 .l { padding-bottom: 0.04em; margin-bottom: -0.04em; }

/* ---------- menú que crece desde la píldora ---------- */
.menu { inset: auto; top: 6px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 16px)); padding: 96px 32px 40px; border-radius: 30px; background: #1f1c18; color: var(--tinta); align-items: center; text-align: center; gap: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); }
.menu a { font-size: clamp(34px, 5vw, 62px); line-height: 1.1; }
.barra .lineas i { transition: transform 0.4s ease; }
.barra button[aria-expanded="true"] .lineas i:first-child { transform: translateY(2.5px) rotate(45deg); }
.barra button[aria-expanded="true"] .lineas i:last-child { transform: translateY(-2.5px) rotate(-45deg); }

/* ---------- móvil ---------- */
@media (max-width: 860px) {
  .manifiesto .fijo { grid-template-columns: 1fr; padding: 16vh var(--gutter) 10vh; }
  .manifiesto .t1, .manifiesto .t2 { grid-area: auto; }
  .manifiesto .fotos { grid-area: auto; height: 62vh; }

  .manifiesto.a-relato { height: 440vh; }
  .manifiesto.a-relato .fijo { height: 100vh; height: 100svh; grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 22px; padding: 88px var(--gutter) 64px; }
  .manifiesto.a-relato .t1, .manifiesto.a-relato .t2 { grid-area: 1 / 1; align-self: start; }
  .manifiesto.a-relato .fotos { grid-area: 2 / 1; height: auto; min-height: 0; align-self: stretch; }
  .manifiesto.a-relato .texto p { font-size: clamp(22px, 6.2vw, 30px); line-height: 1.12; }
  .manifiesto.a-relato .texto .etiqueta { margin-bottom: 14px; }
  .manifiesto.a-relato .cta { margin-top: 18px; }
  .manifiesto .cierre-linea { height: 18vh; }
  .menu { padding: 82px 20px 30px; border-radius: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .barra .lineas i { transition: none; }
}

/* ==========================================================
   v4 · Preloader y portada con arco que se abre
   ========================================================== */
.pre { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--crema); color: var(--carbon); }
.pre-cont { display: grid; justify-items: center; gap: 14px; }
.pre-arbol { width: clamp(110px, 11vw, 150px); height: auto; overflow: visible; }
.pre-trazo { stroke: var(--olivo); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.pre-hoja { fill: var(--terracota); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 0.6s cubic-bezier(.2,1.4,.4,1); }
.pre-hoja.on { transform: scale(1); }
.pre-marca { font-family: var(--serif); font-size: clamp(44px, 6vw, 76px); line-height: 1; margin-top: 6px; }
.pre-sub { color: #6b6255; }
.pre-pct { position: absolute; right: var(--gutter); bottom: clamp(24px, 5vh, 48px); font-family: var(--serif); font-size: clamp(56px, 8vw, 120px); line-height: 0.85; color: var(--olivo); }
.pre-pct span { font-size: 0.35em; color: var(--terracota); margin-left: 0.05em; vertical-align: top; }
.pre-barra { position: absolute; left: var(--gutter); bottom: clamp(30px, 5.6vh, 56px); width: min(240px, 40vw); height: 1px; background: rgba(31, 28, 24, 0.15); }
.pre-barra i { display: block; height: 100%; background: var(--olivo); transform-origin: 0 50%; transform: scaleX(0); }
.pre.fuera { display: none; }
@media (prefers-reduced-motion: reduce) { .pre { display: none; } }

/* Portada: sin JS, el arco es una foto normal debajo del texto */
.intro { position: relative; }
.intro-fijo { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 104px var(--gutter) 0; overflow: hidden; }
.intro-cont { position: relative; z-index: 2; display: grid; justify-items: center; }
.intro .titulo-intro { font-size: clamp(56px, 8vw, 138px); line-height: 0.9; margin-top: 14px; }
.intro p { margin-top: 18px; max-width: 440px; color: #5b5347; }
.intro .bajar { margin-top: 22px; }
.intro-arco { position: absolute; inset: 0; z-index: 1; margin: 0; overflow: hidden; clip-path: inset(54% 38% 0% 38% round 999px 999px 0 0); will-change: clip-path; }
.intro-arco img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; max-width: none; transform-origin: 50% 70%; }
.intro-arco::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,28,24,.25), rgba(31,28,24,0) 40%, rgba(31,28,24,.35)); opacity: 0; transition: none; }
.intro-pie { position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: 26px; display: flex; justify-content: space-between; color: #6b6255; }
/* Con JS (modo relato): la portada es más alta y su contenido se queda fijo mientras el arco se abre */
.intro.a-arco { height: 250vh; height: 250svh; }
.intro.a-arco .intro-fijo { position: sticky; top: 0; height: 100vh; height: 100svh; }
@media (max-width: 860px) {
  .intro-fijo { padding-top: 96px; }
  .intro .titulo-intro { font-size: clamp(54px, 15.5vw, 86px); }
  .intro p { font-size: 14.5px; max-width: 32ch; }
  .intro .bajar { display: none; }
  .intro-arco { clip-path: inset(52% 14% 0% 14% round 999px 999px 0 0); }
  .intro-pie { bottom: 18px; font-size: 10px; }
  .intro.a-arco { height: 250vh; height: 250svh; }
}
@media (max-width: 860px) and (max-height: 700px) { .intro p { display: none; } .intro-arco { clip-path: inset(46% 16% 0% 16% round 999px 999px 0 0); } }
/* Menos espacio vacío al entrar al capítulo */
.capitulo { padding-top: 10vh !important; }
.intro .intro-pie { max-width: none; margin: 0; }
@media (max-width: 860px) { .intro-pie { display: none; } }

/* ==========================================================
   v4 · Sección 2 "relato": video que avanza con el scroll
   ========================================================== */
.relato { position: relative; z-index: 2; background: var(--carbon); color: var(--tinta); }
.relato-fijo { position: relative; min-height: 100vh; overflow: hidden; display: grid; align-content: end; gap: 28px; padding: 18vh var(--gutter) 12vh; }
.relato-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.relato-velo { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,28,24,.35) 0%, rgba(31,28,24,0) 30%, rgba(31,28,24,.15) 55%, rgba(31,28,24,.82) 100%); }
.relato-txt, .relato-datos, .relato .cierre, .relato-avance { position: relative; z-index: 2; }
.relato-txt { max-width: 640px; }
.relato-txt .etiqueta { color: var(--arena); display: block; margin-bottom: 16px; }
.relato-txt p { font-family: var(--serif); font-size: clamp(30px, 3.4vw, 54px); line-height: 1.06; text-shadow: 0 2px 30px rgba(0,0,0,.35); }
.relato-txt p em { color: var(--arena); }
.relato .cta { display: inline-block; margin-top: 22px; color: var(--arena); border-bottom: 1px solid var(--arena); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.relato-datos { display: flex; gap: clamp(24px, 5vw, 72px); }
.relato-datos span { display: grid; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246,241,231,.75); }
.relato-datos b { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 72px); letter-spacing: 0; text-transform: none; color: var(--tinta); line-height: 1; }
.relato .cierre { display: none; }
.relato-avance { display: none; }
/* modo animado */
.relato.a-video { height: 420vh; height: 420svh; }
.relato.a-video .relato-fijo { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; display: block; padding: 0; }
.relato.a-video .relato-txt { position: absolute; left: var(--gutter); bottom: 14vh; }
.relato.a-video .relato-datos { position: absolute; right: var(--gutter); bottom: 14vh; }
.relato.a-video .cierre { display: flex; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; background: rgba(46,58,40,0); }
.relato.a-video .cierre .etiqueta { color: var(--arena); }
.relato .cierre-palabra { font-family: var(--serif); font-style: italic; font-size: clamp(64px, 9vw, 150px); line-height: 1; }
.relato .cierre-linea { display: block; width: 1px; height: 22vh; background: var(--arena); transform-origin: 50% 0; position: absolute; left: 50%; bottom: 0; }
.relato.a-video .relato-avance { display: block; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 5vh; height: 1px; background: rgba(246,241,231,.2); }
.relato-avance i { display: block; height: 100%; background: var(--arena); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 860px) {
  .relato.a-video { height: 340vh; height: 340svh; }
  .relato-velo { background: linear-gradient(180deg, rgba(31,28,24,.45) 0%, rgba(31,28,24,0) 26%, rgba(31,28,24,.2) 50%, rgba(31,28,24,.88) 100%); }
  .relato.a-video .relato-txt { right: var(--gutter); bottom: 15vh; }
  .relato-txt p { font-size: clamp(25px, 7vw, 32px); line-height: 1.1; }
  .relato.a-video .relato-datos { left: var(--gutter); right: var(--gutter); top: 96px; bottom: auto; justify-content: space-between; }
  .relato-datos b { font-size: 38px; }
  .relato-datos span { font-size: 9.5px; }
}

/* v6 · la sección 2 se superpone a la última pantalla de la portada (fundido, sin borde) */
.relato.a-video { margin-top: -160vh; margin-top: -160svh; }
.relato.a-video .cierre .etiqueta, .relato.a-video .cierre-palabra { position: relative; z-index: 1; }
.relato.a-video { background: transparent; }


/* v5 · Portada en PC: textos con aire (título arriba, frase y "Descubre" a los lados del arco) */
@media (min-width: 861px) {
  .intro-fijo { padding-top: clamp(118px, 15vh, 150px); }
  .intro-cont { position: static; }
  .intro-cont > .etiqueta, .intro .titulo-intro { position: relative; z-index: 2; }
  .intro .titulo-intro { margin-top: clamp(18px, 2.6vh, 28px); line-height: 0.96; letter-spacing: -0.012em; }
  .intro-cont > p { position: absolute; z-index: 2; left: max(var(--gutter), calc((100vw - 1320px) / 2)); bottom: clamp(84px, 12vh, 120px); margin: 0; max-width: 300px; text-align: left; font-size: 15.5px; line-height: 1.65; }
  .intro-cont > p::before { content: ""; display: block; width: 36px; height: 1px; margin-bottom: 16px; background: var(--terracota); }
  .intro-cont > .bajar { position: absolute; z-index: 2; right: max(var(--gutter), calc((100vw - 1320px) / 2)); bottom: clamp(84px, 12vh, 120px); margin: 0; }
  .intro .intro-pie { left: max(var(--gutter), calc((100vw - 1320px) / 2)); right: max(var(--gutter), calc((100vw - 1320px) / 2)); bottom: 30px; }
}
