/* Estreno — la boda como una película. functions/invitacion/estreno.js
   Escrita para el móvil primero; cada escena tiene su versión de móvil
   apaisado (max-height 520px), tablet y ordenador, no la misma encogida. */
/* Tipografías propias (web/fonts/). Solo se descarga el trozo latin-ext si hay letras que lo pidan. */
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400 600; font-display: swap; src: url(/fonts/cormorant-garamond-italic-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400 600; font-display: swap; src: url(/fonts/cormorant-garamond-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/cormorant-garamond-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(/fonts/cormorant-garamond-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/hanken-grotesk-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/hanken-grotesk-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/bodoni-moda-italic-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bodoni Moda"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(/fonts/bodoni-moda-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/bodoni-moda-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/bodoni-moda-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --negro: #0E0D0C;
  --carbon: #171513;
  --hueso: #EFE9DF;
  --papel: #F5F0E8;
  --humo: rgba(239, 233, 223, .7);
  --tinta: #1A1816;
  --gris: #625B53;
  --laton: #C9AB80;
  --laton-tinta: #84673C;
  --serif: "Cormorant Garamond", Garamond, Georgia, serif;
  /* Las cifras, en Bodoni: las de Cormorant son de texto y el 1 parece una I */
  --cifras: "Bodoni Moda", "Didot", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --curva: cubic-bezier(.16, 1, .3, 1);
  --lateral: clamp(20px, 6vw, 96px);
  --grano: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .48 0 0 0 0 .45 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--negro); color: var(--hueso); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
/* Grano de película, muy suave, por encima de todo */
body::after { content: ""; position: fixed; inset: 0; z-index: 80; pointer-events: none; background: var(--grano); opacity: .07; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
a { color: inherit; }
.icono { width: 1.1em; height: 1.1em; flex: none; }
.visual-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.credito { font: 600 11px/1.6 var(--sans); letter-spacing: .42em; text-transform: uppercase; color: var(--laton); }
.enlace {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; padding-bottom: 6px; border-bottom: 1px solid currentColor;
  font: 600 11.5px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; text-decoration: none; transition: gap .4s var(--curva);
}
.enlace:hover { gap: 16px; }

/* ===== 0 · Apertura: un rótulo sobre negro y se va ===== */
.apertura { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--negro); pointer-events: none; animation: apertura-fuera .7s .9s ease forwards; }
.apertura p { font: 500 12px/1 var(--sans); letter-spacing: .6em; text-indent: .6em; color: var(--hueso); opacity: 0; animation: rotulo 1.2s .05s ease both; }

/* ===== Barra: aparece al pasar el título ===== */
.barra {
  position: fixed; z-index: 60; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: max(10px, env(safe-area-inset-top)) var(--lateral) 10px;
  background: rgba(14, 13, 12, .74); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid rgba(239, 233, 223, .08);
  transform: translateY(-110%); transition: transform .7s var(--curva);
}
.tras-portada .barra { transform: none; }
.barra-nombres { font: italic 500 1.25rem/1 var(--serif); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-accion { flex: none; padding: 10px 16px; border: 1px solid rgba(239, 233, 223, .4); border-radius: 99px; font: 600 10.5px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; text-decoration: none; transition: background .4s, color .4s; }
.barra-accion:hover { background: var(--hueso); color: var(--negro); }

/* ===== 1 · Título ===== */
.titulo {
  --banda: 0px;
  position: relative; isolation: isolate; overflow: hidden; height: 100svh; min-height: 540px;
  display: grid; align-items: end; justify-items: center; text-align: center; padding: calc(var(--banda) + 28px) var(--lateral) calc(var(--banda) + 13svh);
}
.titulo-foto { position: absolute; inset: 0; z-index: -2; background: var(--carbon); }
.titulo-foto img { width: 100%; height: 100%; object-fit: cover; animation: empujar 16s .8s cubic-bezier(.2, .6, .2, 1) both; }
.titulo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 75% at 50% 52%, rgba(14, 13, 12, .1), rgba(14, 13, 12, .7)),
    linear-gradient(180deg, rgba(14, 13, 12, .45), transparent 28%, transparent 58%, rgba(14, 13, 12, .88));
}
/* Bandas de cine en pantallas apaisadas: el título se ve en formato 2,39:1 */
.titulo::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-block: var(--banda) solid var(--negro); animation: bandas 1.6s 1.8s var(--curva) both; }
.titulo-marco { display: grid; justify-items: center; gap: 26px; }
.titulo-nombres { display: flex; flex-direction: column; align-items: center; font: 400 clamp(3.8rem, 19vw, 11rem)/.9 var(--serif); letter-spacing: -.015em; }
.t-linea { display: block; white-space: nowrap; }
.t-y { display: block; margin: .02em 0 .06em; font-style: italic; font-size: .5em; line-height: 1; color: var(--laton); opacity: 0; animation: aparecer 1.2s 1.7s both; }
.letra { display: inline-block; opacity: 0; animation: letra 1.8s var(--curva) forwards; animation-delay: calc(1s + var(--n, 0) * .05s); }
.t-b .letra { animation-delay: calc(1.4s + var(--n, 0) * .05s); }
.letra.hueco { width: .25em; }
/* El número de cada letra (comun.js → letras); el retraso lo calcula la hoja */
.letra:nth-child(1) { --n: 0; }
.letra:nth-child(2) { --n: 1; }
.letra:nth-child(3) { --n: 2; }
.letra:nth-child(4) { --n: 3; }
.letra:nth-child(5) { --n: 4; }
.letra:nth-child(6) { --n: 5; }
.letra:nth-child(7) { --n: 6; }
.letra:nth-child(8) { --n: 7; }
.letra:nth-child(9) { --n: 8; }
.letra:nth-child(10) { --n: 9; }
.letra:nth-child(11) { --n: 10; }
.letra:nth-child(12) { --n: 11; }
.letra:nth-child(13) { --n: 12; }
.letra:nth-child(14) { --n: 13; }
.letra:nth-child(15) { --n: 14; }
.letra:nth-child(16) { --n: 15; }
.letra:nth-child(17) { --n: 16; }
.letra:nth-child(18) { --n: 17; }
.letra:nth-child(19) { --n: 18; }
.letra:nth-child(20) { --n: 19; }
.letra:nth-child(21) { --n: 20; }
.letra:nth-child(22) { --n: 21; }
.letra:nth-child(23) { --n: 22; }
.letra:nth-child(24) { --n: 23; }
.letra:nth-child(25) { --n: 24; }
.letra:nth-child(26) { --n: 25; }
.letra:nth-child(27) { --n: 26; }
.letra:nth-child(28) { --n: 27; }
.letra:nth-child(29) { --n: 28; }
.letra:nth-child(30) { --n: 29; }
.letra:nth-child(31) { --n: 30; }
.letra:nth-child(32) { --n: 31; }
.letra:nth-child(33) { --n: 32; }
.letra:nth-child(34) { --n: 33; }
.letra:nth-child(35) { --n: 34; }
.letra:nth-child(36) { --n: 35; }
.titulo-arriba, .titulo-abajo { opacity: 0; animation: aparecer 1.2s 1.9s both; }
.titulo-abajo { color: var(--hueso); letter-spacing: .32em; }
.seguir {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(var(--banda) + 16px); margin: 0 auto; width: max-content;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none;
  font: 600 10px/1 var(--sans); letter-spacing: .4em; text-indent: .4em; text-transform: uppercase; color: var(--humo);
  opacity: 0; animation: aparecer 1.4s 4s both;
}
.seguir i { width: 1px; height: 40px; background: linear-gradient(var(--hueso), transparent); transform-origin: top; animation: latido 2.6s ease-in-out infinite; }
@media (min-width: 900px) {
  .titulo-nombres { flex-direction: row; align-items: baseline; gap: .22em; font-size: clamp(5rem, 9.5vw, 11rem); }
  .t-y { margin: 0; font-size: .6em; }
}
@media (min-aspect-ratio: 4/3) { .titulo { --banda: max(0px, calc((100svh - 100vw / 2.39) / 2)); } }

