:root {
    --color-bg: black;
    --color-primary: #808080;
    --color-accent: #2272FF;
    --font-family: 'Roboto', sans-serif;
}

body::after {
    content: "";
    position: fixed;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 100%;

    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    mask-image: radial-gradient(circle at right, black 0%, transparent 80%);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-primary);
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-primary);
    min-height: 100vh;
    scroll-behavior: smooth;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--color-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0.95;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.linea-lateral {
    flex-direction: row-reverse;
    position: fixed;
    bottom: 40px;
    left: 40px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 1000;
}

.linea-lateral span {
    writing-mode: sideways-lr;
    text-orientation: sideways;
    font-size: 14px;
    color: #333;
    letter-spacing: 2px;
}

.linea-lateral::after {
    content: "";
    display: block;
    width: 1px;
    height: 300px;
    background-color: #333;
}

#enumeradores,
#tituloPrincipal {
    color: var(--color-accent);
    font-weight: 700;
    margin-right: 5px;
}

nav {
    display: flex;
    gap: 25px;
}

nav a {
    position: relative;
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    top: 55%;
    width: 100%;
    height: 2px;
    background: var(--color-accent);

    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

nav a:hover::after {
    transform: scaleX(1);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    transition: all 0.3s ease;
}

nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 20px;
    background: #161b22;
    padding: 15px;
    border-radius: 8px;
    gap: 15px;
    z-index: 100;
}

main,
section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 0 0px;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 40px;
}

hr {
    background-color: var(--color-accent);
    width: 40%;
    margin: 30px auto;
}

.visualizador.active {
    position: fixed;
    inset: 0;
    margin: auto;

    max-width: 90vw;
    max-height: 90vh;

    object-fit: contain;

    z-index: 9999;
    cursor: zoom-out;
}

p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 20px;
    color: var(--color-primary);
    text-align: left;
}

#tituloBienvenido {
    color: var(--color-accent);
    text-align: left;
    font-size: 1.5rem;
}

.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin-bottom: 20px;
    object-fit: cover;
    border: 3px solid var(--color-accent);
}

.btn {
    font-family: Arial, Helvetica, sans-serif;
    padding: 12px 28px;
    font-weight: 600;
    text-decoration: none;
    background-color: var(--color-bg);
    border-radius: 10%;
    color: white;
    transition: all 0.3s ease;
    cursor: pointer;
    border-bottom: white 5px outset;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn:hover {
    background: linear-gradient(90deg, #0026fd, #00ffcc);
    border-bottom: #0026fd 5px outset;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: scale(1.1);
}

.btn::before,
.btn::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    transition: all 0.3s ease;
    
}

.btn::before {
    top: 0;
    left: 0;
}

.btn::after {
    bottom: 0;
    right: 0;
}

.btn:hover::before,
.btn:hover::after {
    width: 100%;
}

.footer {
    display: flex;
    gap: 30px;
    padding: 50px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer a {
    position: relative;
    display: inline-block;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.footer a img {
    height: 60px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer a:hover {
    transform: translateY(-3px);
}

.footer a:hover img {
    transform: translate(-5px, -5px);
    box-shadow:   2px 2px #0026fd,
    3px 3px #2743df,
    4px 4px #1771d8;
}

.footer a::before,
.footer a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    transition: all 0.4s ease;
}

.footer a::before {
    top: 0;
    left: 0;
}

.footer a::after {
    bottom: 0;
    right: 0;
}

.footer a:hover::before,
.footer a:hover::after {
    width: 100%;
}

.footer .cardWhatsapp img,
.footer .cardLinked img,
.footer .cardEmail img {
    height: 80px;
    border-radius: 50%;
    border: white 8px outset;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-primary);
    gap: 15px;
}

.section-title::before,
.section-title::after {
    content: "";
    flex: 1;
    height: 2px;
    background-color: var(--color-accent);
}

.Subtitulos {
    margin-top: 20%;
    margin-bottom: 20%;
}

#projects {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px;
    text-align: center;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 100px;
    flex-wrap: wrap;
}

.project-card.reverse {
    flex-direction: row-reverse;
}

.project-image {
    width: 400px;
    flex: 0 0 auto;
}

.project-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    filter: grayscale(100%) contrast(1);
    transition: all 0.4s ease;
}

.project-image img:hover {
    filter: none;
    transform: scale(1.03);

}

.project-content {
    flex: 1 1 auto;
    min-width: 250px;
    position: relative;
    z-index: 2;
    text-align: left;
}

.project-overline {
    color: #64ffda;
    font-size: 14px;
    margin-bottom: 10px;
}

.project-content h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ccd6f6;
}

.project-description {

    padding: 20px;
    border-radius: 8px;
    color: #ccd6f6;
    box-shadow: 0 10px 30px -15px black;
}

.project-content p {
    color: #8892b0;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    list-style: none;
    padding: 0;
    font-size: 14px;
    color: #8892b0;
}

.project-card:nth-child(even) {
    flex-direction: row-reverse;
}

#toggleBtnRes {
    display: none;
}

