
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 0;
    box-shadow: 0 2px 20px var(--shadow-strong);
    z-index: 1000;
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 0.7rem 0;
    box-shadow: 0 4px 30px var(--shadow-strong);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: translateX(5px);
}

.nav-logo {
    width: 45px;
    height: 45px;
    transition: transform 0.3s ease;
    background: transparent;
    border-radius: 8px;
    padding: 2px;
}

.nav-brand:hover .nav-logo {
    transform: rotate(360deg);
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

.theme-toggle {
    background: var(--surface-alt);
    border: 2px solid var(--border);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    transform: rotate(180deg);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 2rem 2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .hero {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 50%, #f5f5f5 100%);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(126, 211, 33, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(126, 211, 33, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.hero-content {
    max-width: 900px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(126, 211, 33, 0.1);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 2px solid rgba(126, 211, 33, 0.3);
    animation: fadeInDown 0.8s ease;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease 0.2s backwards;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero .description {
    font-size: 1.05rem;
    color: var(--text-tertiary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease 0.6s backwards;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.8s backwards;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(126, 211, 33, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(126, 211, 33, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.social-links {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 0.8s ease 1s backwards;
}

.social-links a {
    width: 55px;
    height: 55px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    transform: translateY(-5px) scale(1.1);
}

/* Section Styles */
section {
    padding: 5rem 2rem;
    position: relative;
}

section:nth-child(even) {
    background: var(--surface);
}

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

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

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

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;
}

.profile-image {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow-strong);
    aspect-ratio: 1;
}

.profile-image::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    z-index: -1;
    border-radius: 20px;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-text strong {
    color: var(--primary);
    font-weight: 600;
}

.highlight-box {
    background: var(--surface-alt);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
}

.highlight-box p {
    margin: 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Certifications Section */
.cert-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.stat-card {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow-strong);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.program-card {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 2.5rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.program-card.featured {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.program-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--shadow-strong);
}

.program-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.program-card h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.program-org {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.program-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.program-badge {
    display: inline-block;
    background: rgba(126, 211, 33, 0.1);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid var(--primary);
}

.program-badge.active {
    background: var(--primary);
    color: #000;
}

.cert-categories {
    display: grid;
    gap: 2rem;
    margin-top: 4rem;
}

.cert-category {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.cert-category:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 20px var(--shadow);
}

.cert-category-header {
    padding: 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.3s ease;
}

.cert-category-header:hover {
    background: var(--surface-alt);
}

.cert-category-header h3 {
    color: var(--text);
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.cert-category-header h3 i {
    color: var(--primary);
    font-size: 1.5rem;
}

.toggle-icon {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.cert-category.active .toggle-icon {
    transform: rotate(180deg);
}

.cert-list {
    list-style: none;
    display: grid;
    gap: 1rem;
    max-height: 0;
    overflow: hidden;
    padding: 0 2rem;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.cert-category.active .cert-list {
    max-height: 2000px;
    padding: 0 2rem 2rem 2rem;
}

.cert-list li {
    padding: 1rem;
    background: var(--surface-alt);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.cert-list li:hover {
    border-left-color: var(--primary);
    background: var(--background);
    transform: translateX(5px);
}

.cert-list strong {
    color: var(--text);
    font-weight: 600;
}

.cert-date {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    white-space: nowrap;
    background: var(--surface);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.skill-card {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow-strong);
}

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

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #000;
    box-shadow: 0 8px 20px var(--shadow);
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1) rotate(5deg);
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    margin-top: 3rem;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-strong);
    border-color: var(--primary);
}

.project-image {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .project-image {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}

.project-image::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(126, 211, 33, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.project-image img {
    width: 100%;
    max-width: 200px;
    height: auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

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

.project-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tag {
    background: var(--surface-alt);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.project-link.primary {
    background: var(--primary);
    color: #000;
}

.project-link.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 211, 33, 0.3);
}

.project-link.secondary {
    background: var(--surface-alt);
    color: var(--text);
    border: 2px solid var(--border);
}

.project-link.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Contact Section */
.contact-content {
    max-width: 700px;
    margin: 3rem auto;
    text-align: center;
}

.contact-content > p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.contact-method {
    background: var(--surface);
    border: 2px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.contact-method:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow-strong);
}

.contact-method i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.contact-method a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-method:hover a {
    color: var(--primary);
}

/* Footer */
footer {
    background: var(--surface);
    padding: 3rem 2rem;
    text-align: center;
    border-top: 2px solid var(--border);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

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

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

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 968px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--surface);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        gap: 0;
        transition: left 0.3s ease;
        border-top: 2px solid var(--border);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border);
    }

    .nav-links a {
        font-size: 1.1rem;
        display: block;
    }

    .hamburger {
        display: flex;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profile-image {
        max-width: 300px;
        margin: 0 auto;
    }

    .project-card {
        grid-template-columns: 1fr;
    }

    .project-image {
        padding: 2rem;
    }

    .project-content {
        padding: 2rem;
    }

    .contact-methods {
        grid-template-columns: 1fr;
    }

    .cert-stats {
        grid-template-columns: 1fr;
    }

    .programs-grid {
        grid-template-columns: 1fr;
    }

    .cert-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 100px 1.5rem 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    section {
        padding: 3rem 1.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

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

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 5px 20px rgba(126, 211, 33, 0.4);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(126, 211, 33, 0.5);
}

[data-theme="light"][data-accesibilidad="neuro"] .skill-icon,
[data-theme="light"][data-accesibilidad="neuro"] .btn-primary,
[data-theme="light"][data-accesibilidad="neuro"] .scroll-top,
[data-theme="light"][data-accesibilidad="neuro"] .project-link.primary {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    box-shadow: none !important;
}