/* ===== WebGL (cine.js): el lienzo tapa las <img> cuando ya ha pintado ===== */
.cine-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s ease; }
.cine-activo > .cine-lienzo { opacity: 1; }
.titulo-foto.cine-activo img { visibility: hidden; animation: none; }
.historia-escenario.cine-activo .historia-foto { display: none; }
.titulo-foto.cine-activo { animation: none !important; }
/* Lenis (desplazamiento con inercia) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* Montaje en rollo (cine.js): una toma por golpe de dedo, sobre un escenario fijo */
.montaje-escenario { display: none; }
.montaje.cine-activo { height: calc(var(--tomas, 6) * 55svh + 100svh); padding: 0; }
.montaje.cine-activo .montaje-escenario { display: block; position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--carbon); }
.montaje.cine-activo .montaje-rejilla { display: none; }
.montaje-escenario > .credito { position: absolute; z-index: 2; left: var(--lateral); top: calc(env(safe-area-inset-top) + 84px); margin: 0; text-align: left; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.montaje-contador { position: absolute; z-index: 2; right: var(--lateral); bottom: calc(env(safe-area-inset-bottom) + 28px); font: 400 clamp(1.6rem, 6vw, 2.6rem)/1 var(--cifras); font-variant-numeric: lining-nums tabular-nums; color: var(--hueso); text-shadow: 0 1px 14px rgba(0, 0, 0, .55); }

/* ===== 2 · La historia: escenario fijo, capítulos como subtítulos ===== */
.historia { position: relative; background: var(--negro); }
.historia-escenario { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--carbon); }
.historia-foto { position: absolute; inset: 0; opacity: 0; transition: opacity 1.3s ease; }
.historia-foto.activa { opacity: 1; }
.historia-foto img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); transition: transform 10s cubic-bezier(.2, .6, .2, 1); }
.historia-foto.activa img { transform: none; }
.historia-velo { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 13, 12, .45), rgba(14, 13, 12, 0) 26%, rgba(14, 13, 12, .2) 50%, rgba(14, 13, 12, .92)); }
.historia-pasos { position: relative; margin-top: -100svh; }
.capitulo { min-height: 100svh; display: flex; align-items: flex-end; padding: 0 var(--lateral) 13svh; }
.capitulo:last-child { min-height: 115svh; }
.capitulo-texto { max-width: 34rem; text-shadow: 0 2px 24px rgba(14, 13, 12, .5); }
.capitulo-anio { margin: 12px 0 6px; font: 400 clamp(4.6rem, 25vw, 12rem)/.8 var(--cifras); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px rgba(239, 233, 223, .75); text-shadow: none; }
.capitulo h2 { font: 500 clamp(2.1rem, 9vw, 3.6rem)/1.04 var(--serif); text-wrap: balance; }
.capitulo-texto > p:not(.credito):not(.capitulo-anio) { margin-top: 14px; max-width: 30rem; color: var(--humo); font-size: 1.04rem; }
@media (min-width: 900px) {
  .historia-velo { background: linear-gradient(90deg, rgba(14, 13, 12, .88), rgba(14, 13, 12, .35) 48%, rgba(14, 13, 12, 0) 70%), linear-gradient(180deg, rgba(14, 13, 12, .35), transparent 30%); }
  .capitulo { align-items: center; padding-bottom: 0; }
}

