/* ===============================================
   VARIABLES Y SISTEMA FLUIDO
   =============================================== */
:root {
    /* Colores base */
    --bg: #fafbfc;           /* Blanco cálido, menos quema-retina */
    --bg-elevated: #ffffff;  /* Para cards/elevaciones */
    --text: #0a0e14;         /* Negro azulado, menos duro */
    --text-secondary: #4a5568; /* Para metadata, menos contraste */

    /* IA spectrum */
    --ia-color: rgba(10, 14, 20, 0.5);     /* Más rico que rgba(0,0,0,0.4) */
    --ia-color-light: rgba(10, 14, 20, 0.25);

    /* Accents */
    --accent: #00bcd4;       /* Cyan para texto sobre blanco (ESTE) */
    --accent-bright: #00f2ff; /* Cyan neón para efectos/glows */
    --accent-dark: #0097a7;   /* Para hovers/depth */

    /* Neutrales con warmth */
    --grid-dot: #e8eaed;     /* Grid más sutil */
    --border: #d1d5db;       /* Bordes definidos */
    --surface: #f3f4f6;      /* Superficies alternativas */

    /* Semantic (opcional) */
    --success: #00d68f;      /* Verde neón para estados positivos */
    --warning: #ffaa00;      /* Ámbar para alertas */
    --error: #ff0055;        /* Magenta para errores */

    /* Tipografías */
    --sans: 'Inter', sans-serif;
    --mono: 'JetBrains Mono', monospace;

    /* Sistema de espaciado fluido */
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);      /* ~8-12px */
    --space-sm: clamp(1rem, 2vw, 1.5rem);         /* ~16-24px */
    --space-md: clamp(1.5rem, 3vw, 2.5rem);       /* ~24-40px */
    --space-lg: clamp(2rem, 4vw, 3.125rem);       /* ~32-50px */
    --space-xl: clamp(3rem, 6vw, 5rem);           /* ~48-80px */
    --space-2xl: clamp(4rem, 8vw, 6.25rem);       /* ~64-100px */

    /* Tipografía fluida */
    --text-2xs: clamp(0.5625rem, 0.4vw + 0.5rem, 0.6875rem);  /* ~9-11px */
    --text-xs: clamp(0.625rem, 0.5vw + 0.5rem, 0.75rem);      /* ~10-12px */
    --text-sm: clamp(0.875rem, 0.8vw + 0.6rem, 1rem);         /* ~14-16px */
    --text-base: clamp(1rem, 1vw + 0.75rem, 1.125rem);        /* ~16-18px */
    --text-lg: clamp(1.25rem, 1.5vw + 0.8rem, 1.75rem);       /* ~20-28px */
    --text-xl: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);          /* ~28-40px */
    --text-2xl: clamp(2.5rem, 7.5vw, 8rem);                   /* Hero title */
    --text-3xl: clamp(2rem, 5vw, 3rem);                       /* Section titles */

    /* Gaps fluidos */
    --gap-sm: clamp(1rem, 2vw, 1.25rem);
    --gap-md: clamp(1.5rem, 3vw, 2.5rem);
    --gap-lg: clamp(2rem, 4vw, 3.75rem);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===============================================
   BACKGROUND GRID
   =============================================== */
.background-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(var(--grid-dot) 1.5px, transparent 1.5px);
    background-size: 50px 50px;
    z-index: -1;
}

/* ===============================================
   HEADER
   =============================================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding-block: var(--space-sm);
    padding-inline: var(--space-lg);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--grid-dot);
}

header nav {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.logo {
    font-weight: 900;
    color: var(--accent);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.sep {
    color: var(--ia-color);
}

header a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

header a:hover {
    border-bottom-color: var(--accent);
}

/* ===============================================
   MAIN & HERO
   =============================================== */
main {
    padding-top: clamp(6rem, 12vw, 10rem);
    width: 100%;
}

#hero {
    padding-block-end: var(--space-xl);
    padding-inline: var(--space-lg);
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
    align-items: start;
}

