/* ===============================================
   CSS Variables
   =============================================== */
:root {
    /* Colores de la invitación */
    --color-gris-azulado: #688289;
    --color-rosa-texto: #ca7895;
    --color-verde-precio: #558066;
    --color-dorado: #eda643;

    /* Colores de fondo */
    --color-rosa-principal: #F4B7C8;
    --color-rosa-dusty: #E89AA9;
    --color-rosa-claro: #FBE8F3;
    --color-crema: #FDF4EC;
    --color-blanco: #FFFFFF;

    /* Tipografías */
    --font-principal: 'Cormorant Garamond', serif;
    --font-display: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
}

/* ===============================================
   Reset & Base
   =============================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    font-size: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--color-gris-azulado);
    background-color: var(--color-crema);
    min-height: 100vh;
    overflow: hidden;
}

/* ===============================================
   Background con Video y Overlay
   =============================================== */
.bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.4;
}

.bg-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
            rgba(244, 183, 200, 0.5) 0%,
            rgba(244, 183, 200, 0.65) 40%,
            rgba(232, 154, 169, 0.75) 100%);
    pointer-events: none;
}

/* ===============================================
   Rosas decorativas esquina superior izquierda (racimo)
   =============================================== */
.corner-roses {
    position: fixed;
    top: -5%;
    left: -5%;
    z-index: 50;
    pointer-events: none;
    width: clamp(150px, 45vw, 300px);
    aspect-ratio: 1 / 1;
}

.corner-rose {
    position: absolute;
    height: auto;
    opacity: 0.9;
}

/* Base large rose in corner */
.corner-rose--1 {
    width: 65%;
    top: 5%;
    left: 5%;
    z-index: 10;
}

/* Rose covering right edge */
.corner-rose--2 {
    width: 55%;
    top: 15%;
    left: 45%;
    z-index: 9;
    transform: rotate(55deg);
}

/* Rose covering bottom edge */
.corner-rose--3 {
    width: 50%;
    top: 50%;
    left: 10%;
    z-index: 8;
    transform: rotate(-25deg);
}

/* Smaller filler rose in center */
.corner-rose--4 {
    width: 45%;
    top: 30%;
    left: 30%;
    z-index: 7;
    transform: rotate(15deg);
}

/* Smaller filler rose 2 on far right */
.corner-rose--5 {
    width: 35%;
    top: 25%;
    left: 65%;
    z-index: 6;
    transform: rotate(80deg);
}

/* Smaller filler rose 3 on bottom */
.corner-rose--6 {
    width: 30%;
    top: 60%;
    left: 30%;
    z-index: 5;
    transform: rotate(-50deg);
}

/* ===============================================
   Rosas decorativas esquina inferior izquierda (inverso)
   =============================================== */
.corner-roses-bottom {
    position: fixed;
    bottom: -5%;
    left: -5%;
    z-index: 50;
    pointer-events: none;
    width: clamp(150px, 45vw, 300px);
    aspect-ratio: 1 / 1;
    transform: scale(1, -1);
}

.corner-rose-bottom {
    position: absolute;
    height: auto;
    opacity: 0.8;
}

.corner-rose-bottom--1 {
    width: 65%;
    top: 5%;
    left: 5%;
    z-index: 10;
}

.corner-rose-bottom--2 {
    width: 55%;
    top: 15%;
    left: 45%;
    z-index: 9;
    transform: rotate(55deg);
}

.corner-rose-bottom--3 {
    width: 50%;
    top: 50%;
    left: 10%;
    z-index: 8;
    transform: rotate(-25deg);
}

.corner-rose-bottom--4 {
    width: 45%;
    top: 30%;
    left: 30%;
    z-index: 7;
    transform: rotate(15deg);
}

.corner-rose-bottom--5 {
    width: 35%;
    top: 25%;
    left: 65%;
    z-index: 6;
    transform: rotate(80deg);
}

.corner-rose-bottom--6 {
    width: 30%;
    top: 60%;
    left: 30%;
    z-index: 5;
    transform: rotate(-50deg);
}

/* ===============================================
   Mariposas volando
   =============================================== */
