/* ==========================================================================
   INVITACIÓN DE MATRIMONIO · estilos
   Orden: 1 Variables · 2 Base · 3 Botones · 4 Sobre · 5 Portada/presentación
          6 Historia · 7 Galería · 8 Ceremonia · 9 Música · 10 RSVP
          11 Despedida · 12 Lightbox/FAB · 13 Escritorio · 14 Movimiento reducido
   Los colores llegan desde config.php (se imprimen en <head>);
   aquí quedan valores de respaldo.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES
   -------------------------------------------------------------------------- */
:root {
    /* Colores (respaldo; config.php los reemplaza) */
    --marfil: #faf4e6;
    --crema: #efe3c8;
    --rosa: #d9a9a3;
    --oliva: #6b6b3a;
    --dorado: #c4a265;
    --marron: #4a3428;
    --crema-osc: #d8c9a8;
    --rosa-osc: #9d786f;
    --rosa-suave: #ebd2c8;
    --oliva-osc: #5e5633;
    --oliva-suave: #a3a07a;
    --dorado-osc: #8f7344;
    --dorado-claro: #dcc79b;
    --marron-suave: #8b766b;
    --papel: #fffcf5;

    /* Tipografías: pilas del sistema (sin servicios externos).
       Para usar fuentes propias, mira el bloque @font-face comentado abajo. */
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
    --script: "Segoe Script", "Snell Roundhand", "Apple Chancery", "Lucida Handwriting", "Brush Script MT", "Dancing Script", cursive;

    /* Textura de papel: ruido SVG diminuto, se repite sin costo de red */
    --grano: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .29 0 0 0 0 .2 0 0 0 0 .16 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

    --sombra: 0 22px 40px -22px rgba(74, 52, 40, .55);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Fuentes propias (opcional): copia los .woff2 a /assets/fonts y descomenta.
@font-face { font-family: "Great Vibes"; src: url("../fonts/GreatVibes.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond.woff2") format("woff2"); font-display: swap; }
:root { --script: "Great Vibes", "Segoe Script", cursive; --serif: "Cormorant Garamond", Georgia, serif; }
*/

/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.0625rem, .98rem + .4vw, 1.2rem);
    line-height: 1.65;
    color: var(--marron);
    background: var(--grano), var(--marfil);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }

img, svg { max-width: 100%; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--dorado-osc); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ico { width: 1.25em; height: 1.25em; flex: none; }
.ico--lg { width: 1.8rem; height: 1.8rem; }

.invitation { position: relative; overflow-x: clip; }
.invitation[hidden] { display: none; }
.invitation:focus { outline: none; }

/* Título manuscrito de sección */
.script-title {
    margin: 0 0 1.6rem;
    font-family: var(--script);
    font-weight: 400;
    font-size: clamp(2.4rem, 10vw, 3.8rem);
    line-height: 1.12;
    color: var(--oliva-osc);
    text-align: center;
    text-wrap: balance;
}
.script-title--xl { font-size: clamp(3.4rem, 16vw, 6.6rem); color: var(--rosa-osc); margin-bottom: 2.6rem; }

/* Ramas decorativas extra (solo escritorio) */
.deco { display: none; }

/* Aparición suave de bloques al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   3. BOTONES
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    min-height: 3.4rem; padding: .8rem 1.7rem;
    border: 1.5px solid transparent; border-radius: 999px;
    font-family: var(--serif); font-size: 1.05rem; letter-spacing: .01em; line-height: 1.2; text-align: center;
    text-decoration: none; cursor: pointer;
    transition: transform .25s var(--ease), background-color .25s, color .25s, box-shadow .25s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn { text-wrap: balance; }
.btn--lg { min-height: 3.7rem; padding-inline: 2rem; font-size: 1.12rem; }
.btn--primary { background: var(--oliva-osc); color: var(--marfil); box-shadow: 0 10px 20px -10px var(--oliva-osc); }
.btn--ghost { background: transparent; color: var(--oliva-osc); border-color: var(--oliva); }
.btn--wa { background: var(--marron); color: var(--marfil); box-shadow: 0 10px 20px -10px var(--marron); }
.btn--wa .ico { color: var(--rosa); }
@media (hover: hover) {
    .btn--primary:hover { background: var(--marron); transform: translateY(-2px); }
    .btn--ghost:hover { background: var(--rosa-suave); transform: translateY(-2px); }
    .btn--wa:hover { background: var(--oliva-osc); transform: translateY(-2px); }
}

/* --------------------------------------------------------------------------
   4. PORTADA: SOBRE
   -------------------------------------------------------------------------- */
