/* Detalles visuales y animaciones (lavanda, grano, brillo, itinerario, polaroids, sello). */

/* Papel con grano */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 35;
    opacity: .55;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .36 0 0 0 0 .48 0 0 0 .16 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Barra de progreso de scroll */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 55;
    pointer-events: none;
    background: #8a9451;
    transform-origin: 0 50%;
    transform: scaleX(0);
}

/* Lavanda en línea fina */
.sprig { display: block; pointer-events: none; }
.sprig svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    transform-origin: 50% 100%;
    animation: sprigSway 6s ease-in-out infinite alternate;
}
@keyframes sprigSway {
    from { transform: rotate(-2.5deg); }
    to { transform: rotate(2.5deg); }
}

/* Divisor con monograma */
.s-div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #8a9451;
}
.s-div i { flex: 1; height: 1px; background: #e2e1d0; max-width: 70px; }
.s-div b { font: italic 400 20px "Playfair Display", serif; letter-spacing: .04em; }
.s-div .sprig { width: 22px; height: 41px; flex: none; }
.s-div .sprig.l { transform: rotate(-90deg); margin-right: 9px; }
.s-div .sprig.r { transform: rotate(90deg) scaleX(-1); margin-left: 9px; }

/* Parallax: la imagen es más alta que su marco y se desplaza con el scroll */
[data-par] {
    position: absolute;
    left: 0;
    top: -10%;
    width: 100%;
    height: 120%;
    object-fit: cover;
    transform: translate3d(0, var(--py, 0px), 0);
    will-change: transform;
}

/* Pétalos del hero */
#hero-petals {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

/* Nombres que se escriben */
#hero-content h1 { clip-path: inset(-12% 100% -12% 0); }
#hero-content.revealed h1 { animation: namesWrite 1.8s cubic-bezier(.6, .1, .2, 1) .35s both; }
@keyframes namesWrite {
    from { clip-path: inset(-12% 100% -12% 0); }
    to { clip-path: inset(-12% -6% -12% -6%); }
}

/* Cuenta regresiva con giro */
.cd-flip { animation: cdFlip .5s cubic-bezier(.3, .8, .3, 1); }
@keyframes cdFlip {
    0% { transform: perspective(300px) rotateX(-88deg); opacity: 0; }
    100% { transform: perspective(300px) rotateX(0); opacity: 1; }
}

/* Brillo en botones */
.shine { position: relative; overflow: hidden; transition: transform .15s ease, background-color .2s ease, color .2s ease !important; -webkit-tap-highlight-color: transparent; }
.shine:active { transform: scale(.97); }
.shine::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 38%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .42), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
}
.shine:hover::after { animation: shineSweep .9s ease-out; }
.shine-auto::after { animation: shineSweep 5.5s ease-in-out 2s infinite; }
@keyframes shineSweep {
    0% { left: -60%; }
    20% { left: 130%; }
    100% { left: 130%; }
}

/* Itinerario: línea que se dibuja y nodos */
#timeline-container { position: relative; --tl-x: 76px; }
@media (min-width: 640px) { #timeline-container { --tl-x: 88px; } }
@media (min-width: 768px) { #timeline-container { --tl-x: 94px; } }
.tl-line { position: absolute; left: var(--tl-x); top: 16px; bottom: 16px; width: 1px; background: rgba(43,45,28, .14); }
.tl-fill { position: absolute; inset: 0; background: #8a9451; transform-origin: 50% 0; transform: scaleY(0); }
#timeline-container .timeline-item { position: relative; }
#timeline-container .timeline-item > div:last-child { padding-left: 10px; }
#timeline-container .timeline-item::before {
    content: "";
    position: absolute;
    left: var(--tl-x);
    top: .8rem;
    width: 9px;
    height: 9px;
    margin-left: -4px;
    border-radius: 50%;
    background: #faf7f0;
    border: 1.5px solid rgba(43,45,28, .28);
    transition: background .4s, border-color .4s, transform .4s;
    z-index: 1;
}
#timeline-container .timeline-item.tl-on::before { background: #8a9451; border-color: #8a9451; transform: scale(1.25); }
#timeline-container .timeline-item.tl-on::after {
    content: "";
    position: absolute;
    left: var(--tl-x);
    top: .8rem;
    width: 9px;
    height: 9px;
    margin-left: -4px;
    border-radius: 50%;
    border: 1px solid #8a9451;
    pointer-events: none;
    animation: tlRing 1.2s ease-out 1 both;
}
@keyframes tlRing {
    from { transform: scale(.6); opacity: .9; }
    to { transform: scale(2.4); opacity: 0; }
}

/* Polaroids */
.pol {
    margin: 0;
    background: #fff;
    padding: 9px 9px 12px;
    box-shadow: 0 8px 22px rgba(43,45,28, .16);
    transform: rotate(var(--r, 0deg));
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s;
}
.pol:nth-child(even) { margin-top: 22px; }
.pol:hover, .pol:active { transform: rotate(0deg) scale(1.04); box-shadow: 0 14px 30px rgba(43,45,28, .22); }
.pol img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pol figcaption { font: 700 20px/1 "Dancing Script", cursive; color: #4a5024; margin-top: 10px; text-align: center; }

/* Sello de lacre y corazones */
.seal { position: relative; display: inline-block; width: 112px; height: 112px; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
.seal:active { transform: scale(.94) rotate(-4deg); }
.seal:focus-visible { outline: 2px solid #636b2f; outline-offset: 4px; border-radius: 50%; }
.seal svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 8px 10px rgba(43,45,28, .3)); }
.heart {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    pointer-events: none;
    animation: heartUp 1.6s ease-out forwards;
}
@keyframes heartUp {
    0% { transform: translate(0, 0) scale(.5); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translate(var(--dx), -150px) scale(1.15) rotate(var(--rot)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sprig svg, .shine-auto::after, .cd-flip { animation: none !important; }
    #hero-content h1 { clip-path: none; }
    #hero-content.revealed h1 { animation: none; }
}

/* Portada: fotos que se alternan con fundido */
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease-in-out; }
.hero-slide.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }

/* Portada: siempre cabe exacta en la pantalla, sin nada que desplazar dentro de ella */
#inicio { --hero-photo-h: 54%; }
#inicio h1 { font-size: clamp(2.3rem, 7.4svh, 3.2rem) !important; }
@media (min-width: 768px) {
    #inicio h1 { font-size: clamp(3rem, 14svh, 6.25rem) !important; }
}
@media (max-height: 760px) {
    #inicio .hero-msg { display: none; }
}
@media (max-height: 720px) {
    #inicio { --hero-photo-h: 50%; }
}
@media (max-height: 660px) {
    #inicio .hero-cal { display: none; }
}