/* ===== 3 · Intertítulo ===== */
.intertitulo { min-height: 100svh; display: grid; place-items: center; padding: 18svh var(--lateral); background: var(--negro); text-align: center; }
.intertitulo > p { max-width: 46rem; font: italic 400 clamp(2.1rem, 8.4vw, 4.4rem)/1.14 var(--serif); text-wrap: balance; }
.intertitulo > p::before, .intertitulo > p::after { content: ""; display: block; width: 1px; height: 54px; margin: 0 auto 40px; background: linear-gradient(transparent, var(--laton)); }
.intertitulo > p::after { margin: 40px auto 0; background: linear-gradient(var(--laton), transparent); }
.palabra { transition: opacity .8s; }

/* ===== 4 · La fecha ===== */
.fecha { view-timeline: --fecha; position: relative; padding: 16svh var(--lateral) 14svh; background: var(--papel); color: var(--tinta); text-align: center; }
.fecha .credito, .dia .credito, .practico > .credito { color: var(--laton-tinta); }
/* El pie de los lugares va sobre la foto oscurecida: latón claro (contraste 20/11/2026) */
.lugar-pie > .credito { color: var(--laton); }
.fecha-gran { display: flex; flex-direction: column; align-items: center; margin-top: 26px; }
.fecha-dia { position: relative; isolation: isolate; }
.fecha-dia::before {
  --barrido: 0deg;
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 1.7em; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background:
    linear-gradient(rgba(26, 24, 22, .12), rgba(26, 24, 22, .12)) center / 1px 100% no-repeat,
    linear-gradient(rgba(26, 24, 22, .12), rgba(26, 24, 22, .12)) center / 100% 1px no-repeat,
    radial-gradient(circle, transparent 61.6%, rgba(26, 24, 22, .16) 62%, transparent 62.4%, transparent 70.4%, rgba(26, 24, 22, .2) 70.7%, transparent 71%),
    conic-gradient(from calc(var(--barrido) - 70deg), transparent, rgba(176, 141, 87, .26) 70deg, transparent 70deg);
  -webkit-mask-image: radial-gradient(circle, #000 70.7%, transparent 71%);
  mask-image: radial-gradient(circle, #000 70.7%, transparent 71%);
}
.fecha-dia { font: 400 clamp(8rem, 50vw, 24rem)/.8 var(--cifras); letter-spacing: -.05em; margin-right: .05em; }
.fecha-mes { margin-top: 14px; font: 400 clamp(2.2rem, 10vw, 4.4rem)/1 var(--serif); }
.fecha-mes em { color: var(--laton-tinta); }
.fecha .enlace { display: flex; width: max-content; margin: 30px auto 0; }
.fecha-detalle { margin-top: 18px; font: 600 12px/1.6 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--gris); }
.codigo { display: inline-flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 54px; padding: 20px 24px 18px; border: 1px solid rgba(26, 24, 22, .16); }
.codigo-rec { display: flex; align-items: center; gap: 9px; font: 600 10px/1 var(--sans); letter-spacing: .38em; text-transform: uppercase; color: #A3392A; }
.codigo-rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #C8452F; animation: grabar 1.6s steps(1) infinite; }
.codigo:has(.tc.pasada) .codigo-rec { display: none; }
.tc-numeros { display: flex; }
.tc-casilla { display: flex; flex-direction: column; align-items: center; min-width: 4.2rem; padding: 0 .3em; }
.tc-n { position: relative; display: inline-block; font: 400 clamp(2.1rem, 9.5vw, 3.2rem)/1 var(--cifras); font-variant-numeric: lining-nums tabular-nums; }
.tc-n.cambia { animation: cambiar .5s var(--curva); }
.tc-casilla + .tc-casilla { position: relative; }
.tc-casilla + .tc-casilla::before { content: ":"; position: absolute; left: -.12em; top: .05em; font: 400 clamp(2.1rem, 9.5vw, 3.2rem)/1 var(--cifras); opacity: .3; }
.tc-e { margin-top: 6px; font: 600 9.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gris); }
.tc-pasada { display: none; font: italic 400 1.6rem/1.3 var(--serif); }
.tc.pasada .tc-numeros { display: none; }
.tc.pasada .tc-pasada { display: block; }

/* ===== 5 · El día ===== */
.dia { padding: 6svh var(--lateral) 16svh; background: var(--papel); color: var(--tinta); }
.dia-cabeza { text-align: center; margin-bottom: 56px; }
.dia-cabeza h2 { margin-top: 14px; font: 400 clamp(2.8rem, 12vw, 5.4rem)/1 var(--serif); }
.programa { --col: 4.4rem; --hueco: 26px; position: relative; list-style: none; max-width: 40rem; margin: 0 auto; padding: 0; }
.programa::before { content: ""; position: absolute; left: calc(var(--col) + var(--hueco) / 2); top: 10px; bottom: 30px; width: 1px; background: rgba(26, 24, 22, .22); transform-origin: top; }
.momento { position: relative; display: grid; grid-template-columns: var(--col) 1fr; gap: 0 var(--hueco); padding-bottom: 40px; }
.momento::before { content: ""; position: absolute; left: calc(var(--col) + var(--hueco) / 2 - 5px); top: .62em; width: 11px; height: 11px; border-radius: 50%; background: var(--papel); border: 1px solid var(--laton-tinta); }
.momento-hora { font: 400 1.35rem/1.35 var(--cifras); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.momento h3 { font: 500 1.7rem/1.15 var(--serif); }
.momento-donde { margin-top: 6px; font: 600 11px/1.5 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--laton-tinta); }
.momento-nota { margin-top: 6px; color: var(--gris); font-size: .98rem; }
.lugares { display: grid; gap: 22px; max-width: 76rem; margin: 12svh auto 0; }
.programa + .lugares { margin-top: 10svh; }
.dia-cabeza + .lugares { margin-top: 0; }
.lugar { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: 72svh; background: var(--carbon); color: var(--hueso); }
.lugar:not(:has(.lugar-foto)) { min-height: 0; }
.lugar-foto { position: absolute; inset: 0; z-index: -1; }
.lugar-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.8s var(--curva); }
.lugar-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(14, 13, 12, .88)); }
.lugar:hover .lugar-foto img { transform: scale(1.04); }
.lugar-pie { padding: 30px 24px 32px; }
.lugar h3 { margin-top: 10px; font: 400 clamp(2.1rem, 8.5vw, 3.2rem)/1.04 var(--serif); text-wrap: balance; }
.lugar-municipio { margin-top: 6px; color: var(--humo); }
.lugar .enlace { margin-top: 22px; }
@media (min-width: 900px) {
  .lugares { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .lugar { min-height: 78svh; }
  .lugar-pie { padding: 40px 40px 44px; }
}

/* ===== 6 · Montaje ===== */
.montaje { padding: 16svh var(--lateral); background: var(--negro); }
.montaje > .credito { text-align: center; margin-bottom: 40px; }
.montaje-rejilla { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-flow: dense; gap: 8px; max-width: 80rem; margin: 0 auto; }
.toma { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: var(--carbon); }
.toma:nth-child(5n + 1) { grid-column: span 2; aspect-ratio: 3 / 2; }
.toma img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--curva); }
.toma:hover img { transform: scale(1.05); }
.toma figcaption { position: absolute; left: 10px; bottom: 8px; font: 600 10px/1 var(--sans); letter-spacing: .2em; color: var(--humo); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }

