#trauma-xp-wrapper {
    --padding: 2rem;
    --gutter: 0.75rem;
    --columns: 12;
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --accent-color: #3a3aff;
    --grid-color: rgba(255, 255, 255, 0.15);
    --row-spacing: 4rem;
    font-family: "PP Neue Montreal", sans-serif;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.03em;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: var(--padding);
    overflow-x: hidden;
    position: relative;
}

#trauma-xp-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#trauma-xp-wrapper .grid-container {
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gutter);
    row-gap: var(--row-spacing);
    width: 100%;
    margin: 0 auto;
    position: relative;
}

#trauma-xp-wrapper .grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: var(--padding);
    pointer-events: none;
    z-index: 1000;
}

/* Cambiar la opacidad de las líneas */
#trauma-xp-wrapper .grid-overlay-inner {
    display: grid;
    grid-template-columns: repeat(var(--columns), 1fr);
    gap: var(--gutter);
    height: 100%;
    width: 100%;
    margin: 0 auto;
    opacity: 0.0;
}

#trauma-xp-wrapper .grid-column {
    height: 100%;
    border-left: 1px solid var(--grid-color);
    border-right: 1px solid var(--grid-color);
    opacity: 0;
}

#trauma-xp-wrapper .header {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    margin-bottom: 6rem;
}

#trauma-xp-wrapper .logo {
    grid-column: 2 / span 3;
    font-weight: 700;
    font-size: 4rem;
    text-transform: uppercase;
}

#trauma-xp-wrapper .nav {
    grid-column: 10 / span 3;
    display: flex;
    justify-content: space-between;
}

#trauma-xp-wrapper .nav-item {
    font-size: 3rem;
    cursor: pointer;
}

#trauma-xp-wrapper .nav-item:hover {
    opacity: 1;
}

#trauma-xp-wrapper .inversion-lens {
    position: relative;
    overflow: hidden;
    background-color: #111;
}

#trauma-xp-wrapper .inversion-lens img {
    display: none;
}

#trauma-xp-wrapper .inversion-lens canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#trauma-xp-wrapper .project-info {
    font-size: 1rem;
    margin-top: 1rem;
    line-height: 1.2;
}

#trauma-xp-wrapper .project-date {
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

#trauma-xp-wrapper .project-title {
    font-weight: 700;
    font-size: 2rem;
    margin-top: 0.125rem;
    text-transform: uppercase;
    color: #0062ff;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

#trauma-xp-wrapper .project-subtitle {
    margin-top: 0.125rem;
    font-size: 1rem;
}

/* -------------------------------Item 1 Rav-Toyota------------------------------------------ */
#trauma-xp-wrapper .item-1-container {
    grid-column: 2 / span 5;
    grid-row: 2 / span 4;
}

#trauma-xp-wrapper .item-1 {
    height: 700px;
}

/* ---------------------------------Item 2 A3O---------------------------------------- */
#trauma-xp-wrapper .item-2-container {
    grid-column: 8 / span 5;
    grid-row: 2;

    /* súbelo visualmente */
    margin-top: -5rem;
}

#trauma-xp-wrapper .item-2 {
    height: 300px;
}

.lazy {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* ---------------------------Item 3 Corola Video Toyota-------------------------------- */
#trauma-xp-wrapper .item-3-container {
    grid-column: 3 / span 4;
    grid-row: 4;

    /* súbelo visualmente */
    margin-top: 32rem;
}

#trauma-xp-wrapper .item-3 {
    height: 350px;
}

/* ---------------------------------Item 4 Gatorade--------------------------------------- */
#trauma-xp-wrapper .item-4-container {
    grid-column: 8 / span 4;
    grid-row: 3 / span 2;
    margin-top: var(--row-spacing);
}

#trauma-xp-wrapper .item-4 {
    height: 450px;
}

/* -------------------------------Item 5 Bridgestone Golf------------------------------------------ */
#trauma-xp-wrapper .item-5-container {
    grid-column: 2 / span 4;
    grid-row: 5;

    /* súbelo visualmente */
    margin-top: 7rem;
}

/* ajusta si necesitas otra altura */
#trauma-xp-wrapper .item-5 {
    height: 400px;
}

@media (max-width: 768px) {
    #trauma-xp-wrapper .item-5 {
        height: 350px;
    }

    #trauma-xp-wrapper .item-5-container {
        grid-column: 1;
        grid-row: auto;
        margin-top: var(--row-spacing);
    }
}

@media (max-width: 480px) {
    #trauma-xp-wrapper .item-5 {
        height: 300px;
    }
}

/* ---------------------------------Item 6 Camry Toyota---------------------------------------- */
#trauma-xp-wrapper .item-6-container {
    grid-column: 8 / span 4;
    grid-row: 5;

    /* súbelo visualmente */
    margin-top: -15rem;
}

#trauma-xp-wrapper .item-6 {
    height: 400px;
}

