body {
    font-family: Arial, sans-serif;
    background: #f5f1e6;
    text-align: center;
}

/* Estado inicial (oculto pero preparado para animar) */
#introTitles {
    opacity: 0;
    transform: translateY(20px);
}

/* Cuando se activa */
#introTitles.show {
    animation: fadeSlideIn 1s ease-out forwards;
}

/* Delay progresivo para los títulos */
#introTitles h1 {
    opacity: 0;
    animation: fadeSlideIn 1s ease-out forwards;
    animation-delay: 0.2s;
}

#introTitles h2 {
    opacity: 0;
    animation: fadeSlideIn 1s ease-out forwards;
    animation-delay: 0.6s;
}

/* =====================
   TITULOS (fade + slide)
===================== */

/* Estado inicial (oculto pero preparado para animar) */
#introTitles {
    opacity: 0;
    transform: translateY(20px);
}

/* Cuando se activa */
#introTitles.show {
    animation: fadeSlideIn 1s ease-out forwards;
}

/* Aparición progresiva */
#introTitles h1 {
    opacity: 0;
    animation: fadeSlideIn 1s ease-out forwards;
    animation-delay: 0.2s;
}

#introTitles h2 {
    opacity: 0;
    animation: fadeSlideIn 1s ease-out forwards;
    animation-delay: 0.6s;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =====================
   PENSANDO (2 segundos)
===================== */

.thinking {
    margin-top: 16px;
    font-size: 32px;
    font-weight: bold;
    color: #0b3c5d;
    letter-spacing: 2px;
}

/* Animación de los puntos — ciclo completo 2s */
.thinking span {
    animation: blink 4s infinite both;
}

.thinking span:nth-child(1) {
    animation-delay: 0s;
}
.thinking span:nth-child(2) {
    animation-delay: 0.3s;
}
.thinking span:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes blink {
    0%   { opacity: 0; }
    25%  { opacity: 1; }
    100% { opacity: 0; }
}



/* Keyframes */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 40px auto;
}

.card {
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 220px;
    transform-style: preserve-3d;
    border-radius: 16px;
    overflow: hidden;
}

.card.flipped .card-front {
    transform: rotateY(180deg);
}

.card.flipped .card-back {
    transform: rotateY(0deg);
}

.card-number {
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 2rem;
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s;
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}

.card-front span {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}

.card-front img,
.card-back img {
    max-width: 80%;
    max-height: 80%;
}


/* =====================
   MODAL
===================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-box {
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 16px;
    max-width: 70vw;
    max-height: 70vh;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-box img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.close {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 36px;
    color: white;
    cursor: pointer;
}

.modal-box {
    animation: scaleIn 0.1s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.discover-btn {
    margin-bottom: 14px;
    padding: 12px 32px;
    font-size: 3rem;
    font-weight: bold;

    background: linear-gradient(135deg, #0b3c5d, #09507a);
    color: #fff;

    border: none;
    border-radius: 30px;
    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.discover-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}


.image-description {
	font-size: 3rem;
    line-height: 1.4;
    color: #000;
    text-align: center;
    background-color: #fff;
    border-radius: 15px;
    padding: 5px 20px;
    margin-bottom: 10px;
    margin-top: -50px;
}

.hidden {
    display: none;
}