@charset "utf-8";
/* CSS Document */

/* --- VARIABLES DEL GLITCH --- */
:root {
    --gap-horizontal: 10px;
    --gap-vertical: 5px;
    --time-anim: 2s;
    --delay-anim: 0s;
    --blend-mode-1: none;
    --blend-mode-2: exclusion;
    --blend-mode-3: hard-light;
    --blend-mode-4: overlay;
    --blend-mode-5: overlay;
    --blend-color-1: transparent;
    --blend-color-2: #3700ff;
    --blend-color-3: #ff0000;
    --blend-color-4: #00ff00;
    --blend-color-5: #af4949;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }

body {
    background-color: #0a0a0a;
    color: #f0f0f0;
    font-family: 'Helvetica Neue', 'Montserrat', sans-serif;
    overflow: hidden; 
    height: 100vh;
    width: 100vw;
}

/* --- CURSOR --- */
.cursor {
    width: 20px; height: 20px; border: 1px solid white; border-radius: 50%;
    position: fixed; pointer-events: none; z-index: 2147483647;
    transform: translate(-50%, -50%); transition: width 0.3s, height 0.3s;
    mix-blend-mode: difference;
}
.cursor.active { width: 80px; height: 80px; background-color: white; border: none; }

/* --- GRID CONTAINER (FONDO) --- */
.bg-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
    background-color: #050505;
}

.bg-grid {
    width: 100%; height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 0;
}

/* --- NUEVA CAPA DE DOTS / VELO --- */
.dot-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 5;
    pointer-events: none;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABZJREFUeNpi2r9//38gYGAEESAAEGAAasgJOgzOKCoAAAAASUVORK5CYII=);
    background-color: rgba(0, 0, 0, 0.3); 
    mix-blend-mode: multiply;
}

/* --- GLITCH CELL STRUCTURE --- */
.glitch-cell {
    position: relative; width: 100%; height: 100%; overflow: hidden; background-color: #000;
}

.glitch__img {
    position: absolute;
    top: calc(-1 * var(--gap-vertical));
    left: calc(-1 * var(--gap-horizontal));
    width: calc(100% + var(--gap-horizontal) * 2);
    height: calc(100% + var(--gap-vertical) * 2);
    background-size: cover; background-position: center;
    background-color: var(--blend-color-1);
    transform: translate3d(0,0,0); background-blend-mode: var(--blend-mode-1);
    transition: opacity 0.5s ease; 
}

.glitch__img:nth-child(n+2) { opacity: 0; }

/* Animaciones Glitch ACTIVAS */
.glitch-cell.active .glitch__img:nth-child(n+2) {
    opacity: 1; animation-duration: var(--time-anim); animation-delay: var(--delay-anim);
    animation-timing-function: linear; animation-iteration-count: infinite;
}

/* ESTILOS PARA DESACTIVAR EL GLITCH */
body.no-glitch .glitch-cell.active .glitch__img:nth-child(n+2) {
    opacity: 0 !important; 
    animation: none !important; 
}

.glitch-cell.active .glitch__img:nth-child(2) { background-color: var(--blend-color-2); background-blend-mode: var(--blend-mode-2); animation-name: glitch-anim-1; }
.glitch-cell.active .glitch__img:nth-child(3) { background-color: var(--blend-color-3); background-blend-mode: var(--blend-mode-3); animation-name: glitch-anim-2; }
.glitch-cell.active .glitch__img:nth-child(4) { background-color: var(--blend-color-4); background-blend-mode: var(--blend-mode-4); animation-name: glitch-anim-3; }
.glitch-cell.active .glitch__img:nth-child(5) { background-color: var(--blend-color-5); background-blend-mode: var(--blend-mode-5); animation-name: glitch-anim-flash; }