/* ===== 7 · Lo práctico ===== */
.practico { padding: 16svh var(--lateral); background: var(--papel); color: var(--tinta); }
.practico > .credito { text-align: center; margin-bottom: 44px; }
.practico dl { max-width: 58rem; margin: 0 auto; border-top: 1px solid rgba(26, 24, 22, .16); }
.practico-fila { display: grid; gap: 8px; padding: 26px 0 28px; border-bottom: 1px solid rgba(26, 24, 22, .16); }
.practico dt { font: 500 1.65rem/1.15 var(--serif); }
.practico dd { color: var(--gris); }
.practico dd p + p { margin-top: 10px; }
@media (min-width: 760px) { .practico-fila { grid-template-columns: 17rem 1fr; gap: 40px; } }

/* ===== 8 · Confirmar ===== */
.confirmar { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 92svh; padding: 18svh var(--lateral); background: var(--negro); text-align: center; }
.confirmar h2 { margin-top: 22px; font: italic 400 clamp(3.3rem, 15.5vw, 8.4rem)/.94 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.confirmar-texto { max-width: 32rem; margin: 26px auto 0; color: var(--humo); }
.confirmar-botones { display: grid; gap: 12px; width: 100%; max-width: 26rem; margin-top: 46px; }
.accion {
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 19px 22px; border: 1px solid rgba(239, 233, 223, .42); border-radius: 99px;
  font: 600 12.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; transition: background .5s var(--curva), color .5s var(--curva), border-color .5s;
}
.accion b { font-weight: 600; color: var(--laton); transition: color .5s; }
.accion .icono { width: 18px; height: 18px; }
.accion:hover, .accion:focus-visible { background: var(--hueso); color: var(--negro); border-color: var(--hueso); outline: none; }
.accion:hover b, .accion:focus-visible b { color: var(--laton-tinta); }

/* ===== 9 · Regalo ===== */
.regalo { padding: 14svh var(--lateral); background: var(--carbon); text-align: center; }
.regalo h2 { max-width: 32rem; margin: 18px auto; font: 400 clamp(2.3rem, 9.5vw, 3.8rem)/1.08 var(--serif); text-wrap: balance; }
.regalo > p { max-width: 32rem; margin: 0 auto; color: var(--humo); }
.metodos { max-width: 27rem; margin: 38px auto 0; text-align: left; border-top: 1px solid rgba(239, 233, 223, .18); }
.metodo { border-bottom: 1px solid rgba(239, 233, 223, .18); }
.metodo summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 20px 2px; font: 500 1.45rem/1 var(--serif); }
.metodo summary::-webkit-details-marker { display: none; }
.metodo summary .icono { color: var(--laton); width: 20px; height: 20px; }
.metodo summary::after { content: "+"; margin-left: auto; font: 300 1.6rem/1 var(--sans); color: var(--laton); transition: transform .4s var(--curva); }
.metodo[open] summary::after { transform: rotate(45deg); }
.metodo-cuerpo { display: grid; gap: 14px; padding: 0 2px 22px; animation: aparecer .5s both; }
.metodo-dato { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.metodo-etiqueta { width: 100%; font: 600 10px/1.5 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--laton); }
.metodo-valor { flex: 1; min-width: 0; font-size: 1.05rem; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metodo-copiar { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 1px solid rgba(239, 233, 223, .35); border-radius: 99px; background: none; color: var(--hueso); font: 600 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.metodo-copiar.hecho { background: var(--hueso); color: var(--negro); }
.metodo-copiar .icono { width: 14px; height: 14px; }

/* ===== Créditos finales ===== */
.creditos { overflow: hidden; padding: 20svh var(--lateral) 36px; background: var(--negro); text-align: center; }
.creditos { position: relative; isolation: isolate; }
.creditos-foto { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.creditos-foto img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(.62) contrast(1.05); }
.creditos-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--negro), rgba(14, 13, 12, .4) 22%, rgba(14, 13, 12, .4) 78%, var(--negro)); }
.con-iris .creditos-foto {
  -webkit-mask-image: radial-gradient(circle at var(--ix, 50%) var(--iy, 50%), #000 var(--iris, 140vmax), transparent calc(var(--iris, 140vmax) + 1px));
  mask-image: radial-gradient(circle at var(--ix, 50%) var(--iy, 50%), #000 var(--iris, 140vmax), transparent calc(var(--iris, 140vmax) + 1px));
}
.creditos-rollo { display: grid; gap: 8px; max-width: 30rem; margin: 0 auto; }
.creditos-rollo .credito { margin-top: 34px; }
.creditos-rollo .credito:first-child { margin-top: 0; }
.creditos-rollo p:not(.credito) { font: 400 1.32rem/1.35 var(--serif); }
.creditos-rollo p.creditos-nombres { font: italic 400 clamp(2.5rem, 11vw, 3.8rem)/1 var(--serif); }
.creditos-rollo p.creditos-fin { margin-top: 22svh; margin-bottom: 30svh; font: italic 400 1.7rem/1 var(--serif); letter-spacing: .3em; text-indent: .3em; }
.pie-marca { margin-top: 14svh; font: 600 10.5px/1.8 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(239, 233, 223, .5); }

/* El encuadre que elige la pareja (modelo.js → fx-N fy-N) */
.fx-0 { --fx: 0%; } .fy-0 { --fy: 0%; }
.fx-10 { --fx: 10%; } .fy-10 { --fy: 10%; }
.fx-20 { --fx: 20%; } .fy-20 { --fy: 20%; }
.fx-30 { --fx: 30%; } .fy-30 { --fy: 30%; }
.fx-40 { --fx: 40%; } .fy-40 { --fy: 40%; }
.fx-50 { --fx: 50%; } .fy-50 { --fy: 50%; }
.fx-60 { --fx: 60%; } .fy-60 { --fy: 60%; }
.fx-70 { --fx: 70%; } .fy-70 { --fy: 70%; }
.fx-80 { --fx: 80%; } .fy-80 { --fy: 80%; }
.fx-90 { --fx: 90%; } .fy-90 { --fy: 90%; }
.fx-100 { --fx: 100%; } .fy-100 { --fy: 100%; }
img[class*="fx-"] { object-position: var(--fx, 50%) var(--fy, 50%) !important; }

/* ===== Móvil apaisado: todo cabe en la altura ===== */
@media (orientation: landscape) and (max-height: 520px) {
  .titulo { min-height: 100svh; padding-block: 18px; }
  .titulo-marco { gap: 12px; }
  .titulo-nombres { flex-direction: row; align-items: baseline; gap: .22em; font-size: 20svh; }
  .t-y { margin: 0; font-size: .6em; }
  .capitulo { align-items: center; padding-bottom: 0; }
  .capitulo-anio { font-size: 26svh; }
  .capitulo h2 { font-size: 9svh; }
  .historia-velo { background: linear-gradient(90deg, rgba(14, 13, 12, .9), rgba(14, 13, 12, .3) 55%, transparent); }
  .fecha-dia { font-size: 48svh; }
  .lugar { min-height: 92svh; }
  .lugares { grid-template-columns: 1fr 1fr; }
  .confirmar h2 { font-size: 16svh; }
  .seguir { display: none; }
  .titulo { padding-bottom: 9svh; }
  .lugar h3 { font-size: 1.7rem; }
  .lugar-pie { padding: 20px 22px 22px; }
}
/* Montaje: en cuanto hay anchura (tablet, móvil apaisado), cuatro columnas */
@media (min-width: 700px) and (orientation: landscape), (min-width: 900px) {
  .montaje-rejilla { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .toma:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
  .toma:nth-child(5n + 4) { grid-column: span 2; aspect-ratio: 16 / 9; }
}
/* Tablet: el programa crece */
@media (min-width: 700px) {
  .programa { --col: 5.4rem; max-width: 44rem; }
  .momento h3 { font-size: 1.95rem; }
  .momento-hora { font-size: 1.55rem; }
  .practico dt { font-size: 1.85rem; }
}
/* Ordenador: el día en dos columnas, con el título quieto a la izquierda */
@media (min-width: 1100px) {
  .dia { padding-top: 12svh; }
  .dia-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); column-gap: 6vw; align-items: start; max-width: 80rem; margin: 0 auto; }
  .dia-cabeza { position: sticky; top: 22svh; text-align: left; }
  .programa { --col: 6rem; max-width: none; margin: 0; }
  .momento h3 { font-size: 2.1rem; }
  .momento-hora { font-size: 1.7rem; }
  .momento-nota { font-size: 1.05rem; }
  .practico dt { font-size: 2rem; }
  .practico dd { font-size: 1.05rem; }
}

/* ===== Movimiento ===== */
@keyframes rotulo { 0% { opacity: 0; letter-spacing: .9em; } 35%, 72% { opacity: 1; } 100% { opacity: 0; letter-spacing: .6em; } }
@keyframes apertura-fuera { to { opacity: 0; visibility: hidden; } }
@keyframes empujar { from { transform: scale(1.16); } to { transform: none; } }
@keyframes bandas { from { border-width: 0; } }
@keyframes letra { from { opacity: 0; transform: translateY(.12em) scale(1.06); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes latido { 0%, 100% { transform: scaleY(.4); opacity: .4; } 50% { transform: none; opacity: 1; } }
@keyframes grabar { 50% { opacity: 0; } }
@keyframes cambiar { from { opacity: 0; transform: translateY(-40%); } to { opacity: 1; transform: none; } }
@keyframes revelar { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes subtitulo { 0%, 12% { opacity: 0; transform: translateY(46px); } 34%, 60% { opacity: 1; transform: none; } 78%, 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes salir { to { opacity: 0; transform: translateY(-10svh); } }
@keyframes alejar { to { transform: scale(1.08); filter: brightness(.6); } }
/* Apagada, la palabra se sigue leyendo: .42 da 3,4:1 (mínimo para letra grande) */
@keyframes encender { from { opacity: .42; } to { opacity: 1; } }
@keyframes trazo { from { transform: scaleY(0); } to { transform: none; } }
@keyframes rodar { from { transform: translateY(14svh); } to { transform: translateY(-6svh); } }
@property --barrido { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes barrer { from { --barrido: 0deg; } to { --barrido: 360deg; } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .fecha-dia::before { animation: barrer linear both; animation-timeline: --fecha; animation-range: entry 20% cover 55%; }
    .revela { animation: revelar linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
    /* Al salir del título, los nombres suben y se apagan; la foto se aleja */
    .titulo-marco { animation: salir linear both; animation-timeline: view(); animation-range: exit 0% exit 65%; }
    .titulo-foto { animation: alejar linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    /* Cada capítulo entra, se queda y se va, como un subtítulo */
    .capitulo-texto.revela { animation-name: subtitulo; animation-range: cover 0% cover 100%; }
    .palabra { animation: encender linear both; animation-timeline: view(); animation-range: entry 60% cover 42%; }
    .programa::before { animation: trazo linear both; animation-timeline: view(); animation-range: entry 30% cover 70%; }
    .creditos-rollo { animation: rodar linear both; animation-timeline: view(); animation-range: entry 0% exit 30%; }
  }
  .js-revela .revela { transition: opacity 1s var(--curva), transform 1s var(--curva); }
  .js-revela .revela:not(.visto) { opacity: 0; transform: translateY(40px); }
  .js-revela .palabras:not(.visto) .palabra { opacity: .42; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .apertura { display: none; }
  .letra, .t-y, .titulo-arriba, .titulo-abajo, .seguir { opacity: 1; }
}

/* Tamaño de dedo (44 px, lo que pide Apple) y anclas que no quedan bajo la barra.
   Lo comprueba herramientas/revisar.mjs */
[id] { scroll-margin-top: 78px; }
#inicio { scroll-margin-top: 0; }
.enlace { min-height: 44px; align-items: flex-end; margin-top: 12px; }
.metodo-copiar { min-height: 42px; }
.barra-accion { min-height: 40px; display: inline-flex; align-items: center; }
.barra-nombres { line-height: 44px; }
.pie-marca a { display: inline-block; padding: 14px 3px; margin: -14px 0; }

/* ===== Confirmar con enlace personal (comun.js → formularioConfirmar).
   Igual en las siete plantillas: hereda el color y la letra de cada una. */
.rsvp { display: grid; gap: 18px; width: 100%; max-width: 34rem; margin: 22px auto 0; text-align: left; }
.rsvp-saludo { margin: 0; font-size: 1.15em; }
.rsvp-hecho { margin: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid currentColor; font-weight: 600; }
.rsvp-nota { margin: 0; }
.rsvp fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.rsvp legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.rsvp-asiste { display: flex; flex-wrap: wrap; gap: 10px; }
.rsvp-asiste legend { width: 100%; }
.rsvp-asiste label { flex: 1 1 9rem; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent); cursor: pointer; }
.rsvp-asiste label:has(input:checked) { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.rsvp-asiste input { width: 20px; height: 20px; margin: 0; accent-color: currentColor; }
.rsvp-si, .rsvp-personas { display: grid; gap: 18px; }
.rsvp-persona { display: grid; gap: 10px; padding-top: 14px !important; border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent) !important; }
.rsvp-campo { display: grid; gap: 6px; }
.rsvp-campo > span { font-size: .88em; }
.rsvp input:not([type=radio]), .rsvp select, .rsvp textarea { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent); background: color-mix(in srgb, currentColor 5%, transparent);
  color: inherit; font: inherit; font-size: max(16px, 1em); }
.rsvp select option { color: #111; background: #fff; }
.rsvp textarea { min-height: 90px; resize: vertical; }
.rsvp input:focus-visible, .rsvp select:focus-visible, .rsvp textarea:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.rsvp-enviar { justify-self: start; min-height: 48px; cursor: pointer; font: inherit; }
.rsvp-whatsapp { display: flex; flex-wrap: wrap; gap: 10px; }
.rsvp:has(input[name="asiste"][value="no"]:checked) .rsvp-si { display: none; }
.rsvp:has(select[name="n"] option[value="1"]:checked) .rsvp-persona:nth-child(n+2) { display: none; }
.rsvp:has(select[name="n"] option[value="2"]:checked) .rsvp-persona:nth-child(n+3) { display: none; }
.rsvp:has(select[name="n"] option[value="3"]:checked) .rsvp-persona:nth-child(n+4) { display: none; }
.rsvp:has(select[name="n"] option[value="4"]:checked) .rsvp-persona:nth-child(n+5) { display: none; }
.rsvp:has(select[name="n"] option[value="5"]:checked) .rsvp-persona:nth-child(n+6) { display: none; }
.rsvp:has(select[name="n"] option[value="6"]:checked) .rsvp-persona:nth-child(n+7) { display: none; }
.rsvp:has(select[name="n"] option[value="7"]:checked) .rsvp-persona:nth-child(n+8) { display: none; }
.rsvp:has(select[name="n"] option[value="8"]:checked) .rsvp-persona:nth-child(n+9) { display: none; }
.rsvp:has(select[name="n"] option[value="9"]:checked) .rsvp-persona:nth-child(n+10) { display: none; }
.rsvp:has(select[name="n"] option[value="10"]:checked) .rsvp-persona:nth-child(n+11) { display: none; }
.rsvp:has(select[name="n"] option[value="11"]:checked) .rsvp-persona:nth-child(n+12) { display: none; }
.rsvp:has(select[name="n"] option[value="12"]:checked) .rsvp-persona:nth-child(n+13) { display: none; }
.rsvp:has(select[name="n"] option[value="13"]:checked) .rsvp-persona:nth-child(n+14) { display: none; }
.rsvp:has(select[name="n"] option[value="14"]:checked) .rsvp-persona:nth-child(n+15) { display: none; }
.rsvp:has(select[name="n"] option[value="15"]:checked) .rsvp-persona:nth-child(n+16) { display: none; }
.rsvp:has(select[name="n"] option[value="16"]:checked) .rsvp-persona:nth-child(n+17) { display: none; }
.rsvp:has(select[name="n"] option[value="17"]:checked) .rsvp-persona:nth-child(n+18) { display: none; }
.rsvp:has(select[name="n"] option[value="18"]:checked) .rsvp-persona:nth-child(n+19) { display: none; }
.rsvp:has(select[name="n"] option[value="19"]:checked) .rsvp-persona:nth-child(n+20) { display: none; }
