/* =====================================================
   ALDAIR FLOREZ PORTFOLIO - DISEÑO COHESIVO PROFESIONAL
   Sistema unificado con Anime.js avanzado
   ===================================================== */

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

:root {
    /* Sistema de colores cohesivo */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --secondary-dark: #db2777;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    
    /* Gradientes del sistema */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    /* Superficie y fondo */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(99, 102, 241, 0.5);
    
    /* Texto */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Tamaños de fuente fluidos */
    --text-xs: clamp(0.75rem, 2vw, 0.875rem);
    --text-sm: clamp(0.875rem, 2.5vw, 1rem);
    --text-base: clamp(1rem, 3vw, 1.125rem);
    --text-lg: clamp(1.125rem, 3.5vw, 1.25rem);
    --text-xl: clamp(1.25rem, 4vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 5vw, 2rem);
    --text-3xl: clamp(2rem, 6vw, 2.5rem);
    --text-4xl: clamp(2.5rem, 7vw, 3.5rem);
    --text-5xl: clamp(3rem, 8vw, 4.5rem);
    
    /* Espaciado */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Radios */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Sombras coherentes */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --shadow-glow-lg: 0 0 50px rgba(99, 102, 241, 0.4);
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
    
    /* Transiciones coherentes */
    --transition-fast: 150ms ease-out;
    --transition-base: 250ms ease-out;
    --transition-slow: 500ms ease-out;
    
    /* Blur effects */
    --blur-sm: blur(4px);
    --blur-md: blur(8px);
    --blur-lg: blur(16px);
    --blur-xl: blur(24px);
}

/* =============
   BASE STYLES
   ============= */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* =============
   LOADER SYSTEM
   ============= */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
}

.loader-morph {
    margin-bottom: var(--space-8);
}

.loader-morph svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(var(--shadow-glow));
}

.loader-text {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-6);
}

.loader-letter {
    font-size: var(--text-2xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(50px) rotateX(90deg);
}

.loader-progress {
    width: 300px;
    height: 4px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    border-radius: var(--radius-sm);
    transition: width 2s ease;
}

/* =============
   NAVIGATION
   ============= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: var(--blur-lg);
    border-bottom: 1px solid var(--border);
    z-index: var(--z-fixed);
    transition: all var(--transition-base);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-text {
    font-size: var(--text-xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    position: relative;
    transition: all var(--transition-base);
}

.logo-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-8);
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: var(--text-base);
    transition: all var(--transition-base);
    position: relative;
    padding: var(--space-2) 0;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
}

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

.nav-link:hover::before {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: var(--space-1);
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

/* =============
   HERO SECTION
   ============= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--gradient-dark);
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 100px 100px;
    opacity: 0.3;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at top left,
        rgba(99, 102, 241, 0.15) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at bottom right,
        rgba(139, 92, 246, 0.15) 0%,
        transparent 50%
    );
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-20);
    align-items: center;
    z-index: 2;
    position: relative;
}

.hero-main {
    opacity: 0;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    padding: var(--space-2) var(--space-4);
    margin-bottom: var(--space-6);
    backdrop-filter: var(--blur-sm);
}

.badge-icon {
    font-size: var(--text-lg);
}

.badge-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-6);
}

.title-intro {
    display: block;
    color: var(--text-secondary);
    font-size: var(--text-2xl);
    font-weight: 400;
    margin-bottom: var(--space-2);
}

.title-name-container {
    position: relative;
    display: block;
    overflow: visible;
}

.title-name {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: var(--text-5xl);
    font-weight: 900;
    margin-bottom: var(--space-1);
    position: relative;
    z-index: 3;
}

/* Character-by-character animation */
.title-name .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(90deg);
    transform-origin: center bottom;
}

/* SVG Morphing Background */
.name-morph-svg {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

.morph-shape {
    filter: blur(0.5px);
}

.connect-line-1,
.connect-line-2 {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    opacity: 0;
}

/* Role text animation */
.title-role {
    position: relative;
    overflow: hidden;
}

.role-text {
    display: inline-block;
}

.role-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #4ecdc4;
    font-weight: 300;
}

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

.title-role {
    display: block;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: var(--text-3xl);
    font-weight: 700;
}

.hero-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-8);
    max-width: 540px;
}

.hero-stats {
    display: flex;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: var(--text-2xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-1);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* =============
   BUTTON SYSTEM
   ============= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-hover);
    backdrop-filter: var(--blur-sm);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: var(--space-3) var(--space-4);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--surface);
    border-color: var(--border);
}

.btn i {
    margin-left: var(--space-2);
    transition: transform var(--transition-base);
}

