
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Great+Vibes&display=swap');

:root {
    --marfil: #faf5e9;
    --dorado: #b8934e;
    --dorado-oscuro: #80602e;
    --champagne: #e8d7b5;
    --verde-olivo: #697456;
    --texto: #493b2b;
}

/* Configuración general */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    background: var(--marfil);
    color: var(--texto);
}

[hidden] {
    display: none !important;
}

/* Pantalla de bienvenida */

#bienvenida {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 25px;
    background: radial-gradient(
        ellipse at center,
        #fffdf7,
        #eee1c8
    );
    position: relative;
    overflow: hidden;
}

#bienvenida::before {
    content: "";
    position: absolute;
    inset: 15px;
    border: 1px solid var(--dorado);
    pointer-events: none;
}

#bienvenida::after {
    content: "";
    position: absolute;
    inset: 21px;
    border: 1px solid #b8934e55;
    pointer-events: none;
}

.portada-sobre {
    text-align: center;
    width: 100%;
    max-width: 550px;
    position: relative;
    z-index: 1;
}

.texto-superior {
    font-size: 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.portada-sobre h1 {
    font-size: 30px;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.portada-sobre h2 {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(55px, 11vw, 92px);
    font-weight: 400;
    color: var(--dorado-oscuro);
    margin: 15px 0 35px;
}

/* Sobre digital */

.sobre {
    position: relative;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3 / 2;
    margin: 0 auto;
    background: #d8c29c;
    border-radius: 5px;
    box-shadow: 0 18px 40px #493b2b33;
    perspective: 1000px;
    isolation: isolate;
}

/* Parte frontal del sobre */

.sobre::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        #f6edd9,
        #d9c5a0
    );
    clip-path: polygon(
        0 0, 50% 55%, 100% 0,
        100% 100%, 0 100%
    );
    z-index: 3;
    border-radius: 5px;
}

/* Carta interior */

.carta {
    position: absolute;
    top: 8%;
    left: 5%;
    width: 90%;
    height: 85%;
    background: #fffdf7;
    border: 1px solid var(--dorado);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: transform 1s ease;
}

.carta span {
    font-family: 'Great Vibes', cursive;
    font-size: 60px;
    color: var(--dorado);
}

/* Solapa superior */

.solapa {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        #f8efdd,
        #cfb68b
    );
    clip-path: polygon(
        0 0, 100% 0, 50% 60%
    );
    transform-origin: top;
    transition: transform 0.9s ease;
    z-index: 4;
}

/* Sello dorado */

.sello {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 3px double #f5ddb0;
    background: radial-gradient(
        circle at 30% 30%,
        #e9cd88,
        #b58b40,
        #80602e
    );
    color: #fff8e5;
    font-family: 'Great Vibes', cursive;
    font-size: 27px;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 5px 15px #493b2b55;
    transition: opacity 0.4s, scale 0.3s;
}

.sello:hover {
    scale: 1.08;
}

.sello:focus-visible {
    outline: 3px solid var(--verde-olivo);
    outline-offset: 5px;
}

.instruccion {
    font-size: 19px;
    margin-top: 35px;
    color: var(--dorado-oscuro);
}

/* Animación de apertura */

.sobre.abierto .solapa {
    transform: rotateX(180deg);
    z-index: 1;
}

.sobre.abierto .carta {
    transform: translateY(-65%);
    transition-delay: 0.7s;
}

.sobre.abierto .sello {
    opacity: 0;
    pointer-events: none;
}

/* Portada principal */

.portada-principal {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background: radial-gradient(
        ellipse,
        #fffdf7,
        #eee1c8
    );
}

.portada-principal h1 {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(60px, 13vw, 110px);
    font-weight: 400;
    color: var(--dorado-oscuro);
    margin: 25px 0;
}

.portada-principal h2 {
    font-size: 32px;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.portada-principal p {
    font-size: 23px;
}

.fecha {
    margin-top: 25px;
    color: var(--dorado-oscuro);
}

/* Adaptación a celulares */

@media (max-width: 480px) {
    .texto-superior {
        font-size: 15px;
        letter-spacing: 2px;
    }

    .portada-sobre h1 {
        font-size: 24px;
    }

    .sobre {
        max-width: 290px;
    }

    .sello {
        width: 65px;
        height: 65px;
        font-size: 23px;
    }

    .instruccion {
        font-size: 17px;
    }
}

/* Accesibilidad de las animaciones */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}
