:root {
    --color-fondo: #FAF9F6;
    --color-texto-principal: #4C4F56;
    --color-acento-dorado: #B8860B;
    --color-acento-suave: #A9B29C;
    --font-serif: 'Montserrat', sans-serif;
    --font-sans: 'Lato', sans-serif;
    --transicion-suave: 0.3s ease;
    --font-names: 'Dancing Script', cursive, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    color: var(--color-texto-principal);
    background-color: var(--color-fondo);
    line-height: 1.6;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--color-texto-principal);
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5em;
    letter-spacing: 0.1em;
}

h2 {
    font-size: 1.8em;
    margin-bottom: 1em;
}

p {
    margin-bottom: 1em;
}

.container {
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.container img {
    width: 100%;
    padding-top: 1rem;
    margin-top: 1rem;
    object-fit: cover;
    opacity: 0.9;
}

.ring {
    max-width: 250px;
    opacity: 0.8;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    margin: 10px 0;
    border: 1px solid var(--color-acento-dorado);
    color: var(--color-acento-dorado);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9em;
    transition: background-color var(--transicion-suave), color var(--transicion-suave);
}

.btn:hover {
    background-color: var(--color-acento-dorado);
    color: var(--color-fondo);
}

#hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    background-image: url(img/back-invitate.png);
    background-size: auto 100%;
    background-repeat: no-repeat;
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(1px);
}

.hero-content {
    z-index: 10;
    padding: 20px 10px;
}

.hero-content img {
    width: 40%;
}

.hero-content audio {
    padding-top: 10px;
}

.hero-frame {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-frame img {
    width: 100%;
    height: 75vh;
    object-fit: contain;
}

.names {
    font-family: var(--font-names);
    font-style: italic;
    font-size: 1.8em;
    color: var(--color-texto-principal);
    line-height: 1.2;
    margin-bottom: 0.3em;
}

.date {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1.1em;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5em;
}

.monogram {
    font-family: var(--font-serif);
    font-size: 3.5em;
    color: var(--color-acento-dorado);
    margin-bottom: 0.2em;
}

#invitacion,
#cronograma,
#ubicacion,
#rsvp {
    padding: 10px 0;
    border-bottom: 1px solid rgba(169, 178, 156, 0.3);
    position: relative;
}

#cronograma {
    background-image: url(img/back-crono.png);
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: top;
}

.cita {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.2em;
    color: var(--color-acento-dorado);
    margin-top: 1em;
    margin-bottom: 2em;
}

.invitation-text {
    font-size: 1em;
    max-width: 350px;
    margin: 0 auto;
}

.timeline {
    position: relative;
    margin: 40px auto;
    max-width: 320px;
    text-align: left;
    background-color: var(--color-fondo);
}

.timeline h2 {
    padding-left: 6rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 5rem;
    width: 2px;
    background: var(--color-acento-suave);
}

.timeline i {
    margin-right: 5px;
    color: var(--color-acento-dorado);
    font-weight: 900;
    font-size: 3rem;
}

.timeline-event {
    position: relative;
    padding-left: 6rem;
    margin-bottom: 40px;
}

.timeline-event:last-child {
    margin-bottom: 0;
}

.timeline-event image {
    max-width: 450px;
}

.timeline-icon {
    position: absolute;
    top: 0;
    left: 4.7rem;
    width: 12px;
    height: 12px;
    background: var(--color-acento-dorado);
    border-radius: 50%;
    z-index: 1;
}

.event-time {
    font-weight: 700;
    color: var(--color-texto-principal);
    margin-bottom: 5px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.event-title {
    font-family: var(--font-serif);
    font-size: 1.3em;
    font-style: italic;
    margin: 0;
}

.event-details {
    font-size: 0.9em;
    color: var(--color-texto-principal);
    margin-top: 5px;
}

.location-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 30px;
}

.location-card {
    padding: 20px;
    border: 1px solid rgba(169, 178, 156, 0.5);
    border-radius: 5px;
    background-color: var(--color-fondo);
}

.location-card h3 {
    font-style: italic;
    font-size: 1.5em;
    color: var(--color-acento-dorado);
}

.location-card i {
    margin-right: 5px;
    color: var(--color-acento-dorado);
}

.cta-button {
    background-color: var(--color-acento-dorado);
    color: var(--color-fondo);
    border: 1px solid var(--color-acento-dorado);
    font-weight: 700;
    font-size: 1.1em;
    padding: 15px 40px;
    margin-top: 20px;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--color-acento-dorado);
}