.meta-info {
    font-family: var(--mono);
    font-size: var(--text-2xs);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-md);
    grid-column: 1 / -1;
}

h1 {
    font-size: var(--text-2xl);
    font-weight: 900;
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    display: block;
    max-width: 100%;
    text-align: left;
    margin: 0;
}

/* Typewriter effects */
#typewriter-title span.active {
    color: var(--text);
    animation: rgbText 6s infinite ease-in-out;
}

#typewriter-title span.ia-part {
    color: var(--ia-color);
}

.terminal-cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 900;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes rgbText {
    0%, 100% { text-shadow: 0 0 0 transparent; }
    50% { text-shadow: 1.5px 0 0 rgba(255,0,0,0.1), -1.5px 0 0 rgba(0,242,255,0.1); }
}

.hero-desc {
    font-family: var(--sans); /* Cambia a Sans para mejor legibilidad si es Inter */
    font-size: var(--text-base); /* Asegúrate que sea al menos 18px-20px */
    font-weight: 500; /* Sube un punto el peso (Medium) */
    line-height: 1.4; /* Cerramos el interlineado para que el bloque "pese" más */
    color: var(--text); /* Que sea negro total, no gris, para igualar al h1 */
    max-width: 35ch; /* Limitamos el ancho por caracteres para que sea un bloque sólido */
    opacity: 0;
    transform: translateY(10px); 
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    /* Un detalle de diseño editorial */
    border-left: 2px solid var(--accent); 
    padding-left: var(--space-sm);
    backface-visibility: hidden;
    will-change: opacity, transform;
}

.hero-desc.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===============================================
   LABORATORIO + THINKING WRAPPER
   =============================================== */
#lab-thinking-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--grid-dot);
    background: #fafafa;
}

/* ===============================================
   LABORATORIO
   =============================================== */
#laboratorio {
    padding: var(--space-2xl) var(--space-lg);
    border-right: none;
}

.lab-content {
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
}

.lab-column {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.lab-subtitle {
    font-family: var(--mono);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: var(--space-xs);
}

.lab-content p {
    font-family: var(--sans);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text);
}

.lab-content a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--ia-color);
    transition: 0.3s;
}

.lab-content a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.lab-content strong {
    font-weight: 900;
}

/* ===============================================
   THINKING FRAGMENT
   =============================================== */
#thinking {
    padding: var(--space-2xl) var(--space-lg);
    background: #fafafa;
    border-left: none;
    position: relative;
    overflow: hidden;
}

#thinking::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--x, 50%) var(--y, 50%),
        rgba(0, 242, 255, 0.08),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

#thinking:hover::before {
    opacity: 1;
}

.thinking-content {
    max-width: 100%;
    position: relative;
    z-index: 2;
}

blockquote {
    font-family: var(--sans);
    font-size: var(--text-lg);
    line-height: 1.5;
    font-weight: 400;
    color: var(--text);
    margin: 0;
    padding: 0;
    border: none;
    transition: opacity 0.5s;
}

blockquote::before {
    content: '"';
    font-size: var(--text-xl);
    line-height: 0;
    vertical-align: -0.4em;
    color: var(--accent);
    margin-right: var(--space-xs);
}

.quote-author {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--ia-color);
    margin-top: var(--space-md);
    padding-left: var(--space-md);
    border-left: 2px solid var(--accent);
    transition: opacity 0.5s;
}

.quote-author strong {
    color: var(--text);
    font-weight: 700;
}

/* Quote Controls */
.quote-controls {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-top: var(--space-md);
}

.quote-btn {
    background: none;
    border: 1px solid var(--ia-color);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--text);
    transition: all 0.3s;
    border-radius: 2px;
}

.quote-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.quote-btn.pause-play {
    width: auto;
    padding-inline: var(--space-sm);
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin-bottom: var(--gap-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0s linear;
}

/* Navigation dots */
.nav-dots {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.dot {
    width: 6px;
    height: 6px;
    border: 1px solid var(--ia-color);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.3);
}

/* ===============================================
   RUTAS
   =============================================== */
#rutas {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    border-top: 1px solid var(--text);
    background: #fff;
    margin-top: var(--space-xl);
}

