/* ==========================
   VARIABLES
========================== */

:root{
    --pink:#fbe4ec;
    --pink-dark:#d87b9a;
    --gold:#d4af37;
    --white:#ffffff;
    --text:#5b4b53;
    --glass:rgba(255,255,255,.30);
    --shadow:0 20px 50px rgba(0,0,0,.12);
}

/* ==========================
   RESET
========================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:'Poppins',sans-serif;
    background:linear-gradient(180deg,#fff,#fdf2f7,#fde8f1);
    color:var(--text);
    overflow-x:hidden;
}

/* ==========================
   HERO
========================== */

.hero{

    height:100vh;

    display:flex;
    justify-content:center;
    align-items:center;

    text-align:center;

    position:relative;

    background:
    radial-gradient(circle at top,#ffe8f2 0%,transparent 45%),
    linear-gradient(#fdeff5,#f8dbe7);

}

.glass{

    width:min(90%,500px);

    padding:50px 35px;

    border-radius:30px;

    background:var(--glass);

    backdrop-filter:blur(12px);

    box-shadow:var(--shadow);

    border:1px solid rgba(255,255,255,.5);

}

.subtitle{

    letter-spacing:4px;

    text-transform:uppercase;

    color:var(--gold);

    font-size:.9rem;

}

h1{

    font-family:"Great Vibes",cursive;

    font-size:5rem;

    color:var(--pink-dark);

    margin:15px 0;

}

.date{

    margin-bottom:35px;

    font-size:1.1rem;

}

button,
a{

    display:inline-block;

    padding:14px 35px;

    border:none;

    border-radius:40px;

    background:linear-gradient(45deg,#f5bfd2,#f09cbc);

    color:white;

    text-decoration:none;

    cursor:pointer;

    transition:.35s;

    font-size:1rem;

}

button:hover,
a:hover{

    transform:translateY(-3px);

    box-shadow:0 12px 25px rgba(240,156,188,.4);

}

/* ==========================
   SECCIONES
========================== */

.section{

    width:min(900px,92%);

    margin:90px auto;

    text-align:center;

}

.section h2{

    font-family:"Great Vibes",cursive;

    color:var(--pink-dark);

    font-size:3rem;

    margin-bottom:20px;

}

.section p{

    line-height:1.9;

    margin:12px 0;

}

/* ==========================
   CUENTA REGRESIVA
========================== */

#countdown{

    display:grid;

    grid-template-columns:repeat(4,1fr);

    gap:20px;

    margin-top:40px;

}

#countdown div{

    background:white;

    border-radius:20px;

    padding:20px;

    box-shadow:var(--shadow);

}

#countdown span{

    display:block;

    font-size:2.2rem;

    color:var(--pink-dark);

    font-weight:bold;

}

#countdown small{

    color:#777;

}

/* ==========================
   FLORES (Temporal)
========================== */

.flowers{

    position:fixed;

    inset:0;

    pointer-events:none;

    opacity:.12;

    background-image:
    radial-gradient(circle,#f6bfd1 2px,transparent 2px);

    background-size:45px 45px;

}

/* ==========================
   RESPONSIVE
========================== */

@media(max-width:768px){

    h1{

        font-size:4rem;

    }

    #countdown{

        grid-template-columns:repeat(2,1fr);

    }

}

/* ==========================
ANIMACIONES
========================== */

.section{

    opacity:0;

    transform:translateY(60px);

    transition:1s;

}

.section.show{

    opacity:1;

    transform:translateY(0);

}

/* ==========================
   ACABADO PREMIUM
========================== */

body {
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,.95), transparent 30%),
        radial-gradient(circle at 85% 35%, rgba(255,220,232,.75), transparent 35%),
        linear-gradient(180deg, #fff9fb 0%, #fce5ee 50%, #fff8fb 100%);
}

.hero {
    overflow: hidden;
}

.hero::before,
.hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(20px);
    opacity: .45;
    animation: floatingLight 7s ease-in-out infinite;
}

.hero::before {
    top: -120px;
    left: -120px;
    background: rgba(255, 255, 255, .9);
}

.hero::after {
    right: -130px;
    bottom: -130px;
    background: rgba(244, 175, 202, .65);
    animation-delay: -3s;
}

.glass {
    position: relative;
    z-index: 3;
    overflow: hidden;
    animation: heroEntrance 1.2s ease both;
}

.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,.9),
        rgba(212,175,55,.45),
        rgba(255,255,255,.4)
    );

    -webkit-mask:
    
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
        mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);

    -webkit-mask-composite: xor;
    mask-composite: exclude;

    pointer-events: none;
}


