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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --card-bg: #f8fafc;
    --section-light: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--dark);
    position: relative;
    overflow-x: hidden;
}

/* Mouse follower */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(139, 92, 246, 0.08) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    mix-blend-mode: screen;
}

.cursor-glow.active {
    opacity: 1;
}

.cursor-trail {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.cursor-trail.active {
    opacity: 1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: pulse 4s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

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

.hero-image-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 2rem;
}

.hero-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid transparent;
    background: linear-gradient(var(--dark), var(--dark)) padding-box,
        linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)) border-box;
    ;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background-color: var(--dark-light);
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-image:hover::before {
    opacity: 1;
}

.hero-image-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(4, 35, 100, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    animation: imageGlow 3s ease-in-out infinite;
}

@keyframes imageGlow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.3;
    animation: float-icon 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    top: 10%;
    left: -10%;
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    top: 80%;
    left: 0%;
    animation-delay: 1s;
}

.floating-icon:nth-child(3) {
    top: 20%;
    right: -10%;
    animation-delay: 2s;
}

.floating-icon:nth-child(4) {
    top: 70%;
    right: 0%;
    animation-delay: 3s;
}

@keyframes float-icon {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.hero-subtitle {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.4);
}

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

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

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

.section-light {
    background: linear-gradient(180deg, #dbe3ef 0%, #0e233b 100%);
}

.section-dark {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.section-light .section-title {
    color: var(--dark);
}

.section-dark .section-title {
    color: var(--white);
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 4rem;
    font-size: 1.125rem;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    align-items: start;
    /* Esta línea es clave */
}

.skill-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.1);
    height: auto;
    /* Asegura altura automática */
}

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

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #dfeeff 100%);
}

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

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    justify-content: center;
    display: flex;
    width: 100%;
    height: 90px;

}

.skill-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.skill-list {
    list-style: none;
    font-size: 20px;
}

.skill-list li {
    padding: 0.5rem 0;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-list li::before {
    content: '▹';
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

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

.stat-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(139, 92, 246, 0.05));
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

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

.stat-label {
    color: black;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
}

:root {
    --primary: #3498db;
    --secondary: #2c3e50;
}

.project-image {
    width: 100%;
    /* Relación de aspecto 16:9 (puedes ajustar) */
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Rellena el contenedor, puede recortar */
    /* O usa object-fit: contain; para mostrar completa sin recortar */
}

.project-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    z-index: 1;
}

.project-content {
    padding: 2rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.project-description {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

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

/* Experience Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: 45%;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -20px;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent var(--white);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -20px;
    border-width: 10px 20px 10px 0;
    border-color: transparent var(--white) transparent transparent;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 6px var(--light);
}

.timeline-date {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

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

.timeline-company {
    color: var(--gray);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Contact */
.contact-card {
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15), 0 1.5px 6px rgba(139, 92, 246, 0.08);
}

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

.contact-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(37, 99, 235, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    justify-content: center;
    display: flex;
    width: 100%;
    height: 60px;

}

.contact-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.contact-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--secondary);
}

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

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-link {
    color: var(--gray);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .section {
        padding: 4rem 1rem;
    }

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

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        flex-direction: column !important;
        padding-left: 50px;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-content::before {
        display: none;
    }

    .timeline-dot {
        left: 20px;
    }

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

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

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