/* ---------------------------------Item 7 Arrancon-Toyota---------------------------------- */
#trauma-xp-wrapper .item-7-container {
    grid-column: 8 / span 4;
    grid-row: 6;
    margin-top: -13rem;
}

#trauma-xp-wrapper .item-7 {
    height: 450px;
}

@media (max-width: 768px) {
    #trauma-xp-wrapper .item-7 {
        height: 350px;
    }
}

@media (max-width: 480px) {
    #trauma-xp-wrapper .item-7 {
        height: 300px;
    }
}

/* -----------Item 8 Sta. MAria Teaser ---------- */
#trauma-xp-wrapper .item-8-container {
    grid-column: 2 / span 4;
    grid-row: 7;

    /* súbelo visualmente */
    margin-top: -20rem;
}

#trauma-xp-wrapper .item-8 {
    height: 600px;
}

@media (max-width: 768px) {
    #trauma-xp-wrapper .item-8 {
        height: 350px;
    }
}

@media (max-width: 480px) {
    #trauma-xp-wrapper .item-8 {
        height: 300px;
    }
}

/* ---------------------------------Item 9 video---------------------------------------- */
#trauma-xp-wrapper .item-9-container {
    grid-column: 7 / span 4;
    grid-row: 7;

    /* súbelo visualmente */
    margin-top: 8rem;
}

#trauma-xp-wrapper .item-9 {
    height: 400px;
}

#trauma-xp-wrapper .item-9 video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ajuste de video al conteedor */
.inversion-lens video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------------------------------Item 10---------------------------------------- */
@media (max-width: 768px) {
    #trauma-xp-wrapper {
        --padding: 1.5rem;
        --gutter: 0.5rem;
        --row-spacing: 3rem;
    }

    #trauma-xp-wrapper {
        font-size: 15px;
    }

    #trauma-xp-wrapper .grid-container,
    #trauma-xp-wrapper .grid-overlay-inner {
        grid-template-columns: repeat(6, 1fr);
    }

    #trauma-xp-wrapper .header {
        margin-bottom: 3rem;
    }

    #trauma-xp-wrapper .logo {
        grid-column: 1 / span 3;
        font-size: 1.3rem;
    }

    #trauma-xp-wrapper .nav {
        grid-column: 4 / span 3;
    }

    #trauma-xp-wrapper .nav-item {
        font-size: 1rem;
    }

    #trauma-xp-wrapper .item-1,
    #trauma-xp-wrapper .item-2,
    #trauma-xp-wrapper .item-3,
    #trauma-xp-wrapper .item-4,
    #trauma-xp-wrapper .item-5,
    #trauma-xp-wrapper .item-6,
    #trauma-xp-wrapper .item-7,
    #trauma-xp-wrapper .item-8,
    #trauma-xp-wrapper .item-9,
    #trauma-xp-wrapper .item-10,
    #trauma-xp-wrapper .item-11,
    #trauma-xp-wrapper .item-12,
    #trauma-xp-wrapper .item-13,
    #trauma-xp-wrapper .item-14,
    #trauma-xp-wrapper .item-15 {
        height: 350px;
    }
}

@media (max-width: 480px) {
    #trauma-xp-wrapper {
        --padding: 1rem;
        --gutter: 0.4rem;
        --row-spacing: 2.5rem;
        font-size: 14px;
    }

    #trauma-xp-wrapper .grid-container,
    #trauma-xp-wrapper .grid-overlay-inner {
        grid-template-columns: 1fr;
    }

    #trauma-xp-wrapper .header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2.5rem;
        display: flex;
    }

    #trauma-xp-wrapper .logo,
    #trauma-xp-wrapper .nav {
        grid-column: 1;
    }

    #trauma-xp-wrapper .logo {
        font-size: 1.2rem;
    }

    #trauma-xp-wrapper .nav-item {
        font-size: 0.9rem;
    }

    #trauma-xp-wrapper .item-1-container,
    #trauma-xp-wrapper .item-2-container,
    #trauma-xp-wrapper .item-3-container,
    #trauma-xp-wrapper .item-4-container,
    #trauma-xp-wrapper .item-5-container,
    #trauma-xp-wrapper .item-6-container,
    #trauma-xp-wrapper .item-7-container,
    #trauma-xp-wrapper .item-8-container,
    #trauma-xp-wrapper .item-9-container,
    #trauma-xp-wrapper .item-10-container,
    #trauma-xp-wrapper .item-11-container,
    #trauma-xp-wrapper .item-12-container,
    #trauma-xp-wrapper .item-13-container,
    #trauma-xp-wrapper .item-14-container,
    #trauma-xp-wrapper .item-15-container {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
    }

    #trauma-xp-wrapper .item-1-container + .item-2-container,
    #trauma-xp-wrapper .item-2-container + .item-3-container,
    #trauma-xp-wrapper .item-3-container + .item-4-container,
    #trauma-xp-wrapper .item-4-container + .item-5-container,
    #trauma-xp-wrapper .item-5-container + .item-6-container,
    #trauma-xp-wrapper .item-6-container + .item-7-container,
    #trauma-xp-wrapper .item-7-container + .item-8-container,
    #trauma-xp-wrapper .item-8-container + .item-9-container,
    #trauma-xp-wrapper .item-9-container + .item-10-container,
    #trauma-xp-wrapper .item-10-container + .item-11-container,
    #trauma-xp-wrapper .item-11-container + .item-12-container,
    #trauma-xp-wrapper .item-12-container + .item-13-container,
    #trauma-xp-wrapper .item-13-container + .item-14-container,
    #trauma-xp-wrapper .item-14-container + .item-15-container {
        margin-top: var(--row-spacing);
    }

    #trauma-xp-wrapper .item-1,
    #trauma-xp-wrapper .item-2,
    #trauma-xp-wrapper .item-3,
    #trauma-xp-wrapper .item-4,
    #trauma-xp-wrapper .item-5,
    #trauma-xp-wrapper .item-6,
    #trauma-xp-wrapper .item-7,
    #trauma-xp-wrapper .item-8,
    #trauma-xp-wrapper .item-9,
    #trauma-xp-wrapper .item-10,
    #trauma-xp-wrapper .item-11,
    #trauma-xp-wrapper .item-12,
    #trauma-xp-wrapper .item-13,
    #trauma-xp-wrapper .item-14,
    #trauma-xp-wrapper .item-15 {
        height: 300px;
    }
}

