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

:root {
    --bg-light: #F0F0F0;
    --bg-dark: #111111;
    --text-light: #111111;
    --text-dark: #F0F0F0;
    --accent: #667eea;
    --grid-color: rgba(0, 0, 0, 0.1);
    --transition-duration: 0.8s;

    /* OKLCH System (Perceptually Uniform Colors) */
    --accent-lch: 65% 0.18 260;
}

@supports (color: oklch(0% 0 0)) {
    :root {
        --bg-light: oklch(96% 0.01 260);
        --bg-dark: oklch(15% 0.02 260);
        --text-light: oklch(15% 0.02 260);
        --text-dark: oklch(96% 0.01 260);
        --accent: oklch(var(--accent-lch));
        --grid-color: oklch(0% 0 0 / 0.1);
    }
}

    /* Fluid Scale: Base 16px -> 18px | Ratio 1.25 */
    --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.89rem);
    --step-0: clamp(1rem, 0.96rem + 0.17vw, 1.13rem);
    --step-1: clamp(1.25rem, 1.18rem + 0.3vw, 1.41rem);
    --step-2: clamp(1.56rem, 1.45rem + 0.49vw, 1.83rem);
    --step-3: clamp(1.95rem, 1.77rem + 0.77vw, 2.37rem);
    --step-4: clamp(2.44rem, 2.16rem + 1.2vw, 3.1rem);
    --step-5: clamp(3.05rem, 2.62rem + 1.84vw, 4.06rem);
    --step-6: clamp(3.81rem, 3.16rem + 2.79vw, 5.34rem);
    --step-7: clamp(4.77rem, 3.78rem + 4.2vw, 7.07rem);
}

body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    position: relative;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    padding: 1.5rem 3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    mix-blend-mode: difference;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: #fff;
    text-transform: uppercase;
}

.menu {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.menu a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.8rem 0; /* Asegurar altura m├¡nima */
    display: inline-block;
}

.menu a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.3s ease;
}

.menu a:hover::after {
    width: 100%;
}

.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: background-color var(--transition-duration) ease;
    z-index: 1;
}

.hero-bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-light);
    transition: background-color var(--transition-duration) ease, opacity 0.6s ease;
    z-index: -1;
    pointer-events: none;
}

.hero-bg-image::before,
.hero-bg-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity var(--transition-duration) ease;
}