/* --- KEYFRAMES --- */
@keyframes glitch-anim-1 { 0% { opacity: 1; transform: translate3d(var(--gap-horizontal),0,0); clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%); } 2% { clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%); } 4% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); } 6% { clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%); } 8% { clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%); } 10% { clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%); } 12% { clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%); } 14% { clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%); } 16% { clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%); } 18% { clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%); } 20% { clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%); } 21.9% { opacity: 1; transform: translate3d(var(--gap-horizontal),0,0); } 22%, 100% { opacity: 0; transform: translate3d(0,0,0); clip-path: polygon(0 0, 0 0, 0 0, 0 0); } }
@keyframes glitch-anim-2 { 0% { opacity: 1; transform: translate3d(calc(-1 * var(--gap-horizontal)),0,0); clip-path: polygon(0 25%, 100% 25%, 100% 30%, 0 30%); } 3% { clip-path: polygon(0 3%, 100% 3%, 100% 3%, 0 3%); } 5% { clip-path: polygon(0 5%, 100% 5%, 100% 20%, 0 20%); } 7% { clip-path: polygon(0 20%, 100% 20%, 100% 20%, 0 20%); } 9% { clip-path: polygon(0 40%, 100% 40%, 100% 40%, 0 40%); } 11% { clip-path: polygon(0 52%, 100% 52%, 100% 59%, 0 59%); } 13% { clip-path: polygon(0 60%, 100% 60%, 100% 60%, 0 60%); } 15% { clip-path: polygon(0 75%, 100% 75%, 100% 75%, 0 75%); } 17% { clip-path: polygon(0 65%, 100% 65%, 100% 40%, 0 40%); } 19% { clip-path: polygon(0 45%, 100% 45%, 100% 50%, 0 50%); } 20% { clip-path: polygon(0 14%, 100% 14%, 100% 33%, 0 33%); } 21.9% { opacity: 1; transform: translate3d(calc(-1 * var(--gap-horizontal)),0,0); } 22%, 100% { opacity: 0; transform: translate3d(0,0,0); clip-path: polygon(0 0, 0 0, 0 0, 0 0); } }
@keyframes glitch-anim-3 { 0% { opacity: 1; transform: translate3d(0, calc(-1 * var(--gap-vertical)), 0) scale3d(-1,-1,1); clip-path: polygon(0 1%, 100% 1%, 100% 3%, 0 3%); } 1.5% { clip-path: polygon(0 10%, 100% 10%, 100% 9%, 0 9%); } 2% { clip-path: polygon(0 5%, 100% 5%, 100% 6%, 0 6%); } 2.5% { clip-path: polygon(0 20%, 100% 20%, 100% 20%, 0 20%); } 3% { clip-path: polygon(0 10%, 100% 10%, 100% 10%, 0 10%); } 5% { clip-path: polygon(0 30%, 100% 30%, 100% 25%, 0 25%); } 5.5% { clip-path: polygon(0 15%, 100% 15%, 100% 16%, 0 16%); } 7% { clip-path: polygon(0 40%, 100% 40%, 100% 39%, 0 39%); } 8% { clip-path: polygon(0 20%, 100% 20%, 100% 21%, 0 21%); } 9% { clip-path: polygon(0 60%, 100% 60%, 100% 55%, 0 55%); } 10.5% { clip-path: polygon(0 30%, 100% 30%, 100% 31%, 0 31%); } 11% { clip-path: polygon(0 70%, 100% 70%, 100% 69%, 0 69%); } 13% { clip-path: polygon(0 40%, 100% 40%, 100% 41%, 0 41%); } 14% { clip-path: polygon(0 80%, 100% 80%, 100% 75%, 0 75%); } 14.5% { clip-path: polygon(0 50%, 100% 50%, 100% 51%, 0 51%); } 15% { clip-path: polygon(0 90%, 100% 90%, 100% 90%, 0 90%); } 16% { clip-path: polygon(0 60%, 100% 60%, 100% 60%, 0 60%); } 18% { clip-path: polygon(0 100%, 100% 100%, 100% 99%, 0 99%); } 20% { clip-path: polygon(0 70%, 100% 70%, 100% 71%, 0 71%); } 21.9% { opacity: 1; transform: translate3d(0, calc(-1 * var(--gap-vertical)), 0) scale3d(-1,-1,1); } 22%, 100% { opacity: 0; transform: translate3d(0,0,0); clip-path: polygon(0 0, 0 0, 0 0, 0 0); } }
@keyframes glitch-anim-flash { 0%, 5% { opacity: 0.2; transform: translate3d(var(--gap-horizontal), var(--gap-vertical), 0); } 5.5%, 100% { opacity: 0; transform: translate3d(0, 0, 0); } }

/* --- LOGO --- */
.logo-container {
    position: absolute; top: 3vh; left: 50%; transform: translateX(-50%);
    z-index: 100; width: 140px; mix-blend-mode: normal;
}
.logo-container img { width: 100%; display: block; }