.section-label {
    grid-column: span 2;
    padding-block: var(--space-2xl);
    padding-inline: var(--space-lg);
    font-family: var(--mono);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text);
    background: #fff;
    border-block: 2px solid var(--text);
}

.ruta-item {
    padding: var(--space-2xl) var(--space-lg);
    border-right: 1px solid var(--grid-dot);
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
    text-decoration: none;
    color: inherit;
    position: relative;
    background: #fff;
    min-height: clamp(20rem, 40vh, 28rem);
}

.ruta-item:last-child {
    border-right: none;
}

.ruta-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(0,242,255,0.06), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.ruta-item:hover::before {
    opacity: 1;
}

.ruta-item:hover {
    background: #fafafa;
}

.ruta-header h2 {
    font-size: var(--text-3xl);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.ruta-content {
    font-family: var(--sans);
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    position: relative;
    z-index: 1;
}

.disparador {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.ruta-desc {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ia-color);
}

.cta-link {
    font-family: var(--mono);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    align-self: flex-start;
    padding-bottom: 4px;
    transition: 0.3s;
}

.ruta-item:hover .cta-link {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===============================================
   ACTIVITY + FOOTER WRAPPER
   =============================================== */
#activity-footer-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--grid-dot);
    background: #fff;
}

/* ===============================================
   ACTIVITY FEED
   =============================================== */
#activity {
    padding: var(--space-2xl) var(--space-lg);
    border-right: none;
    background: #fff;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: var(--gap-lg); */
}

#activity-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s ease;
}

#activity-link:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

#activity-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--x, 50%) var(--y, 50%),
        rgba(0, 242, 255, 0.12),
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

#activity-link:hover::before {
    opacity: 1;
}

.activity-display {
    position: relative;
    z-index: 2;
    display: grid;
    /* Reducimos ligeramente para dar más aire a la descripción y evitar empujes */
    grid-template-columns: 7.5rem 9.5rem 1fr;
    gap: var(--gap-md);
    font-family: var(--mono);
    font-size: var(--text-sm);
    padding-block: var(--space-md);
    border-top: 2px solid var(--grid-dot);
    border-bottom: 2px solid var(--grid-dot);

    /* ESTABILIDAD VERTICAL: 8rem suele ser el "sweet spot" para 3 líneas de texto */
    min-height: 8rem;
    align-items: start;

    /* ANTIALIASING: Evita que las letras vibren al animarse */
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.activity-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs); /* Usamos tu variable de espacio pequeño */
    min-width: 0;         /* Evita que el flex-item desborde su grid cell */
}