.hero-bg-image::before {
    background-image: url('img/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0;
    filter: contrast(0.5);
}

.hero-bg-image::after {
    background-image: 
        linear-gradient(var(--grid-color) 0%, transparent 0px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 80px 80px;
}



.code-toggle {
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(20px);
}

.code-toggle:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.code-toggle:focus-visible,
.btn-primary:focus-visible,
.contact-submit:focus-visible,
.text-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin-left: 10%;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    line-height: 0.95;
    transition: all var(--transition-duration) cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left center;
    text-wrap: balance;
}

.display-main {
    font-size: var(--step-7);
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.display-sub {
    font-size: var(--step-6);
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.4;
    letter-spacing: -0.02em;
    font-style: italic;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: var(--step-1);
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.8;
    max-width: 600px;
    margin-bottom: 3.5rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
    transition: all var(--transition-duration) ease;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.hero-title.visible,
.hero-subtitle.visible,
.code-toggle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* X-Ray Mode Global Styles */
body.xray-active .hero-bg-image::after {
    background-size: 100% 20vh; /* Líneas horizontales cada 20% de la pantalla */
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    opacity: 0.4;
}

/* Technical Brackets for Hero Content */
body.xray-active .hero-content::before,
body.xray-active .hero-content::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 0.5px solid var(--accent);
    pointer-events: none;
}

body.xray-active .hero-content::before {
    top: -30px;
    left: -30px;
    border-right: none;
    border-bottom: none;
}

body.xray-active .hero-content::after {
    bottom: -30px;
    right: -30px;
    border-left: none;
    border-top: none;
    content: 'COORD_SYS: [HEAD_MAIN]';
    font-family: 'Inter', monospace;
    font-size: 0.5rem;
    color: var(--accent);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 5px;
    letter-spacing: 0.1em;
}

body.xray-active .service-item,
body.xray-active .project-item,
body.xray-active .card {
    outline: 0.5px dashed rgba(102, 126, 234, 0.4) !important;
    outline-offset: 12px;
}

body.xray-active .section-display {
    position: relative;
    outline: none !important;
}

body.xray-active .section-display::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 5px;
    bottom: 5px;
    width: 3px;
    background-color: var(--accent);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   SECTION: SERVICES - MINIMAL GRID
   ========================================= */

.services {
    position: relative;
    z-index: 2;
    padding: 12rem 10%;
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(circle at 80% 20%, oklch(90% 0.05 260 / 0.4) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    border-bottom: 1px solid var(--grid-color);
    transition: background-color var(--transition-duration) ease;
}

.services-header {
    max-width: 1400px;
    margin: 0 auto 8rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.services-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    display: block;
    margin-bottom: 1.5rem;
}

.section-display {
    font-family: 'Inter', sans-serif;
    font-size: var(--step-6);
    font-weight: 800;
    color: var(--text-light);
    max-width: 800px;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.section-display .highlight {
    color: var(--accent);
    font-style: italic;
    font-weight: 400;
}

.services-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.service-item {
    display: flex;
    flex-direction: column;
    padding: 3.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.05);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(20px);
}

.service-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger item reveals */
.service-item:nth-child(2) { transition-delay: 0.1s; }
.service-item:nth-child(3) { transition-delay: 0.2s; }

.service-item:hover {
    padding-top: 4.5rem;
    border-top: 1px solid var(--accent);
}

.services-footer {
    max-width: 1400px;
    margin: 8rem auto 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.services-footer.revealed {
    opacity: 1;
    transform: translateY(0);
}

.text-link {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    padding-bottom: 8px;
    transition: color 0.3s ease;
}

.text-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-link:hover::after {
    width: 100%;
}

.text-link .arrow {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.text-link:hover .arrow {
    transform: translateX(12px);
}

.service-index {
    font-family: 'Inter', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.3em;
    margin-bottom: 2.5rem;
    opacity: 0.6;
}

.service-title {
    font-family: 'Inter', sans-serif;
    font-size: var(--step-3);
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.service-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.65;
    color: var(--text-light);
    opacity: 0.6;
    max-width: 95%;
}

/* Responsive Services */
@media (max-width: 1024px) {
    .services-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .services {
        padding: 6rem 1.5rem;
    }
    
    .services-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* =========================================
   SECTION 2: PROCESS - STICKY CARDS
   ======================================== */

.process {
    position: relative;
    z-index: 2;
    min-height: 350vh; /* Aumentado para acomodar 4 tarjetas con un scroll suave */
    background-color: var(--bg-light);
    background-image: 
        linear-gradient(to bottom, var(--bg-light) 0%, oklch(93% 0.02 260) 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    transition: background-color var(--transition-duration) ease;
}

.process-container {
    position: sticky;
    top: 0;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Evita scrolls raros internos */
}

.process-title {
    position: absolute;
    top: 10vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    width: 100%;
}

.process-title h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem; /* Un poco m├ís peque├▒o para dar aire */
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-title.visible h2 {
    opacity: 1;
    transform: translateY(0);
    font-size: 3rem;
}

/* Vertical Progress Indicator */
.process-progress-container {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    height: 40vh;
    width: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 15;
}

.process-progress-track {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 1px;
    overflow: hidden;
}

.process-progress-fill {
    width: 100%;
    height: 0%;
    background: var(--accent);
    transition: height 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-steps-markers {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.step-marker {
    width: 8px;
    height: 8px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    transform: translateX(-3px);
    transition: all 0.4s ease;
}

.step-marker.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateX(-3px) scale(1.5);
    box-shadow: 0 0 15px var(--accent);
}

.cards-wrapper {
    position: relative;
    width: 100%;
    height: 60vh; /* Contenedor limitado para centrar mejor el movimiento */
    display: flex;
    justify-content: center;
    align-items: center;
}

.card {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Empieza m├ís abajo y m├ís peque├▒a */
    transform: translate(-50%, 20%) scale(0.85); 
    background-color: #ffffff;
    border-radius: 32px; /* Bordes m├ís suaves */
    padding: 3.5rem;
    max-width: 600px;
    width: 90%;
    min-height: 350px; /* Tama├▒o consistente para todas */
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
    transition: 
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.6s ease,
        box-shadow 0.4s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    will-change: transform, opacity;
}

.card.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: all;
    z-index: 2;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.12);
}

/* Efecto de apilamiento: las cartas anteriores se quedan visibles debajo */
.card.past {
    opacity: 1; /* Se mantienen visibles */
    transform: translate(-50%, -55%) scale(0.95); /* Ligeramente m├ís arriba y peque├▒as */
    pointer-events: none;
    z-index: 1;
    filter: brightness(0.9); /* Un poco m├ís oscuras para dar profundidad */
}

/* Si hay una carta "m├ís" vieja, la subimos y oscurecemos un poco m├ís */
.card.past-old {
    opacity: 1;
    transform: translate(-50%, -60%) scale(0.9);
    pointer-events: none;
    z-index: 0;
    filter: brightness(0.8);
}

.card-number {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: 'Inter', sans-serif;
    font-size: var(--step-4);
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-light);
    opacity: 0.7;
    line-height: 1.7;
}

.card-cta {
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background-color: var(--text-light);
    color: var(--bg-light);
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-cta:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Scroll Hint Indicator */
.scroll-hint {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
    z-index: 20;
}

.scroll-hint.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-hint span {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 600;
    color: var(--accent);
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-right: 2px solid #000;
    border-bottom: 2px solid #000;
    transform: rotate(45deg);
    animation: arrowBounce 2s infinite;
}

@keyframes arrowBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(45deg); }
    40% { transform: translateY(-10px) rotate(45deg); }
    60% { transform: translateY(-5px) rotate(45deg); }
}

/* Mobile: Adjust for scroll reveal */
@media (max-width: 768px) {
    .process {
        min-height: auto;
        padding: 4rem 0;
    }

    .process-container {
        position: relative;
        height: auto;
        top: 0;
        padding: 0 1.5rem;
    }

    .process-title {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin-bottom: 3rem;
    }

    .process-title h2 {
        opacity: 1 !important;
        transform: none !important;
    }

    .cards-wrapper {
        position: relative;
        flex-direction: column;
        height: auto;
        gap: 2rem;
    }

    .process-progress-container {
        display: none;
    }

    .card {
        position: relative;
        top: 0;
        left: 0;
        transform: translateY(30px);
        opacity: 0;
        max-width: 100%;
        padding: 2.5rem 2rem;
        pointer-events: all;
        margin-bottom: 1rem;
        filter: none !important; /* Eliminar oscurecimiento */
        transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .card.revealed {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }

    .card.visible, .card.past, .card.past-old {
        transform: none !important;
        opacity: 1 !important;
        filter: none !important;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
    }

    .menu {
        gap: 1.5rem;
    }

    .menu a {
        font-size: 0.75rem;
    }

    .hero-content {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    .hero-content {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .display-main {
        font-size: var(--step-5);
    }

    .display-sub {
        font-size: var(--step-4);
    }

    .section-display {
        font-size: var(--step-4);
    }

    .hero-buttons {
        flex-wrap: wrap;
    }
}

/* =========================================
   SECTION: WORK - PROJECT GRID
   ========================================= */

.work {
    position: relative;
    z-index: 2;
    padding: 10rem 10%;
    background-color: var(--bg-light);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    transition: background-color var(--transition-duration) ease;
}

.work-header {
    max-width: 1400px;
    margin: 0 auto 6rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.project-item {
    position: relative;
    width: 100%;
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Asymmetric Grid Effect */
.project-item:nth-child(even) {
    margin-top: 4rem;
}

.project-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: #e0e0e0;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.2) contrast(1.1);
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}

.project-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3rem;
    z-index: 5;
    color: #fff;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.8) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* Hover Effects */
.project-container:hover .project-image {
    transform: scale(1.05);
}

.project-container:hover .project-image img {
    transform: scale(1.1);
    filter: grayscale(0) contrast(1);
}

.project-container:hover .project-content {
    transform: translateY(0);
    opacity: 1;
}

.project-container:hover::after {
    opacity: 1;
}

.project-header-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 1rem;
}

.project-year {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    opacity: 0.6;
}

.project-name {
    font-size: var(--step-2);
    font-weight: 700;
    margin: 0;
}

.project-details {
    max-width: 90%;
}

.project-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 500;
}

.project-solution {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.project-container:hover .project-solution {
    transform: translateY(0);
    opacity: 1;
}

.solution-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.project-solution p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.8;
}

.work-footer {
    max-width: 1400px;
    margin: 6rem auto 0;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-footer.revealed {
    opacity: 1;
    transform: translateY(0);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 4rem;
    background-color: var(--text-light);
    color: var(--bg-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    border-radius: 999px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
    background-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.btn-primary .arrow {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover .arrow {
    transform: translateX(10px);
}

/* Responsive Work Section */
@media (max-width: 1024px) {
    .work-grid {
        gap: 4rem 2rem;
    }
    
    .project-item:nth-child(even) {
        margin-top: 5rem;
    }
}

@media (max-width: 768px) {
    .work {
        padding: 6rem 1.5rem;
    }

    .work-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .project-item:nth-child(even) {
        margin-top: 0;
    }

    .project-content {
        padding: 2rem;
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9));
    }

    .project-container::after {
        opacity: 1;
    }

    .project-solution {
        opacity: 1;
        transform: translateY(0);
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 1.2rem 2rem;
        font-size: 0.9rem;
    }
}

/* =========================================
   SECTION: TESTIMONIALS - INFINITE CAROUSEL
   ========================================= */

.testimonials {
    position: relative;
    z-index: 2;
    padding: 8rem 0;
    background-color: #080808; /* Deep black for high contrast */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    color: #fff;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.testimonials-header {
    padding: 0 10%;
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonials-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.testimonials-header .section-display {
    color: #fff;
    max-width: 800px;
}

.testimonials-carousel-container {
    position: relative;
    width: 100%;
    padding: 0 10%;
    display: flex;
    align-items: center;
}

.testimonials-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    margin: 0 4rem;
}

.testimonials-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    user-select: none;
    cursor: grab;
}

.testimonials-track:active {
    cursor: grabbing;
}

.testimonial-card {
    flex: 0 0 calc(33.333% - 2rem);
    margin: 0 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 380px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: grab;
}

.testimonial-card:active {
    cursor: grabbing;
}

.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(102, 126, 234, 0.1);
}

.testimonial-logo {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.testimonial-card:hover .testimonial-logo {
    color: #fff;
}

.testimonial-stars {
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.testimonial-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.author-role {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

/* Navigation Buttons */
.carousel-nav {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    width: 44px; /* Target m├¡nimo */
    height: 44px; /* Target m├¡nimo */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.carousel-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 50%;
}

.carousel-nav:hover {
    color: var(--accent);
    transform: scale(1.3);
}

.carousel-nav .arrow {
    font-size: 2rem;
    font-weight: 300;
}

/* Responsive Testimonials */
@media (max-width: 1200px) {
    .testimonial-card {
        flex: 0 0 calc(50% - 2rem);
    }
}

@media (max-width: 992px) {
    .testimonial-card {
        flex: 0 0 calc(100% - 2rem);
    }
    
    .testimonials-carousel-wrapper {
        margin: 0 1rem;
    }
}

@media (max-width: 768px) {
    .testimonials {
        padding: 6rem 0;
    }
    
    .testimonials-header {
        margin-bottom: 3rem;
    }
    
    .testimonials-carousel-wrapper {
        margin: 0;
    }
    
    .carousel-nav {
        display: none;
    }
    
    .testimonial-card {
        flex: 0 0 100%;
        margin: 0;
        min-height: auto;
        padding: 2.5rem 1.5rem;
    }

    .testimonials-track {
        gap: 0;
    }
    
    .testimonials-carousel-container {
        padding: 0 1.5rem;
    }
}

/* =========================================
   SECTION: CONTACT & SCHEDULER
   ======================================== */

.contact {
    position: relative;
    z-index: 2;
    padding: 10rem 2rem;
    background-color: #050505; /* Fondo negro sólido por defecto */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.4s ease;
}

.contact-header {
    max-width: 1200px;
    margin: 0 auto 5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.contact-header .section-display {
    color: #ffffff !important; /* Siempre en blanco */
}

.contact-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8rem;
}

/* Formulario Minimalista */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--accent, #2ea043);
}

.form-group textarea {
    min-height: 150px;
    resize: none;
}

/* Scheduler Simplificado */
.scheduler-simple {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 2.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.days-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.day-btn {
    flex: 1;
    min-width: 60px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.day-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.day-btn.active {
    background: var(--accent, #2ea043);
    border-color: var(--accent, #2ea043);
    color: #fff;
}

.time-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.select-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.select-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
}

.time-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.8rem;
    border-radius: 2px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none; /* Quitar estilo por defecto */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 15px) center;
    padding-right: 40px;
}

.time-select:focus {
    border-color: var(--accent, #2ea043);
    background-color: rgba(255, 255, 255, 0.08);
}

.time-select option {
    background: #111;
    color: #fff;
}

.scheduler-summary {
    margin-top: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

#selected-range {
    color: var(--accent, #2ea043);
    margin-left: 10px;
}

.scheduler-instruction {
    margin-bottom: 2rem;
}

/* =========================================
   BUTTONS: UNIFIED DESIGN SYSTEM
   ======================================== */

.btn-primary, .contact-submit {
    padding: 1.5rem 2.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 2em;
}

.btn-primary:hover, .contact-submit:hover {
    background: var(--accent, #2ea043);
    border-color: var(--accent, #2ea043);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(46, 160, 67, 0.2);
    color: #fff;
}

.btn-primary .arrow, .contact-submit .arrow {
    transition: transform 0.4s ease;
}

.btn-primary:hover .arrow, .contact-submit:hover .arrow {
    transform: translateX(8px);
}

/* Responsive */
@media (max-width: 968px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 5rem;
    }
}

/* =========================================
   LAB SECTION (Engineering Playground)
   ========================================= */

.lab {
    position: relative;
    z-index: 2;
    padding: 10rem 10%;
    background-color: #080808;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-blend-mode: overlay;
    color: #fff;
    min-height: 100vh;
    overflow: hidden; /* Evitar que el resize handle cause scroll */
}

@media (max-width: 768px) {
    .lab {
        padding: 6rem 5%;
    }
}

.lab-header {
    margin-bottom: 6rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.lab-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.playground-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.experiment-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
    position: relative;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .experiment-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .experiment-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

.experiment-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experiment-index {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.experiment-title {
    font-family: 'Inter', sans-serif;
    font-size: var(--step-3);
    font-weight: 700;
    line-height: 1.2;
}

.experiment-description {
    font-size: var(--step-0);
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.experiment-controls {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    padding-top: 2rem;
    justify-content: end
}

.playground-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playground-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.playground-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

.playground-viewport-wrapper {
    grid-column: 1 / -1;
    background: #000;
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.playground-viewport {
    width: 100%;
    max-width: 100% !important;
    min-width: 290px;
    height: auto;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    resize: horizontal;
    box-sizing: border-box;

    /* Scrollbar Discreta */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;

    /* Ingeniería de Precisión: Unidad Maestra */
    container-type: inline-size;
    --grid-step: clamp(1.5rem, 1rem + 3cqw, 2.5rem);
    padding: var(--grid-step);

    /* Fluid Tokens for Mini-Web */
    --f-typo-h1: clamp(1.5rem, 0.8rem + 5cqw, 3.5rem);
    --f-typo-p: clamp(0.8rem, 0.6rem + 1.2cqw, 1.1rem);
    --f-spacing: clamp(1.2rem, 0.8rem + 4cqw, 3rem);
    --f-radius: clamp(4px, 2px + 1.5cqw, 16px);
    --f-gap: clamp(0.5rem, 0.2rem + 2cqw, 2rem);
    --f-btn-p: clamp(0.6rem, 0.4rem + 1cqw, 1.2rem);
}

#fluid-viewport {
    min-width: 230px;
}

.playground-viewport::-webkit-scrollbar {
    width: 4px;
}

.playground-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.playground-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.playground-viewport::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* =========================================
   MINI-WEB INTERNALS
   ========================================= */

.mini-web-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: var(--f-spacing);
    width: 100%;
    height: 100%;
}

.mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: calc(var(--f-spacing) / 2);
}

.mini-logo {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--accent);
}

.mini-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mini-nav-item {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.5;
}

.mini-cta {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 1;
    color: var(--accent);
}

.mini-hero {
    display: flex;
    flex-direction: column;
    gap: calc(var(--f-gap) / 2);
}

.fluid-h1 {
    font-size: var(--f-typo-h1);
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.02em;
}

.fluid-p {
    font-size: var(--f-typo-p);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    max-width: 400px;
    margin: 0;
}

.mini-hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

@container (max-width: 350px) {
    .mini-hero-actions {
        flex-direction: column;
    }
    
    .mini-btn-primary, .mini-btn-secondary {
        width: 100%;
        text-align: center;
    }
}

.mini-btn-primary, .mini-btn-secondary {
    padding: var(--f-btn-p) calc(var(--f-btn-p) * 2);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--f-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
}

.mini-btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--f-gap);
    margin-top: auto;
}

@container (max-width: 450px) {
    .mini-grid {
        grid-template-columns: 1fr;
    }
    
    .mini-card {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        padding: calc(var(--f-gap) / 1.5);
    }
}

.mini-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--f-gap);
    border-radius: var(--f-radius);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.card-icon {
    font-size: var(--f-typo-p);
}

.card-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    opacity: 0.4;
}

/* Debug Mode Enhancements */
.experiment-card.debug-active .mini-card {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid var(--accent);
}

.experiment-card.debug-active .mini-hero,
.experiment-card.debug-active .mini-header {
    outline: 1px solid rgba(255, 255, 255, 0.1);
    outline-offset: 4px;
}

.experiment-card.debug-active .fluid-h1,
.experiment-card.debug-active .fluid-p {
    background: rgba(102, 126, 234, 0.05);
    outline: 1px solid rgba(102, 126, 234, 0.3);
}

.experiment-card.debug-active .mini-btn-primary,
.experiment-card.debug-active .mini-btn-secondary {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

.experiment-card.debug-active .mini-web-container::after {
    content: 'FLUID_CORE_ACTIVE';
    position: absolute;
    top: -15px;
    right: 0;
    font-size: 0.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100%;
    cursor: ew-resize;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05));
    z-index: 10;
}

.resize-handle::after {
    content: 'RESIZE ME';
    position: absolute;
    bottom: 25px;
    right: 20px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 18px 18px 2px 18px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: bubblePulse 2s infinite ease-in-out;
}

.resize-handle::before {
    display: none;
}

@keyframes bubblePulse {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.9; }
    50% { transform: translateY(-5px) scale(1.05); opacity: 1; }
}

.playground-viewport:active .resize-handle::after,
.playground-viewport:active .resize-handle::before {
    display: none;
}

.debug-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(102, 126, 234, 0.15) 1px, transparent 0);
    background-size: 20px 20px;
}

.experiment-card.debug-active .debug-overlay {
    opacity: 1;
}

.column-grid {
    width: 100%;
    height: 100%;
    display: grid;
    /* Por defecto 12 columnas */
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.column-grid span {
    background: rgba(0, 255, 255, 0.05);
    height: 100%;
    border-left: 1px solid rgba(0, 255, 255, 0.1);
    border-right: 1px solid rgba(0, 255, 255, 0.1);
    transition: opacity 0.3s ease;
}

/* Lógica Responsiva basada en el tamaño del CONTENEDOR */
@container (max-width: 900px) {
    .column-grid { grid-template-columns: repeat(8, 1fr); }
    .column-grid span:nth-child(n+9) { display: none; }
}

@container (max-width: 600px) {
    .column-grid { grid-template-columns: repeat(4, 1fr); }
    .column-grid span:nth-child(n+5) { display: none; }
}

@container (max-width: 350px) {
    .column-grid { grid-template-columns: repeat(1, 1fr); }
    .column-grid span:nth-child(n+2) { display: none; }
}

.experiment-card.debug-active .debug-overlay {
    opacity: 1;
}

.experiment-card.debug-active {
    border-color: var(--accent);
    background: rgba(102, 126, 234, 0.05);
}

.floating-formula {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--accent);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Inter', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
}

.fluid-demo-content {
    position: relative;
    z-index: 2;
}

.fluid-demo-text {
    font-family: 'Inter', sans-serif;
    font-size: calc(var(--grid-step) * 0.8);
    font-weight: 700;
    line-height: var(--grid-step);
    margin: 0;
    margin-bottom: var(--grid-step);
    color: #fff;
    transition: font-size 0.05s linear;
    display: block;
}

.fluid-demo-subtext {
    font-size: calc(var(--grid-step) * 0.4);
    line-height: calc(var(--grid-step) * 0.5);
    color: rgba(255, 255, 255, 0.5);
    max-width: 450px;
    margin: 0;
    display: block;
}

.experiment-metrics {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .experiment-metrics {
        flex-direction: column;
        gap: 1rem;
    }
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

.metric-value {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.formula {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

/* Operational Pulse Dashboard Styles */
.dashboard-viewport {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: #050505 !important;
    padding: clamp(1rem, 0.5rem + 3cqw, 2.5rem) !important;
}

.dashboard-tabs {
    display: flex;
    gap: clamp(0.8rem, 0.5rem + 1cqw, 1.5rem);
    margin-bottom: 2rem;
    padding: 0 clamp(0.5rem, 0.2rem + 4cqw, 3rem);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
    color: #fff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tab-pane {
    display: none;
    width: 100%;
    animation: tab-fade 0.5s ease;
}

@keyframes tab-fade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-pane.active {
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

@container (max-width: 800px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (max-width: 500px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: clamp(1rem, 0.5rem + 2cqw, 1.5rem);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.kpi-main {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.kpi-unit {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

/* Visual Components */
.kpi-visual {
    height: 30px;
    display: flex;
    align-items: center;
}

.mini-chart-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #2ea043;
    width: 0;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mini-chart-bar.costs .bar-fill {
    background: #f85149;
}

.mini-chart-bar.warning .bar-fill {
    background: #ffab00;
}

.progress-bar-mini {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-indicator-pulse {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #2ea043;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid #2ea043;
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.status-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Department Distribution */
.dept-distribution {
    display: flex;
    justify-content: space-between;
    padding-top: 0.5rem;
}

.dept-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.dept-name {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

.dept-val {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 600;
}

/* Star Rating */
.star-rating {
    color: #ffab00;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

/* Inventory Tags */
.inventory-tags-pulse {
    display: flex;
    gap: 8px;
}

.tag-pulse {
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.tag-pulse.optimal {
    background: rgba(46, 160, 67, 0.1);
    color: #2ea043;
}

.tag-pulse.warning {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
}

.kpi-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: auto;
}

.dashboard-footer {
    margin-top: auto;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-note {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Advanced Dashboard Elements */
.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

@container (max-width: 800px) {
    .dashboard-secondary-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card.wide {
    grid-column: span 1;
}

/* Revenue Distribution */
.revenue-distribution {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 0.5rem;
}

.dist-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dist-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.dist-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

/* Unit Economics */
.unit-economics {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    height: 100%;
}

.economic-item {
    text-align: center;
}

.economic-item .label {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.economic-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.economic-divider {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.ratio-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Dashboard Table */
.dashboard-table-wrapper {
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: clamp(0.8rem, 0.5rem + 2cqw, 1.5rem);
    width: 100%;
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.dashboard-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-table td {
    padding: 1rem 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.status-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.status-tag.success {
    background: rgba(46, 160, 67, 0.1);
    color: #2ea043;
}

.status-tag.pending {
    background: rgba(255, 171, 0, 0.1);
    color: #ffab00;
}

/* Trend Indicator */
.trend-indicator {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-indicator.up { color: #2ea043; }
.trend-indicator.down { color: #f85149; }

/* Personnel Tab Specifics */
.capacity-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.capacity-gauge {
    position: relative;
    width: 120px;
}

.gauge-fill {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gauge-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.talent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.talent-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.talent-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.talent-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.talent-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.talent-info .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.talent-info .role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.talent-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

/* Inventory Tab Specifics */
.warehouse-heatmap {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.heat-cell {
    height: 40px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: help;
}

.heat-cell:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.heat-cell.low { background: rgba(46, 160, 67, 0.1); border-color: rgba(46, 160, 67, 0.2); }
.heat-cell.mid { background: rgba(255, 171, 0, 0.1); border-color: rgba(255, 171, 0, 0.2); }
.heat-cell.high { background: rgba(248, 81, 73, 0.1); border-color: rgba(248, 81, 73, 0.2); }

.heatmap-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-item .box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-item .box.low { background: #2ea043; }
.legend-item .box.mid { background: #ffab00; }
.legend-item .box.high { background: #f85149; }

.tag-pulse.error {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
}

.status-tag.error {
    background: rgba(248, 81, 73, 0.1);
    color: #f85149;
}

.dashboard-table td.mono {
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--accent);
}

/* AI Enterprise Orchestrator Specifics */
.orchestrator-viewport {
    background: #020202 !important;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 160, 67, 0.1);
    color: #2ea043;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border: 1px solid rgba(46, 160, 67, 0.2);
}

.orchestrator-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.orchestrator-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.persona-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.persona-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.persona-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sandbox-container {
    background: #050505;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 300px;
    position: relative;
    z-index: 1;
}

.sandbox-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-status {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #2ea043;
    border-radius: 50%;
    box-shadow: 0 0 10px #2ea043;
    animation: pulse-ring 2s infinite;
}

.terminal-feed {
    font-size: 0.6rem;
    color: var(--accent);
    font-family: monospace;
    letter-spacing: 0.1em;
}

.terminal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-line {
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(5px);
    animation: line-fade-in 0.3s forwards;
}

@keyframes line-fade-in {
    to { opacity: 1; transform: translateY(0); }
}

.terminal-line.system { color: rgba(255, 255, 255, 0.3); }
.terminal-line.ai { color: var(--accent); }
.terminal-line.data { color: #2ea043; font-style: italic; }

.terminal-input-simulation {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    gap: 10px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.4);
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.impact-metrics {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
}

.impact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.impact-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

.impact-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.impact-value.secure { color: #2ea043; }

.impact-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
}

/* Hide 'RESIZE ME' callout for specific experiments */
#operational-pulse .resize-handle::after,
#ai-orchestrator .resize-handle::after {
    display: none;
}

/* =========================================
   GLOBAL DEBUG MODE & ENGINEERING HUD
   ========================================= */

.global-debug-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1100; /* Above HUD */
    background: #111;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.debug-scan-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(102, 126, 234, 0.3),
        transparent
    );
    transition: none;
}

.global-debug-toggle.active .debug-scan-line {
    animation: debugScan 2s linear infinite;
}

@keyframes debugScan {
    from { left: -100%; }
    to { left: 100%; }
}

.global-debug-toggle:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.global-debug-toggle.active {
    background: var(--accent);
    color: #fff;
    border-color: #fff;
}

.debug-hud {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 280px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1.5rem;
    z-index: 1050;
    backdrop-filter: blur(12px);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', monospace;
    pointer-events: none;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

body.debug-active .debug-hud {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hud-header {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    display: flex;
    justify-content: space-between;
}

.hud-status {
    color: #2ea043;
    animation: blink 1s infinite;
}

.hud-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hud-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hud-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

/* Specific highlight for HUD */
#hud-fps { color: #2ea043; }
#hud-nodes { color: var(--accent); }

/* Global Grid Overlay - Pro 12 Columns & Baseline */
body.debug-active::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    background-image: 
        /* 12 Column Grid with Gutters */
        repeating-linear-gradient(90deg, 
            rgba(102, 126, 234, 0.05) 0px, 
            rgba(102, 126, 234, 0.05) calc((100% - 220px) / 12), /* Column width */
            transparent calc((100% - 220px) / 12), 
            transparent calc((100% - 220px) / 12 + 20px) /* Column + Gutter */
        );
    background-size: 100% 100%;
    margin: 0 10%;
}

body.debug-active::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 998;
    pointer-events: none;
    /* Horizontal Baseline Grid (24px) */
    background-image: linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px);
    background-size: 100% 24px;
}

/* Section Inspection Labels */
body.debug-active section {
    outline: 1px dashed rgba(102, 126, 234, 0.2);
    position: relative;
}

body.debug-active section::before {
    content: 'SECTION_ID: [' attr(id) '] // AREA: ' attr(data-debug-size);
    position: absolute;
    top: 0;
    left: 0;
    background: var(--accent);
    color: #fff;
    font-family: 'Inter', monospace;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 4px 10px;
    z-index: 1001;
    letter-spacing: 0.1em;
}

/* Mouse Follower / Crosshair */
.debug-crosshair {
    position: fixed;
    inset: 0;
    z-index: 1005;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

body.debug-active .debug-crosshair {
    opacity: 1;
    visibility: visible;
}

.crosshair-h, .crosshair-v {
    position: absolute;
    background: rgba(102, 126, 234, 0.3);
}

.crosshair-h { width: 100%; height: 1px; left: 0; top: 0; }
.crosshair-v { height: 100%; width: 1px; top: 0; left: 0; }

.crosshair-coords {
    position: absolute;
    background: var(--accent);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-family: monospace;
    border-radius: 2px;
    transform: translate(10px, 10px);
}

@media (max-width: 768px) {
    .debug-hud {
        width: calc(100% - 4rem);
        bottom: 5.5rem;
    }
}





