/* ----------------------------------------------------
   1. SISTEMA DE DISEÑO & VARIABLES GLOBALES
   ---------------------------------------------------- */
:root {
    /* Colores */
    --bg-color: #090909;
    --card-bg: rgba(18, 18, 18, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #86868b;
    --text-muted: #646468;
    --accent-blue: #0066ff;
    --accent-cyan: #00e5ff;
    --glow-color: rgba(0, 102, 255, 0.15);
    
    /* Fuentes */
    --font-title: 'Sora', 'Manrope', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    
    /* Espaciados y Layouts */
    --max-width: 1200px;
    --nav-height: 72px;
    --radius-lg: 16px;
    --radius-md: 8px;
    --transition-smooth: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Variables Dinámicas para Hover Glow */
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* ----------------------------------------------------
   2. RESET & ESTILOS BASE
   ---------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    position: relative;
    background-color: var(--bg-color);
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #333;
}

/* Barra de progreso de lectura */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1000;
    background: transparent;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: width 0.1s ease-out;
}

/* Cursor Personalizado Premium */
.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}
.custom-cursor-ring {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

/* ----------------------------------------------------
   3. ESTRUCTURAS GLOBALES & UTILIDADES
   ---------------------------------------------------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

section {
    padding: 4.5rem 0;
    position: relative;
    z-index: 10;
}

/* Títulos de sección Premium */
.section-header {
    margin-bottom: 2.5rem;
}
.section-tag {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
}
.section-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin-top: 1rem;
}

/* Botones Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border: 1px solid transparent;
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-color);
}
.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.06);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--card-border);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    border-color: var(--card-border-hover);
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.btn-glow:hover::after {
    transform: translateX(100%);
}

/* Efectos Glow Periféricos en Tarjetas */
.glow-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glow-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: radial-gradient(
        400px circle at var(--mouse-x) var(--mouse-y),
        rgba(0, 229, 255, 0.4),
        transparent 40%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.glow-card:hover::before {
    opacity: 1;
}

/* ----------------------------------------------------
   4. NAVBAR INTELIGENTE
   ---------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.navbar.nav-scrolled {
    background-color: rgba(9, 9, 9, 0.7);
    backdrop-filter: blur(16px);
    border-color: var(--card-border);
}

.navbar.nav-hidden {
    transform: translateY(-100%);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    display: inline-block;
}

.logo-img {
    height: 32px;
    width: auto;
    max-width: 100px;
    display: block;
    border-radius: 4px;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transform: scale(0.9) translateX(-10px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo:hover .logo-img {
    opacity: 0;
    max-width: 0;
    transform: scale(0.9) translateX(10px);
}

.logo:hover .logo-text {
    opacity: 1;
    max-width: 250px;
    transform: scale(1) translateX(0);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.burger-line {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-smooth);
}

/* ----------------------------------------------------
   5. HERO SECTION (INTERACTIVO)
   ---------------------------------------------------- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero-mesh-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--bg-color) 80%);
    z-index: 2;
    pointer-events: none;
}

.hero-container {
    position: relative;
    z-index: 3;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    width: fit-content;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.hero-badge-status {
    width: 8px;
    height: 8px;
    background-color: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff66;
    animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(0, 255, 102, 0.4); }
    50% { box-shadow: 0 0 14px rgba(0, 255, 102, 0.8); }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: scroll-indicator-in 0.8s 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scroll-indicator-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg, var(--accent-cyan), transparent);
    animation: scroll-line-draw 2s ease-in-out infinite;
}

@keyframes scroll-indicator-in {
    to { opacity: 1; }
}

@keyframes scroll-line-draw {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0.3; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
    100% { transform: scaleY(0); transform-origin: bottom; opacity: 0.3; }
}

.hero-title {
    font-family: var(--font-title);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.hero-title span {
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    font-weight: 500;
}

.hero-subtitles span::after {
    content: ' //';
    color: var(--text-muted);
    margin-left: 0.8rem;
}

.hero-subtitles span:last-child::after {
    content: '';
}

.hero-description {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.5;
    font-weight: 400;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ----------------------------------------------------
   6. SOBRE MÍ (BENTO GRID)
   ---------------------------------------------------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.bento-card {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-1 { /* Narrativa Principal */
    grid-column: span 8;
}

.bento-2 { /* Ingeniería */
    grid-column: span 4;
}

.bento-3 { /* Software & IA */
    grid-column: span 4;
}