.glass::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 300%;
    top: -100%;
    left: -180px;
    transform: rotate(25deg);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.45),
        transparent
    );
    animation: glassShine 5s infinite;
    pointer-events: none;
}

.subtitle {
    position: relative;
    z-index: 2;
}

h1 {
    position: relative;
    z-index: 2;
    text-shadow: 0 5px 18px rgba(216,123,154,.18);
}

.date {
    position: relative;
    z-index: 2;
}

button,
a {
    position: relative;
    z-index: 2;
    overflow: hidden;
    font-family: inherit;
    box-shadow: 0 10px 25px rgba(216,123,154,.25);
}

button::before,
a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 90%;
    height: 100%;
    transform: skewX(-25deg);
    background: rgba(255,255,255,.35);
    transition: .7s;
}

button:hover::before,
a:hover::before {
    left: 140%;
}

.section {
    position: relative;
    padding: 42px 30px;
    border-radius: 30px;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(255,255,255,.78);
    backdrop-filter: blur(10px);
    box-shadow: 0 22px 55px rgba(167,100,125,.10);
}

.section::before {
    content: "✦";
    display: block;
    margin-bottom: 10px;
    color: var(--gold);
    font-size: 1.2rem;
}

.section h2 {
    text-shadow: 0 4px 15px rgba(216,123,154,.15);
}

.section p {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

#countdown div {
    border: 1px solid rgba(212,175,55,.22);
    transition: transform .3s ease, box-shadow .3s ease;
}

#countdown div:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(216,123,154,.18);
}

/* ==========================
   PÉTALOS Y DESTELLOS
========================== */

.petals-layer,
.sparkles-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 20;
}

.petal {
    position: absolute;
    top: -40px;
    width: 14px;
    height: 18px;
    border-radius: 70% 30% 70% 30%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,.95),
        rgba(240,156,188,.75)
    );
    opacity: .72;
    animation: fallingPetal linear infinite;
}

.sparkle {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    box-shadow:
        0 0 8px rgba(255,255,255,.9),
        0 0 15px rgba(212,175,55,.45);
    animation: sparklePulse 2.5s ease-in-out infinite;
}

/* ==========================
   ANIMACIONES
========================== */

@keyframes heroEntrance {
    from {
        opacity: 0;
        transform: translateY(35px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floatingLight {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(25px) translateX(15px);
    }
}

@keyframes glassShine {
    0% {
        left: -180px;
    }

    35%,
    100% {
        left: 130%;
    }
}

@keyframes fallingPetal {
    0% {
        transform: translate3d(0, -40px, 0) rotate(0deg);
    }

    50% {
        transform: translate3d(45px, 50vh, 0) rotate(180deg);
    }

    100% {
        transform: translate3d(-25px, 110vh, 0) rotate(360deg);
    }
}

@keyframes sparklePulse {
    0%, 100% {
        opacity: .15;
        transform: scale(.6);
    }

    50% {
        opacity: 1;
        transform: scale(1.4);
    }
}

@media (max-width: 600px) {

    .glass {
        padding: 42px 22px;
    }

    h1 {
        font-size: 4.2rem;
    }

    .section {
        padding: 35px 20px;
        margin: 55px auto;
    }

    #countdown {
        gap: 12px;
    }

    #countdown div {
        padding: 16px 8px;
    }

    #countdown span {
        font-size: 1.8rem;
    }
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================
   SOBRE ANIMADO
========================== */

.envelope-wrapper {
    width: min(92%, 520px);
    text-align: center;
    position: relative;
    z-index: 5;
    perspective: 1200px;
}

.envelope {
    width: 100%;
    height: 340px;
    position: relative;
    cursor: pointer;
    filter: drop-shadow(0 25px 35px rgba(140, 70, 100, .22));
}

.envelope-back {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(
        145deg,
        #fbd7e5,
        #f4b8ce
    );
    border: 1px solid rgba(255, 255, 255, .7);
}

.letter {
    position: absolute;
    left: 7%;
    bottom: 18px;
    width: 86%;
    min-height: 285px;
    padding: 32px 24px;
    border-radius: 20px;
    background:
        linear-gradient(
            rgba(255, 255, 255, .94),
            rgba(255, 248, 251, .96)
        );
    border: 1px solid rgba(212, 175, 55, .3);
    box-shadow: 0 15px 30px rgba(120, 70, 90, .13);
    z-index: 2;
    transition:
        transform 1.15s cubic-bezier(.2, .8, .2, 1),
        opacity .6s ease;
}

.letter h1 {
    font-size: 4.5rem;
    margin: 5px 0;
}

.letter .date {
    margin-bottom: 22px;
}

