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

#trauma-xp-wrapper {
    --padding: 2rem;
    --gutter: 0.75rem;
    --columns: 12;

    /* --bg-color: #00000000; */
    --text-color: #ffffff;
    --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: 0px;
    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;
}

/* Asegura que el fondo negro se extienda más allá del padding */
#trauma-xp-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    /* background-color: rgba(0, 0, 0, 0); */
    z-index: -1;
    pointer-events: none;
}

#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: 6rem;
    text-transform: uppercase;
}

#trauma-xp-wrapper .instructions {
    grid-column: 2 / span 3;
    font-weight: 700;
    font-size: 1rem;
    text-transform: none;
    color: #3a3aff;
}

#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: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#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 INPAL ------------------------------------------ */
#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 VENTURA ---------------------------------------- */
#trauma-xp-wrapper .item-2-container {
    grid-column: 8 / span 5;
    grid-row: 2;

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

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

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

.lazy.loaded {
    opacity: 1;
}

/* ---------------------------Item 3 AMEXCAI -------------------------------- */
#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 PLOT ------------------------------ */
#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 NISSAN QUE TE MUEVE ----------------- */
#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 JJT -------------- */
#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 FIRESTONE ------------------- */
#trauma-xp-wrapper .item-7-container {
    grid-column: 7 / span 4;
    grid-row: 6;
    margin-top: -13rem;
}

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

@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 ------------------ */
#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 CHIVAS PRIVATE --------------------- */
#trauma-xp-wrapper .item-9-container {
    grid-column: 8 / 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 BRIDGESTONE GOLF --------------------- */
#trauma-xp-wrapper .item-10-container {
    grid-column: 1 / span 4;
    grid-row: 8;
    margin-top: -2rem;
}

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

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

/* ---------------------- Item 11 Imagen --------------------- */
#trauma-xp-wrapper .item-11-container {
    grid-column: 7 / span 4;
    grid-row: 9;
    margin-top: -25rem;
}

#trauma-xp-wrapper .item-img-11 {
    height: 500px;
}

/* ------------------------------------------------ */
@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-video-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-video-9,
    #trauma-xp-wrapper .item-video-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: 5.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-video-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-video-9,
    #trauma-xp-wrapper .item-video-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;

    /* Básico para que no brinque la ventana */
    transform: none;
}

/* Text 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: #0062ff;
    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: #0062ff;
    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;
    top: 80px;
    right: 40px;
    z-index: 2147483647;
    pointer-events: auto;
}

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

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

.spacer-top {
    margin-top: 100px;
}

.spacer-footer {
    margin-top: 100px;
}

/* ======================================================
   TRAUMA-XP SHADER GUI DRAG HANDLE
====================================================== */
body .txp-gui-drag-handle {
    position: fixed;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 8px 12px;
    box-sizing: border-box;
    margin: 0;
    background: #000000;
    color: #0062ff;
    outline: none;
    font-size: 14px;
    font-family: "PP Neue Montreal", sans-serif;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 2px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
    transform: none;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    pointer-events: auto;
    border-top-style: none;
    filter: none;
    mix-blend-mode: normal;
}

/* DRAGGING */
body .txp-gui-drag-handle:active {
    cursor: grabbing;
}

/* ======================================================
   🔥 FIX PARA CASOS DE ESTUDIO 🔥
   ====================================================== */
/* FORZAR estilos base */
.logo-es {
    font-weight: 700;
    text-transform: uppercase;
    word-break: keep-all;
    white-space: normal;
    max-width: 100%;
    line-height: 1.2;
    display: block;
}

/* MÓVIL (hasta 768px) */
@media (max-width: 768px) {
    .logo-es {
        grid-column: 1 / -1;
        font-size: 3.5rem;
        text-align: left;
        padding: 0 1rem;
        margin: 0 auto;
        width: 100%;
    }
}

/* TABLETA (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .logo-es {
        grid-column: 1 / -1;
        font-size: 4.5rem;
        text-align: left;
        padding: 0 1.5rem;
        margin: 0 auto;
        width: 100%;
    }
}

/* ESCRITORIO (1025px+) */
@media (min-width: 1025px) {
    .logo-es {
        grid-column: 2 / span 5;
        font-size: 6rem;
        text-align: left;
        padding: 0;
        margin: 0;
        line-height: 1.1;
    }
}

/* 🔥 EXTRA: Forzar para móviles muy pequeños (menos de 480px) */
@media (max-width: 480px) {
    .logo-es {
        font-size: 2.5rem;
        padding: 0 0.5rem;
    }
}

/* /////////////////////////////// */