/* --- MENU WRAP --- */
.menu-wrap {
    height: 100vh; width: 100%; display: flex; flex-direction: column;
    justify-content: center; align-items: center; position: relative;
    z-index: 10; padding: 120px 0; gap: 1vh;
}

/* --- LINKS --- */
.menu-item {
    position: relative; 
    text-decoration: none; 
    background: linear-gradient(90deg, #ccff00 0%, #ffff00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0px;
    font-size: 7.5vw; 
    line-height: 1.1; 
    font-weight: 900;
    text-transform: uppercase; 
    letter-spacing: -2px; 
    padding: 0 20px;
    filter: drop-shadow(0 0 5px rgba(204, 255, 0, 0.2));
    transition: transform 0.4s ease, filter 0.3s ease, background 0.3s ease;
    mix-blend-mode: normal; 
}

.menu-item:hover {
    background: linear-gradient(90deg, #FF6B00 0%, #FF006E 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; -webkit-text-stroke: 0px;
    mix-blend-mode: normal;
    transform: translateX(30px);
}

/* --- FOOTER --- */
.footer {
    position: fixed; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%);
    z-index: 200; 
    color: #ffffff;
    mix-blend-mode: normal; 
    font-family: 'Montserrat', sans-serif;
    font-size: 11px; 
    font-weight: 500; 
    letter-spacing: 1px;
    text-transform: lowercase; 
    text-align: center;
    pointer-events: auto; 
    background-color: rgba(0, 0, 0, 0.6); 
    padding: 8px 20px; 
    border-radius: 50px; 
    width: auto;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1); 
}

.footer a {
    color: #ccff00;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    background: linear-gradient(90deg, #FF6B00 0%, #FF006E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transform: scale(1.02);
}

/* --- LOADING LINE --- */
.loader-line {
    position: fixed; bottom: 12vh; left: 0;
    height: 5px; width: 0%; 
    background-color: #ccff00; 
    z-index: 99999; 
    transition: width 2s cubic-bezier(0.25, 1, 0.5, 1); 
    box-shadow: 0 0 20px #ccff00; 
}

.loader-line.loading { width: 100%; }

/* --- BOTÓN TOGGLE GLITCH --- */
#glitch-toggle {
    position: fixed; top: 30px; right: 30px; z-index: 9999;
    background: transparent;
    border: 1px solid transparent;
    border-image: linear-gradient(90deg, #ccff00 0%, #ffff00 100%);
    border-image-slice: 1;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px; font-weight: 800;
    padding: 8px 15px;
    text-transform: uppercase; letter-spacing: 2px;
    mix-blend-mode: NORMAL;
    transition: all 0.3s ease;
}

#glitch-toggle:hover {
    background-color: #fff;
    color: #000;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES REVISADAS (SOLUCIÓN IPAD & TABLETS)
   ========================================================================== */