.bento-4 { /* Emprendimiento */
    grid-column: span 8;
}

.bento-card-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bento-card-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.bento-card-highlight {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.85rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ----------------------------------------------------
   7. EXPERIENCIA (TIMELINE INTERACTIVA)
   ---------------------------------------------------- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-blue) 0%, var(--card-border) 100%);
}

/* Timeline Progress Overlay — drawn by JS */
.timeline::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
    transform-origin: top;
    transform: scaleY(var(--timeline-progress, 0));
    transition: transform 0.1s linear;
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 16px;
    height: 16px;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    transform: translateX(-50%) translateY(4px);
    z-index: 2;
    transition: var(--transition-smooth);
}

.timeline-item:hover .timeline-dot {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.timeline-role {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-company {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--accent-cyan);
    margin-top: 0.2rem;
}

.timeline-company a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.timeline-company a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}

.timeline-content {
    background-color: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.timeline-content:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.timeline-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.timeline-subtitle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.timeline-bullets {
    list-style: none;
    margin-bottom: 1.5rem;
}

.timeline-bullets li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.timeline-bullets li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

.timeline-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tech-pill:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ----------------------------------------------------
   8. PROYECTOS (TARJETAS PREMIUM CON MODAL DIALOG)
   ---------------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: rgba(18, 18, 18, 0.8);
    border-bottom: 1px solid var(--card-border);
}

.project-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.0) 0%,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%,
        rgba(255, 255, 255, 0.0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.project-card-image {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-card-image {
    transform: scale(1.05);
}

.project-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(9, 9, 9, 0.5) 100%);
    pointer-events: none;
    z-index: 3;
}

.project-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    padding: 2rem;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-status {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-weight: 500;
}

.status-production {
    background-color: rgba(0, 255, 102, 0.08);
    color: #00ff66;
    border: 1px solid rgba(0, 255, 102, 0.2);
}

.status-optimization {
    background-color: rgba(0, 102, 255, 0.08);
    color: #00e5ff;
    border: 1px solid rgba(0, 102, 255, 0.2);
}

.status-pivoted {
    background-color: rgba(255, 170, 0, 0.08);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.2);
}

.project-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

.project-tech {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-link-btn {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition-smooth);
}

.project-link-btn:hover {
    color: var(--text-primary);
}

/* Modal Dialog Nativo */
dialog.project-modal {
    border: 1px solid var(--card-border);
    background-color: #0c0c0e;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    padding: 0;
    max-width: 700px;
    width: 90%;
    margin: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

dialog.project-modal[open] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

dialog.project-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

dialog.project-modal[open]::backdrop {
    opacity: 1;
}

.modal-container {
    padding: 3rem;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1rem;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 0.5rem;
    letter-spacing: -0.02em;
}

.modal-section {
    margin-bottom: 1.8rem;
}

.modal-section-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.modal-section-content {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.modal-results-box {
    background: rgba(0, 229, 255, 0.03);
    border: 1px solid rgba(0, 229, 255, 0.15);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.modal-results-text {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1.05rem;
}

/* ----------------------------------------------------
   9. TECNOLOGÍAS (GRID CATEGORIZADO)
   ---------------------------------------------------- */
.tech-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.tech-category-card {
    padding: 2rem;
    background-color: rgba(18, 18, 18, 0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
}

.tech-category-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(18, 18, 18, 0.6);
}

.tech-category-title {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-left: 2.5px solid var(--accent-cyan);
    padding-left: 0.75rem;
}

.tech-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tech-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tech-item::before {
    content: '○';
    color: var(--accent-blue);
    font-size: 0.7rem;
}


/* ----------------------------------------------------
   11. FILOSOFÍA EDITORIAL
   ---------------------------------------------------- */
.philosophy-card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    background: rgba(12, 12, 14, 0.5);
    padding: 4rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.philosophy-quote {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    position: relative;
}

.philosophy-quote::before {
    content: '“';
    position: absolute;
    left: -2.5rem;
    top: -1.5rem;
    font-size: 5rem;
    color: rgba(0, 229, 255, 0.1);
    font-family: Georgia, serif;
}

.philosophy-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.philosophy-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 2rem;
}

.pillar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pillar-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pillar-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}


/* ----------------------------------------------------
   13. CONTACTO (FORMULARIO PREMIUM)
   ---------------------------------------------------- */
.contact-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.contact-link-item:hover {
    color: var(--text-primary);
    border-color: var(--card-border-hover);
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.contact-link-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    color: var(--accent-cyan);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: rgba(18, 18, 18, 0.4);
    border: 1px solid var(--card-border);
    padding: 3rem;
    border-radius: var(--radius-lg);
    position: relative;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.form-input {
    background-color: rgba(9, 9, 9, 0.7);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.06), 0 0 12px rgba(0, 229, 255, 0.08);
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
}

.submit-btn-container {
    margin-top: 1rem;
}

.contact-form-status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    display: none;
    will-change: opacity, transform;
}