.gate {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    overflow: hidden auto;
    background: var(--grano), radial-gradient(120% 90% at 50% 38%, var(--marfil), var(--crema));
}
.gate[hidden] { display: none; }
.gate.is-leaving { opacity: 0; transform: scale(1.04); pointer-events: none; transition: opacity .9s ease, transform .9s ease; }

.gate__inner {
    position: relative; z-index: 1; width: 100%;
    display: flex; flex-direction: column; align-items: center;
    padding: 1.25rem; text-align: center;
}
.gate__title {
    max-width: 15em; margin: 0;
    font-family: var(--script); font-size: clamp(1.9rem, 7.6vw, 3rem); line-height: 1.2;
    color: var(--marron); text-wrap: balance;
}

.gate__branch { position: absolute; z-index: -1; width: min(78vw, 460px); aspect-ratio: 2.16; opacity: .85; pointer-events: none; }
.gate__branch--a { top: -5.2rem; left: -24vw; rotate: 12deg; }
.gate__branch--b { bottom: -4.6rem; right: -26vw; rotate: 192deg; }

/* Sobre construido solo con CSS */
.envelope {
    --w: min(88vw, 440px, max(170px, calc((100svh - 14rem) / 1.1)));
    position: relative; width: var(--w); aspect-ratio: 3 / 2;
    margin: calc(var(--w) * .44) 0 clamp(1.6rem, 5vh, 2.6rem);
    perspective: 1400px; cursor: pointer;
}
.env-back {
    position: absolute; inset: 0; border-radius: 4px;
    background: var(--grano), linear-gradient(var(--rosa-suave), var(--rosa));
    box-shadow: 0 26px 42px -16px rgba(74, 52, 40, .5), 0 2px 0 rgba(74, 52, 40, .06);
}
.env-card {
    position: absolute; z-index: 2; left: 6%; right: 6%; top: 8%; height: 84%; padding: 5px;
    background: var(--grano), var(--papel); border-radius: 3px;
    box-shadow: 0 2px 8px rgba(74, 52, 40, .25);
    transition: transform 1.05s var(--ease) .8s;
}
.env-card__in {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
    border: 1px solid var(--dorado); text-align: center;
}
.env-card__flower { width: calc(var(--w) * .1); height: calc(var(--w) * .1); }
.env-card__names { font-family: var(--script); font-size: calc(var(--w) * .075); line-height: 1.1; color: var(--marron); }
.env-card__date { font-size: calc(var(--w) * .036); letter-spacing: .2em; color: var(--oliva-osc); }

.env-front { position: absolute; inset: 0; z-index: 3; }
.env-front--l { clip-path: polygon(0 0, 52% 53%, 0 100%); background: var(--grano), linear-gradient(100deg, var(--crema), var(--crema-osc)); }
.env-front--r { clip-path: polygon(100% 0, 48% 53%, 100% 100%); background: var(--grano), linear-gradient(260deg, var(--crema), var(--crema-osc)); }
.env-front--b { clip-path: polygon(0 100%, 50% 46%, 100% 100%); background: var(--grano), linear-gradient(0deg, var(--crema), var(--crema-osc)); filter: brightness(1.03); }