.field-value {
    display: block;
    min-height: 3.5em; /* Estabilidad vertical */
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    white-space: normal; /* El navegador hace el wrap por palabras automáticamente */
}
/* Animación de revelado suave */
.field-value.revealing {
    animation: revealText 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes revealText {
    from {
        opacity: 0;
        transform: translateX(-10px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

.field-label {
    font-size: var(--text-2xs);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.field-value.timestamp {
    color: var(--text);
}

.field-value.type {
    color: var(--accent);
    text-transform: uppercase;
}

.field-value.desc {
    color: var(--ia-color);
    font-weight: 400;
}

.activity-controls {
    margin-top: var(--space-md);
}

.controls-row {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-top: var(--gap-sm);
}

.status-badge {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-bright); /* Usamos el cyan neón */
    border-radius: 50%;
    display: inline-block;
    margin-right: var(--space-xs);
    
    /* La magia ocurre aquí */
    box-shadow: 0 0 5px var(--accent-bright);
    animation: titilar 1.5s ease-in-out infinite;
}

@keyframes titilar {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 5px var(--accent-bright);
    }
    50% { 
        opacity: 0.5; 
        transform: scale(0.9);
        box-shadow: 0 0 2px var(--accent-bright);
    }
}

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

/* Split-flap animation */
.flip-char {
    display: inline-block;
    white-space: pre; /* Mantiene el espacio si lo hubiera */
    /* Evita que el navegador separe letras de una misma palabra */
    unicode-bidi: isolate;
}
.field-value span {
    display: inline-block;
}

.flip-char.flipping {
    animation: flipChar 0.6s ease-in-out;
}
.flip-char.space {
    display: inline; /* Permite que el navegador rompa la línea aquí */
    width: 0.25em;   /* Un ancho mínimo de seguridad */
}

@keyframes flipChar {
    0% {
        transform: rotateX(0deg);
        opacity: 1;
    }
    49% {
        transform: rotateX(90deg);
        opacity: 0;
    }
    50% {
        transform: rotateX(-90deg);
        opacity: 0;
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

/* ===============================================
   FOOTER
   =============================================== */
footer {
    padding: var(--space-2xl) var(--space-lg);
    border-left: none;
    background: #fff;
}

.footer-content {
    font-family: var(--sans);
    font-size: var(--text-sm);
    color: #666;
    max-width: 100%;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.footer-content strong {
    font-weight: 900;
    color: var(--text);
}

.footer-links {
    font-family: var(--mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: #888;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===============================================
   RESPONSIVE - SOLO CAMBIOS ESTRUCTURALES
   =============================================== */

/* Desktop: grids asimétricos */
@media (min-width: 1025px) {
    #hero {
        grid-template-columns: 3fr 1fr;
        column-gap: var(--gap-lg);
        align-items: end;
    }


    .meta-info {
        grid-column: 1 / -1;
        margin-bottom: var(--space-md);
    }

    h1 {
        grid-column: 1;
    }

    .hero-desc {
        grid-column: 2;
        align-self: end;
        padding-bottom: var(--space-xs);
        transform: translateX(11px);
        border-left: 2px solid var(--accent);
        padding-bottom: 2px; /* Espacio extra para que el texto no toque el borde inferior */
        margin-bottom: 0;
        margin-left:12px;
    }

    #lab-thinking-wrapper {
        grid-template-columns: 3fr 1fr;
    }

    #laboratorio {
        border-right: 1px solid var(--grid-dot);
    }

    .lab-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--gap-lg);
    }

    #thinking {
        border-left: 1px solid var(--grid-dot);
    }

    #activity-footer-wrapper {
        grid-template-columns: 2fr 1fr;
    }

    #activity {
        border-right: 1px solid var(--grid-dot);
    }

    footer {
        border-left: 1px solid var(--grid-dot);
    }
}

/* Tablet y mobile: columna única */
@media (max-width: 1024px) {

    #hero {
        /* Reducimos el gap entre el H1 y la descripción en mobile */
        gap: var(--space-md); 
        padding-block-end: var(--space-lg); /* Menos aire abajo del hero */
    }

    .meta-info {
        /* Reducimos el margen inferior del texto gris superior */
        margin-bottom: var(--space-sm);
    }

    .hero-desc {
        /* En mobile no necesitamos el empuje lateral (transform) de escritorio */
        transform: none; 
        margin-left: 0;
        
        /* Aseguramos que el bloque no se vea tan ancho en pantallas pequeñas */
        max-width: 100%; 
        
        /* Un poco de aire arriba para que no respire pegado al título */
        margin-top: var(--space-xs);
    }


    #rutas {
        grid-template-columns: 1fr;
    }

    .section-label {
        grid-column: span 1;
    }

    .ruta-item {
        border-right: none;
        border-bottom: 1px solid var(--grid-dot);
        min-height: auto;
    }
    .activity-display {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
        min-height: auto;
    }

    .activity-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    width: 100%; /* Ocupa el ancho de su celda de grid */
}

    .field-label {
        min-width: 60px; /* Alinea los labels en mobile */
    }
}