.status-success {
    background-color: rgba(9, 9, 9, 0.85);
    border: 1px solid rgba(0, 255, 102, 0.3);
    color: #00ff66;
}

.status-error {
    background-color: rgba(9, 9, 9, 0.85);
    border: 1px solid rgba(255, 51, 51, 0.3);
    color: #ff3333;
}

/* ----------------------------------------------------
   14. FOOTER & VOLVER ARRIBA
   ---------------------------------------------------- */
.footer {
    border-top: 1px solid var(--card-border);
    padding: 4rem 0;
    background-color: #050505;
}

.footer-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-pulse-green {
    width: 6px;
    height: 6px;
    background-color: #00ff66;
    border-radius: 50%;
    box-shadow: 0 0 6px #00ff66;
    animation: pulse-light 2s infinite ease-in-out;
}

@keyframes pulse-light {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.footer-socials {
    display: flex;
    gap: 1.5rem;
}

.footer-socials a {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.footer-socials a:hover {
    color: var(--text-primary);
}

.footer-socials svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Botón Volver Arriba */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background-color: rgba(9, 9, 9, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-4px);
}

/* ----------------------------------------------------
   15. ANIMACIONES DE SCROLL REVEAL (CSS-DRIVEN)
   ---------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Variantes de dirección — rompen la monotonía */
.reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-left.revealed,
.reveal-right.revealed,
.reveal-scale.revealed {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Hero stagger — timing más dramático */
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.5s; }
.reveal-delay-4 { transition-delay: 0.65s; }

/* Section Dividers — gradiente sutil entre secciones */
section + section::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border) 30%, var(--card-border) 70%, transparent);
    margin-bottom: 4.5rem;
}

/* Page Transition */
.page-transition {
    animation: page-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-transition-out {
    animation: page-fade-out 0.25s cubic-bezier(0.7, 0, 0.84, 0) both;
}

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

@keyframes page-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

/* ----------------------------------------------------
   15b. PREFERS-REDUCED-MOTION
   ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .scroll-indicator {
        display: none;
    }
    .custom-cursor-dot,
    .custom-cursor-ring {
        display: none;
    }
}

/* ----------------------------------------------------
   16. ADAPTABILIDAD RESPONSIVE
   ---------------------------------------------------- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-1, .bento-2, .bento-3, .bento-4 {
        grid-column: span 12;
    }
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tech-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .antigravity-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    section {
        padding: 2.5rem 0;
    }
    .navbar {
        height: 64px;
    }
    .burger-menu {
        display: flex;
    }
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background-color: #0c0c0e;
        border-left: 1px solid var(--card-border);
        flex-direction: column;
        justify-content: center;
        gap: 2.5rem;
        z-index: 100;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 3rem;
    }
    .nav-links.nav-active {
        right: 0;
    }
    /* Transformación del Burger en X */
    .burger-menu.open .burger-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .burger-menu.open .burger-line:nth-child(2) {
        opacity: 0;
    }
    .burger-menu.open .burger-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .hero-description {
        font-size: 1rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .tech-categories-grid {
        grid-template-columns: 1fr;
    }
    .philosophy-card {
        padding: 2rem;
    }
    .philosophy-pillars {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .custom-cursor-dot, .custom-cursor-ring {
        display: none; /* Desactivar en táctiles */
    }
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
    }
}

/* ----------------------------------------------------
   17. NUEVAS CLASES PARA ARQUITECTURA MULTIPÁGINA Y GRID RESPONSIVE
   ---------------------------------------------------- */

/* Breadcrumbs */
.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0;
    margin: 0;
}

/* Bento grid custom spans */
.col-span-12 {
    grid-column: span 12 !important;
}
.col-span-6 {
    grid-column: span 6 !important;
}

/* Project Detail Grid Layout */
.project-grid-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    margin-top: 3rem;
}

/* Blog & Articles grids */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.project-narrative,
.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .col-span-6 {
        grid-column: span 12 !important;
    }
    .project-grid-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