.butterflies {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.butterfly {
    position: absolute;
    width: clamp(40px, 10vw, 70px);
    height: auto;
    opacity: 0.8;
}

/* Cada mariposa cruza la pantalla en diferentes direcciones */
.butterfly--1 {
    top: 20%;
    animation: flyAcross1 25s linear infinite;
}

.butterfly--2 {
    top: 50%;
    animation: flyAcross2 30s linear infinite;
    animation-delay: -8s;
}

.butterfly--3 {
    top: 70%;
    animation: flyAcross3 22s linear infinite;
    animation-delay: -15s;
}

.butterfly--4 {
    top: 35%;
    animation: flyAcross4 28s linear infinite;
    animation-delay: -5s;
}

.butterfly--5 {
    top: 85%;
    animation: flyAcross5 24s linear infinite;
    animation-delay: -12s;
}

/* Trayectorias que cruzan toda la pantalla y salen por los bordes */
@keyframes flyAcross1 {
    0% {
        left: -30%;
        top: 20%;
        transform: rotate(10deg);
    }

    25% {
        left: 30%;
        top: 35%;
        transform: rotate(-5deg);
    }

    50% {
        left: 60%;
        top: 15%;
        transform: rotate(15deg);
    }

    75% {
        left: 85%;
        top: 40%;
        transform: rotate(-10deg);
    }

    100% {
        left: 130%;
        top: 25%;
        transform: rotate(5deg);
    }
}

@keyframes flyAcross2 {
    0% {
        right: -30%;
        top: 60%;
        transform: scaleX(-1) rotate(5deg);
    }

    30% {
        right: 25%;
        top: 45%;
        transform: scaleX(-1) rotate(-10deg);
    }

    60% {
        right: 55%;
        top: 70%;
        transform: scaleX(-1) rotate(8deg);
    }

    100% {
        right: 130%;
        top: 50%;
        transform: scaleX(-1) rotate(-5deg);
    }
}

@keyframes flyAcross3 {
    0% {
        left: -30%;
        top: 80%;
        transform: rotate(-15deg);
    }

    20% {
        left: 20%;
        top: 65%;
        transform: rotate(10deg);
    }

    45% {
        left: 50%;
        top: 85%;
        transform: rotate(-8deg);
    }

    70% {
        left: 75%;
        top: 60%;
        transform: rotate(12deg);
    }

    100% {
        left: 130%;
        top: 75%;
        transform: rotate(-5deg);
    }
}

@keyframes flyAcross4 {
    0% {
        left: 130%;
        top: 10%;
        transform: scaleX(-1) rotate(-10deg);
    }

    25% {
        left: 70%;
        top: 30%;
        transform: scaleX(-1) rotate(8deg);
    }

    50% {
        left: 40%;
        top: 15%;
        transform: scaleX(-1) rotate(-12deg);
    }

    75% {
        left: 15%;
        top: 40%;
        transform: scaleX(-1) rotate(5deg);
    }

    100% {
        left: -30%;
        top: 20%;
        transform: scaleX(-1) rotate(-8deg);
    }
}

@keyframes flyAcross5 {
    0% {
        right: -30%;
        bottom: 5%;
        transform: scaleX(-1) rotate(8deg);
    }

    35% {
        right: 40%;
        bottom: 20%;
        transform: scaleX(-1) rotate(-12deg);
    }

    65% {
        right: 70%;
        bottom: 8%;
        transform: scaleX(-1) rotate(10deg);
    }

    100% {
        right: 130%;
        bottom: 15%;
        transform: scaleX(-1) rotate(-6deg);
    }
}

/* ===============================================
   Invitation Container
   =============================================== */
.invitation {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ===============================================
   Screen System (Bloques/Pantallas)
   =============================================== */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10vh 1.5rem 15vh;
    padding: 10dvh 1.5rem 15dvh;

    /* Estado inicial: oculto */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition:
        opacity 0.6s ease-out,
        visibility 0.6s ease-out,
        transform 0.6s ease-out;
}

.screen--active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Animación de entrada */
.screen--entering {
    animation: screenFadeIn 0.8s ease-out forwards;
}

@keyframes screenFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* Animación de salida */
.screen--leaving {
    animation: screenFadeOut 0.5s ease-in forwards;
}

@keyframes screenFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(8px);
    }
}