.btn:hover i {
    transform: translateX(4px);
}

/* =============
   HERO VISUAL
   ============= */
.hero-visual {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.code-preview {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: var(--blur-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    width: 400px;
    position: relative;
    z-index: 2;
}



.code-header {
    background: rgba(30, 41, 59, 0.8);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.code-dots {
    display: flex;
    gap: var(--space-2);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28ca42; }

.code-title {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.code-content {
    padding: var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.code-line {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-1);
    opacity: 0;
    transform: translateX(-20px);
}

.line-number {
    color: var(--text-muted);
    width: 25px;
    text-align: right;
    margin-right: var(--space-3);
    font-size: var(--text-xs);
}

.code-text {
    flex: 1;
}

.keyword { color: #c792ea; }
.variable { color: #82aaff; }
.property { color: #ffcb6b; }
.string { color: #c3e88d; }
.comment { color: #546e7a; }

.cursor {
    color: var(--primary);
    animation: blink 1s infinite;
}

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

.typing {
    position: relative;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-tech {
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--blur-sm);
    opacity: 0;
    transform: scale(0);
}

.floating-tech i {
    font-size: var(--text-xl);
    color: var(--primary);
}

.tech-1 {
    top: 10%;
    left: -10%;
    animation: float1 8s ease-in-out infinite;
}

.tech-2 {
    top: 60%;
    right: -15%;
    animation: float2 10s ease-in-out infinite;
}

.tech-3 {
    bottom: 20%;
    left: -5%;
    animation: float3 12s ease-in-out infinite;
}

.tech-4 {
    top: 25%;
    right: -20%;
    animation: float4 14s ease-in-out infinite;
}

/* =============
   SVG DRAWING ANIMATIONS - OPTIMIZED
   ============= */

/* Stats SVG Background */
.stats-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.2;
}

.stats-drawing-svg {
    width: 100%;
    height: 100%;
}

.stats-section .draw-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    opacity: 0;
}

.stats-section .draw-line.animate {
    animation: draw-stats-line 3s ease-in-out forwards;
}

.stats-section .draw-circle.animate {
    animation: fade-in-stats-circle 0.8s ease-in-out forwards;
}

@keyframes draw-stats-line {
    0% {
        stroke-dashoffset: 2000;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }
}

@keyframes fade-in-stats-circle {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    100% {
        opacity: 0.9;
        transform: scale(1);
    }
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(90deg); }
    50% { transform: translate(-10px, -15px) rotate(180deg); }
    75% { transform: translate(30px, -40px) rotate(270deg); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-25px, 20px) rotate(-90deg); }
    50% { transform: translate(15px, -25px) rotate(-180deg); }
    75% { transform: translate(-35px, 30px) rotate(-270deg); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(25px, -20px) rotate(120deg); }
    66% { transform: translate(-20px, -35px) rotate(240deg); }
}

@keyframes float4 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, 25px) rotate(180deg); }
}

/* =============
   SECTION SYSTEM
   ============= */
.section {
    padding: var(--space-24) 0;
    position: relative;
    overflow: hidden;
}

.section-alt {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
    opacity: 0;
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-bottom: var(--space-4);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* =============
   SERVICES GRID
   ============= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--surface);
    backdrop-filter: var(--blur-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-xl);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-6);
    position: relative;
    overflow: hidden;
}

.service-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.service-card:hover .service-icon::before {
    left: 100%;
}

.service-icon i {
    font-size: var(--text-2xl);
    color: white;
    z-index: 1;
    position: relative;
}

.service-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
    line-height: 1.7;
}

.service-features {
    list-style: none;
}

.service-features li {
    padding: var(--space-2) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-6);
    opacity: 0;
    transform: translateX(-20px);
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: var(--text-base);
}

/* =============
   ABOUT SECTION
   ============= */
.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: start;
}

.about-main-section {
    display: block;
}

.about-text {
    opacity: 0;
}

.about-description {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-8);
}

/* =============
   TECH STACK SECTION - NEW DESIGN
   ============= */
.tech-stack-container {
    flex: 1;
}

.tech-stack-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.tech-stack-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.tech-stack-title i {
    color: var(--primary);
    font-size: var(--text-xl);
}

.tech-stack-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-base);
    max-width: 600px;
    margin: 0 auto;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.tech-category {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(30px);
}

.tech-category:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.tech-category-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border);
}

.tech-category-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tech-category-icon i {
    font-size: var(--text-xl);
    color: white;
}

.tech-category-info {
    flex: 1;
}

.tech-category-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.tech-category-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.tech-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.tech-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

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