#courses .certificados {
    display: flex;
    gap: 30px;
    justify-content: center;
    width: 250px;
    height: 250px;
}

#courses .certificados img {
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px -15px black;
    transition: transform 0.3s ease;
    object-fit: cover;
    filter: grayscale(100%) contrast(1);
    transition: all 0.5s ease;
}

#courses .certificados img:hover {
    filter: none;
    border-color: var(--color-accent);
    transform: scale(1.05);
    transition: transform 0.3s ease;
}


/* Mobile Styles */
@media (max-width: 1082px) {

    main{
        margin-top: 15%;
    }

    #hero h1 {
        font-size: 3rem;
    }

    #typed-text {
        font-size: 1rem;
    }

    #hero .btn {
        font-size: 1rem;
        padding: 12px 28px;
    }

    body,
    ol {
        padding: 0 20px;
    }

    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .contact-form {
        animation: fadeInUp 0.8s ease forwards;
    }



    .project-card,
    .project-card.reverse {
        flex-direction: column;
        gap: 20px;
    }

    .project-image {
        width: 100%;
        flex: 1 1 100%;
    }

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

    hr {
        width: 80%;
        margin: 20% 10%;
    }


    .footer {
        padding: 20px;
        gap: 20px;
    }

    .footer .cardWhatsapp img,
    .footer .cardLinked img,
    .footer .cardEmail img {
        height: 60px;
    }

    #descripcionTexto.collapsed,
    #descripcionResumen.collapsed {
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    #toggleBtnRes {
        display: flex;
        background: none;
        border: none;
        color: #007acc;
        font-weight: bold;
        cursor: pointer;
        margin-top: 5px;
        margin-bottom: 5%;
    }

    .linea-lateral {
        display: none;
    }


    #contact h2,
    #portfolio h2,
    #about h2,
    #courses h2 {
        font-size: 2.5rem;
        color: #007acc;
        margin-bottom: 40px;
        margin-left: 0px;
    }

    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .contact-links {
        display: flex;
        justify-content: center;
        gap: 30px;
        flex-wrap: wrap;
    }

    .contact-links a {
        display: inline-block;
        transition: transform 0.3s ease, filter 0.3s ease;
    }

    .contact-links a img {
        width: 80px;
        height: 80px;
        border-radius: 50%;

        padding: 10px;
        background-color: #0a192f;
        transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
    }

    .contact-links a:hover img {
        transform: scale(1.15) rotate(5deg);
        filter: brightness(1.2);
        box-shadow: 0 0 20px rgba(100, 255, 218, 0.5);
    }


    #hero {
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        background: linear-gradient(135deg, #0a192f, #112240);
        color: #f5f5f5;
        text-align: center;
        padding: 0 20px;
    }


    #hero h1 {
        font-size: 5rem;
        font-weight: 800;
        margin-bottom: 20px;
        line-height: 1.1;
        letter-spacing: 2px;
        opacity: 0;
        animation: fadeInUp 1s ease forwards 0.5s;
    }


    #typed-text {
        font-family: monospace;
        font-size: 2rem;
        color: var(--color-primary);
        min-height: 2.5rem;
        border-right: 3px solid var(--color-primary);
        white-space: nowrap;
        overflow: hidden;
        margin-bottom: 40px;
        opacity: 0;
        animation: fadeInUp 1s ease forwards 1s;
    }


    @keyframes fadeInUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }

    }

    #nav-links {
        position: absolute;
        top: 70px;
        right: 10%;
        background: black;
        padding: 20px;
        border-radius: 8px;
        display: none;
        flex-direction: column;
        gap: 15px;
        z-index: 999;
        opacity: 0;
        transform: translateY(-20px);
    }

    .certificados {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin-top: 20%;

    }

    #courses p {
        text-align: center;
        margin-bottom: 30%;
    }

    nav a {
        font-size: 1rem;
    }

    .visualizador {
        width: 90%;
        max-width: 350px;
        height: auto;
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }

    #hero h1 {
        font-size: 4rem;
    }

    .hamburger {
        display: flex;
    }

    #typed-text {
        font-size: 1.8rem;
    }

    #hero .btn {
        font-size: 1.1rem;
        padding: 14px 32px;
    }

    #nav-links.show {
        display: flex;
        animation: slideDown 0.4s forwards;
    }

    @keyframes slideDown {
        0% {
            opacity: 0;
            transform: translateY(-20px);
        }

        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    #hero h1 {
        font-size: 2.2rem;
    }

    #typed-text {
        font-size: 1.2rem;
    }

    #hero .btn {
        font-size: 0.9rem;
        padding: 10px 24px;
    }


    .transition-wave {
        height: 180px;
        background: linear-gradient(180deg, #0a192f, #007acc, #00e5ff);
        background-size: 200% 200%;
        animation: gradientFlow 10s ease infinite;
        clip-path: ellipse(120% 100% at 50% 0%);
    }

    @keyframes gradientMove {
        0% {
            background-position: 0% 50%;
        }

        50% {
            background-position: 100% 50%;
        }

        100% {
            background-position: 0% 50%;
        }
    }
}