/* Reset y variables */
:root {
    /* Colores principales */
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #fbbf24;
    --accent-secondary: #f59e0b;
    
    /* Colores de gradiente hero */
    --hero-gradient-start: #667eea;
    --hero-gradient-end: #764ba2;
    
    /* Colores de texto */
    --text-color: #1f2937;
    --text-light: #6b7280;
    --text-white: #ffffff;
    --text-white-transparent: rgba(255, 255, 255, 0.9);
    
    /* Colores de fondo */
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #1f2937;
    
    /* Bordes */
    --border-color: #e5e7eb;
    
    /* Sombras */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Espaciado */
    --container-max-width: 1200px;
    --container-padding: 4rem 2rem;
    --container-padding-mobile: 3rem 1rem;
    
    /* Tipografía */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --line-height: 1.6;
    
    /* Transiciones */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.8s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        /* Colores principales adaptados para dark mode */
        --primary-color: #60a5fa;
        --secondary-color: #3b82f6;
        --accent-color: #fbbf24;
        --accent-secondary: #f59e0b;
        
        /* Colores de gradiente hero - más oscuros pero vibrantes */
        --hero-gradient-start: #4c5fd5;
        --hero-gradient-end: #5a3c7a;
        
        /* Colores de texto */
        --text-color: #e5e7eb;
        --text-light: #9ca3af;
        --text-white: #ffffff;
        --text-white-transparent: rgba(255, 255, 255, 0.9);
        
        /* Colores de fondo */
        --bg-color: #111827;
        --bg-secondary: #1f2937;
        --bg-dark: #0f172a;
        
        /* Bordes */
        --border-color: #374151;
        
        /* Sombras - más pronunciadas en dark mode */
        --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Header y navegación */
header {
    background-color: var(--bg-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    
    & .nav-container {
        max-width: var(--container-max-width);
        margin: 0 auto;
        padding: 1rem 2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    & .logo {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--primary-color);
    }
    
    & .nav-links {
        display: flex;
        list-style: none;
        gap: 2rem;
        
        & a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            transition: color var(--transition-fast);
            
            &:hover {
                color: var(--primary-color);
            }
        }
    }
}

/* Hero section */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    color: var(--text-white);
    text-align: center;
    padding: 2rem;
    
    & .hero-content {
        max-width: 800px;
    }
    
    & .hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
        margin-bottom: 1rem;
        animation: fadeInUp var(--transition-medium);
        
        & .highlight {
            color: var(--accent-color);
        }
    }
    
    & .hero-subtitle {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
        margin-bottom: 2rem;
        color: var(--text-white-transparent);
        animation: fadeInUp var(--transition-medium) 0.2s both;
    }
    
    & .cta-button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        background-color: var(--text-white);
        color: var(--primary-color);
        border: none;
        border-radius: 50px;
        cursor: pointer;
        font-weight: 600;
        box-shadow: var(--shadow-lg);
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        animation: fadeInUp var(--transition-medium) 0.4s both;
        
        &:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-xl);
        }
    }
}

/* Secciones */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--container-padding);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* Work Approach Section */
.work-approach {
    background-color: var(--bg-color);
    position: relative;
    
    & .approach-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        margin-top: 2rem;
    }
    
    & .approach-card {
        background-color: var(--bg-secondary);
        padding: 2.5rem 2rem;
        border-radius: 16px;
        box-shadow: var(--shadow);
        text-align: center;
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        border: 1px solid var(--border-color);
        
        &:hover {
            transform: translateY(-8px);
            box-shadow: var(--shadow-lg);
            border-color: var(--primary-color);
        }
        
        & .approach-icon {
            font-size: 3rem;
            margin-bottom: 1.5rem;
            display: block;
            filter: grayscale(0.2);
            transition: filter var(--transition-fast), transform var(--transition-fast);
        }
        
        &:hover .approach-icon {
            filter: grayscale(0);
            transform: scale(1.1);
        }
        
        & h3 {
            font-size: 1.4rem;
            color: var(--text-color);
            margin-bottom: 1rem;
            font-weight: 700;
        }
        
        & p {
            color: var(--text-light);
            line-height: var(--line-height);
            font-size: 1rem;
        }
    }
}

/* Timeline section */
.timeline-section {
    background-color: var(--bg-secondary);
    min-height: 100vh;
    position: relative;
    
    & .timeline {
        position: relative;
        max-width: 800px;
        margin: 0 auto;
        padding: 2rem 0;
        
        &::before {
            content: '';
            position: absolute;
            left: 50%;
            top: 0;
            bottom: 0;
            width: 3px;
            background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
            transform: translateX(-50%);
            border-radius: 2px;
        }
    }
}