.screen__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

/* ===============================================
   Screen Navigation Button
   =============================================== */
.screen__nav-btn {
    position: absolute;
    bottom: 8vh;
    bottom: 8dvh;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 0.6rem;

    background: transparent;
    border: none;
    padding: 1rem 1.5rem;

    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-rosa-texto);

    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.screen__nav-btn:hover,
.screen__nav-btn:focus {
    color: var(--color-dorado);
    transform: translateX(-50%) translateY(-2px);
}

.screen__nav-btn:focus {
    outline: none;
}

.nav-arrow {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
    animation: arrowBounce 1.5s ease-in-out infinite;
}

.screen__nav-btn:hover .nav-arrow {
    transform: translateX(4px);
    animation: none;
}

@keyframes arrowBounce {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(6px);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        color: var(--color-rosa-texto);
    }

    50% {
        color: var(--color-dorado);
    }
}

/* Animación sutil del botón */
.screen__nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--color-dorado);
    transition: width 0.3s ease;
}

.screen__nav-btn:hover::after {
    width: 80%;
}

/* ===============================================
   SCREEN 1: Pantalla Inicial
   =============================================== */
.screen1__greeting {
    font-family: var(--font-principal);
    font-size: clamp(1.7rem, 5.5vw, 2.6rem);
    font-weight: 400;
    color: var(--color-gris-azulado);
    line-height: 1.3;
    margin-bottom: 0;
}

.screen1__subtitle {
    font-family: var(--font-principal);
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-gris-azulado);
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

/* Mis 15 en una sola línea con borde blanco y luz */
.screen1__title {
    font-family: var(--font-principal);
    font-size: clamp(5rem, 20vw, 12rem);
    font-weight: 600;
    color: var(--color-gris-azulado);
    line-height: 1;
    letter-spacing: 0.02em;
    margin: 0;
    -webkit-text-stroke: clamp(2px, 0.4vw, 4px) var(--color-blanco);
    paint-order: stroke fill;
    position: relative;
    animation: glowSweep 4s ease-in-out infinite;
}

/* Nombre Azul con destello y borde blanco */
.screen1__name {
    font-family: var(--font-principal);
    font-size: clamp(4.5rem, 18vw, 10rem);
    font-weight: 500;
    color: var(--color-rosa-texto);
    line-height: 1;
    margin-top: 0.3rem;
    position: relative;
    -webkit-text-stroke: clamp(2px, 0.5vw, 5px) var(--color-blanco);
    paint-order: stroke fill;
    animation: glowSweep 4s ease-in-out infinite 0.5s;
}

/* Efecto de luz que recorre el borde */
@keyframes glowSweep {
    0% {
        text-shadow:
            -0.1em -0.05em 0.15em rgba(255, 255, 255, 0.8),
            0 0 0 transparent;
    }

    25% {
        text-shadow:
            0.1em -0.05em 0.15em rgba(255, 255, 255, 0.8),
            0 0 0 transparent;
    }

    50% {
        text-shadow:
            0.1em 0.05em 0.15em rgba(255, 255, 255, 0.8),
            0 0 0 transparent;
    }

    75% {
        text-shadow:
            -0.1em 0.05em 0.15em rgba(255, 255, 255, 0.8),
            0 0 0 transparent;
    }

    100% {
        text-shadow:
            -0.1em -0.05em 0.15em rgba(255, 255, 255, 0.8),
            0 0 0 transparent;
    }
}

/* ===============================================
   SCREEN 2: Detalles del Evento
   =============================================== */
.screen2__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-principal);
    font-size: clamp(2.2rem, 7vw, 3.5rem);
    font-weight: 500;
    font-style: normal;
    color: var(--color-rosa-texto);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.screen2__time {
    font-family: var(--font-principal);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 400;
    color: var(--color-gris-azulado);
    margin-bottom: 2rem;
}

.screen2__location {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-principal);
    font-size: clamp(1.5rem, 4.5vw, 2rem);
    font-weight: 400;
    font-style: normal;
    color: var(--color-rosa-texto);
    line-height: 1.4;
    margin-bottom: 2.5rem;
}