.env-flap {
    position: absolute; z-index: 5; left: 0; top: 0; width: 100%; height: 58%;
    transform-origin: 50% 0; transform-style: preserve-3d;
    transition: transform .95s cubic-bezier(.5, 0, .2, 1) .3s, z-index 0s linear .65s;
}
.env-flap i { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.env-flap__out { background: var(--grano), linear-gradient(172deg, var(--crema), var(--crema-osc)); }
.env-flap__in {
    transform: rotateX(180deg);
    background: var(--grano), radial-gradient(circle at 50% 12%, var(--dorado) 0 1.5px, transparent 2px) 0 0 / 22px 22px, linear-gradient(var(--rosa), var(--rosa-suave));
}

.env-seal {
    position: absolute; z-index: 6; left: 50%; top: 57%;
    width: clamp(56px, calc(var(--w) * .2), 88px); aspect-ratio: 1;
    display: grid; place-items: center;
    border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
    background: radial-gradient(circle at 35% 30%, var(--rosa), var(--rosa-osc) 78%);
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .14), 0 5px 10px rgba(74, 52, 40, .4);
    color: var(--marfil); transform: translate(-50%, -50%);
    transition: transform .5s var(--ease), opacity .5s ease .1s;
    animation: seal-beat 3.6s ease-in-out infinite;
}
.env-seal::before { content: ""; position: absolute; inset: 11%; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, .4); }
.env-seal span { position: relative; font-style: italic; font-weight: 700; font-size: calc(var(--w) * .052); letter-spacing: .02em; text-shadow: 0 1px 1px rgba(74, 52, 40, .5); }

/* Estado: sobre abierto */
.envelope.is-open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-open .env-card { transform: translateY(-62%); }
.envelope.is-open .env-seal { transform: translate(-50%, -50%) scale(1.3) rotate(10deg); opacity: 0; animation: none; }

@keyframes seal-beat { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }

@media (max-height: 520px) { .gate__branch { display: none; } }

/* --------------------------------------------------------------------------
   5. PRESENTACIÓN DE LOS NOVIOS
   -------------------------------------------------------------------------- */
.hero {
    position: relative; min-height: 100svh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: clamp(2.5rem, 8vw, 4rem) 1.25rem 3rem; text-align: center; overflow-x: clip;
}

/* Secuencia de entrada: se ejecuta una vez, al abrir el sobre */
.invitation:not(.is-in) .hero > * { opacity: 0; }
.invitation.is-in .hero > * { animation: rise 1s var(--ease) both; animation-delay: calc(var(--i, 0) * .16s); }
.hero > :nth-child(1) { --i: 0; }
.hero > :nth-child(2) { --i: 2; }
.hero > :nth-child(3) { --i: 3; }
.hero > :nth-child(4) { --i: 4; }
.hero > :nth-child(5) { --i: 6; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.hero__arch { position: relative; width: min(74vw, 340px); }
.hero__photo {
    aspect-ratio: 3 / 4; overflow: hidden;
    border: 8px solid var(--papel); border-radius: 999px 999px 8px 8px;
    box-shadow: 0 0 0 1px var(--dorado), 0 28px 44px -22px rgba(74, 52, 40, .6);
    background: var(--rosa-suave);
}
.hero__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hero__branch { position: absolute; width: 66%; aspect-ratio: 2.16; pointer-events: none; }
.hero__branch--a { left: -34%; top: 30%; rotate: -62deg; }
.hero__branch--b { right: -34%; bottom: 10%; rotate: 118deg; }

.postmark { position: absolute; top: -2%; right: -16%; width: 36%; rotate: -14deg; opacity: .88; }
.postmark__line { fill: none; stroke: var(--rosa-osc); stroke-width: 1.2; }
.postmark__ring { font: 600 9.2px var(--serif); fill: var(--rosa-osc); }
.postmark__day { font: 700 30px var(--serif); fill: var(--rosa-osc); }
.postmark__month { font: 600 9.5px var(--serif); fill: var(--rosa-osc); letter-spacing: .18em; }

.hero__names {
    position: relative; z-index: 2; width: min(88vw, 540px);
    margin: calc(-1 * clamp(2.6rem, 10vw, 4.2rem)) 0 0;
    display: grid; font-family: var(--script); font-weight: 400; line-height: .98; color: var(--marron);
    text-shadow: 0 0 .3em var(--marfil), 0 0 .12em var(--marfil);
}
.hero__n1, .hero__n2 { font-size: clamp(3.7rem, 17vw, 6.9rem); }
.hero__n1 { justify-self: start; }
.hero__n2 { justify-self: end; }
.hero__amp { justify-self: center; font-family: var(--serif); font-style: italic; font-size: clamp(1.9rem, 8vw, 3rem); color: var(--dorado-osc); line-height: 1; text-shadow: none; }

.hero__quote { max-width: 24em; margin-top: 1.6rem; font-size: clamp(1.1rem, 4.4vw, 1.4rem); font-style: italic; text-wrap: balance; }
.hero__date {
    display: flex; align-items: center; gap: .9rem; margin-top: 1.2rem;
    font-size: 1rem; letter-spacing: .12em; color: var(--oliva-osc);
}
.hero__date::before, .hero__date::after { content: ""; width: 2rem; height: 1px; background: var(--dorado); }
.hero__down { margin-top: 1.6rem; color: var(--dorado-osc); display: grid; place-items: center; width: 3rem; height: 3rem; }
.hero__down .ico { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }

/* --------------------------------------------------------------------------
   6. NUESTRA HISTORIA (carta)
   -------------------------------------------------------------------------- */
.story, .gallery, .ceremony, .music, .rsvp { position: relative; padding: clamp(3.5rem, 11vw, 6.5rem) 1.25rem; }
.story { display: grid; place-items: center; }

.letter {
    position: relative; width: min(100%, 560px); rotate: -1.2deg;
    padding: clamp(3.6rem, 10vw, 4rem) clamp(1.4rem, 6vw, 3rem) 2rem clamp(2.4rem, 9vw, 4.2rem);
    background: var(--grano), var(--papel); border-radius: 3px; box-shadow: var(--sombra);
}
.letter::before { content: ""; position: absolute; top: 0; bottom: 0; left: clamp(1.6rem, 6.5vw, 3rem); width: 1px; background: var(--rosa); opacity: .7; }
.letter .script-title { text-align: left; margin-bottom: 1.2rem; }
.letter__text {
    font-size: 1.15rem; line-height: 2rem; font-style: italic;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(2rem - 1px), rgba(196, 162, 101, .35) calc(2rem - 1px), rgba(196, 162, 101, .35) 2rem);
}
.letter__text::first-letter { font-family: var(--script); font-style: normal; font-size: 3.1em; float: left; line-height: .8; padding: .1em .12em 0 0; color: var(--rosa-osc); }
.letter__sign { margin-top: 1.2rem; text-align: right; font-family: var(--script); font-size: 2rem; color: var(--rosa-osc); }

