* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.4, 1.1),
                color 0.8s ease-in-out;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== TEMAS (CLARO / OSCURO) - DEFINICIÓN DE VARIABLES ===== */
/* Tema por defecto (azul) */
.theme-default {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --hero-bg: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
    --text-primary: #0f172a;
    --text-muted: #475569;
    --border-light: #e2e8f0;
    --btn-hover: rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.05);
    --accent: #2563eb;
    --accent-grad: linear-gradient(135deg, #2563eb, #7c3aed);
    --footer-bg: #f1f5f9;
    --footer-text: #0f172a;
}
.theme-default.dark {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-header: rgba(15, 23, 42, 0.95);
    --hero-bg: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --border-light: #334155;
    --btn-hover: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.3);
    --accent: #3b82f6;
    --accent-grad: linear-gradient(135deg, #3b82f6, #a855f7);
    --footer-bg: #1e293b;
    --footer-text: #e2e8f0;
}

/* Tema Atardecer (naranja) - CONTRASTE CORREGIDO */
.theme-atardecer {
    --bg-body: #fdf2e6;      /* fondo más oscuro/grisáceo para contrastar con blanco */
    --bg-card: #ffffff;
    --bg-header: rgba(255, 245, 235, 0.95);
    --hero-bg: linear-gradient(135deg, #ffe6d5 0%, #ffffff 100%);
    --text-primary: #2c1a0e;
    --text-muted: #7a5a4a;
    --border-light: #ffded0;
    --btn-hover: rgba(255, 105, 48, 0.1);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.05);
    --accent: #ff6930;
    --accent-grad: linear-gradient(135deg, #ff6930, #ffb347);
    --footer-bg: #fff0e6;
    --footer-text: #2c1a0e;
}
.theme-atardecer.dark {
    --bg-body: #1f1712;
    --bg-card: #2c241e;
    --bg-header: rgba(28, 22, 18, 0.95);
    --hero-bg: linear-gradient(135deg, #261a12 0%, #1f1712 100%);
    --text-primary: #f5e6de;
    --text-muted: #c6a994;
    --border-light: #4a3a2e;
    --btn-hover: rgba(255, 105, 48, 0.2);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.3);
    --accent: #ff8c5a;
    --accent-grad: linear-gradient(135deg, #ff8c5a, #ffc08a);
    --footer-bg: #3d2a1c;
    --footer-text: #f5e6de;
}

/* Tema Bosque (verde) - CONTRASTE CORREGIDO */
.theme-bosque {
    --bg-body: #e8f3e8;      /* fondo verde grisáceo suave */
    --bg-card: #ffffff;
    --bg-header: rgba(240, 253, 244, 0.95);
    --hero-bg: linear-gradient(135deg, #dcfce7 0%, #ffffff 100%);
    --text-primary: #14532d;
    --text-muted: #3f5e42;
    --border-light: #bbf7d0;
    --btn-hover: rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.05);
    --accent: #10b981;
    --accent-grad: linear-gradient(135deg, #10b981, #34d399);
    --footer-bg: #e6f9ed;
    --footer-text: #14532d;
}
.theme-bosque.dark {
    --bg-body: #0f1a12;
    --bg-card: #1a2a1c;
    --bg-header: rgba(15, 26, 18, 0.95);
    --hero-bg: linear-gradient(135deg, #0a1910 0%, #0f1a12 100%);
    --text-primary: #e6f3e0;
    --text-muted: #90b08c;
    --border-light: #2d4430;
    --btn-hover: rgba(16, 185, 129, 0.2);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.3);
    --accent: #34d399;
    --accent-grad: linear-gradient(135deg, #34d399, #6ee7b7);
    --footer-bg: #1a2a1c;
    --footer-text: #e6f3e0;
}

/* Tema Ocaso (púrpura) - CONTRASTE CORREGIDO */
.theme-ocaso {
    --bg-body: #f3ecfa;      /* fondo lila grisáceo */
    --bg-card: #ffffff;
    --bg-header: rgba(250, 245, 255, 0.95);
    --hero-bg: linear-gradient(135deg, #f3e8ff 0%, #ffffff 100%);
    --text-primary: #3b0764;
    --text-muted: #6b21a5;
    --border-light: #e9d5ff;
    --btn-hover: rgba(139, 92, 246, 0.1);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.05);
    --accent: #8b5cf6;
    --accent-grad: linear-gradient(135deg, #8b5cf6, #c084fc);
    --footer-bg: #f5f0ff;
    --footer-text: #3b0764;
}
.theme-ocaso.dark {
    --bg-body: #1a1025;
    --bg-card: #261b36;
    --bg-header: rgba(26, 16, 37, 0.95);
    --hero-bg: linear-gradient(135deg, #1b0f2c 0%, #1a1025 100%);
    --text-primary: #f0eaff;
    --text-muted: #b19cd9;
    --border-light: #3e2a55;
    --btn-hover: rgba(139, 92, 246, 0.2);
    --shadow-sm: 0 5px 15px rgba(0,0,0,0.2);
    --shadow-md: 0 15px 35px rgba(0,0,0,0.3);
    --accent: #a78bfa;
    --accent-grad: linear-gradient(135deg, #a78bfa, #d8b4fe);
    --footer-bg: #2d1b4a;
    --footer-text: #f0eaff;
}

/* Transiciones globales para elementos clave */
.header,
.hero,
.card,
.skill-card,
.timeline-item,
.lab-card,
.navbar,
.nav-links a,
.dark-mode-btn,
footer,
.section.alt-bg,
.skill-card i,
.btn-primary,
.theme-selector-btn {
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.4, 1.1),
                color 0.8s ease-in-out,
                border-color 0.8s ease-in-out,
                box-shadow 0.6s ease-in-out,
                transform 0.3s ease;
}

/* HEADER FIJO */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: var(--text-primary);
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-lab {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Botón modo oscuro */
.dark-mode-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-btn:hover {
    background: var(--btn-hover);
}

.dark-mode-btn i {
    transition: transform 0.4s ease;
}

.dark-mode-btn:active i {
    transform: rotate(360deg);
}

/* Selector de temas (paleta) */
.theme-selector-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    margin-left: 1rem;
    color: currentColor;
}

.theme-selector-btn:hover {
    background: var(--btn-hover);
    transform: rotate(15deg);
}

/* Menú flotante de temas */
.theme-menu {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 0.8rem;
    display: flex;
    gap: 0.8rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 1px solid var(--border-light);
    z-index: 1000;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.theme-menu.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.theme-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border-light);
    transition: transform 0.2s, border-color 0.2s;
}

.theme-option:hover {
    transform: scale(1.1);
}

.theme-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-body);
}

/* Colores de los círculos del menú */
.theme-azul { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.theme-atardecer { background: linear-gradient(135deg, #ff6930, #ffb347); }
.theme-bosque { background: linear-gradient(135deg, #10b981, #34d399); }
.theme-ocaso { background: linear-gradient(135deg, #8b5cf6, #c084fc); }

/* Hamburguesa (móvil) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* HERO */
.hero {
    min-height: 100vh;
    background: var(--hero-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.highlight {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.8rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: var(--accent);
    filter: brightness(0.9);
    transform: translateY(-3px);
}

/* Secciones */
.section {
    padding: 5rem 0;
}

.alt-bg {
    background-color: var(--bg-card);
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Card Sobre mí */
.card {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    border: 1px solid var(--border-light);
}

/* Timeline experiencia */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent);
    border: 1px solid var(--border-light);
}

.date {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
}

.timeline-item h3 {
    margin: 0.5rem 0;
}

/* Skills grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.skill-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.skill-card span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    text-align: center;
    transition: background-color 0.8s cubic-bezier(0.2, 0.9, 0.4, 1.1),
                color 0.8s ease-in-out;
}

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

.social-links a {
    color: var(--footer-text);
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--accent);
}

footer .theme-selector-btn {
    color: var(--footer-text);
}
footer .theme-selector-btn:hover {
    color: var(--accent);
    background: var(--btn-hover);
}

/* ANIMACIONES SCROLL */
.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* RESPONSIVE */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-header);
        backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        padding: 2rem;
        gap: 1.5rem;
        transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    .nav-links.active {
        left: 0;
    }
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .footer-content {
        justify-content: center;
        flex-direction: column;
    }
    .theme-menu {
        bottom: 80px;
        right: 10px;
    }
}