/* Mobile: ajustes específicos */
@media (max-width: 768px) {
    main {
        /* Bajamos el techo del sitio en móviles para que el Hero aparezca antes */
        padding-top: var(--space-2xl); 
    }
    #lab-thinking-wrapper,
    #activity-footer-wrapper {
        grid-template-columns: 1fr;
        display: block;
    }

    #laboratorio,
    #thinking,
    #activity,
    footer {
        border-right: none;
        border-left: none;
        border-top: 1px solid var(--grid-dot);
    }

    h1 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .quote-controls,
    .controls-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .quote-btn {
        min-width: 2.5rem;
        height: 2.5rem;
    }

    .quote-btn.pause-play {
        width: auto;
        min-width: 5rem;
    }

    #activity-link {
        padding: var(--space-sm);
        border: 1px solid var(--grid-dot);
    }

    .activity-display {
        padding-block: 0;
        border-top: none;
        border-bottom: none;
    }
}
/* Añadir a tu CSS existente */
.line.sys {
  color: #00f2ff;
  position: relative;
  font-family: 'Courier New', monospace;
}

.line.sys::before {
  content: '[ELIZA/DF]';
  color: #666;
  font-size: 0.8em;
  margin-right: 8px;
  opacity: 0.7;
}

/* Efectos de distorsión progresiva */
.distortion-1 .line.sys {
  text-shadow: 0 0 1px #00f2ff;
}

.distortion-2 .line.sys {
  text-shadow: 0 0 3px #00f2ff, 0 0 5px #ff00ff;
  animation: glitch 2s infinite;
}

.distortion-3 .line.sys {
  filter: blur(0.5px) hue-rotate(180deg);
  animation: glitch 1s infinite;
}

@keyframes glitch {
  0% { transform: translateX(0); }
  20% { transform: translateX(-1px); }
  40% { transform: translateX(1px); }
  60% { transform: translateX(0); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

/* Telemetría de Design Fiction */
#df-telemetry {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  color: #666;
  font-family: monospace;
}

#df-telemetry::before {
  content: '[DESIGN FICTION ACTIVE]';
  display: block;
  border-bottom: 1px solid #333;
  margin-bottom: 5px;
  padding-bottom: 3px;
}

/* Header navigation updates */
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
.sep, .nav-sep {
    opacity: 0.5; /* Las barras separadoras quedan mejor sutiles */
}
.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeInNav 0.8s ease forwards;
    animation-delay: 0.6s;
}

@keyframes fadeInNav {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-sep {
    color: var(--text-secondary);
    opacity: 0.3;
    font-size: 0.85rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    opacity: 0.7;
}

.nav-link:hover {
    color: var(--accent);
    opacity: 1;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: radial-gradient(
        400px circle at var(--x, 50%) var(--y, 50%),
        rgba(0, 255, 157, 0.04),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.nav-link:hover::before {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-right {
        display: none;
    }
}

/* === Enlaces globales: normalizamos todos los estados === */
a,
a:visited {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* Si querés un subrayado “editorial” tenue por defecto, descomentá:
// a, a:visited { border-bottom-color: rgba(0,0,0,0.1); }
*/

/* Links dentro del terminal (fondo oscuro) */
#terminal-output a,
#terminal-output a:visited {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 242, 255, 0.35);
}

#terminal-output a:hover,
#terminal-output a:focus-visible {
  color: #fff;
  border-bottom-color: #fff;
  outline: none;
}
/* === Enlaces globales (normalización) === */
a,
a:visited {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: 0.3s;
}

a:hover,
a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* === Enlaces dentro del terminal (fondo oscuro) === */
#terminal-output a,
#terminal-output a:visited {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 242, 255, 0.35);
}

#terminal-output a:hover,
#terminal-output a:focus-visible {
  color: #fff;
  border-bottom-color: #fff;
  outline: none;
}
/* ===============================================
   UTILITY CLASSES
   =============================================== */
