html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Bloquea el scroll en todos los ejes */
    overscroll-behavior: none; /* Evita el "rebote" en iOS */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #000000 0%, #000000 100%) no-repeat center;
    font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir, "segoe ui", "helvetica neue", helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
    perspective: 1000px;
    /* Eliminamos min-height: 100vh y min-height: 100dvh porque height: 100% ya lo hace */
}

/* Wrapper del tilt */
.tilt-wrapper {
    transform-style: preserve-3d;
    will-change: transform;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Texto del glitch */
.glitch-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
    margin: 0;
    padding: 2rem;
    color: #0062ff;
    font-family: 'WC Mano Negra Bta', sans-serif;
    font-size: clamp(2rem, 8vw, 6rem);
    font-weight: normal;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-shadow: 0 0 10px #000000;
    position: relative;
}

.glitch-text .line {
    display: block;
    position: relative;
}

.glitch-text .line::before,
.glitch-text .line::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;

    /* El fondo negro tapaba las letras de abajo */
    overflow: hidden;
    clip-path: inset(0 0 100% 0);

    /* Oculto por defecto al inicio */
    pointer-events: none;
}

.glitch-text .powerglitch-clone {
    opacity: 0 !important;

    /* Animación destello blanco para que aparezcan juntos */
    animation: mostrar-clon 5s infinite linear;
}

.glitch-text .line::before {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    left: 2px;
    animation: glitch-anim-1 8s infinite linear alternate-reverse;
}

.glitch-text .line::after {
    color: #ffffff;
    left: -2px;
    animation: glitch-anim-2 8s infinite linear alternate-reverse;
}

/* 4. La nueva animación que sincroniza los clones con tus destellos */
@keyframes mostrar-clon {
    0%,
    70% {
        opacity: 0;
    }

    /* Oculto hasta el 70% */
    71%,
    86% {
        opacity: 1;
    }

    /* Visible durante tu ventana de glitch */
    87%,
    100% {
        opacity: 0;
    }

    /* Oculto de nuevo */
}

/* Animación de los cortes (Clip-path) */
@keyframes glitch-anim-1 {
    0%,
    80% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }

    81% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-2px, 2px);
    }

    82% {
        clip-path: inset(40% 0 20% 0);
        transform: translate(2px, -1px);
    }

    83% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-1px, 1px);
    }

    84% {
        clip-path: inset(30% 0 50% 0);
        transform: translate(1px, -2px);
    }

    85% {
        clip-path: inset(70% 0 15% 0);
        transform: translate(-2px, 0);
    }

    86%,
    100% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }
}

@keyframes glitch-anim-2 {
    0%,
    70% {
        clip-path: inset(100% 0 0 0);
        transform: translate(0);
    }

    71% {
        clip-path: inset(20% 0 50% 0);
        transform: translate(2px, -1px);
    }

    72% {
        clip-path: inset(50% 0 10% 0);
        transform: translate(-2px, 2px);
    }

    73% {
        clip-path: inset(10% 0 80% 0);
        transform: translate(1px, 1px);
    }

    74%,
    100% {
        clip-path: inset(100% 0 0 0);
        transform: translate(0);
    }
}

.trauma-logo {
    position: absolute;
    top: 2rem;

    /* Distancia desde arriba */
    right: 2rem;

    /* Distancia desde la derecha */
    width: 120px;

    /* Ajusta el tamaño según tu logo */
    height: auto;

    /* Mantiene la proporción */
    z-index: 10;

    /* Asegura que esté por encima del texto */
    pointer-events: none;

    /* Evita que el logo bloquee el mouse si pasa por encima */
    /* brillo o sombra */
    filter: drop-shadow(0 0 8px rgb(0, 0, 0));
}



/* ESTILOS GENERICOS */


html {
  -webkit-text-size-adjust: 100%;   /* evita que iOS agrande el texto al rotar */
}

body {
  overscroll-behavior: none;        /* evita pull-to-refresh accidental */
}

* {
  -webkit-tap-highlight-color: transparent; /* quita el flash azul al tocar en iOS */
}



/* ==========================================
   TRAUMA-XP — INTERACTION GUIDE
========================================== */
#xp-interaction-guide {
    position: fixed;
    left: 40px;
    bottom: 40px;
    z-index: 999;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Poppins', sans-serif;
}

/* TYPOGRAPHY */
#xp-interaction-guide .xp-guide-words {
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: inherit;
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.06em;
}

#xp-interaction-guide .xp-guide-words span {
    display: block;
    font-family: inherit;
    font-weight: 900;
    color: #fff;
}

#xp-interaction-guide .xp-guide-words span:first-child {
    color: #0062ff;
}

/* DESCRIPTION */
#xp-interaction-guide p {
    margin: 18px 0 0;
    font-family: inherit;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
}

/* RESPONSIVE */
@media (max-width: 600px) {
    #xp-interaction-guide {
        left: 20px;
        bottom: 24px;
    }

    #xp-interaction-guide .xp-guide-words {
        font-size: clamp(32px, 8vw, 38px);
    }

    #xp-interaction-guide p {
        font-size: 8px;
        max-width: 230px;
    }
}



/* ==========================================
   AJUSTE SOLO DEL GLITCH (MÓVIL)
========================================== */
/* 1. Móvil vertical: lo hacemos ligeramente más grande */
@media (max-width: 600px) and (orientation: portrait) {
    .glitch-text {
        /* Aumentamos el tamaño base. Ajusta el 11vw si lo quieres aún más grande */
        font-size: clamp(2.5rem, 11vw, 5rem);
    }
}

/* 2. Móvil horizontal: lo hacemos más grande pero sin chocar */
@media (max-width: 900px) and (orientation: landscape) {
    .glitch-text {
        /* Usamos 12vh (altura) para que crezca. */
        /* Si lo quieres aún más grande, sube a 13vh o 14vh */
        font-size: clamp(1.8rem, 12vh, 5rem); 
        
        /* Juntamos las líneas al máximo para ganar espacio vertical */
        line-height: 0.8; 
        
        /* Reducimos el padding para que no empuje hacia los lados */
        padding: 0.5rem;
    }
}



/* Ajuste fino: mantener la guía a la izquierda en formato horizontal */
@media (max-width: 900px) and (orientation: landscape) {
    #xp-interaction-guide {
        /* Forzamos que se quede en el margen izquierdo original */
        left: 20px !important; 
        right: auto !important; /* Anulamos cualquier empuje de la derecha */
        
        /* Usamos la safe-area de iOS para que no se corte en la curva del móvil */
        left: max(20px, env(safe-area-inset-left)) !important;
    }
}