/*
 * Vives en mí — sitio web de la campaña de Día de Muertos de J. García López.
 * Dirección: íntimo y elegante, como estar frente a un altar de noche iluminado por
 * velas. Fotografía realista, penumbra cálida y luz de vela viva (flamas y halos que
 * tiemblan). Solo copy aprobado por la marca (entrega-campana/index.html y gracias.html).
 */
@font-face { font-family: 'Meta Serif Pro'; src: url('../fonts/MetaSerifPro-Medium.woff2') format('woff2'); font-style: normal; font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Meta Serif Pro'; src: url('../fonts/MetaSerifPro-MediumItalic.woff2') format('woff2'); font-style: italic; font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Meta Serif Pro'; src: url('../fonts/MetaSerifPro-BoldItalic.woff2') format('woff2'); font-style: italic; font-weight: 700; font-display: swap; }
/* Letra manuscrita de las cartas (Homemade Apple, Google Fonts, licencia Apache 2.0) */
@font-face { font-family: 'Homemade Apple'; src: url('../fonts/HomemadeApple-Regular.woff2') format('woff2'); font-display: swap; }

:root {
    /* Café de olla: fondos cálidos tomados de la foto del altar, nunca negro */
    --noche: #3a2418;
    --noche-2: #44291c;
    --noche-hondo: #2c1b12;
    --cera: #f3e3c6;
    --cera-suave: rgba(243, 227, 198, .74);
    --orange: #ff5b00;
    --orange-press: #e04f00;
    --ambar: #ffb35c;
    --papel: #f8eedf;
    --ink: #4a1d05;
    --rust: #b54d10;
    --dark-rust: #8e3604;
    --line: #e5cba5;
    --radius: 14px;
    --barra: 68px;
    --pared: #1c1311;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; min-width: 320px; font-family: 'Meta Serif Pro', Georgia, serif; font-size: 17px; line-height: 1.55; color: var(--cera); background: var(--noche); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
.wrap { width: min(100% - 40px, 1140px); margin-inline: auto; }
.titulo-crema { filter: brightness(0) invert(92%) sepia(16%) saturate(420%) hue-rotate(330deg); }

/* ── Botones ───────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--orange); color: #fff; font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.btn:hover { background: var(--orange-press); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 15px; white-space: nowrap; }
.btn-linea { border: 1px solid rgba(243, 227, 198, .45); background: transparent; color: var(--cera); }
.btn-linea:hover, .btn-linea[aria-current] { border-color: var(--cera); background: rgba(243, 227, 198, .08); }
:is(.btn, .stepper button, a, button):focus-visible { outline: 2px solid var(--ambar); outline-offset: 3px; }

/* ── Barra superior ────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(44, 27, 18, .94); border-bottom: 1px solid rgba(243, 227, 198, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--barra); }
.topbar-logo img { width: 118px; filter: brightness(0) invert(92%) sepia(16%) saturate(420%) hue-rotate(330deg); }
.topbar-nav { display: flex; align-items: center; gap: 12px; }
/* Área de toque de 44 px de alto aunque el texto sea pequeño */
.topbar-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--cera-suave); font-size: 15px; font-weight: 600; text-decoration: none; }
.topbar-link:hover, .topbar-link[aria-current] { color: var(--cera); }

/* ── Luz de vela ───────────────────────────────────────
 * .flama: la flama de cada vela (núcleo claro, cuerpo ámbar y base azulada).
 * .luz: el halo que la vela proyecta sobre la pared y los retratos; tiembla con ella.
 */
.flama { position: absolute; left: var(--fx, 50%); top: var(--fy, 0); z-index: 3; width: var(--fw, 12px); aspect-ratio: 1 / 2.5; transform: translate(-50%, -96%); transform-origin: 50% 100%; pointer-events: none; animation: flama var(--ft, 1.7s) ease-in-out var(--fd, 0s) infinite alternate; }
.flama::before { content: ''; position: absolute; inset: 0; border-radius: 50% 50% 46% 46% / 64% 64% 36% 36%; background: radial-gradient(ellipse 48% 42% at 50% 74%, #fffaf0 0 30%, #ffe2a1 46%, #ffae45 66%, rgba(255, 128, 30, .55) 82%, rgba(255, 110, 20, 0) 100%); filter: blur(.35px); }
.flama::after { content: ''; position: absolute; left: 50%; bottom: 2%; width: 46%; height: 18%; border-radius: 50%; background: rgba(110, 140, 255, .45); transform: translateX(-50%); filter: blur(1px); }
.halo { position: absolute; left: var(--fx, 50%); top: var(--fy, 0); z-index: 2; width: calc(var(--fw, 12px) * 7); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 196, 120, .55), rgba(255, 150, 60, .16) 38%, rgba(255, 140, 50, 0) 70%); transform: translate(-50%, -70%); pointer-events: none; mix-blend-mode: screen; animation: pulso var(--ft, 1.7s) ease-in-out var(--fd, 0s) infinite alternate; }
.luz { position: absolute; left: var(--x); top: var(--y); z-index: 2; width: var(--d, 340px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 90, var(--i, .3)), rgba(255, 140, 60, calc(var(--i, .3) * .3)) 40%, rgba(255, 130, 50, 0) 70%); transform: translate(-50%, -50%); pointer-events: none; mix-blend-mode: screen; animation: pulso var(--t, 2.3s) ease-in-out var(--dd, 0s) infinite alternate; }
@keyframes flama {
    0% { transform: translate(-50%, -96%) scale(1, 1) rotate(-1.5deg); }
    30% { transform: translate(-50%, -96%) scale(.95, 1.07) rotate(1.5deg); }
    55% { transform: translate(-50%, -96%) scale(1.04, .95) rotate(-.5deg); }
    80% { transform: translate(-50%, -96%) scale(.97, 1.04) rotate(1deg); }
    100% { transform: translate(-50%, -96%) scale(1.02, .98) rotate(-1deg); }
}
@keyframes pulso { 0% { opacity: .82; } 40% { opacity: 1; } 70% { opacity: .88; } 100% { opacity: .97; } }

/* ── Luz de vela sobre toda la escena ──────────────────
 * Tres capas que titilan a ritmos distintos (primos entre sí, así nunca se repite el mismo
 * patrón): dos focos cálidos que respiran y una penumbra en las orillas que se mueve con ellos.
 */
