/* ==========================================================================
   1. RESET Y BASE
   ========================================================================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html,
        body {
            width: 100vw;
            height: 100vh;
            -webkit-font-smoothing: antialiased;
            font-family: 'Inter', sans-serif;
            background-color: transparent;
            color: #ffffff;
            overflow: hidden;
            /* Evita scroll en la ventana principal */
        }

        .main-header {
            height: 60px;
            width: 100%;
            padding: 0 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: rgba(0, 0, 0, 0.6) !important;
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .global-page-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: -1;
            /* Se coloca detrás de ABSOLUTAMENTE TODO */
            overflow: hidden;
        }

        .global-page-bg img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;

            /* Oscurece la imagen para que el texto y los SVGs blancos destaquen */
            filter: grayscale(100%) brightness(0.25);
        }

        .brand-container {
            display: flex;
            align-items: baseline;
            gap: 0.8rem;
        }

        .logo {
            font-family: 'Playfair Display', serif;
            font-size: 1.1rem;
            text-transform: uppercase;
            letter-spacing: 0.3em;
        }

        .subtitle {
            color: #909090;
            font-size: 0.75rem;
        }

        /* Estilo base de tus enlaces (apagados por defecto) */
        .nav-links a {
            color: #505050;
            /* Gris oscuro/apagado */
            text-decoration: none;
            margin-left: 0.2rem;
            font-size: 0.5rem;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            transition: color 0.4s ease;
        }

        /* ESTADO ILUMINADO (Cuando se añade la clase .current mediante JS) */
        .nav-links a.current {
            color: #ffffff !important;
            /* Blanco brillante e intacto */
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
            /* Sutil aura premium */
        }

        .nav-links a:hover {
            color: #ffffff;
        }


        /* ==========================================================================
   2. DASHBOARD FLEXIBLE Y AUTONOMO
   ========================================================================== */
        .dashboard-container {
            display: grid;
            /* Columna izquierda fija para la Intro (320px) y el resto para los Trabajos */
            grid-template-columns: 300px 1fr;
            height: calc(100vh - 60px);
            gap: 1.5rem;
            padding: 1.5rem;
        }

        /* SECCIÓN 1: INTRO FIJA */
        .section-minimal {
            border: 1px solid rgba(255, 255, 255, 0.08);
            background-color: rgba(3, 3, 3, 0.6) !important;
            backdrop-filter: blur(8px);
            border-radius: 4px;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .intro-text {
            font-size: 1.1rem;
            font-weight: 300;
            line-height: 1.6;
            color: #cccccc;
        }

        .tag {
            display: block;
            font-size: 0.65rem;
            letter-spacing: 0.2em;
            color: #606060;
            margin-bottom: 0.8rem;
            text-transform: uppercase;
        }

        /* ==========================================================================
   3. GRILLA DINÁMICA DE TRABAJOS (AUTO-ADAPTABLE)
   ========================================================================== */
        .works-grid {
            display: grid;
            /* Crea tantas columnas como quepan (mínimo 300px cada una) */
            grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
            grid-auto-rows: 320px;
            /* Altura fija para cada tarjeta */
            gap: 1.5rem;

            /* Si hay muchos trabajos, esta zona permite scroll suave sin mover la Intro */
            overflow-y: auto;
            padding-right: 0.5rem;
        }

        /* Personalización de la barra de scroll para que sea invisible/minimalista */
        .works-grid::-webkit-scrollbar {
            width: 4px;
        }

        .works-grid::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 2px;
        }

        /* TARJETA DE TRABAJO INDIVIDUAL */
        .work-card {
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background-color: rgba(5, 5, 5, 0.2);
            backdrop-filter: blur(4px);
            border-radius: 4px;
            margin-top: 2px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 1.5rem;
            transition: border-color 0.3s ease, transform 0.3s ease;
            text-decoration: none;
            color: inherit;
        }

        .work-card:hover {
            border-color: rgba(255, 255, 255, 0.5);
            transform: translateY(-2px);
        }

        /* FONDOS SVG Y CONTENIDO */
        .card-bg-svg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            pointer-events: none;
        }

        .card-bg-svg svg {
            width: 100%;
            height: 100%;
            display: block;
        }

        .card-content {
            position: relative;
            z-index: 2;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 30%, transparent 100%);
            padding: 0.8rem;
            border-radius: 4px;
        }

        .card-content h3 {
            font-size: 1.1rem;
            font-weight: 400;
            margin-bottom: 0.3rem;
        }

        .card-content p {
            font-size: 0.8rem;
            color: #888888;
            line-height: 1.4;
        }

        /* ==========================================================================
   4. ESTILOS DE ANIMACIÓN SVG (Sin cambios)
   ========================================================================== */
        .crystal {
            fill: none;
            /* Sin relleno para que sea ultra minimalista, solo la silueta */
            stroke: rgba(255, 255, 255, 0.7);
            /* Línea blanca grisácea, limpia y definida */
            stroke-width: 1.2;
            /* Fino, simulando el trazo de tu dibujo */
            transform-origin: center;
            vector-effect: non-scaling-stroke;
            /* Evita que el trazo se deforme en pantallas raras */
        }

        /* Animaciones de balanceo orgánico muy lentas, como si flotasen en el agua */
        .shard-1 {
            animation: floatOrganic1 5s ease-in-out infinite alternate;
        }

        .shard-2 {
            animation: floatOrganic2 7s ease-in-out infinite alternate;
            stroke: rgba(177, 219, 255, 0.46);
        }

        /* Unos más tenues que otros */
        .shard-3 {
            animation: floatOrganic1 6s ease-in-out infinite alternate;
            stroke: rgba(77, 225, 255, 0.46);
        }

        .shard-4 {
            animation: floatOrganic2 10s ease-in-out infinite alternate;
            stroke: rgba(255, 255, 255, 0.3);
        }

        .shard-5 {
            animation: floatOrganic1 4s ease-in-out infinite alternate;
        }

        .shard-6 {
            animation: floatOrganic2 8s ease-in-out infinite alternate;
        }

        /* --- KEYFRAMES ORGÁNICOS (Deriva suave y cabeceo ligero) --- */
        @keyframes floatOrganic1 {
            0% {
                transform: translate(0, 0) rotate(0deg) scale(1);
            }

            100% {
                transform: translate(15px, -25px) rotate(4deg) scale(1.02);
                /* Rotación muy leve para no perder la verticalidad de tu diseño */
            }
        }

        @keyframes floatOrganic2 {
            0% {
                transform: translate(0, 0) rotate(0deg) scale(1);
            }

            100% {
                transform: translate(-20px, 15px) rotate(-3deg) scale(0.98);
            }
        }

        /* Campo de la rejilla */
        .tile-field {
            /* Usamos 'linear' para ritmo constante e 'infinite' para bucle */
            animation: walkForward 3s linear infinite;
        }

        .tile-line {
            fill: none;
            stroke: rgba(255, 255, 255, 0.6);
            stroke-width: 1.2;
        }

        /* ANIMACIÓN PERFECTA SIN SALTO */
        @keyframes walkForward {
            0% {
                transform: translateY(0px);
            }

            100% {
                /* Mover exactamente 30px (la altura exactadel patrón) */
                transform: translateY(30px);
            }
        }

        /* Simulación perfecta de avance: se mueve verticalmente la altura exacta del patrón (40px) 
   para que el bucle sea infinito e imperceptible al ojo */
        @keyframes walkForward {
            0% {
                transform: translateY(0px);
            }

            100% {
                transform: translateY(40px);
                /* Coincide matemáticamente con el alto del patrón */
            }
        }

        .animated-wave {
            fill: none;
            /* Color base azul cian brillante */
            stroke: rgba(0, 200, 255, 0.9);
            /* Alta opacidad */
            stroke-width: 4.0;
            /* Grosor generoso */
            stroke-linecap: round;

            /* Filtro de desenfoque para efecto de brillo neón */
            filter: drop-shadow(0 0 15px rgba(0, 150, 255, 0.6));

            animation: pulseOpacity 8s ease-in-out infinite alternate;
        }

        /* Y para variar los colores en bucle como en la imagen */
        .wave-1 {
            animation: waveMotion1 16s ease-in-out infinite alternate, pulseOpacity 6s ease-in-out infinite alternate, colorCycle1 20s infinite alternate;
        }

        .wave-2 {
            animation: waveMotion2 22s ease-in-out infinite alternate, pulseOpacity 9s ease-in-out infinite alternate, colorCycle2 30s infinite alternate;
        }

        /* Animaciones de ciclo de color para las líneas */
        @keyframes colorCycle1 {
            0% {
                stroke: rgba(0, 200, 255, 0.8);
            }

            50% {
                stroke: rgba(255, 0, 255, 0.7);
            }

            /* Cambia a Magenta */
            100% {
                stroke: rgba(0, 200, 255, 0.8);
            }
        }

        @keyframes colorCycle2 {
            0% {
                stroke: rgba(255, 0, 255, 0.6);
            }

            /* Magenta sutil */
            50% {
                stroke: rgba(0, 200, 255, 0.5);
            }

            100% {
                stroke: rgba(255, 0, 255, 0.5);
            }
        }


        /* --- COREOGRAFÍA DE LAS ANIMACIONES (KEYFRAMES) --- */

        /* Hace que las líneas respiren apareciendo y desapareciendo sutilmente */
        @keyframes pulseOpacity {
            0% {
                opacity: 0.3;
            }

            100% {
                opacity: 0.8;
            }
        }

        /* Modifica matemáticamente las curvas de la línea 1 en bucle */
        @keyframes waveMotion1 {
            0% {
                d: path("M0,200 C300,400 600,100 900,300 C1200,500 1300,200 1440,400");
            }

            100% {
                d: path("M0,250 C400,300 500,200 1000,250 C1100,400 1350,150 1440,350");
            }
        }

        /* Modifica matemáticamente las curvas de la línea 2 en bucle */
        @keyframes waveMotion2 {
            0% {
                d: path("M0,600 C400,400 500,700 900,500 C1200,300 1300,600 1440,300");
            }

            100% {
                d: path("M0,500 C300,500 600,600 800,450 C1100,350 1250,650 1440,400");
            }
        }

        /* ==========================================================================
   ANIMACIÓN DE LA COMETA MINIMALISTA
   ========================================================================== */

        /* Estilos de las líneas y triángulos de la cometa */
        .kite-shape1 {
            fill: none;
            stroke: rgba(68, 106, 126, 0.859);
            stroke-width: 1.5;
            stroke-linejoin: round;
        }
        .kite-shape2 {
            fill: none;
            stroke: rgba(100, 160, 192, 0.859);
            stroke-width: 1.5;
            stroke-linejoin: round;
        }

        .kite-string {
            stroke: rgba(239, 215, 32, 0.7);
            stroke-width: 1.2;
            stroke-dasharray: 4 2;
            /* Opcional: le da un toque punteado minimalista al hilo */
        }

        .kite-group {
            transform-origin: 120px 580px;
            /* Misma base de donde sale el hilo */
            animation: kiteFloat 14s ease-in-out infinite alternate;
        }

        @keyframes kiteFloat {
            0% {
                transform: rotate(0deg) translate(0, 0);
            }

            50% {
                transform: rotate(2.5deg) translate(15px, -10px);
            }

            100% {
                transform: rotate(-1.5deg) translate(-10px, -20px);
            }
        }

        /* ==========================================================================
   ADAPTACIÓN PARA MÓVILES Y TABLETS (RESPONSIVE)
   ========================================================================== */

        @media (max-width: 850px) {

            /* 1. Permitimos scroll vertical en la página en móvil */
            html,
            body {
                overflow-y: auto !important;
                height: auto;
            }

            /* 2. Convertimos el contenedor principal de 2 columnas a 1 sola columna vertical */
            .dashboard-container {
                grid-template-columns: 1fr;
                /* Una sola columna que ocupa el 100% */
                height: auto;
                padding: 1rem;
                gap: 1rem;
            }

            /* 3. La sección minimalista pasa a estar arriba y no ocupa toda la pantalla */
            .section-minimal {
                padding: 1.5rem;
            }

            .intro-text {
                font-size: 1rem;
            }

            /* 4. La rejilla de trabajos en móvil muestra 1 tarjeta por fila */
            .works-grid {
                grid-template-columns: 1fr;
                /* 1 tarjeta a lo ancho */
                grid-auto-rows: 240px;
                /* Un poco más compacta en móvil */
                overflow-y: visible;
                /* El scroll lo maneja toda la página */
                padding-right: 0;
            }

            .main-header {
                padding: 0 1rem;
            }
        }