.envelope-left,
.envelope-right,
.envelope-bottom,
.envelope-flap {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.envelope-left {
    z-index: 4;
    clip-path: polygon(0 0, 52% 52%, 0 100%);
    background: linear-gradient(
        145deg,
        #f8c9da,
        #efadc5
    );
    border-radius: 18px;
}

.envelope-right {
    z-index: 4;
    clip-path: polygon(100% 0, 48% 52%, 100% 100%);
    background: linear-gradient(
        215deg,
        #f8c9da,
        #eda8c1
    );
    border-radius: 18px;
}

.envelope-bottom {
    z-index: 5;
    clip-path: polygon(0 100%, 50% 45%, 100% 100%);
    background: linear-gradient(
        180deg,
        #f6bdd2,
        #e99db9
    );
    border-radius: 18px;
}

.envelope-flap {
    z-index: 6;
    transform-origin: top center;
    clip-path: polygon(0 0, 100% 0, 50% 60%);
    background: linear-gradient(
        180deg,
        #fce0ea,
        #efb1c8
    );
    border-radius: 18px;
    transition:
        transform .9s cubic-bezier(.2, .8, .2, 1),
        z-index 0s linear .45s;
}

.seal {
    position: absolute;
    z-index: 7;
    left: 50%;
    top: 49%;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    color: white;
    font-family: "Great Vibes", cursive;
    font-size: 2rem;
    background:
        radial-gradient(circle at 35% 30%, #f3d878, #c59b28);
    border: 3px solid rgba(255, 255, 255, .55);
    box-shadow:
        0 8px 20px rgba(130, 90, 20, .25),
        inset 0 2px 5px rgba(255, 255, 255, .5);
    transition:
        opacity .4s ease,
        transform .5s ease;
}

.open-hint {
    margin-top: 24px;
    color: #9a6176;
    font-size: .95rem;
    animation: hintPulse 1.8s ease-in-out infinite;
}

/* Estado abierto */

.envelope-wrapper.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 1;
}

.envelope-wrapper.open .seal {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.4);
}

.envelope-wrapper.open .letter {
    transform: translateY(-175px);
}

.envelope-wrapper.open .open-hint {
    opacity: 0;
}

/* Cuando ya se abrió por completo */

.hero.hero-finished {
    min-height: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        height .8s ease,
        opacity .6s ease;
}

@keyframes hintPulse {
    0%, 100% {
        opacity: .55;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@media (max-width: 600px) {

    .envelope {
        height: 295px;
    }

    .letter {
        min-height: 250px;
        padding: 25px 16px;
    }

    .letter h1 {
        font-size: 3.7rem;
    }

    .envelope-wrapper.open .letter {
        transform: translateY(-135px);
    }

    .seal {
        width: 52px;
        height: 52px;
    }
}

.envelope-wrapper.open #openInvitation {
    opacity: 0;
    transform: scale(.85);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease;
}

.music-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    z-index: 10000;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: linear-gradient(145deg, #f6bfd2, #df8dab);
    box-shadow: 0 10px 25px rgba(140, 70, 100, .25);
}

.music-button.playing {
    animation: musicPulse 1.8s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

/* ==========================
   GALERÍA
========================== */

.gallery-section {
    overflow: hidden;
}

.gallery-eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: .78rem;
    margin-bottom: 0 !important;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 35px;
}

.gallery-item {
    width: 100%;
    height: 330px;
    padding: 0;
    border-radius: 22px;
    overflow: hidden;
    background: white;
    box-shadow: 0 14px 35px rgba(115, 68, 87, .16);
    cursor: pointer;
}

.gallery-item::before {
    display: none;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s ease, filter .5s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: brightness(1.03);
}

.gallery-featured {
    grid-column: 1 / -1;
    height: 540px;
}

.gallery-wide {
    grid-column: 1 / -1;
    height: 480px;
}

.gallery-closing {
    font-family: "Great Vibes", cursive;
    font-size: 2.1rem;
    color: var(--pink-dark);
    margin-top: 40px !important;
}


/* ==========================
   LIGHTBOX
========================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(20, 10, 16, .94);
    backdrop-filter: blur(12px);

    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: min(88vw, 900px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 18px;

    box-shadow: 0 20px 60px rgba(0,0,0,.45);

    transform: scale(.96);
    transition: transform .35s ease;
}

.lightbox.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;

    width: 48px;
    height: 48px;

    padding: 0;
    border-radius: 50%;

    font-size: 2rem;
    line-height: 1;

    background: rgba(255,255,255,.13);
    box-shadow: none;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;

    width: 52px;
    height: 52px;

    padding: 0;
    border-radius: 50%;

    transform: translateY(-50%);

    font-size: 2.4rem;
    line-height: 1;

    background: rgba(255,255,255,.13);
    box-shadow: none;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-counter {
    position: absolute;
    bottom: 22px;

    color: rgba(255,255,255,.8);
    font-size: .9rem;
    letter-spacing: 2px;
}


/* ==========================
   GALERÍA EN CELULAR
========================== */

@media (max-width: 600px) {

    .gallery-grid {
        gap: 10px;
    }

    .gallery-item {
        height: 230px;
        border-radius: 16px;
    }

    .gallery-featured {
        height: 460px;
    }

    .gallery-wide {
        height: 400px;
    }

    .lightbox img {
        max-width: 94vw;
        max-height: 82vh;
        border-radius: 12px;
    }

    .lightbox-arrow {
        width: 42px;
        height: 42px;
        font-size: 2rem;
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .lightbox-prev {
        left: 22px;
    }

    .lightbox-next {
        right: 22px;
    }

    .lightbox-close {
        top: 18px;
        right: 18px;
    }

    .lightbox-counter {
        bottom: 30px;
    }
}

/* ==========================
   15 AÑOS DE RECUERDOS
========================== */

.childhood-section {
    overflow: hidden;
}

.childhood-eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: .75rem;
    margin-bottom: 4px !important;
}

.childhood-intro {
    max-width: 620px !important;
    margin: 0 auto 35px !important;
    line-height: 1.8 !important;
}

.childhood-timeline {
    position: relative;
    max-width: 680px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 34px;

    padding: 15px 25px;
}

/* Línea decorativa central */
.childhood-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 15px;
    bottom: 15px;
    width: 1px;

    background: linear-gradient(
        transparent,
        rgba(212, 175, 55, .55),
        rgba(216, 123, 154, .45),
        rgba(212, 175, 55, .55),
        transparent
    );
}