.stamp {
    position: absolute; top: -1.7rem; right: 1rem; width: 4rem; padding: .5rem .45rem .35rem;
    display: grid; place-items: center; gap: .1rem; rotate: 5deg;
    background: var(--marfil); outline: 2px dashed var(--dorado-osc); outline-offset: -3px;
    box-shadow: 0 6px 12px -6px rgba(74, 52, 40, .5);
}
.stamp__flower { width: 2.3rem; height: 2.3rem; }
.stamp span { font-size: .72rem; font-style: italic; color: var(--oliva-osc); }

/* --------------------------------------------------------------------------
   7. GALERÍA (álbum vintage)
   -------------------------------------------------------------------------- */
.gallery { padding-top: clamp(2rem, 7vw, 4rem); }
.album {
    list-style: none; margin: 0 auto; padding: 0 .4rem; max-width: 1000px;
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem .9rem; align-items: center;
}
.polaroid { rotate: var(--r, 0deg); }
.polaroid--1 { grid-column: 1 / 5; --r: -3deg; }
.polaroid--2 { grid-column: 3 / 7; --r: 2.5deg; margin-top: -2.6rem; }
.polaroid--3 { grid-column: 1 / 4; --r: 2deg; }
.polaroid--4 { grid-column: 4 / 7; --r: -2.5deg; margin-top: 1.6rem; }

/* Las fotos "caen" sobre el álbum al aparecer */
.polaroid.reveal { rotate: calc(var(--r, 0deg) * 2.6); transform: translateY(26px); transition: opacity .9s ease, transform 1s var(--ease), rotate 1s var(--ease); }
.polaroid.reveal.is-visible { rotate: var(--r, 0deg); transform: none; }