.footer {
    text-align: center;
    font-size: 0.8em;
    color: var(--color-texto-principal);
    padding: 1rem 0;
}

@media (min-width: 768px) {
    h1 {
        font-size: 3.5em;
    }

    .names {
        font-size: 4em;
    }

    .envelope-wrapper .names {
        font-size: 2em;
    }

    .monogram {
        font-size: 5em;
    }

    h2 {
        font-size: 2.2em;
    }

    .container {
        max-width: 700px;
    }

    .location-grid {
        flex-direction: row;
        justify-content: space-between;
    }

    .location-card {
        width: 48%;
    }

    .timeline {
        max-width: 500px;
    }

    .hero-frame img {
        object-fit: cover;
    }

    #cronograma {
        background-size: auto
    }
}

#preloader-envelope {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-fondo);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 1.5s ease 1.5s, visibility 1.5s ease 1.5s;
}

#preloader-envelope.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.envelope-wrapper {
    position: relative;
    width: 280px;
    height: 180px;
    perspective: 1000px;
    z-index: 2;
    box-shadow: 0 0 10px rgba(0, 0, 0, 1.1);
}

.envelope-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-acento-dorado);
    z-index: 2;
}

.envelope-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-acento-suave);
    z-index: 2;
    clip-path: polygon(50% 50%, 100% 0, 100% 100%, 0 100%, 0 0);
    transform: translateY(0);
    animation: slidePaper 5s ease-out forwards;
}

.envelope-botton {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #b9c4aa;
    box-shadow: 0 0 10px rgba(0, 0, 0, 1.1);
    transform: translate(5%, 10%);
    z-index: 3;
    clip-path: polygon(50% 50%, 100% 100%, 0 100%);
    transform: translateY(0);
    animation: slidePaper 2s ease-out forwards;
}

.envelope-paper {
    position: absolute;
    top: 0;
    left: 0;
    width: 96%;
    height: 96%;
    background-color: var(--color-fondo);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transform: translate(2%, 2%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: liftPaper 1.5s ease-in-out forwards;
    animation-delay: 2.5s;
    text-align: center;
    border: 2px solid var(--color-acento-dorado);
    border-style: double;
    border-width: 10px;
}

.envelope-paper .names {
    font-size: 2.5 rem;
}

.envelope-wrapper img {
    height: 100%;
    padding: 1rem;
    object-fit: cover;
}

.envelope-top-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #b9c4aa;
    transform-origin: top;
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    animation: openFlap 2s ease-in-out forwards;
    animation-delay: 0.5s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 1.1);
}

.js-loading *,
.js-loading *:before,
.js-loading *:after {
    animation-play-state: paused !important;
}

@keyframes openFlap {
    0% {
        transform: rotateX(0deg);
    }

    100% {
        transform: rotateX(180deg);
        z-index: 1;
    }

}

@keyframes liftPaper {
    0% {
        transform: translate(2%, 2%);
    }

    100% {
        transform: translate(2%, -100%);
    }

}

@keyframes slidePaper {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.wedding-countdown {
    font-family: var(--font-serif);
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: var(--transicion-suave);
    background-position: center;
    background-image: url(img/back-date.png);
    background-repeat: no-repeat;
    background-size: cover;
}

.wedding-countdown:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.countdown-title {
    font-family: var(--font-names);
    font-size: 2.8rem;
    color: var(--color-acento-dorado);
    margin-bottom: 10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.countdown-subtitle {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 30px;
    letter-spacing: 1px;
    padding-top: 300px;
}

.countdown-date {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 35px;
    color: var(--color-acento-suave);
    font-weight: 500;
}

.countdown-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 15px 10px;
    border-radius: 10px;
    min-width: 80px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: var(--transicion-suave);
}

.countdown-unit:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.countdown-value {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--color-acento-dorado);
    line-height: 1;
    margin-bottom: 5px;
}

.countdown-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-texto-principal);
    font-weight: 400;
}

.countdown-message {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-style: italic;
    color: var(--color-acento-suave);
    margin-top: 15px;
}

@media (max-width: 600px) {
    .wedding-countdown {
        padding: 20px 15px;
    }

    .countdown-title {
        font-size: 2.2rem;
    }

    .countdown-container {
        gap: 10px;
    }

    .countdown-unit {
        min-width: 70px;
        padding: 12px 8px;
    }

    .countdown-value {
        font-size: 2rem;
    }
}

@media (max-width: 400px) {
    .countdown-container {
        flex-wrap: wrap;
    }

    .countdown-unit {
        min-width: 60px;
    }
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none;
}