.gray-bg { background: #fafafa; }
.white-bg { background: #fff; }

.text-mono {
    font-family: var(--mono);
    font-size: var(--text-sm);
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Grid genérico para cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* De 280px a 320px */
    gap: var(--gap-md);
}

/* Card base */
.card {
    background: #fff;
    padding: var(--space-md);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-title {
    font-family: var(--mono);
    font-size: var(--text-sm);
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
}

.card-text {
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--ia-color);
}
/* Agregalo a tu CSS para darle ese toque de IA avanzada */
span.ia-part {
    color: var(--accent-bright);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    font-weight: 900;
    transition: text-shadow 0.3s ease;
}

span.ia-part:hover {
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.8), 0 0 30px rgba(255, 0, 255, 0.3);
}

/* ===============================================
   COMPONENTE DE IMAGEN (CASO-FIGURE)
   =============================================== */

/* 1. Contenedor Base */
.caso-figure {
    position: relative;
    width: 100%;
    margin: 0;
    aspect-ratio: 16 / 9; 
    overflow: hidden; 
    background-color: transparent; 
    border: 1px solid rgba(0, 188, 212, 0.15); /* Borde con el accent */
    display: block;
}

/* 2. Variante Tritono - MÁS JUGADA */
.caso-figure.tritono {
    background: linear-gradient(
        135deg, /* Ángulo más dinámico */
        #0a0a0a 0%,           /* Negro profundo pero no aplastante */
        var(--accent) 45%,    /* Accent más temprano */
        #00e5ff 55%,          /* Cyan vibrante en el medio */
        var(--accent) 65%,    /* Vuelta al accent */
        #fafafa 100%          /* Blanco cálido */
    );
    /* Gradiente alternativo con más paradas para efecto más rico */
}

/* 3. El tag picture */
.caso-figure picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* 4. La Imagen - ESTADO INICIAL MÁS LUMINOSO */
.caso-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center;
    
    /* Estado inicial: tritono visible pero no aplastado */
    filter: grayscale(100%) contrast(1.15) brightness(1.1);
    mix-blend-mode: luminosity;
    
    /* Transiciones suaves y elegantes */
    transition: 
        filter 1.4s cubic-bezier(0.23, 1, 0.32, 1), 
        transform 2s cubic-bezier(0.19, 1, 0.22, 1), 
        mix-blend-mode 1s ease,
        opacity 0.6s ease;
    
    will-change: filter, transform;
}

/* 5. Hover - REVELADO DRAMÁTICO */
.caso-item:hover .caso-figure img,
.caso-figure.hero-full:hover img {
    filter: grayscale(0%) brightness(1.05) contrast(1.05) saturate(1.1);
    mix-blend-mode: normal;
    transform: scale(1.05); /* Menos zoom, más sutil */
}

/* 6. Variante Hero Full - MÁS PRESENTE */
.caso-figure.hero-full {
    margin-top: var(--space-md);
    margin-bottom: var(--space-xl);
    border-width: 2px; /* Borde más marcado para hero */
}

.caso-figure.hero-full img {
    /* Hero más luminoso y nítido */
    filter: grayscale(100%) contrast(1.12) brightness(1.15);
    /* Opcional: un toque de saturación residual para que no sea 100% B&N */
}

/* 7. Estados adicionales - CARGA PROGRESIVA */
.caso-figure img {
    opacity: 0;
    animation: fadeInImage 0.8s ease-out forwards;
}

@keyframes fadeInImage {
    from { 
        opacity: 0; 
        transform: scale(1.02);
    }
    to { 
        opacity: 1; 
        transform: scale(1);
    }
}

/* 8. Efecto sutil de "escaneo" en hover (OPCIONAL - comentá si no te gusta) */
.caso-figure::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 188, 212, 0.1) 50%,
        transparent 100%
    );
    transition: left 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.caso-item:hover .caso-figure::after,
.caso-figure.hero-full:hover::after {
    left: 100%;
}

.metodologia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.metodo-col {
    padding: var(--space-md);
    border-left: 3px solid var(--accent);
    background: rgba(0, 188, 212, 0.03);
}

.metodo-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.metodo-col p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.metodo-col strong {
    font-weight: 900;
}