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

    :root {
        --primary-color: #2563eb;
        --secondary-color: #1e40af;
        --dark-bg: #0f172a;
        --light-bg: #1e293b;
        --text-light: #e2e8f0;
        --text-dark: #94a3b8;
        --accent: #3b82f6;
        --success: #10b981;
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background: linear-gradient(135deg, var(--dark-bg) 0%, var(--light-bg) 100%);
        color: var(--text-light);
        line-height: 1.6;
        overflow-x: hidden;
    }

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

    @keyframes float {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }

    @keyframes glow {
        0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.5); }
        50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.8); }
    }

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

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

    .logo {
        font-size: 1.5rem;
        font-weight: bold;
        background: linear-gradient(45deg, var(--accent), var(--success));
        background-clip: text;
        -webkit-text-fill-color: transparent;
        animation: glow 3s infinite;
    }

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

    nav a {
        color: var(--text-light);
        text-decoration: none;
        transition: all 0.3s;
        position: relative;
        padding: 0.5rem 0;
    }

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

    nav a:hover::after {
        width: 100%;
    }

    /* Hero Section */
    .hero {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        margin-top: 60px;
        position: relative;
        overflow: hidden;
    }

    .hero::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
        opacity: 0.1;
        animation: float 6s ease-in-out infinite;
    }

    .hero-content {
        text-align: center;
        z-index: 1;
        animation: fadeInUp 1s ease-out;
    }

    .profile-img {
        width: 300px;
        height: 350px;
        border-radius: 50%;
        border: 5px solid var(--accent);
        margin-bottom: 2rem;
        animation: float 3s ease-in-out infinite;
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    }

    h1 {
        font-size: 3rem;
        margin-bottom: 1rem;
        background: linear-gradient(45deg, var(--accent), var(--success));
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .subtitle {
        font-size: 1.5rem;
        color: var(--text-dark);
        margin-bottom: 2rem;
    }

    .btn-group {
        display: flex;
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

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

    .btn-primary {
        background: linear-gradient(45deg, var(--primary-color), var(--accent));
        color: white;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    }

    .btn-primary:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    }

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

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

    /* Secciones */
    section {
        max-width: 1200px;
        margin: 0 auto;
        padding: 5rem 2rem;
        animation: fadeInUp 1s ease-out;
    }

    h2 {
        font-size: 2.5rem;
        text-align: center;
        margin-bottom: 3rem;
        background: linear-gradient(45deg, var(--accent), var(--success));
         background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* About Me */
    .about-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: center;
    }

    .about-text {
        background: rgba(30, 41, 59, 0.5);
        padding: 2rem;
        border-radius: 15px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(59, 130, 246, 0.2);
    }

    .about-text p {
        margin-bottom: 1rem;
        color: var(--text-dark);
    }

    .soft-skills {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .skill-tag {
        background: rgba(59, 130, 246, 0.2);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.9rem;
        border: 1px solid var(--accent);
        transition: all 0.3s;
    }

    .skill-tag:hover {
        background: var(--accent);
        transform: scale(1.05);
    }

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

    .project-card {
        background: rgba(30, 41, 59, 0.7);
        border-radius: 15px;
        overflow: hidden;
        transition: all 0.3s;
        border: 1px solid rgba(59, 130, 246, 0.2);
        backdrop-filter: blur(10px);
    }

    .project-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
        border-color: var(--accent);
    }

    .project-img {
    width: 100%;
    max-width: 100%;   /* evita que excedan el ancho */
    height: 200px;
    object-fit: cover; /* recorta la imagen sin deformarla */
    border-radius: 12px; /* opcional para estética */
    background: linear-gradient(45deg, var(--primary-color), var(--accent));
}

/* Asegura que todas las imágenes dentro de project-img se adapten */
.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


    .project-content {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        color: var(--accent);
    }

    .project-desc {
        color: var(--text-dark);
        margin-bottom: 1rem;
    }

    .tech-stack {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tech-badge {
        background: rgba(59, 130, 246, 0.2);
        padding: 0.3rem 0.8rem;
        border-radius: 15px;
        font-size: 0.8rem;
    }

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

    .project-links a {
        padding: 0.5rem 1rem;
        background: var(--accent);
        color: white;
        border-radius: 5px;
        text-decoration: none;
        transition: all 0.3s;
    }

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

    /* Skills */
    .skills-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 2rem;
        padding: 2rem;
        background: rgba(30, 41, 59, 0.5);
        border-radius: 15px;
        backdrop-filter: blur(10px);
    }

    .skill-item {
        text-align: center;
        transition: all 0.3s;
    }

    .skill-item:hover {
        transform: translateY(-10px);
    }

    .skill-icon {
        width: 80px;
        height: 80px;
        margin: 0 auto 1rem;
        background: linear-gradient(45deg, var(--primary-color), var(--accent));
        border-radius: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        color: white;
        transition: all 0.3s;
    }

    .skill-item:hover .skill-icon {
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.5);
        transform: rotate(360deg);
    }

    .skill-name {
        font-size: 0.9rem;
        color: var(--text-dark);
    }

    .skill-level {
        margin-top: 0.5rem;
        height: 5px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
        overflow: hidden;
    }

    .skill-progress {
        height: 100%;
        background: linear-gradient(90deg, var(--accent), var(--success));
        border-radius: 5px;
        animation: fillProgress 2s ease-out;
    }

    @keyframes fillProgress {
        from { width: 0; }
    }

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

    .timeline::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--accent);
        transform: translateX(-50%);
    }

    .timeline-item {
        position: relative;
        margin-bottom: 3rem;
        width: 45%;
        background: rgba(30, 41, 59, 0.7);
        padding: 1.5rem;
        border-radius: 10px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(59, 130, 246, 0.2);
    }

    .timeline-item:nth-child(odd) {
        margin-left: auto;
    }

    .timeline-item::before {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        background: var(--accent);
        border-radius: 50%;
        top: 1.5rem;
    }

    .timeline-item:nth-child(odd)::before {
        left: -35px;
    }

    .timeline-item:nth-child(even)::before {
        right: -35px;
    }

    /* Contact Form */
    .contact-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        background: rgba(30, 41, 59, 0.5);
        padding: 3rem;
        border-radius: 15px;
        backdrop-filter: blur(10px);
    }

    .contact-form {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-group {
        display: flex;
        flex-direction: column;
    }

    .form-group label {
        margin-bottom: 0.5rem;
        color: var(--text-dark);
    }

    .form-group input,
    .form-group textarea {
        padding: 1rem;
        background: rgba(15, 23, 42, 0.5);
        border: 1px solid rgba(59, 130, 246, 0.2);
        border-radius: 10px;
        color: var(--text-light);
        transition: all 0.3s;
    }

    .form-group input:focus,
    .form-group textarea:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
    }

    textarea {
        resize: vertical;
        min-height: 120px;
    }

    .contact-info {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .contact-item {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .contact-icon {
        width: 50px;
        height: 50px;
        background: linear-gradient(45deg, var(--primary-color), var(--accent));
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.5rem;
    }

    /* Footer */
    footer {
        background: rgba(15, 23, 42, 0.95);
        padding: 3rem 2rem 1.5rem;
        text-align: center;
    }

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

    .social-links a {
        width: 50px;
        height: 50px;
        background: rgba(59, 130, 246, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent);
        font-size: 1.5rem;
        transition: all 0.3s;
        text-decoration: none;
    }

    .social-links a:hover {
        background: var(--accent);
        color: white;
        transform: translateY(-5px) rotate(360deg);
    }

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

        h1 {
            font-size: 2rem;
        }

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

        .timeline-item {
            width: 90%;
            margin-left: auto;
            margin-right: auto;
        }

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

        .timeline-item::before {
            left: -30px !important;
        }

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

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

    /* Loading animation */
    .loading {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: var(--dark-bg);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        transition: opacity 0.5s;
    }

    .loading.hide {
        opacity: 0;
        pointer-events: none;
    }

    .spinner {
        width: 50px;
        height: 50px;
        border: 3px solid rgba(255, 255, 255, 0.1);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

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