/* 1. MÓVILES (Smartphone Vertical) (< 768px) */
@media (max-width: 767px) {
    body { overflow: hidden; position: fixed; }
    .bg-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
    .glitch-cell:nth-child(9) { display: none !important; }
    
    .menu-wrap { padding-top: 15vh; gap: 2vh; }
    .menu-item { font-size: 11vw; color: #aaa; -webkit-text-fill-color: inherit; }
    .menu-item:hover { transform: none; background: linear-gradient(90deg, #FF6B00 0%, #FF006E 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
    
    .cursor { display: none; }
    .footer { bottom: 25px; font-size: 10px; padding: 6px 15px; background-color: rgba(0,0,0,0.7); }
    .loader-line { bottom: 15vh; }
    #glitch-toggle { top: 20px; right: 20px; font-size: 9px; line-height: 1.1; }
}

/* 2. MÓVILES (Horizontal) */
@media (max-height: 600px) and (orientation: landscape) {
    body { overflow: hidden; position: fixed; }
    .bg-grid { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
    .glitch-cell:nth-child(9) { display: none !important; }
    
    .menu-wrap { padding: 0; padding-bottom: 35px; gap: 10px; }
    .menu-item { font-size: 9vh; }
    .logo-container { top: 10px; left: 70px; width: 80px; }
    #glitch-toggle { top: 15px; right: 20px; }
    .footer { bottom: 10px; font-size: 9px; padding: 4px 12px; }
    .loader-line { bottom: 0; }
}

/* 3. TABLETS, IPADS Y PORTÁTILES PEQUEÑOS (La zona crítica)
   Abarca desde 768px hasta 1399px. Esto cubre el iPad Pro 12.9 (1366px) 
   y evita que salte el estilo de Escritorio Gigante */
@media screen and (min-width: 768px) and (max-width: 1399px) {
    
    /* Reglas Generales para Tablet (Vertical y Horizontal) */
    .menu-wrap {
        padding-top: 140px; /* Asegura espacio para el logo */
        padding-bottom: 80px; /* Asegura espacio para el footer */
        gap: 2vh;
        justify-content: center;
    }
    
    .menu-item {
        /* Usamos vw para que escale con el ancho, pero limitado */
        font-size: 6vw; 
        line-height: 1.2;
    }
    
    .footer {
        bottom: 30px; /* Un poco más arriba para asegurar visibilidad */
    }

    /* Regla ESPECÍFICA para iPad en Horizontal (Landscape) */
    /* Aquí es donde el espacio vertical es menor y se superponen las cosas */
    @media (orientation: landscape) {
        .menu-wrap {
            padding-top: 12vh; /* Menos padding arriba para alejarlo del logo */
            padding-bottom: 10vh;
            gap: 1.5vh; /* Menos espacio entre links */
        }
        
        .menu-item {
            /* IMPORTANTE: Reducimos la fuente en horizontal para que quepa todo */
            font-size: 4.5vw; 
        }
        
        .logo-container {
            width: 120px; /* Logo un pelín más pequeño en horizontal */
            top: 25px;
        }
        
        .bg-grid {
             /* Opcional: Ajustar grid en tablet horizontal si quieres */
             grid-template-columns: repeat(3, 1fr);
        }
    }
}

/* 4. ESCRITORIO GRANDE (> 1400px) 
   Solo saltará en monitores reales grandes, no en iPads */
@media (min-width: 1400px) {
    .menu-wrap { padding-top: 15vh; padding-bottom: 10vh; gap: 2vh; }
    .menu-item { font-size: 110px; line-height: 1.2; }
}

/* =========================================
   EFECTO GLITCH PARA LOGO
   ========================================= */
.efecto_glitch_logo_header {
    --glitch-cyan: #00f0ff;
    --glitch-pink: #ff0099;
    position: relative;
    display: inline-block; 
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none;
    transform-style: preserve-3d; 
}
.efecto_glitch_logo_header img {
    position: relative; display: block; z-index: 1; 
}
.efecto_glitch_logo_header::before,
.efecto_glitch_logo_header::after {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images_advertising_animation_studio/logo_goonie_studio_animation_branding_illustration_storyboard_studio.gif');
    background-size: 100% 100%; background-repeat: no-repeat; background-position: center;
    background-color: transparent !important; opacity: 0; z-index: 2; pointer-events: none;
    mix-blend-mode: hard-light; 
}
.efecto_glitch_logo_header:hover img { animation: glitch-main-shake 0.4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
.efecto_glitch_logo_header:hover::before { opacity: 0.9; filter: drop-shadow(-3px 0px var(--glitch-cyan)); animation: glitch-anim-1 0.4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
.efecto_glitch_logo_header:hover::after { opacity: 0.9; filter: drop-shadow(3px 0px var(--glitch-pink)); animation: glitch-anim-2 0.4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both; }

@keyframes glitch-main-shake {
    0% { transform: translate(0); }
    20% { transform: translate(-1px, 1px); }
    40% { transform: translate(-1px, -1px); }
    60% { transform: translate(1px, 1px); }
    80% { transform: translate(1px, -1px); }
    100% { transform: translate(0); }
}
@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-3px, 0); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-3px, 0); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(3px, 0); }
    80% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 0); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(3px, 0); }
}
@keyframes glitch-anim-2 {
    0% { clip-path: inset(10% 0 60% 0); transform: translate(3px, 0); }
    20% { clip-path: inset(30% 0 20% 0); transform: translate(-3px, 0); }
    40% { clip-path: inset(70% 0 10% 0); transform: translate(3px, 0); }
    60% { clip-path: inset(20% 0 50% 0); transform: translate(-3px, 0); }
    80% { clip-path: inset(50% 0 30% 0); transform: translate(3px, 0); }
    100% { clip-path: inset(0% 0 80% 0); transform: translate(-3px, 0); }
}