/* Cada recuerdo */
.memory,
.memory-left,
.memory-right {
    width: 100%;
    padding: 0;
    margin: 0;
}

.memory-photo {
    position: relative;
    background: #fff;
    padding: 7px 7px 24px;
    border-radius: 4px;

    box-shadow:
        0 12px 25px rgba(96, 53, 72, .15);

    transition: transform .4s ease;
}

.memory:nth-child(odd) .memory-photo {
    transform: rotate(-2deg);
}

.memory:nth-child(even) .memory-photo {
    transform: rotate(2deg);
}

.memory-photo img {
    display: block;
    width: 100%;
    height: 230px;

    object-fit: cover;
    border-radius: 2px;
}

.memory-photo:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Ya no necesitamos los puntos laterales */
.memory-dot {
    display: none;
}


/* Cierre */
.new-chapter {
    margin-top: 40px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    color: var(--gold);
}

.new-chapter p {
    margin: 0 !important;

    font-family: "Great Vibes", cursive;
    font-size: 2.4rem;

    color: var(--pink-dark);
}


/* ==========================
   CELULAR
========================== */

@media (max-width: 600px) {

    .childhood-intro {
        margin-bottom: 25px !important;
    }

    .childhood-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px 14px;

        padding: 10px 4px;
    }

    .childhood-timeline::before {
        display: none;
    }

    .memory-photo {
        padding: 5px 5px 18px;
    }

    .memory-photo img {
        height: 190px;
        object-fit: cover;
    }

    .memory:nth-child(odd) .memory-photo {
        transform: rotate(-1.5deg);
    }

    .memory:nth-child(even) .memory-photo {
        transform: rotate(1.5deg);
    }

    .new-chapter {
        margin-top: 30px;
        gap: 8px;
    }

    .new-chapter p {
        font-size: 1.9rem;
    }
}

/* ==========================
   CIERRE DE LA INVITACIÓN
========================== */

.final-confirmation {
    padding-bottom: 80px;
}

.final-confirmation > p {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.final-signature {
    margin-top: 55px;
    padding-top: 35px;
    position: relative;
}

.final-signature::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 90px;
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(
        90deg,
        transparent,
        var(--gold),
        transparent
    );
}

.final-signature span {
    display: block;
    font-family: "Great Vibes", cursive;
    font-size: 4.5rem;
    line-height: 1;
    color: var(--pink-dark);
}

.final-signature p {
    margin: 10px 0 4px !important;
    font-size: .9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.final-signature small {
    color: var(--gold);
    letter-spacing: 2px;
}
.final-confirmation h2 {
    font-size: 2.7rem;
}

.final-signature {
    margin-top: 38px;
    padding-top: 28px;
}

@media (max-width: 600px) {
    .final-confirmation h2 {
        font-size: 2.4rem;
    }

    .final-signature {
        margin-top: 32px;
    }
}
.final-signature {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.final-signature * {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}