.screen2__location strong {
    font-weight: 600;
    font-size: 1.15em;
}

/* ===============================================
   SCREEN 3: Precios
   =============================================== */
.screen3__title {
    font-family: var(--font-principal);
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 600;
    color: var(--color-dorado);
    margin-bottom: 2rem;
}

.screen3__prices {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 3rem;
    margin-bottom: 2.5rem;
}

.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
}

.price-item__label {
    font-family: var(--font-principal);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 400;
    color: var(--color-rosa-texto);
}

.price-item__value {
    font-family: var(--font-principal);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 600;
    color: var(--color-verde-precio);
}

/* ===============================================
   Buttons
   =============================================== */
.btn {
    display: inline-block;
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn--primary {
    background-color: var(--color-gris-azulado);
    color: var(--color-blanco);
}

.btn--primary:hover,
.btn--primary:focus {
    background-color: var(--color-dorado);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn--secondary {
    background-color: var(--color-verde-precio);
    color: var(--color-blanco);
}

.btn--secondary:hover,
.btn--secondary:focus {
    background-color: var(--color-dorado);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:focus {
    outline: none;
}

/* ===============================================
   Music Toggle Button
   =============================================== */
.music-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-rosa-dusty) 0%, var(--color-rosa-principal) 100%);
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(244, 183, 200, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: transform 0.2s;
}

.music-toggle:hover,
.music-toggle:focus {
    transform: scale(1.05);
    outline: 2px solid var(--color-rosa-dusty);
    outline-offset: 2px;
}

.music-toggle__icon {
    position: absolute;
    color: var(--color-blanco);
    font-size: 1rem;
    font-weight: 700;
}

.music-toggle__icon--play {
    padding-left: 2px;
}

.music-toggle.is-playing .music-toggle__icon--play {
    display: none;
}

.music-toggle.is-playing .music-toggle__icon--pause {
    display: flex;
}

.music-toggle:not(.is-playing) .music-toggle__icon--play {
    display: flex;
}

.music-toggle:not(.is-playing) .music-toggle__icon--pause {
    display: none;
}

/* ===============================================
   Responsive Adjustments
   =============================================== */
@media (min-width: 768px) {
    .screen {
        padding: 8vh 2rem 18vh;
        padding: 8dvh 2rem 18dvh;
    }

    .screen__nav-btn {
        font-size: 1.2rem;
        bottom: 6vh;
        bottom: 6dvh;
    }

    .screen__content {
        gap: 0.8rem;
    }

    .music-toggle {
        width: 56px;
        height: 56px;
    }
}

/* Pantallas muy cortas o landscape */
@media (max-height: 600px) {
    .screen {
        padding: 3vh 1rem 15vh;
        padding: 3dvh 1rem 15dvh;
    }

    .screen__content {
        gap: 0.3rem;
    }

    .screen__nav-btn {
        bottom: 3vh;
        bottom: 3dvh;
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }

    .screen1__title {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .screen1__name {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .screen1__greeting {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
    }

    .screen1__subtitle {
        font-size: clamp(1rem, 3.5vw, 1.5rem);
        margin-bottom: 0.8rem;
    }

    .screen2__date {
        font-size: clamp(1.5rem, 5vw, 2rem);
        margin-bottom: 0.8rem;
    }

    .screen2__time {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
        margin-bottom: 1rem;
    }

    .screen2__location {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
        margin-bottom: 1rem;
    }

    .screen3__title {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin-bottom: 1rem;
    }

    .screen3__prices {
        gap: 0.8rem 2rem;
        margin-bottom: 1.5rem;
    }

    .price-item__label,
    .price-item__value {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .music-toggle {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* ===============================================
   Accessibility - Reduced Motion
   =============================================== */
@media (prefers-reduced-motion: reduce) {

    .screen,
    .screen--entering,
    .screen--leaving {
        animation: none;
        transition: opacity 0.3s ease;
    }

    .screen__nav-btn,
    .btn,
    .music-toggle {
        transition: none;
    }

    .bg-video {
        animation: none;
    }
}