:root {
    /* Colores - Paleta principal */
    --color-fondo-claro: #ebe7d9;
    --color-fondo-oscuro: #1e1f22;
    --color-acento-primario: #f55139;
    --color-acento-primario-brillo: #fd0800;
    --color-acento-secundario: #3AB7BF;
    --color-acento-dark: #298288;
    --modal-shadow:#298288b2;
}

html[data-theme='light'] {
    --bg-main: #02020263;
    --bg-surface: #7e7b7bda;
    --bg-overlay: rgba(255, 255, 255, 0.6);
    --text-main: var(--color-fondo-oscuro);
    --text-muted: rgba(30, 31, 34, 0.7);
    --border-soft: rgba(0, 0, 0, 0.15);
    --modal-shadow:#0a0a0ae3;
}

.bodycardfame {
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    cursor: default;
    margin-top: 3rem;
}

.carousel-wrapperfame {
    width: 100%;
    height: 80%;
    overflow: hidden;
    position: relative;
    perspective: 2000px;
    padding-block: 1rem;
}

.carouselfame {
    position: relative;
    height: 100%;
    width: 100%;
    transform-style: preserve-3d;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cardfame {
    position: absolute;
    padding: 0;
    height: 100%;
    border-radius: 35px;
    overflow: hidden;
    transition: transform 0.8s ease, opacity 0.6s ease, filter 0.6s ease;
    filter: blur(2px);
    opacity: 0;
    z-index: 0;

}

a[data-title] {
    position: relative;
}

a[data-title]::after {
    content: attr(data-title);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    background: var(--color-acento-dark);
    color: var(--color-fondo-claro);
    border-radius: 15px;
    padding: 0.5rem 0.7rem;
    font-size: clamp(8px, 3vw, 13px);
    font-weight: 550;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

a[data-title]:hover::after {
    opacity: 1;
}

@media (max-width: 800px) {
    .carousel-wrapperfame {
        height: 70vh;
    }

    .cardfame {
        height: 450px;
        border-radius: 30px;
    }

}

@media (max-width:440px) {
    .bodycardfame{
        margin-top: 0;
    }

    .carousel-wrapperfame {
        height: 70vh;
    }

}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.3s ease;
    cursor: pointer;
}

video:hover {
    filter: brightness(1.05);
}

.cardfame.activefame {
    transform: translateX(0px) translateZ(0px) rotateY(0deg) scale(1);
    filter: none;
    opacity: 1;
    z-index: 5;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* Safari / iOS */
    -moz-tap-highlight-color: transparent;
    /* Firefox móvil */
    user-select: none;
    /* Evita selección de texto */
}

.cardfame.activefame:hover {
    transform: translateX(0px) translateZ(0px) rotateY(0deg) scale(1.03);
}

.cardfame.leftfame {
    transform: translateX(-350px) translateZ(-150px) rotateY(35deg) scale(0.85);
    opacity: 1;
    z-index: 3;
}

.cardfame.rightfame {
    transform: translateX(350px) translateZ(-150px) rotateY(-35deg) scale(0.85);
    opacity: 1;
    z-index: 3;
}

@media(max-width:1024px) {
    .cardfame.leftfame {
        transform: translateX(-280px) translateZ(-150px) rotateY(35deg) scale(0.85);
        opacity: 1;
        z-index: 3;
    }

    .cardfame.rightfame {
        transform: translateX(280px) translateZ(-150px) rotateY(-35deg) scale(0.85);
        opacity: 1;
        z-index: 3;
    }
}

@media(max-width:440px) {
    .cardfame.leftfame {
        transform: translateX(-200px) translateZ(-150px) rotateY(35deg) scale(0.85);
        opacity: 1;
        z-index: 3;
    }

    .cardfame.rightfame {
        transform: translateX(200px) translateZ(-150px) rotateY(-35deg) scale(0.85);
        opacity: 1;
        z-index: 3;
    }
}

.cardfame.hiddenfame {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5) translateZ(-500px);
    z-index: 0;
}

/* ==========================
   INDICADORES DEL CAROUSEL
   =========================*/

.indicators {
    display: flex;
    justify-content: initial;
    align-items: center;
    gap: 12px;
    margin-block: 1rem;
    height: auto;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(46, 46, 46, 0.829);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.indicator:hover {
    background-color: #3ab6bf7d;
    transform: scale(1.2);
}

.indicator-active {
    background-color: var(--color-acento-secundario);
    transform: scale(1.2);
    box-shadow: 0 0 10px var(--color-acento-secundario);
}

/* ==========================
   MODAL PROYECTOS
   ========================= */

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    text-align: center;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.project-modal.hidden {
    display: none;
}

.project-modal-overlay {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    backdrop-filter: blur(6px);
}

.project-modal-content {
    position: relative;
    max-width: 500px;
    height: auto;
    margin: 18vh 1rem;
    text-align: center;
    font-weight: 600;
    background: var(--bg-surface);
    color: var(--text-main);
    border-radius: 30px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--modal-shadow);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

@keyframes modalOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(40px);
        opacity: 0;
    }
}

.project-modal.closing .project-modal-content {
    animation: modalOut 0.3s ease forwards;
}

.project-modal .project-modal-content {
    animation: modalIn 0.3s ease forwards;
}

.project-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-acento-primario);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* Safari / iOS */
    -moz-tap-highlight-color: transparent;
    /* Firefox móvil */
    user-select: none;
    /* Evita selección de texto */
}

#project-modal-tech {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

#project-modal-tech li {
    background: var(--color-acento-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
}