.polaroid__btn {
    position: relative; display: block; width: 100%; padding: .6rem .6rem 0; border: 0;
    background: var(--papel); text-align: center; cursor: zoom-in;
    box-shadow: 0 16px 24px -14px rgba(74, 52, 40, .6), 0 1px 3px rgba(74, 52, 40, .25);
    transition: transform .4s var(--ease), box-shadow .4s;
    -webkit-tap-highlight-color: transparent;
}
.polaroid__btn img { display: block; width: 100%; height: auto; object-fit: cover; filter: saturate(.92) sepia(.07); }
.polaroid__cap { display: block; padding: .5rem 0 .7rem; font-family: var(--script); font-size: 1.15rem; line-height: 1.3; color: var(--marron-suave); }
.polaroid__tape {
    position: absolute; z-index: 1; top: -.75rem; left: 50%; width: 4.6rem; height: 1.5rem; translate: -50% 0; rotate: -3deg;
    background: rgba(217, 169, 163, .6); box-shadow: 0 1px 2px rgba(74, 52, 40, .15);
}
.polaroid--2 .polaroid__tape { rotate: 4deg; background: rgba(196, 162, 101, .5); }
.polaroid--3 .polaroid__tape { background: rgba(163, 160, 122, .55); }
@media (hover: hover) {
    .polaroid__btn:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 24px 30px -16px rgba(74, 52, 40, .65), 0 1px 3px rgba(74, 52, 40, .25); }
}

/* --------------------------------------------------------------------------
   8. CEREMONIA
   -------------------------------------------------------------------------- */
.ceremony { background: var(--grano), var(--rosa-suave); padding-top: clamp(5rem, 14vw, 8rem); padding-bottom: clamp(4.5rem, 13vw, 7rem); }
/* Borde festoneado arriba y abajo (como papel de encaje) */
.ceremony::before, .ceremony::after, .farewell::before {
    content: ""; position: absolute; left: 0; right: 0; height: 22px; pointer-events: none;
    background: radial-gradient(circle at 50% 0, var(--marfil) 11px, transparent 12px) 0 0 / 28px 22px repeat-x;
}
.ceremony::before { top: -1px; }
.ceremony::after { top: 100%; z-index: 2; background-image: radial-gradient(circle at 50% 0, var(--rosa-suave) 11px, transparent 12px); }

.ticket {
    position: relative; width: min(100%, 560px); margin: 0 auto; padding: 2.8rem 1.6rem 1.9rem; text-align: center;
    background: var(--grano), var(--papel); border-radius: 6px; box-shadow: var(--sombra);
}
.ticket::before { content: ""; position: absolute; inset: .55rem; border: 1px solid var(--dorado); border-radius: 3px; pointer-events: none; }
.ticket__flower { position: absolute; top: -1.7rem; left: 50%; translate: -50% 0; width: 3.4rem; height: 3.4rem; }

.ticket__list { margin: 0; display: grid; gap: 1.1rem; text-align: left; padding-inline: .4rem; }
.ticket__row { display: flex; align-items: center; gap: 1rem; }
.ticket__row .ico--lg { box-sizing: border-box; width: 3.3rem; height: 3.3rem; padding: .75rem; border: 1px solid var(--dorado); border-radius: 50%; color: var(--oliva-osc); }
.ticket__row dt { font-family: var(--script); font-size: 1.4rem; line-height: 1.1; color: var(--rosa-osc); }
.ticket__row dd { margin: 0; font-size: 1.15rem; line-height: 1.35; }

.ticket__tear { position: relative; margin: 1.6rem -1.6rem; border-top: 2px dashed var(--dorado); }
.ticket__tear::before, .ticket__tear::after {
    content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--rosa-suave);
}
.ticket__tear::before { left: -11px; }
.ticket__tear::after { right: -11px; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; max-width: 23rem; margin: 0 auto; }
.countdown__cell {
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .9rem .2rem .6rem;
    border: 1px solid var(--dorado); border-radius: 999px 999px 10px 10px; background: var(--marfil);
}
.countdown__cell b { font-size: clamp(1.5rem, 7vw, 2.1rem); font-weight: 600; line-height: 1.1; color: var(--oliva-osc); font-variant-numeric: tabular-nums; }
.countdown__cell span { font-size: .9rem; font-style: italic; color: var(--marron-suave); }
.countdown[hidden], .countdown__done[hidden] { display: none; }
.countdown__done { font-family: var(--script); font-size: 2rem; color: var(--rosa-osc); }

.ticket__actions { display: grid; gap: .8rem; margin-top: 1.7rem; }

