/* Base & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --dynamic-hue: 210;
    --primary-color: hsl(var(--dynamic-hue) 85% 60%); /* Azul vibrante dinámico */
    --secondary-color: hsl(calc(var(--dynamic-hue) + 120) 90% 58%); /* Acento dinámico */
    --primary-glow: hsla(var(--dynamic-hue) 85% 60% / 0.45);
    --secondary-glow: hsla(calc(var(--dynamic-hue) + 120) 90% 58% / 0.55);
    --text-color-light: #e2e8f0; /* Texto claro */
    --text-color-dark: #cbd5e1; /* Texto secundario */
    --bg-dark-1: #0f172a; /* Fondo muy oscuro */
    --bg-dark-2: #1e293b; /* Fondo oscuro intermedio */
    --border-color: #334155; /* Bordes sutiles */
    --font-sans: 'Inter', sans-serif; /* Fuente moderna */
}

@property --dynamic-hue {
    syntax: '<number>';
    inherits: true;
    initial-value: 210;
}

:root {
    animation: hueCycle 40s linear infinite;
}

@keyframes hueCycle {
    0% {
        --dynamic-hue: 200;
    }
    50% {
        --dynamic-hue: 320;
    }
    100% {
        --dynamic-hue: 560;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    background-color: var(--bg-dark-1);
    color: var(--text-color-light);
    scroll-behavior: smooth;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

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

/* Navbar */
.navbar {
    background-color: var(--bg-dark-2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.navbar .brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links a {
    color: var(--text-color-light);
    font-weight: 600;
    padding: 5px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-color-light);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, border-color 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bg-dark-1) 0%, #17253e 100%);
    text-align: center;
    padding: 100px 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Para las animaciones de fondo */
}

/* Efecto de fondo con partículas */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at top left, var(--primary-color) 0%, transparent 20%),
                      radial-gradient(circle at bottom right, var(--secondary-color) 0%, transparent 20%);
    opacity: 0.12;
    animation: backgroundMove 20s infinite alternate;
}

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

.hero-content {
    position: relative;
    z-index: 10;
    animation: fadeIn 1.5s ease-out;
}

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

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 0 20px var(--primary-glow);
    animation: pulseBorder 2s infinite alternate;
}

@keyframes pulseBorder {
    from { border-color: var(--primary-color); box-shadow: 0 0 20px var(--primary-glow); }
    to { border-color: var(--secondary-color); box-shadow: 0 0 25px var(--secondary-glow); }
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

.hero-content .subtitle {
    font-size: 1.5rem;
    color: var(--text-color-dark);
    margin-bottom: 20px;
}

.hero-description {
    max-width: 720px;
    margin: 0 auto 30px;
    color: var(--text-color-dark);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--primary-color);
    color: var(--text-color-light);
}

.btn-outline:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.social-links a {
    margin: 0 15px;
    color: var(--text-color-light);
    font-size: 2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-5px) scale(1.1);
    color: var(--secondary-color);
}

/* Page Hero */
.page-hero {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.95));
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, var(--primary-color), transparent 50%),
                radial-gradient(circle at bottom right, var(--secondary-color), transparent 40%);
    opacity: 0.12;
    pointer-events: none;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.page-hero h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-subtitle {
    color: var(--text-color-dark);
    max-width: 720px;
    margin-bottom: 25px;
}

/* Sections generales */
.section-padded {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-padded:last-of-type {
    border-bottom: none;
}

.section-padded h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-padded h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    left: 50%;
    transform: translateX(-50%);
    bottom: -15px;
    border-radius: 2px;
}

.bg-dark {
    background-color: var(--bg-dark-2);
}

.content-card {
    background: var(--bg-dark-2);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 40px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.content-card.center {
    text-align: center;
}

/* Quick links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.quick-card {
    background: var(--bg-dark-2);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
    color: var(--text-color-light);
}

.quick-card span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--secondary-color);
    font-weight: 600;
}

.quick-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.info-card {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

/* About Section */
#about p {
    font-size: 1.15rem;
    line-height: 1.8;
    text-align: justify;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-color-dark);
}

/* Experience Section - Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: var(--bg-dark-1);
    border: 4px solid var(--secondary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.left {
    left: 0;
    text-align: right;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
}

.timeline-item.right::after {
    left: -16px;
}

.timeline-item h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.4rem;
}

.timeline-item .date {
    color: var(--text-color-dark);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-item ul {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-color-dark);
}

.timeline-item ul li {
    margin-bottom: 5px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-category {
    background-color: var(--bg-dark-1);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-left: 5px solid var(--primary-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-10px);
    border-left-color: var(--secondary-color);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.6rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 10px;
}

.skill-category ul {
    list-style: none;
    padding: 0;
}

.skill-category ul li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    color: var(--text-color-dark);
}

.skill-icon {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-right: 10px;
    width: 25px;
    text-align: center;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-dark-2);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    border-top: 5px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.project-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-card p {
    color: var(--text-color-dark);
    margin-bottom: 20px;
    flex-grow: 1;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag-list span {
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-color-light);
}

.btn-project {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    margin-top: auto;
}

.btn-project:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

/* References Section */
#references p {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color-dark);
}

/* Contact Section */
.contact-info {
    text-align: center;
    margin-top: 30px;
    font-size: 1.1rem;
    color: var(--text-color-dark);
}

.contact-info p {
    margin-bottom: 15px;
}

.contact-info .fas,
.contact-info .fab {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.3rem;
}

/* Footer */
footer {
    background-color: var(--bg-dark-1);
    color: var(--text-color-dark);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 900px) {
    .navbar .container {
        flex-wrap: wrap;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
    }
    .navbar .nav-links {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content .subtitle {
        font-size: 1.2rem;
    }

    .page-hero h1 {
        font-size: 2.4rem;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: left;
    }

    .timeline-item::before {
        left: 60px;
        margin-left: 0;
        right: auto;
    }

    .timeline-item::after {
        left: 15px;
    }

    .timeline-item.right {
        left: 0%;
    }

    .timeline-item.left::after {
        left: 15px;
    }
}

@media (max-width: 480px) {
    .nav-links {
        flex-direction: column;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .profile-pic {
        width: 120px;
        height: 120px;
    }
    .social-links a {
        font-size: 1.5rem;
        margin: 0 10px;
    }
    .section-padded h2 {
        font-size: 2rem;
    }
    .skills-grid,
    .projects-grid,
    .quick-links,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
    }
}