.luz-velas { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.luz-velas i { position: absolute; inset: -10%; }
.luz-velas .calida-1 { background: radial-gradient(ellipse 45% 55% at 32% 62%, rgba(255, 160, 70, .32), rgba(255, 140, 50, 0) 70%); mix-blend-mode: soft-light; animation: titila-a 3.7s infinite; }
.luz-velas .calida-2 { background: radial-gradient(ellipse 40% 50% at 72% 58%, rgba(255, 175, 90, .3), rgba(255, 140, 50, 0) 70%); mix-blend-mode: soft-light; animation: titila-b 2.9s infinite; }
.luz-velas .ambar { background: rgba(255, 150, 60, .07); mix-blend-mode: overlay; animation: titila-c 4.3s infinite; }
.luz-velas .penumbra { background: radial-gradient(ellipse 80% 75% at 50% 58%, rgba(38, 23, 15, 0) 55%, rgba(38, 23, 15, .5) 100%); animation: respira 5.3s ease-in-out infinite alternate; }
@keyframes titila-a { 0% { opacity: .85; translate: 0 0; } 13% { opacity: 1; } 21% { opacity: .78; translate: .4% -.3%; } 34% { opacity: .95; } 47% { opacity: .82; translate: -.3% .2%; } 58% { opacity: 1; } 71% { opacity: .74; translate: .2% .3%; } 86% { opacity: .93; } 100% { opacity: .85; translate: 0 0; } }
@keyframes titila-b { 0% { opacity: .9; translate: 0 0; } 17% { opacity: .72; translate: -.4% .2%; } 29% { opacity: 1; } 43% { opacity: .86; translate: .3% -.2%; } 61% { opacity: .7; } 77% { opacity: .97; translate: -.2% -.3%; } 100% { opacity: .9; translate: 0 0; } }
@keyframes titila-c { 0%, 100% { opacity: .6; } 11% { opacity: 1; } 19% { opacity: .5; } 37% { opacity: .9; } 52% { opacity: .65; } 68% { opacity: 1; } 83% { opacity: .55; } }
@keyframes respira { from { opacity: .85; scale: 1; } to { opacity: 1; scale: 1.03; } }
.en-altar::before { animation: pulso 2.6s ease-in-out infinite alternate; }

/* ── Carga: una luz de vela que se enciende ─────────────
 * Solo resplandores difusos (sin dibujar una vela). Se enciende, titila y respira mientras
 * carga; al terminar (clase .listo, la pone intro.js) la luz se abre y se desvanece.
 */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; background: #2a1a11; transition: background-color 1.3s ease .1s; }
/* Al terminar, la oscuridad se disuelve y el logo y la flama viajan a su lugar en el hero (intro.js) */
.intro.saliendo { background-color: rgba(7, 4, 3, 0); pointer-events: none; }
.intro.saliendo .intro-halos { opacity: 0; transition: opacity .9s ease; }
.intro.listo { opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
body:has(#intro) :is(.hero-texto h1 img, .altar-entrada img) { opacity: 0; }
/* La flama está abajo del logo; su base es el punto de origen y el resplandor nace justo encima */
.intro-luz { position: absolute; left: 50%; top: 64%; width: 0; height: 0; }
.intro-halos { position: absolute; left: 0; top: -34px; animation: deriva 3.7s ease-in-out 1.2s infinite; }
.intro-halos i { position: absolute; left: 0; top: 0; border-radius: 50%; translate: -50% -50%; mix-blend-mode: screen; }
.intro-luz .halo-1 { width: 200px; height: 240px; background: radial-gradient(ellipse, rgba(255, 205, 125, .5), rgba(255, 150, 60, 0) 70%); filter: blur(10px); opacity: 0; scale: .2; animation: crece 1.4s cubic-bezier(.2, .7, .2, 1) .55s forwards, respira-luz 2.3s ease-in-out 2s infinite; }
.intro-luz .halo-2 { width: 640px; height: 680px; background: radial-gradient(ellipse, rgba(255, 160, 70, .3), rgba(255, 130, 50, 0) 68%); filter: blur(24px); opacity: 0; scale: .2; animation: crece 1.9s cubic-bezier(.2, .7, .2, 1) .75s forwards, respira-luz 3.1s ease-in-out 2.6s infinite reverse; }
.intro-luz .halo-3 { width: 170vmax; height: 170vmax; background: radial-gradient(circle, rgba(255, 140, 60, .14), rgba(255, 120, 40, 0) 55%); filter: blur(40px); opacity: 0; scale: .2; animation: crece 2.6s cubic-bezier(.2, .7, .2, 1) 1s forwards, respira-luz 4.1s ease-in-out 3.5s infinite; }

/* Flama: se mece con el aire desde la base (viento) y además titila rápido (cuerpo) */
.intro-flama { position: absolute; left: 0; top: 0; width: 22px; height: 58px; translate: -50% -100%; transform-origin: 50% 100%; opacity: 0; scale: .2; animation: nace-flama .9s cubic-bezier(.2, .8, .3, 1.2) .3s forwards, viento 3.7s ease-in-out 1.2s infinite; }
.intro-flama i { position: absolute; left: 50%; bottom: 0; translate: -50% 0; transform-origin: 50% 100%; }
.intro-flama .cuerpo { width: 100%; height: 100%; border-radius: 50% 50% 46% 46% / 72% 72% 28% 28%; background: radial-gradient(ellipse 60% 55% at 50% 72%, #fff6df 0 22%, #ffd890 42%, #ffa847 64%, rgba(255, 120, 30, .5) 82%, rgba(255, 110, 20, 0) 100%); filter: blur(1.4px); animation: titila-flama .19s steps(1) infinite, estira 1.3s ease-in-out infinite alternate; }
.intro-flama .centro { width: 40%; height: 42%; bottom: 8%; border-radius: 50%; background: #fffdf5; filter: blur(2.5px); opacity: .9; }
.intro-flama .base { width: 46%; height: 16%; bottom: 0; border-radius: 50%; background: rgba(110, 140, 255, .5); filter: blur(2px); }
@keyframes nace-flama { to { opacity: 1; scale: 1; } }
@keyframes viento {
    0%, 100% { rotate: 0deg; }
    14% { rotate: -4deg; }
    27% { rotate: 2.5deg; }
    38% { rotate: -1.5deg; }
    55% { rotate: 5deg; }
    63% { rotate: 1deg; }
    78% { rotate: -3deg; }
    90% { rotate: 1.5deg; }
}
@keyframes deriva { 0%, 100% { translate: 0 0; } 14% { translate: -3px 1px; } 27% { translate: 2px 0; } 55% { translate: 4px 1px; } 78% { translate: -2px 0; } }
@keyframes estira { 0% { scale: 1 1; } 30% { scale: .92 1.1; } 60% { scale: 1.06 .94; } 100% { scale: .96 1.05; } }
@keyframes titila-flama { 0% { opacity: 1; } 25% { opacity: .9; } 50% { opacity: 1; } 75% { opacity: .94; } }
.intro-titulo { position: absolute; left: 50%; top: 40%; translate: -50% -50%; width: min(64vw, 340px); opacity: 0; filter: brightness(0) invert(92%) sepia(30%) saturate(520%) hue-rotate(330deg) blur(8px); animation: revela 1.6s ease-out 1.15s forwards; }
@keyframes nace { to { opacity: 1; } }
@keyframes respira-luz { 0%, 100% { opacity: 1; scale: 1; } 23% { opacity: .82; scale: .97; } 41% { opacity: .96; scale: 1.02; } 64% { opacity: .78; scale: .98; } 82% { opacity: 1; scale: 1.03; } }
@keyframes crece { to { opacity: 1; scale: 1; } }
@keyframes revela { to { opacity: 1; filter: brightness(0) invert(92%) sepia(30%) saturate(520%) hue-rotate(330deg) blur(0); } }

/* ── Hero: altar con un marco donde se restauran las fotos ─ */
.hero-noche { position: relative; background: var(--noche); }
.hero-escena { position: relative; height: max(600px, calc(100svh - var(--barra))); overflow: hidden; }
.hero-caja { position: absolute; left: 50%; bottom: 0; width: max(100%, calc(max(600px, 100svh - var(--barra)) * 1.5)); aspect-ratio: 3 / 2; transform: translateX(-50%); }
.hero-caja picture, .hero-caja .hero-fondo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-escena::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(90deg, rgba(38, 23, 15, .78) 0%, rgba(38, 23, 15, .55) 32%, rgba(38, 23, 15, 0) 52%), radial-gradient(ellipse 75% 85% at 66% 60%, rgba(38, 23, 15, 0) 45%, rgba(38, 23, 15, .55) 100%); pointer-events: none; }
.hero-marco { position: absolute; left: 60.94%; top: 32.7%; width: 16.2%; height: 32.9%; transform: skewX(-3.6deg); z-index: 1; overflow: hidden; background: #2a2420; }
.hero-marco img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.rh-restaurada { filter: sepia(.12) brightness(.94); }
.rh-craquelado { mix-blend-mode: multiply; opacity: .55; }
.recuerdo-hero.is-restaurando .rh-restaurada { animation: rh-revela 1.9s cubic-bezier(.6, 0, .3, 1) forwards; }
.rh-barrido { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; z-index: 2; background: rgba(255, 236, 200, .9); box-shadow: 0 0 12px 3px rgba(255, 200, 130, .6); opacity: 0; }
.recuerdo-hero.is-restaurando .rh-barrido { animation: rh-barre 1.9s cubic-bezier(.6, 0, .3, 1) forwards; }
.recuerdo-hero.is-cambiando .hero-marco img, .recuerdo-hero.is-cambiando .rh-historia { opacity: 0; transition: opacity .6s ease; }
.hero-marco img, .rh-historia { transition: opacity .6s ease; }
@keyframes rh-revela { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes rh-barre { 0% { left: 0; opacity: 1; } 94% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

.hero-texto { position: absolute; z-index: 4; top: 0; bottom: 0; left: max(20px, calc((100% - 1140px) / 2)); display: flex; flex-direction: column; justify-content: center; width: min(470px, 42%); }
.hero-texto .titulo-inicio { width: min(100%, 360px); }
.hero-texto h1 img { width: 100%; }
.lead { margin: 20px 0 0; color: var(--cera); font-size: 20px; line-height: 1.5; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.lead + .lead { margin-top: 6px; }
.lead strong { color: var(--ambar); }
.hero-actions { margin-top: 28px; }
.rh-historia { min-height: 7.4em; margin: 34px 0 0; padding-left: 18px; border-left: 1px solid rgba(243, 227, 198, .28); color: var(--cera-suave); font-size: 17px; font-style: italic; line-height: 1.6; text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.rh-demo { display: block; margin-top: 10px; color: rgba(243, 227, 198, .45); font-size: 12px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
[data-maquina].is-escribiendo::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -.12em; background: var(--ambar); animation: cursor .9s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }

/* Luces de las velas que vienen en la foto del hero */
.hero-caja .luz { z-index: 2; }
.hero-caja .luz-1 { --x: 46.5%; --y: 51.5%; --d: 26%; --i: .34; --t: 1.9s; }
.hero-caja .luz-2 { --x: 90.7%; --y: 59.8%; --d: 26%; --i: .34; --t: 2.4s; --dd: -.7s; }
.hero-caja .luz-3 { --x: 29%; --y: 28.5%; --d: 18%; --i: .28; --t: 2.1s; --dd: -1.2s; }

/* ── Formulario ────────────────────────────────────── */
/* Medidas tomadas 1:1 del diseño (Formulario web 01-03, 1920 px de ancho): --u es un píxel
   del diseño y se encoge con la pantalla; en celular hay medidas propias más abajo. */
.share { --u: clamp(.6px, calc(100vw / 1920), 1px); --papel-form: #f5eddf; --tinta-form: #3d1f0c; --naranja-form: #c16223; --durazno: #d5ab8c; --borde-form: #dcc8b4; --placeholder-form: #c99f80;
    position: relative; overflow-x: clip; padding: calc(137 * var(--u)) 0 calc(117 * var(--u)); background: #3b2920; }
.share-inner { position: relative; width: min(100% - 32px, calc(1456 * var(--u))); max-width: none; }
.flor-esquina { position: absolute; z-index: 2; width: calc(163 * var(--u)); pointer-events: none; }
.flor-sup-izq { left: calc(-119 * var(--u)); top: calc(-85 * var(--u)); }
.flor-sup-der { right: calc(-119 * var(--u)); top: calc(-85 * var(--u)); }
.flor-inf-izq { left: calc(-119 * var(--u)); bottom: calc(-90 * var(--u)); }
.flor-inf-der { right: calc(-119 * var(--u)); bottom: calc(-90 * var(--u)); }

/* Tarjeta de papel picado: orilla de medios círculos con su perforación arriba y abajo */
.card { position: relative; display: flex; flex-direction: column; min-height: calc(826 * var(--u)); padding: calc(48 * var(--u)) calc(60 * var(--u)) calc(44 * var(--u)); color: var(--tinta-form);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 26'%3E%3Cpath fill='%23f5eddf' fill-rule='evenodd' d='M.5 17.5a17.5 17.5 0 0 1 35 0H36V26H0v-8.5zM11.7 17.5a6.3 6.3 0 1 0 12.6 0a6.3 6.3 0 1 0-12.6 0z'/%3E%3C/svg%3E") left top / calc(36 * var(--u)) calc(26 * var(--u)) round no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 26'%3E%3Cpath fill='%23f5eddf' fill-rule='evenodd' d='M.5 8.5a17.5 17.5 0 0 0 35 0H36V0H0v8.5zM11.7 8.5a6.3 6.3 0 1 0 12.6 0a6.3 6.3 0 1 0-12.6 0z'/%3E%3C/svg%3E") left bottom / calc(36 * var(--u)) calc(26 * var(--u)) round no-repeat,
        linear-gradient(var(--papel-form), var(--papel-form)) center / 100% calc(100% - 52 * var(--u)) no-repeat; }

.stepper { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 0 calc(30 * var(--u)) calc(25 * var(--u)); border-bottom: 1px solid #d6bba3; list-style: none; }
.stepper button { display: flex; align-items: center; gap: calc(12 * var(--u)); padding: 0; border: 0; background: none; color: var(--durazno); font-size: calc(32 * var(--u)); font-weight: 600; line-height: 1.1; text-align: left; white-space: nowrap; cursor: default; }
.stepper span { display: inline-grid; place-items: center; flex: none; width: calc(48 * var(--u)); height: calc(48 * var(--u)); border: 1.5px solid currentColor; border-radius: 50%; font-size: calc(32 * var(--u)); line-height: 1; }
.stepper .is-active { color: var(--naranja-form); }
.stepper .is-active span { border-color: var(--naranja-form); background: var(--naranja-form); color: var(--papel-form); }
.stepper .is-done { cursor: pointer; }
.stepper .is-done:hover { color: var(--naranja-form); }

.form-step { display: flex; flex: 1; flex-direction: column; text-align: center; }
.form-step:is([hidden]) { display: none; }
.step-count { margin: calc(15 * var(--u)) 0 0; color: #b0531b; font-size: calc(26 * var(--u)); font-weight: 600; letter-spacing: .01em; line-height: 1.15; text-transform: uppercase; }
.form-step h3 { display: flex; align-items: center; justify-content: center; gap: calc(14 * var(--u)); margin-top: calc(14 * var(--u)); color: #7f3a14; font-size: calc(56 * var(--u)); line-height: 1.15; }
.form-step h3 .floritura { flex: none; width: calc(226 * var(--u)); }
.step-intro { margin: calc(16 * var(--u)) 0 0; font-size: calc(26 * var(--u)); line-height: 1.3; }
.ideas { display: grid; grid-template-columns: 458fr 558fr; gap: calc(11 * var(--u)) calc(14 * var(--u)); width: min(100%, calc(1030 * var(--u))); margin: calc(12 * var(--u)) auto 0; padding: 0; list-style: none; text-align: left; }
.ideas li { display: flex; align-items: center; gap: calc(6 * var(--u)); min-height: calc(77 * var(--u)); padding: 0 calc(6 * var(--u)) 0 calc(10 * var(--u)); border: 1px solid #dcc3a9; border-radius: calc(22 * var(--u)); background: #f3e6d4; font-size: calc(24.5 * var(--u)); line-height: 1.2; white-space: nowrap; }
.idea-icono { display: flex; align-items: center; justify-content: center; flex: none; width: calc(54 * var(--u)); }
.idea-icono img { width: auto; height: calc(var(--alto) * var(--u)); }
.ideas li:nth-child(1) img { --alto: 52; }
.ideas li:nth-child(2) img { --alto: 49; }
.ideas li:nth-child(3) img { --alto: 41; }
.ideas li:nth-child(4) img { --alto: 36; }
.share textarea, .fields input, .fields select { width: 100%; border: 1px solid var(--borde-form); background: #fff; color: var(--tinta-form); outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.share textarea { display: block; width: min(100%, calc(1118 * var(--u))); min-height: calc(194 * var(--u)); margin: calc(17 * var(--u)) auto 0; padding: calc(18 * var(--u)) calc(26 * var(--u)); border-color: #c9a283; border-radius: calc(34 * var(--u)); font-size: calc(26 * var(--u)); line-height: 1.4; resize: vertical; }
.share textarea:focus, .fields input:focus, .fields select:focus { border-color: var(--naranja-form); box-shadow: 0 0 0 3px rgba(193, 98, 35, .18); }
.share ::placeholder { color: var(--placeholder-form); opacity: 1; }
.actions { display: flex; justify-content: center; margin-top: auto; padding-top: calc(17 * var(--u)); }
.btn-papel { display: inline-flex; align-items: center; justify-content: center; width: calc(395 * var(--u)); height: calc(83 * var(--u)); padding: 0 0 calc(4 * var(--u)); border: 0; background: url('../assets/formulario/boton.svg') center / 100% 100% no-repeat; color: var(--papel-form); font-size: calc(46 * var(--u)); font-weight: 600; line-height: 1; cursor: pointer; transition: filter .15s ease; }
.btn-papel:hover { filter: brightness(.92); }
.btn-papel:focus-visible { outline: 2px solid var(--naranja-form); outline-offset: 4px; }
.upload-box { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: min(100%, calc(790 * var(--u))); min-height: calc(262 * var(--u)); margin: calc(29 * var(--u)) auto 0; padding: calc(24 * var(--u)); border-radius: calc(34 * var(--u)); background: #fff; color: var(--naranja-form); cursor: pointer; transition: box-shadow .15s ease; }
.upload-borde { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.upload-borde rect { width: calc(100% - 1.5px); height: calc(100% - 1.5px); rx: calc(34 * var(--u)); fill: none; stroke: #c06a35; stroke-width: 1.5; stroke-dasharray: 10 7; }
.upload-box:hover .upload-borde rect, .upload-box.dragging .upload-borde rect { stroke-dasharray: none; }
.upload-box:focus-within { box-shadow: 0 0 0 3px rgba(193, 98, 35, .18); }
.upload-icon { width: auto; height: calc(78 * var(--u)); }
.upload-box strong { margin-top: calc(16 * var(--u)); font-size: calc(25 * var(--u)); font-weight: 600; line-height: 1.3; }
.upload-box small { margin-top: calc(6 * var(--u)); font-size: calc(25 * var(--u)); line-height: 1.3; }
.upload-box input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hint { margin: calc(30 * var(--u)) 0 0; color: var(--naranja-form); font-size: calc(25 * var(--u)); line-height: 1.25; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(9 * var(--u)) calc(86 * var(--u)); width: min(100%, calc(990 * var(--u))); margin: calc(36 * var(--u)) auto 0; text-align: left; }
.fields label { padding-left: calc(7 * var(--u)); font-size: calc(27 * var(--u)); line-height: 1.2; }
.fields input, .fields select { display: block; width: calc(100% + 7 * var(--u)); height: calc(46 * var(--u)); margin: calc(1 * var(--u)) 0 0 calc(-7 * var(--u)); padding: 0 calc(7 * var(--u)); border-radius: calc(14 * var(--u)); font-size: calc(27 * var(--u)); }
.fields select { appearance: none; cursor: pointer; }
.fields select:invalid { color: var(--placeholder-form); }
.fields option { color: var(--tinta-form); }
.consents { display: grid; gap: calc(8 * var(--u)); width: min(100%, calc(1006 * var(--u))); margin: calc(13 * var(--u)) auto 0; text-align: left; }
.consents label { display: flex; align-items: center; gap: calc(7 * var(--u)); font-size: calc(16.5 * var(--u)); font-weight: 600; line-height: 1.3; white-space: nowrap; cursor: pointer; }
.consents input { appearance: none; flex: none; width: calc(27 * var(--u)); height: calc(27 * var(--u)); margin: 0; border: 1px solid var(--borde-form); border-radius: 2px; background: #fff center / 70% no-repeat; cursor: pointer; }
.consents input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1' fill='none' stroke='%23c16223' stroke-width='2'/%3E%3C/svg%3E"); }
.consents input:focus-visible { outline: 2px solid var(--naranja-form); outline-offset: 2px; }
.consents a { color: inherit; text-decoration: none; }
.consents a:hover { text-decoration: underline; text-underline-offset: 2px; }
.form-errors { width: min(100%, calc(1118 * var(--u))); margin: calc(20 * var(--u)) auto 0; padding: 14px 18px; border: 1px solid var(--naranja-form); border-radius: 10px; background: #fff1e6; font-size: 15px; text-align: left; }
.form-errors p { margin: 0 0 6px; font-weight: 600; }
.form-errors ul { margin: 0; padding-left: 20px; }
.form-errors .form-errors-note { margin: 8px 0 0; font-weight: 400; }

/* ── Pie ───────────────────────────────────────────── */
.footer { padding: 34px 0; background: var(--noche-hondo); border-top: 1px solid rgba(243, 227, 198, .06); }
.footer-inner { display: flex; justify-content: center; }
.footer img { width: 220px; opacity: .85; }

/* ── Gracias ───────────────────────────────────────── */
.gracias-page { display: flex; flex-direction: column; min-height: 100svh; }
/* Gracias: su foto ya está en el altar y el agradecimiento llega como carta (mismo altar que /recuerdo) */
.gracias { position: relative; flex: 1; }
.recuerdo-escena.gracias-escena { height: max(480px, calc(82svh - var(--barra))); }
.gracias-carta { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gracias-titulo { width: min(56vw, 230px); }
.gracias-carta h1 { margin-top: 22px; color: var(--dark-rust); font-size: clamp(27px, 3.2vw, 36px); }
.carta.gracias-carta p { max-width: 32em; margin-top: 18px; color: var(--ink); font-family: 'Meta Serif Pro', Georgia, serif; font-size: 18px; line-height: 1.65; }
.gracias-carta p strong { color: var(--dark-rust); }
.gracias-carta .btn { margin-top: 28px; min-width: 180px; }

/* Retrato enmarcado (cabecera y repisas) */
.retrato { position: relative; display: block; width: 100%; aspect-ratio: 480 / 605; padding: 0; border: 0; background: none; cursor: zoom-in; rotate: var(--giro, 0deg); scale: var(--escala, 1); transform-origin: 50% 100%; isolation: isolate; transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.retrato-foto { position: absolute; top: 13%; right: 17.6%; bottom: 12.7%; left: 17.3%; width: 65.1%; height: 74.3%; object-fit: cover; object-position: 50% 18%; background: #1a0903; filter: sepia(.14) brightness(.9); }
.retrato-marco { position: relative; width: 100%; height: auto; pointer-events: none; filter: brightness(.88); }
.retrato:hover, .retrato:focus-visible { transform: translateY(-6px) scale(1.05); }
/* Tipos de marco: el hueco donde va la foto cambia en cada uno */
.retrato.marco-oval, .cerca-marco.marco-oval { aspect-ratio: 480 / 664; }
.retrato.marco-sencillo, .cerca-marco.marco-sencillo { aspect-ratio: 480 / 618; }
.marco-oval :is(.retrato-foto, .cerca-foto) { top: 16.8%; left: 16.5%; right: auto; bottom: auto; width: 66.4%; height: 69.3%; border-radius: 50%; }
.marco-sencillo :is(.retrato-foto, .cerca-foto) { top: 10.6%; left: 14%; right: auto; bottom: auto; width: 71.6%; height: 78.8%; }
.retrato:focus-visible { outline: 2px solid var(--ambar); outline-offset: 6px; }

/* Sombras: contacto en la base y una sombra hacia atrás, como la proyecta la luz de las velas */
.retrato::before, .adorno::before, .manojo-sombra { content: ''; position: absolute; left: 6%; right: 6%; bottom: -3%; z-index: -1; height: 9%; border-radius: 50%; background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0) 70%); filter: blur(2px); pointer-events: none; }
.adorno::before { bottom: -6%; height: 16%; left: -4%; right: -4%; }
.retrato { filter: drop-shadow(0 -3px 9px rgba(0, 0, 0, .55)) drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.adorno img, .manojo { filter: brightness(.88) drop-shadow(0 -2px 7px rgba(0, 0, 0, .5)) drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.adorno { isolation: isolate; }

/* Adornos entre los retratos (los acomoda altar.js al azar en cada visita) */
.adorno { flex: none; pointer-events: none; }
.adorno img { width: 100%; }
/* Planos de profundidad: retratos atrás, velas y floreros en medio, ofrendas y cempasúchil al frente */
/* ── Altar horizontal ──────────────────────────────────
 * Como recorrer un altar de pie: alto fijo y se avanza de lado. El altar son cuatro
 * fotografías que embonan entre sí en cualquier orden (repisas a 47.4 % y 77.3 % del alto);
 * altar.js las encadena y para los retratos sobre las repisas, con cempasúchil a sus pies.
 */
.altar-page { background: var(--noche); }
.altar { --inicio: min(42vw, 460px); position: relative; height: max(560px, calc(100svh - var(--barra))); overflow: hidden; background: var(--noche); user-select: none; -webkit-user-select: none; }
.altar::after { content: ''; position: absolute; inset: 0; z-index: 8; background: linear-gradient(90deg, rgba(38, 23, 15, .5), rgba(38, 23, 15, 0) 10%, rgba(38, 23, 15, 0) 90%, rgba(38, 23, 15, .5)), linear-gradient(rgba(38, 23, 15, 0) 70%, rgba(38, 23, 15, .45)); pointer-events: none; }
.altar-vista { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; }
.altar-vista::-webkit-scrollbar { display: none; }
.altar-vista.arrastrando { cursor: grabbing; }
.altar-vista.arrastrando .retrato { pointer-events: none; }
.altar-pista { position: relative; height: 100%; width: var(--ancho, 100%); background: url('../altar/pared.webp') 0 0 / 520px repeat; }
.altar-entrada { position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: var(--inicio); display: flex; flex-direction: column; justify-content: center; padding: 0 clamp(20px, 4vw, 56px); }
/* El logo de Vives en mí siempre lleva al inicio */
.titulo-inicio { display: block; width: fit-content; max-width: 100%; }
.altar-entrada .titulo-inicio { width: min(100%, 300px); }
.altar-entrada img { width: 100%; }
.altar-entrada p { margin: 18px 0 0; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.altar-entrada p strong { color: var(--ambar); }
.altar-entrada .btn { align-self: flex-start; margin-top: 24px; }
.altar-paneles { position: absolute; top: 0; bottom: 0; left: var(--inicio); width: var(--largo, 100%); display: flex; -webkit-mask: linear-gradient(90deg, transparent, #000 90px, #000 calc(100% - 90px), transparent); mask: linear-gradient(90deg, transparent, #000 90px, #000 calc(100% - 90px), transparent); }
.altar-paneles img { height: 100%; width: auto; flex: none; }
.altar-retratos { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--inicio); }
.altar-final { position: absolute; z-index: 6; top: 0; bottom: 0; width: 420px; display: flex; align-items: center; justify-content: center; }

/* Retrato parado en la repisa: luz cálida de las velas y cempasúchil a sus pies */
.en-altar { position: absolute; bottom: calc(100% - var(--y)); transform: translateX(-50%); }
.en-altar .retrato { width: calc(var(--retrato) * var(--tam, 1)); }
.en-altar .retrato-foto { filter: sepia(.25) saturate(.85) brightness(.82) contrast(1.05); }
.en-altar .retrato-marco { filter: brightness(.78) sepia(.2); }
.en-altar::before { content: ''; position: absolute; left: 50%; bottom: 10%; z-index: -1; width: 260%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 90, .22), rgba(255, 150, 60, 0) 60%); transform: translateX(-50%); pointer-events: none; }
.en-altar .flores-pie { position: absolute; left: 50%; bottom: -7%; z-index: 2; width: 150%; translate: -50% 0; pointer-events: none; filter: brightness(.85) drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }

.altar-flecha { position: absolute; z-index: 9; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -26px; border: 1px solid rgba(243, 227, 198, .35); border-radius: 50%; background: rgba(44, 27, 18, .6); color: var(--cera); font-size: 28px; line-height: 1; cursor: pointer; transition: opacity .3s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.altar-flecha:hover { border-color: var(--cera); }
.altar-flecha[data-dir="-1"] { left: 16px; }
.altar-flecha[data-dir="1"] { right: 16px; }
.altar-flecha[disabled] { opacity: 0; pointer-events: none; }
.en-pausa *, .en-pausa *::before, .en-pausa *::after { animation-play-state: paused !important; }

/* Vista de cerca */
.altar-cerca { width: min(100% - 32px, 980px); max-width: none; max-height: calc(100svh - 32px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--cera); overflow: visible; }
.altar-cerca::backdrop { background: rgba(38, 23, 15, .94); }
/* El marco vuela desde su repisa (altar.js); la carta, los controles y la penumbra llegan detrás */
.altar-cerca[open]::backdrop { animation: penumbra-entra .5s ease; }
.altar-cerca[open] :is(.cerca-texto, .cerca-cerrar) { animation: cerca-entra .5s cubic-bezier(.2, .7, .2, 1) .3s backwards; }
.altar-cerca.volando .cerca-marco::before { opacity: 0; }
.altar-cerca.cerrando::backdrop { opacity: 0; transition: opacity .5s ease; }
.altar-cerca.cerrando :is(.cerca-texto, .cerca-cerrar) { opacity: 0; transition: opacity .25s ease; }
.altar-cerca.cerrando .cerca-marco::before { opacity: 0; transition: opacity .2s ease; }
.cerca-marco { transform-origin: 0 0; }
.cerca-contenido { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); align-items: center; gap: 48px; }
.cerca-marco { position: relative; aspect-ratio: 480 / 605; }
.cerca-marco::before { content: ''; position: absolute; left: 50%; top: 55%; z-index: -1; width: 170%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 90, .2), rgba(255, 150, 60, 0) 65%); transform: translate(-50%, -50%); animation: pulso 2.2s ease-in-out infinite alternate; }
.cerca-foto { position: absolute; top: 13%; right: 17.6%; bottom: 12.7%; left: 17.3%; width: 65.1%; height: 74.3%; object-fit: cover; object-position: 50% 18%; background: #1a0903; filter: sepia(.1); }
.cerca-texto .rh-demo { margin: 0 0 14px; }
.cerca-texto .carta { max-height: calc(100svh - 170px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(74, 40, 18, .35) transparent; }
.cerca-nav { display: flex; align-items: center; gap: 10px; margin-top: 26px; }
.cerca-abrir { margin-left: auto; color: var(--cera); font-size: 16px; text-underline-offset: 4px; text-decoration-color: rgba(243, 227, 198, .4); }
.cerca-abrir:hover { text-decoration-color: var(--cera); }
.cerca-nav button, .cerca-cerrar { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(243, 227, 198, .35); border-radius: 50%; background: transparent; color: var(--cera); font-size: 26px; line-height: 1; cursor: pointer; }
.cerca-nav button:hover, .cerca-cerrar:hover { border-color: var(--cera); background: rgba(243, 227, 198, .08); }
.cerca-cerrar { position: fixed; top: 20px; right: 20px; }

/* ── Carta ─────────────────────────────────────────────
 * La historia escrita a mano en una hoja de papel de algodón (vista de cerca y página
 * de cada recuerdo). La hoja se ve apenas ladeada, como dejada sobre el altar.
 */
.carta { position: relative; padding: clamp(28px, 4.5vw, 54px) clamp(24px, 4.5vw, 58px); border-radius: 2px; background: #eedcbc url('../altar/papel-carta.webp') 50% 0 / cover; background-blend-mode: multiply; color: #36200f; box-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 16px 36px rgba(0, 0, 0, .5); rotate: -.6deg; cursor: auto; user-select: text; -webkit-user-select: text; }
.carta p { margin: 0; font-family: 'Homemade Apple', 'Segoe Script', cursive; }
.carta-fecha { margin-bottom: 1.6em !important; color: #5b3b21; font-size: clamp(13px, 1.25vw, 15px); text-align: right; }
.carta-firma { margin-top: 2em !important; padding-left: 40%; font-size: clamp(15px, 1.55vw, 18px); line-height: 2; }
.carta-historia { font-size: clamp(15px, 1.55vw, 18px); line-height: 2.2; white-space: pre-line; overflow-wrap: anywhere; }

@keyframes cerca-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes penumbra-entra { from { opacity: 0; } }

/* ── Página de un recuerdo (/recuerdo/{codigo}) ────────
 * Su propio altar: la mesa con encaje, velas y cempasúchil, el retrato grande al centro
 * y debajo la carta, lista para compartirse con la familia. La posición del marco es la
 * misma que usa Miniatura::tarjeta() para la vista previa al compartir.
 */
.recuerdo-escena { position: relative; height: max(560px, calc(100svh - var(--barra))); overflow: hidden; background: var(--noche); }
.recuerdo-caja { position: absolute; left: 50%; top: 50%; width: max(100%, calc(max(560px, 100svh - var(--barra)) * 1.6)); aspect-ratio: 3 / 2; translate: -50% -47.5%; }
.recuerdo-caja picture, .recuerdo-fondo { position: absolute; inset: 0; width: 100%; height: 100%; }
.recuerdo-escena::after { content: ''; position: absolute; inset: 0; z-index: 3; background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(38, 23, 15, 0) 50%, rgba(38, 23, 15, .6) 100%), linear-gradient(rgba(58, 36, 24, 0) 82%, var(--noche)); pointer-events: none; }
.recuerdo-marco { position: absolute; z-index: 1; left: 34.5%; bottom: 31.5%; width: 22%; aspect-ratio: 480 / 605; filter: drop-shadow(0 -4px 14px rgba(0, 0, 0, .5)) drop-shadow(0 3px 4px rgba(0, 0, 0, .65)); }
.recuerdo-marco .cerca-foto { filter: sepia(.12) brightness(.95); }
.recuerdo-marco .retrato-marco { filter: brightness(.86); }
/* Antes y después dentro del marco: se arrastra la línea (o se usan las flechas del teclado) */
.comparar { position: absolute; top: 13%; left: 17.3%; width: 65.1%; height: 74.3%; overflow: hidden; background: #1a0903; cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.comparar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; pointer-events: none; }
.comparar-restaurada { filter: sepia(.12) brightness(.95); }
.comparar-original { clip-path: inset(0 calc(100% - var(--corte)) 0 0); }
.comparar-linea { position: absolute; top: 0; bottom: 0; left: var(--corte); width: 2px; margin-left: -1px; background: var(--cera); box-shadow: 0 0 0 1px rgba(30, 14, 6, .35); pointer-events: none; }
.comparar-perilla { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--cera); border-radius: 50%; background: rgba(20, 10, 5, .75); color: var(--cera); font-size: 15px; letter-spacing: 2px; transform: translate(-50%, -50%); }
.comparar:focus-visible { outline: 2px solid var(--ambar); outline-offset: 2px; }

.recuerdo-caja .luz-1 { --x: 15.5%; --y: 61%; --d: 22%; --i: .32; --t: 1.9s; }
.recuerdo-caja .luz-2 { --x: 69%; --y: 42%; --d: 22%; --i: .3; --t: 2.4s; --dd: -.7s; }
.recuerdo-caja .luz-3 { --x: 45.5%; --y: 52%; --d: 34%; --i: .12; --t: 2.8s; --dd: -1.4s; }

.recuerdo-texto { position: relative; z-index: 5; width: min(100% - 32px, 660px); margin: clamp(-90px, -8svh, -40px) auto 0; padding-bottom: 72px; }
.recuerdo-texto .rh-demo { margin: 0 0 14px; text-align: center; }
.recuerdo-compartir { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 44px; }

.recuerdo-copiado { flex-basis: 100%; min-height: 1.5em; margin: 0; color: var(--cera-suave); font-size: 15px; text-align: center; overflow-wrap: anywhere; }
.recuerdo-siguiente { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 28px; margin-top: 28px; padding-top: 32px; border-top: 1px solid rgba(243, 227, 198, .12); }
.recuerdo-siguiente a:not(.btn) { color: var(--cera-suave); font-size: 16px; text-underline-offset: 4px; }
.recuerdo-siguiente a:not(.btn):hover { color: var(--cera); }

/* ── Tablet y celular ──────────────────────────────── */
@media (max-width: 900px) {
    .cerca-contenido { grid-template-columns: 1fr; gap: 22px; justify-items: center; max-height: calc(100svh - 60px); overflow-y: auto; padding: 8px 4px 24px; }
    .cerca-marco { width: min(64vw, 300px); }
    .cerca-texto { width: 100%; }
    .cerca-texto .carta { max-height: none; overflow: visible; }
    .cerca-cerrar { position: fixed; top: 14px; right: 14px; background: rgba(44, 27, 18, .8); }
}
@media (max-width: 700px) {
    :root { --barra: 60px; }
    body { font-size: 16px; }
    .topbar-logo img { width: 92px; }
    .topbar-nav { gap: 8px; }
    .topbar-link { padding: 0 10px; font-size: 14px; }
    .topbar .btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
    .altar { --inicio: 82vw; }
    .altar-flecha { width: 42px; height: 42px; font-size: 22px; }
    .altar-flecha[data-dir="-1"] { left: 8px; }
    .altar-flecha[data-dir="1"] { right: 8px; }

    /* Hero: foto vertical arriba (recortada en la pared vacía) y el texto debajo */
    .hero-escena { height: auto; aspect-ratio: 1024 / 1250; }
    .hero-caja { width: 100%; aspect-ratio: 2 / 3; }
    .hero-escena::after { background: radial-gradient(ellipse 85% 70% at 50% 62%, rgba(38, 23, 15, 0) 50%, rgba(38, 23, 15, .5) 100%); }
    .hero-marco { left: 49.2%; top: 32.7%; width: 36.5%; height: 32.9%; }
    .hero-caja .luz-1 { --x: 16.7%; --y: 51.5%; --d: 40%; }
    .hero-caja .luz-2 { display: none; }
    .hero-caja .luz-3 { display: none; }
    .hero-texto { position: static; width: auto; padding: 26px 20px 56px; text-align: center; }
    .hero-texto .titulo-inicio { width: min(64vw, 250px); margin: 0 auto; }
    .lead { font-size: 18px; }
    .rh-historia { margin-top: 28px; padding: 0; border: 0; text-align: left; min-height: 8.5em; }

    .recuerdo-escena.gracias-escena { height: auto; }
    .carta.gracias-carta p { font-size: 16px; }

    /* Recuerdo: mesa vertical, el retrato ocupa casi todo el ancho */
    .recuerdo-escena { height: auto; aspect-ratio: 5 / 7; }
    .recuerdo-caja { top: auto; bottom: 0; width: 100%; aspect-ratio: 2 / 3; translate: -50% 0; }
    .recuerdo-marco { left: 15%; bottom: 31%; width: 66%; }
    .recuerdo-caja .luz-1 { --x: 9%; --y: 63%; --d: 40%; }
    .recuerdo-caja .luz-2 { --x: 93%; --y: 61%; --d: 40%; }
    .recuerdo-caja .luz-3 { --x: 48%; --y: 50%; --d: 70%; }
    .recuerdo-texto { margin-top: -28px; padding-bottom: 56px; }
    .recuerdo-compartir .btn { flex: 1 1 100%; }

    /* Altar: foto vertical completa */
    :root { --pared: #1e110b; }
}
@media (max-width: 380px) {
    .topbar-logo img { width: 78px; }
    .topbar-nav { gap: 6px; }
    .topbar-link { padding: 0 8px; }
    .topbar .btn-small { padding: 0 11px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .flama, .halo, .luz, .cerca-marco::before, .luz-velas i, .en-altar::before { animation: none !important; }
    .altar-cerca[open]::backdrop, .altar-cerca[open] :is(.cerca-texto, .cerca-cerrar) { animation: none !important; }
    .intro-luz i, .intro-flama, .intro-halos, .intro-titulo { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}

/* Formulario en celular: misma tarjeta y elementos, a una columna y con letra legible */
@media (max-width: 760px) {
    .share { --u: .5px; padding: 74px 0 78px; }
    .share-inner { width: calc(100% - 32px); }
    .flor-esquina { width: 62px; }
    .flor-sup-izq { left: -12px; top: -58px; }
    .flor-sup-der { right: -12px; top: -58px; }
    .flor-inf-izq { left: -12px; bottom: -58px; }
    .flor-inf-der { right: -12px; bottom: -58px; }
    .card { min-height: 0; padding: 40px 16px 36px; }
    .stepper { gap: 4px; padding: 0 0 14px; }
    .stepper li { flex: 1 1 0; }
    .stepper button { flex-direction: column; gap: 6px; width: 100%; font-size: 12.5px; text-align: center; white-space: normal; }
    .stepper span { width: 30px; height: 30px; font-size: 17px; }
    .step-count { margin-top: 14px; font-size: 13px; }
    .form-step h3 { gap: 6px; margin-top: 8px; font-size: 21px; white-space: nowrap; }
    .form-step h3 .floritura { width: 36px; }
    .step-intro { margin-top: 10px; font-size: 16px; }
    .ideas { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
    .ideas li { white-space: normal; min-height: 54px; padding: 6px 10px 6px 6px; gap: 6px; border-radius: 14px; font-size: 15px; }
    .idea-icono { width: 38px; }
    .idea-icono img { height: calc(var(--alto) * .62px); }
    .share textarea { min-height: 170px; margin-top: 14px; padding: 14px 16px; border-radius: 20px; font-size: 16px; }
    .actions { padding-top: 18px; }
    .btn-papel { width: 240px; height: 50px; padding-bottom: 2px; font-size: 27px; }
    .upload-box { min-height: 190px; margin-top: 18px; padding: 20px 16px; border-radius: 20px; }
    .upload-borde rect { rx: 20px; }
    .upload-icon { height: 52px; }
    .upload-box strong, .upload-box small { font-size: 15px; }
    .upload-box strong { margin-top: 12px; }
    .hint { margin-top: 16px; font-size: 14.5px; line-height: 1.35; }
    .hint br { display: none; }
    .fields { grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
    .fields label { padding-left: 4px; font-size: 16px; }
    .fields input, .fields select { width: calc(100% + 4px); height: 46px; margin: 4px 0 0 -4px; padding: 0 12px; border-radius: 12px; font-size: 16px; }
    .consents { gap: 10px; margin-top: 18px; }
    .consents label { align-items: flex-start; gap: 10px; font-size: 13.5px; white-space: normal; }
    .consents input { width: 22px; height: 22px; }
    .form-errors { margin-top: 16px; }
}