/* --------------------------------------------------------------------------
   9. MÚSICA
   -------------------------------------------------------------------------- */
.music { padding-top: clamp(5rem, 14vw, 8rem); }
.player { width: min(100%, 620px); margin: 0 auto; padding: 1.3rem 1.2rem 1rem; display: grid; gap: .9rem; background: var(--grano), var(--papel); border-radius: 8px; box-shadow: var(--sombra); }
.player__top { display: flex; align-items: center; gap: 1.2rem; }

.sleeve {
    position: relative; flex: none; width: min(34vw, 150px); aspect-ratio: 1; margin-right: 1rem;
    background: var(--grano), linear-gradient(135deg, var(--rosa-suave), var(--rosa)); border-radius: 4px; box-shadow: 0 10px 18px -10px rgba(74, 52, 40, .6);
}
.sleeve__flower { position: absolute; left: -12%; bottom: -12%; width: 46%; height: 46%; z-index: 2; }
.vinyl {
    position: absolute; top: 7%; left: 22%; width: 86%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
    background:
        conic-gradient(rgba(255, 255, 255, 0) 0 18%, rgba(255, 255, 255, .13) 25%, rgba(255, 255, 255, 0) 32% 68%, rgba(255, 255, 255, .13) 75%, rgba(255, 255, 255, 0) 82%),
        repeating-radial-gradient(circle, #2a2019 0 2px, #382c22 2px 4px);
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, .5);
}
.vinyl__label {
    width: 36%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
    background: var(--rosa); box-shadow: inset 0 0 0 2px var(--dorado); font-size: .72rem; font-style: italic; font-weight: 700; color: var(--marron);
}
.player.is-playing .vinyl { animation: spin 5s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

.player__info { min-width: 0; }
.player__title { font-size: 1.3rem; font-style: italic; line-height: 1.25; overflow-wrap: anywhere; }
.player__artist { font-size: .95rem; color: var(--marron-suave); }

.player__bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; font-size: .88rem; font-variant-numeric: tabular-nums; color: var(--marron-suave); }

/* Barras deslizantes personalizadas */
input[type="range"] { --p: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 2.2rem; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--oliva) var(--p), rgba(74, 52, 40, .18) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px; border-radius: 50%; background: var(--rosa-osc); border: 2px solid var(--papel); box-shadow: 0 0 0 1px var(--dorado-osc); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 5px; background: rgba(74, 52, 40, .18); }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--oliva); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--rosa-osc); border: 2px solid var(--papel); box-shadow: 0 0 0 1px var(--dorado-osc); }

.player__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem 1rem; }
.ctrl {
    display: grid; place-items: center; width: 3.2rem; height: 3.2rem; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--oliva-osc); cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background-color .25s, transform .2s;
}
.ctrl:active { transform: scale(.94); }
.ctrl--main { width: 4rem; height: 4rem; background: var(--oliva-osc); color: var(--marfil); box-shadow: 0 10px 18px -10px var(--oliva-osc); }
.ctrl--small { width: 2.6rem; height: 2.6rem; }
@media (hover: hover) { .ctrl:hover { background: var(--rosa-suave); } .ctrl--main:hover { background: var(--marron); } }

.volume { display: flex; align-items: center; flex: 1 1 100%; max-width: 15rem; gap: .4rem; }
.volume[hidden] { display: none; }

.playlist { counter-reset: t; list-style: none; margin: .3rem 0 0; padding: .5rem 0 0; display: grid; gap: .15rem; border-top: 1px dashed var(--dorado); }
.playlist__item {
    display: grid; grid-template-columns: 1.7rem 1fr; grid-template-areas: "n name" "n artist"; column-gap: .6rem; align-items: center;
    width: 100%; min-height: 3.2rem; padding: .5rem .6rem; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: background-color .25s;
}
.playlist__item::before { counter-increment: t; content: counter(t); grid-area: n; justify-self: center; font-style: italic; color: var(--marron-suave); }
.playlist__name { grid-area: name; font-size: 1.05rem; line-height: 1.3; }
.playlist__artist { grid-area: artist; font-size: .85rem; line-height: 1.2; color: var(--marron-suave); }
.playlist__item[aria-current="true"] { background: var(--rosa-suave); }
.playlist__item[aria-current="true"] .playlist__name { font-weight: 700; }
.playlist__item[aria-current="true"]::before { visibility: hidden; }
@media (hover: hover) { .playlist__item:hover { background: var(--crema); } }