/* dat.gui ajustes opcionales */
#trauma-xp-wrapper .dg.ac {
    z-index: 1001 !important;
}

#trauma-xp-wrapper .dg.main {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.dg.ac {
    z-index: 99999 !important;
    position: fixed !important;
    top: 80px !important;
    right: 40px !important;

    /* Cambiado de "right" a "left" para alejarlo del botón hamburguesa */
    transform: scale(0.85);
}

/* Menú Controls Shadsers */
body .dg.ac .title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #ccc !important;
    margin-top: 0px !important;
}

/* Loader para las imágenes/videos en lazy load */
#trauma-xp-wrapper .inversion-lens .loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#trauma-xp-wrapper .inversion-lens img.lazy {
    opacity: 0;
    transition: opacity 0.8s ease;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

#trauma-xp-wrapper .inversion-lens img.lazy.loaded {
    opacity: 1;
}

/* Animación de giro */
/* Efecto parpadeo rápido */
@keyframes blink-fast {
    0%,
    100% {
        opacity: 1;
    }

    25% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    75% {
        opacity: 0.6;
    }
}

#trauma-xp-wrapper .overlay-button-square {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 20px;
    background: #0062ff;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid rgb(255, 255, 255);
    border-radius: 2px;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0);
}

/* Solo aparece al pasar el mouse por la tarjeta */
#trauma-xp-wrapper .inversion-lens:hover .overlay-button-square {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, hsla(217, 100%, 50%, 0.5), hsla(217, 100%, 50%, 0.5));
}

/* El parpadeo solo ocurre si pasas el mouse sobre el botón */
#trauma-xp-wrapper .overlay-button-square:hover {
    animation: blink-fast 0.4s ease-in-out 2;
}

/* TOOLTIP PARA DESKTOP + TEXTO RESPONSIVO PARA MÓVIL */
.project-title {
    position: relative;
    display: inline-flex;
    align-items: flex-start;

    /* Cambiado para mejor alineación */
    flex-wrap: wrap;

    /* Permite que el texto baje */
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    gap: 8px;

    /* Espacio entre elementos */
    line-height: 1.3;
}

/* Tooltip para desktop */
.project-title::after {
    content: "View Project";
    position: absolute;

    /* Lo posiciona a la derecha del botón */
    left: 100%;

    /* Centrado vertical */
    top: 50%;

    /* Ajuste fino */
    transform: translateY(-50%) translateX(8px);
    background: #0062ff00;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    font-weight: normal;
}

.project-title:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(12px);

    /* Mismo centrado, un poco más de margen */
}

/* Texto "view project" para móvil */
.view-project-text {
    display: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: normal;
    font-style: italic;
    text-transform: lowercase;
    margin-left: 12px;

    /* ← MÁS ESPACIO */
    white-space: nowrap;
}

/* Mostrar texto en móvil */
@media (max-width: 768px) {
    .project-title {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;

        /* Permite salto de línea */
    }

    .view-project-text {
        display: inline-block;
        margin-left: 15px;

        /* ← ESPACIO GENEROSO */
    }

    .project-title::after {
        display: none;
    }

    /* Cuando el texto es muy largo, "view project" baja */
    .project-title:has(.view-project-text) {
        align-items: flex-start;
    }
}

/* === PROTECCIÓN CONTRA MENÚ BLINDADO === */
.dg.ac {
    position: fixed !important;
    top: 80px !important;
    right: 40px !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}

/* Canvas NO deben bloquear clicks */
.inversion-lens canvas {
    pointer-events: none !important;
}

/* Tipografía forzada del menú */
.dg .title,
.dg .c label,
.dg .c input,
.dg .c select {
    font-size: 11px !important;
}