.timeline-item {
    position: relative;
    margin: 4rem 0;
    opacity: 0;
    transform: translateY(50px);
    transition: all var(--transition-medium);
    
    &.animate {
        opacity: 1;
        transform: translateY(0);
    }
    
    &:nth-child(odd) .timeline-content {
        margin-left: 60%;
        text-align: left;
    }
    
    &:nth-child(even) .timeline-content {
        margin-right: 60%;
        text-align: right;
        
        & .timeline-tech {
            justify-content: flex-end;
        }
    }
    
    & .timeline-marker {
        position: absolute;
        left: 50%;
        top: 20px;
        width: 20px;
        height: 20px;
        background-color: var(--primary-color);
        border: 4px solid var(--bg-color);
        border-radius: 50%;
        transform: translateX(-50%);
        box-shadow: var(--shadow);
        z-index: 2;
    }
    
    & .timeline-content {
        background-color: var(--bg-color);
        padding: 2rem;
        border-radius: 12px;
        box-shadow: var(--shadow);
        position: relative;
        max-width: 400px;
    }
    
    &:nth-child(odd) .timeline-content::before {
        content: '';
        position: absolute;
        left: -10px;
        top: 20px;
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-right: 10px solid var(--bg-color);
    }
    
    &:nth-child(even) .timeline-content::before {
        content: '';
        position: absolute;
        right: -10px;
        top: 20px;
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 10px solid var(--bg-color);
    }
}

/* Elementos del timeline */
.timeline-year {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.timeline-subtitle {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-details {
    & p {
        color: var(--text-light);
        line-height: var(--line-height);
        margin-bottom: 1rem;
    }
}

.timeline-description {
    margin-bottom: 1rem;
    
    & p {
        color: var(--text-light);
        line-height: var(--line-height);
        margin-bottom: 0.8rem;
        
        &:last-child {
            margin-bottom: 0;
        }
    }
    
    & strong {
        color: var(--text-color);
        font-weight: 600;
    }
    
    & em {
        font-style: italic;
        color: var(--primary-color);
    }
    
    & ul {
        margin: 1rem 0;
        padding-left: 1.5rem;
    }
    
    & li {
        color: var(--text-light);
        line-height: var(--line-height);
        margin-bottom: 0.5rem;
        
        &:last-child {
            margin-bottom: 0;
        }
    }
}

.timeline-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    
    & .tech-tag {
        background-color: var(--bg-secondary);
        color: var(--text-color);
        padding: 0.3rem 0.8rem;
        border-radius: 15px;
        font-size: 0.8rem;
        font-weight: 500;
        border: 1px solid var(--border-color);
        transition: all var(--transition-fast);
        
        &:hover {
            background-color: var(--primary-color);
            color: var(--text-white);
            transform: scale(1.05);
        }
    }
}

/* About section con Grid - mantener para compatibilidad */
.about {
    background-color: var(--bg-secondary);
    
    & .about-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    & .about-card {
        background-color: var(--bg-color);
        padding: 2rem;
        border-radius: 12px;
        box-shadow: var(--shadow);
        transition: transform var(--transition-fast), box-shadow var(--transition-fast);
        
        &:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
        }
        
        & h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }
        
        & p {
            color: var(--text-light);
            line-height: 1.8;
        }
    }
}

/* Contact section con Flexbox */
.contact {
    background-color: var(--bg-color);
    
    & .contact-info {
        text-align: center;
        
        & p {
            font-size: 1.2rem;
            margin-bottom: 2rem;
            color: var(--text-light);
        }
    }
    
    & .contact-links {
        display: flex;
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    & .contact-link {
        padding: 0.8rem 2rem;
        background-color: var(--primary-color);
        color: var(--text-white);
        text-decoration: none;
        border-radius: 8px;
        font-weight: 500;
        transition: background-color var(--transition-fast), transform var(--transition-fast);
        
        &:hover {
            background-color: var(--secondary-color);
            transform: scale(1.05);
        }
    }
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--text-white);
    text-align: center;
    padding: 2rem;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: var(--container-padding-mobile);
    }
    
    header {
        & .nav-container {
            padding: 1rem;
        }
        
        & .nav-links {
            gap: 1rem;
        }
    }
    
    .hero {
        min-height: 60vh;
    }
    
    .work-approach {
        & .approach-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }
        
        & .approach-card {
            padding: 2rem 1.5rem;
        }
    }
    
    .about {
        & .about-grid {
            grid-template-columns: 1fr;
        }
    }
    
    .contact {
        & .contact-links {
            flex-direction: column;
            align-items: center;
        }
        
        & .contact-link {
            width: 100%;
            max-width: 300px;
        }
    }
    
    /* Timeline responsive */
    .timeline-section {
        & .timeline {
            &::before {
                left: 30px;
            }
        }
    }
    
    .timeline-item {
        &:nth-child(odd) .timeline-content,
        &:nth-child(even) .timeline-content {
            margin-left: 80px;
            margin-right: 0;
            text-align: left;
            max-width: calc(100% - 80px);
        }
        
        & .timeline-marker {
            left: 30px;
        }
        
        &:nth-child(odd) .timeline-content::before,
        &:nth-child(even) .timeline-content::before {
            left: -10px;
            right: auto;
            border-right: 10px solid var(--bg-color);
            border-left: none;
        }
        
        & .timeline-tech {
            justify-content: flex-start !important;
        }
    }
}