.eq { grid-area: n; display: none; justify-self: center; align-items: flex-end; gap: 2px; height: .95rem; }
.playlist__item[aria-current="true"] .eq { display: flex; }
.eq i { width: 3px; height: 45%; background: var(--oliva-osc); border-radius: 1px; }
.player.is-playing .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .25s; }
.eq i:nth-child(3) { animation-delay: .5s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* --------------------------------------------------------------------------
   10. RSVP
   -------------------------------------------------------------------------- */
.rsvp { padding-top: clamp(3rem, 9vw, 5rem); padding-bottom: clamp(6rem, 16vw, 9rem); }
.rsvp__card {
    position: relative; max-width: 560px; margin: 4rem auto 0; padding: 0 1.5rem 2.6rem; text-align: center;
    background: var(--grano), var(--papel); border: 1px solid var(--dorado); box-shadow: var(--sombra);
    outline: 1px solid var(--dorado); outline-offset: 6px;
}
.rsvp__branch { display: block; width: min(76%, 280px); aspect-ratio: 2.16; margin: -2.6rem auto 1rem; }
.rsvp__text { max-width: 30ch; margin: 0 auto 1.8rem; font-size: 1.15rem; text-wrap: balance; }

/* --------------------------------------------------------------------------
   11. DESPEDIDA
   -------------------------------------------------------------------------- */
.farewell {
    position: relative; min-height: 85svh; display: grid; place-items: center; overflow: hidden; text-align: center;
    padding: clamp(5.5rem, 16vw, 8rem) 1.5rem calc(2.5rem + env(safe-area-inset-bottom));
    background: var(--grano), var(--oliva-osc); color: var(--marfil);
}
.farewell::before { top: -1px; z-index: 2; }
#petals { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.farewell__in { position: relative; z-index: 1; max-width: 34rem; }
.farewell__star { width: 2rem; height: 2rem; }
.farewell__text { margin: 1rem 0 2rem; font-size: clamp(1.25rem, 5vw, 1.6rem); line-height: 1.6; font-style: italic; text-wrap: balance; }
.farewell__names { font-family: var(--script); font-size: clamp(3.2rem, 15vw, 5.8rem); line-height: 1.05; color: var(--rosa-suave); }
.farewell__date { margin: .6rem 0 3.2rem; font-size: 1.15rem; font-weight: 600; letter-spacing: .32em; color: var(--dorado-claro); }
.farewell__sign { font-size: .9rem; font-style: italic; opacity: .72; }

/* --------------------------------------------------------------------------
   12. LIGHTBOX Y BOTÓN FLOTANTE DE MÚSICA
   -------------------------------------------------------------------------- */
.lightbox {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    padding: 4rem .6rem 3.4rem; background: rgba(40, 28, 20, .92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .3s ease; touch-action: pan-y;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: min(92vw, 900px); padding: .7rem .7rem 0; background: var(--papel); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); transition: opacity .25s ease; }
.lightbox__figure.is-swapping { opacity: 0; }
.lightbox__figure img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100svh - 12rem); object-fit: contain; }
.lightbox__figure figcaption { padding: .5rem 0 .7rem; font-family: var(--script); font-size: 1.4rem; color: var(--marron-suave); text-align: center; }
.lightbox__close, .lightbox__nav {
    position: absolute; z-index: 2; display: grid; place-items: center; width: 3.1rem; height: 3.1rem; padding: 0; border: 0; border-radius: 50%;
    background: var(--marfil); color: var(--marron); cursor: pointer; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); -webkit-tap-highlight-color: transparent;
}
.lightbox__close { top: max(.8rem, env(safe-area-inset-top)); right: .8rem; }
.lightbox__nav { top: 50%; translate: 0 -50%; }
.lightbox__nav--prev { left: .6rem; }
.lightbox__nav--next { right: .6rem; }
.lightbox__count { position: absolute; bottom: max(1rem, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: .95rem; color: var(--marfil); opacity: .85; }

.fab {
    position: fixed; z-index: 20; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
    display: grid; place-items: center; width: 3.5rem; height: 3.5rem; padding: 0; border-radius: 50%;
    background: var(--papel); color: var(--oliva-osc); border: 1.5px solid var(--dorado); cursor: pointer;
    box-shadow: 0 10px 20px -8px rgba(74, 52, 40, .55); -webkit-tap-highlight-color: transparent; transition: background-color .3s, color .3s;
}
.fab[hidden] { display: none; }
.fab.is-playing { background: var(--oliva-osc); color: var(--marfil); }

/* --------------------------------------------------------------------------
   13. TABLET Y ESCRITORIO
   -------------------------------------------------------------------------- */
@media (min-width: 520px) {
    .ticket__actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 760px) {
    .ticket { width: min(100%, 780px); padding: 3.2rem 2.6rem 2.2rem; }
    .ticket__tear { margin-inline: -2.6rem; }
    .ticket__list { grid-template-columns: repeat(3, 1fr); text-align: center; gap: 1.2rem; }
    .ticket__row { flex-direction: column; gap: .6rem; }
    .player { padding: 1.8rem 2rem 1.3rem; }
    .player__title { font-size: 1.55rem; }
    .letter { padding-left: 4.6rem; }
    .letter__text { font-size: 1.25rem; }
}

@media (min-width: 900px) {
    /* Presentación editorial: foto a la izquierda, nombres a la derecha */
    .hero {
        display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 540px); column-gap: 3rem;
        grid-template-areas: "arch names" "arch quote" "arch date" "arch down"; grid-template-rows: auto auto auto auto;
        align-content: center; justify-content: center; text-align: left; padding-inline: 2rem;
    }
    .postmark { right: auto; left: -15%; top: -3%; rotate: 12deg; }
    .hero__arch { grid-area: arch; grid-row: 1 / -1; align-self: center; width: 100%; }
    .hero__names { grid-area: names; align-self: end; margin: 0 0 0 -6rem; width: auto; }
    .hero__n1, .hero__n2 { font-size: clamp(5rem, 8vw, 7.6rem); }
    .hero__n2 { justify-self: end; }
    .hero__amp { justify-self: start; margin-left: 4rem; font-size: 3.2rem; }
    .hero__quote { grid-area: quote; max-width: 22em; font-size: 1.5rem; margin-top: 1.4rem; }
    .hero__date { grid-area: date; justify-self: start; }
    .hero__date::before { display: none; }
    .hero__down { grid-area: down; justify-self: start; margin-top: 1rem; }

    /* Álbum: collage creativo */
    .album { grid-template-columns: repeat(12, 1fr); gap: 2rem 1.5rem; padding-inline: 1rem; }
    .polaroid--1 { grid-column: 1 / 6; grid-row: 1 / 3; --r: -3.5deg; }
    .polaroid--2 { grid-column: 6 / 11; grid-row: 1; margin-top: 2.5rem; --r: 2.5deg; }
    .polaroid--3 { grid-column: 6 / 9; grid-row: 2; --r: -2deg; }
    .polaroid--4 { grid-column: 9 / 12; grid-row: 2; margin-top: 2rem; --r: 3deg; }

    /* Ramas decorativas adicionales */
    .deco { display: block; position: absolute; width: min(24vw, 320px); aspect-ratio: 2.16; opacity: .6; pointer-events: none; }
    .story .deco--l { left: 3%; top: 12%; rotate: -16deg; }
    .story .deco--r { right: 3%; bottom: 10%; rotate: 158deg; }
    .gallery .deco--l { left: 2%; top: 8%; rotate: 12deg; }
    .gallery .deco--r { right: 2%; bottom: 6%; rotate: 190deg; }
    .music .deco--l { left: 4%; top: 30%; rotate: -10deg; }
    .music .deco--r { right: 4%; bottom: 8%; rotate: 170deg; }
}

/* --------------------------------------------------------------------------
   14. MOVIMIENTO REDUCIDO (preferencia del dispositivo)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
        transition-duration: .01ms !important; transition-delay: 0s !important;
    }
    .reveal, .polaroid.reveal { opacity: 1; transform: none; rotate: var(--r, 0deg); }
    .letter.reveal { rotate: -1.2deg; }
}