.tech-item i {
    font-size: var(--text-lg);
    color: var(--primary);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.tech-item span {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.tech-progress {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.tech-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 1s ease-out;
}

/* Stats Section - Enhanced with spectacular effects */
.stats-section {
    padding: var(--space-24) 0;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.stats-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.stats-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.1"><animate attributeName="opacity" values="0.1;0.3;0.1" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="30" r="1" fill="%23ffffff" opacity="0.15"><animate attributeName="opacity" values="0.15;0.4;0.15" dur="4s" repeatCount="indefinite"/></circle><circle cx="30" cy="70" r="1" fill="%23ffffff" opacity="0.2"><animate attributeName="opacity" values="0.2;0.5;0.2" dur="5s" repeatCount="indefinite"/></circle><circle cx="70" cy="80" r="1" fill="%23ffffff" opacity="0.1"><animate attributeName="opacity" values="0.1;0.3;0.1" dur="6s" repeatCount="indefinite"/></circle></svg>') repeat;
    animation: float 20s linear infinite;
}

.stats-gradient {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(98, 84, 255, 0.1) 0%, transparent 50%);
    animation: rotate 30s linear infinite;
}

@keyframes float {
    0% { transform: translateY(0px) translateX(0px); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(0px) translateX(10px); }
    75% { transform: translateY(-5px) translateX(5px); }
    100% { transform: translateY(0px) translateX(0px); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stats-section .container {
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-16);
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(50px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(98, 84, 255, 0.1) 0%, rgba(255, 107, 107, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(98, 84, 255, 0.5);
    box-shadow: 0 20px 60px rgba(98, 84, 255, 0.3);
}

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

.stat-background {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(98, 84, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover .stat-background {
    opacity: 1;
    animation: pulse-bg 2s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stat-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    position: relative;
    box-shadow: 0 10px 30px rgba(98, 84, 255, 0.3);
    transition: all 0.4s ease;
}

.stat-icon i {
    font-size: var(--text-2xl);
    color: white;
    transition: transform 0.4s ease;
}

.stat-icon-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    opacity: 0;
    filter: blur(20px);
    transition: opacity 0.4s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(98, 84, 255, 0.5);
}

.stat-card:hover .stat-icon i {
    transform: rotateY(360deg);
}

.stat-card:hover .stat-icon-glow {
    opacity: 0.8;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0.4; }
}

.stat-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.stat-number {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1;
    margin-bottom: var(--space-3);
    text-shadow: 0 0 30px rgba(98, 84, 255, 0.5);
    transition: all 0.4s ease;
}

.stat-card:hover .stat-number {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(98, 84, 255, 0.8));
}

.stat-label {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    transition: color 0.4s ease;
}

.stat-card:hover .stat-label {
    color: #ffffff;
}

.stat-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0.8;
    transition: all 0.4s ease;
}

.stat-card:hover .stat-description {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.stat-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="10" cy="10" r="0.5" fill="%23ffffff" opacity="0.3"><animate attributeName="cy" values="10;90;10" dur="8s" repeatCount="indefinite"/></circle><circle cx="30" cy="30" r="0.5" fill="%23ffffff" opacity="0.2"><animate attributeName="cy" values="30;70;30" dur="6s" repeatCount="indefinite"/></circle><circle cx="50" cy="50" r="0.5" fill="%23ffffff" opacity="0.4"><animate attributeName="cy" values="50;20;50" dur="7s" repeatCount="indefinite"/></circle><circle cx="70" cy="70" r="0.5" fill="%23ffffff" opacity="0.3"><animate attributeName="cy" values="70;30;70" dur="9s" repeatCount="indefinite"/></circle><circle cx="90" cy="90" r="0.5" fill="%23ffffff" opacity="0.2"><animate attributeName="cy" values="90;10;90" dur="5s" repeatCount="indefinite"/></circle></svg>') repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover .stat-particles {
    opacity: 1;
}

/* =============
   PORTFOLIO SECTION
   ============= */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-3) var(--space-6);
    background: transparent;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-btn:hover,
.filter-btn.active {
    color: white;
    border-color: var(--primary);
}

.filter-btn:hover::before,
.filter-btn.active::before {
    left: 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-8);
}

.portfolio-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.portfolio-item.show {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-image {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--surface);
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(98, 84, 255, 0.9) 0%, rgba(255, 107, 107, 0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-6);
    opacity: 0;
    transition: all 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.1);
}

.portfolio-info h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2);
}

.portfolio-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-4);
    line-height: 1.5;
}

.portfolio-tech {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.portfolio-tech span {
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: white;
    font-weight: 500;
}

.portfolio-links {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

.portfolio-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.portfolio-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

.portfolio-btn i {
    font-size: var(--text-base);
}

/* =============
   SCROLL INDICATOR
   ============= */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    opacity: 0;
    color: var(--text-secondary);
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-hover);
    border-radius: 12px;
    position: relative;
}

.scroll-wheel {
    width: 3px;
    height: 6px;
    background: var(--gradient-primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-animation 2s infinite;
}

@keyframes scroll-animation {
    0% { opacity: 0; top: 8px; }
    50% { opacity: 1; top: 16px; }
    100% { opacity: 0; top: 26px; }
}

.scroll-text {
    font-size: var(--text-sm);
    font-weight: 500;
}

/* =============
   RESPONSIVE DESIGN
   ============= */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        height: 400px;
    }
    
    .code-preview {
        width: 350px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .about-main-section {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--space-6);
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}

@media (max-width: 768px) {
    :root {
        --space-6: 1rem;
        --space-8: 1.5rem;
        --space-12: 2rem;
        --space-16: 2.5rem;
        --space-20: 3rem;
        --space-24: 4rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: var(--blur-xl);
        width: 100%;
        text-align: center;
        transition: left var(--transition-base);
        padding: var(--space-8) 0;
        border-top: 1px solid var(--border);
        gap: var(--space-4);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .hero-visual {
        height: 300px;
    }
    
    .code-preview {
        width: 300px;
    }
    
    .floating-tech {
        width: 45px;
        height: 45px;
    }
    
    .hero-stats {
        gap: var(--space-4);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .service-card {
        padding: var(--space-6);
    }
    
    .about-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .stat-item {
        min-height: 100px;
        padding: var(--space-4);
    }
    
    .morph-1 { width: 200px; height: 200px; }
    .morph-2 { width: 150px; height: 150px; }
    .morph-3 { width: 120px; height: 120px; }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-4);
    }
    
    .container {
        padding: 0 var(--space-4);
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .service-card {
        padding: var(--space-4);
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .contact-item {
        padding: var(--space-4);
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
    }
    
    .contact-form {
        padding: var(--space-6);
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-6);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .tech-category {
        padding: var(--space-4);
    }
    
    .tech-category-header {
        gap: var(--space-3);
    }
    
    .tech-category-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-card {
        padding: var(--space-4);
    }
}

/* Responsive para tablets */
@media (max-width: 768px) and (min-width: 481px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .contact-info {
        grid-row: 2;
    }
    
    .contact-form {
        grid-row: 1;
    }
}

/* =============
   CONTACT SECTION
   ============= */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-16);
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateX(-30px);
}

.contact-item:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: var(--text-xl);
    color: white;
}

.contact-details h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.contact-details p {
    color: var(--text-secondary);
    font-size: var(--text-base);
}

/* =============
   CONTACT FORM
   ============= */
.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    backdrop-filter: var(--blur-lg);
    opacity: 0;
    transform: translateY(30px);
}

.form-group {
    position: relative;
    margin-bottom: var(--space-6);
    opacity: 0;
    transform: translateY(30px);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-4);
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-family: var(--font-family);
    transition: all var(--transition-base);
    resize: vertical;
}

.form-group textarea {
    min-height: 120px;
    max-height: 200px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.form-group label {
    position: absolute;
    left: var(--space-4);
    top: var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-base);
    transition: all var(--transition-base);
    pointer-events: none;
    background: transparent;
    padding: 0 var(--space-2);
}

.form-group input:focus + label,
.form-group select:focus + label,
.form-group textarea:focus + label,
.form-group input:valid + label,
.form-group select:valid + label,
.form-group textarea:valid + label {
    top: -10px;
    left: var(--space-3);
    font-size: var(--text-sm);
    color: var(--primary);
    background: var(--bg-primary);
    padding: 0 var(--space-2);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-2);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-lg);
    font-weight: 700;
}

/* =============
   FOOTER
   ============= */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: var(--space-8) 0;
    margin-top: var(--space-24);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.footer-text p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.social-links {
    display: flex;
    gap: var(--space-4);
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: var(--text-base);
    transition: all var(--transition-base);
    text-decoration: none;
}

.social-link:hover {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* =============
   UTILITY CLASSES
   ============= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100px) rotateX(90deg);
}

/* =============
   PERFORMANCE
   ============= */
* {
    will-change: auto;
}

.hero,
.section {
    transform: translateZ(0);
}

/* =============
   DARK MODE OPTIMIZATION
   ============= */
@media (prefers-color-scheme: dark) {
    /* Ya optimizado para modo oscuro */
}

/* =============
   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-wheel {
        animation: none;
    }
}
}