/* =========================================
   1. FUENTES (FONTS)
   ========================================= */
@font-face {
    font-family: Teko;
    src: url(./font/Teko-VariableFont_wght.woff2);
    font-display: swap;
}
@font-face {
    font-family: EuroStyle;
    src: url(./font/eurostile.TTF);
    font-display: swap;
}
@font-face {
    font-family: Lemon;
    src: url(./font/lemonpunchDEMO.otf);
    font-display: swap;
}
@font-face {
    font-family: Poppins;
    src: url(./font/Poppins-ExtraLight.woff2);
    font-display: swap;
}

/* =========================================
   2. VARIABLES (:ROOT)
   ========================================= */
:root {
    /* Colores Principales */
    --color-general: rgb(102, 0, 234);
    --color-accent: #EAB000;
    --color-accent-dark: #d4a20ab2;
    --color-ink: #000000; 
    
    /* Temas */
    --color-bg-light: #ffffff;
    --color-bg-dark: #121212;
    --color-text-light: #696969; /* Gris oscuro para modo claro */
    --color-text-dark: #000000;  /* Negro puro */
    --color-text-on-dark: #ffffff; /* Texto blanco para modo oscuro */
    
    /* Fuentes y Efectos */
    --font-primary: "EuroStyle", sans-serif;
    --transition: all 0.3s ease-in-out;
}

/* =========================================
   3. RESET Y ESTILOS BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    outline-offset: 2px;
}
html {
    scroll-behavior: smooth;
}
body {
    transition: background-color 0.3s, color 0.3s;
}
/* Enlaces y Texto Básico */
a {
    text-decoration: none;
    color: white;
}
b {
    color: var(--color-general);
}
h2 {
    font-family: Teko, sans-serif;
    color: var(--color-general);
    font-size: 2.2em;
    text-shadow: none;
}

/* =========================================
   4. TEMAS (LIGHT & DARK MODE)
   ========================================= */

/* Light Mode (Por defecto o clase) */
body.light-mode {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
}
.h2-light-mode {
    color: var(--color-ink);
    text-shadow: 4px 4px 0px rgba(70, 0, 234, 0.473);
    display: inline-block;
    padding-right: 20px;
    transform: skew(-5deg);
    background: none;
    text-transform: uppercase;
}
.headerText p.text-light-mode {
    margin-top: 2%;
    color: #696969;
    margin-block: 1lh;
}
#contact.contact-light-mode {
    background-color: #6544ea2a;
}
/* Dark Mode */
body.dark-mode {
    background-color: var(--color-bg-dark);
    color: var(--color-text-on-dark);
}
.h2-dark-mode {
    color: #ffffff;
    text-shadow: 4px 4px 0 rgba(70, 0, 234, 0.473);
    transform: skew(-5deg);
}
.headerText p.text-dark-mode {
    color: #ffffff;
    margin-top: 2%;
}
.cardInfo-dark-mode {
    background-color: var(--color-bg-dark);
}
.gridSkills-dark-mode{
    filter: invert(80%) sepia(100%) saturate(5%) hue-rotate(270deg) brightness(100%);
}
.aboutme p.text-dark-mode {
    color: #ffffff;
    margin-top: 2%;
}
#contact.contact-dark-mode {
    background-color: #220632;
}

/* =========================================
   5. NAVEGACIÓN (NAVBAR)
   ========================================= */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100px;
}
.nav .hamburger {
    cursor: pointer;
    z-index: 100;
}
.nav .hamburger .abrir { display: block; }
.nav .hamburger .cerrar { display: none; }
.nav span {
    width: 100%;
    height: 100lvh; /* Fallback moderno para móviles */
    height: 100vh;
    position: fixed;
    display: flex;
    justify-content: space-evenly;
    flex-direction: column;
    text-align: center;
    transition: all 300ms;
    top: -100%;
    background-color: var(--color-general);
    padding-top: 1%;
    z-index: 99;
    font-size: 2em;
}
.nav li {
    position: relative;
    list-style: none;
    margin-bottom: 40px;
    letter-spacing: 1px;
}
.nav li a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 5%;
    background-color: white;
    bottom: -5%;
    left: 45%;
}
.nav li:hover a::after {
    width: 10%;
    transition: 0.5s all;
}

/* Icono Hamburguesa */
.hamburger {
    position: fixed;
    width: 35px;
    height: 35px;
    top: 3%;
    right: 2%;
}
.hamburger img {
    width: 100%;
    height: 90%;
    top: 2%;
    right: 0%;
}

/* =========================================
   6. UI COMPONENTS (Botones, Iconos, etc.)
   ========================================= */

/* Botón Dark Mode */
.containerdarkmode {
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    padding: 12px;
    background: none;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: -1%;
    margin-left: 1%;
    z-index: 99;
}
.sun {
    width: 50%;
    height: 50%;
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6) rotate(0deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
    background: radial-gradient(circle, rgb(255, 255, 255) 50%, #000000 50%);
}
.sun:before {
    content: "";
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #000000 30%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 50%, #000000 50%);
    transform: rotate(45deg);
}
.sun.visible {
    opacity: 1;
    transform: scale(1) rotate(180deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}
.moon {
    width: 50%;
    height: 50%;
    pointer-events: none;
    position: absolute;
    left: 12.5%;
    top: 18.75%;
    background-color: rgba(255, 255, 255, 0);
    border-radius: 50%;
    box-shadow: 9px 3px 0px 0px #000000;
    opacity: 0;
    transform: scale(0.3) rotate(65deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}
.moon.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}

/* Flecha Scroll Header */
.flechaScroll {
    width: 2.5%;
    position: absolute;
    bottom: 5%;
    left: 48.75%;
    animation: bounce 1s infinite alternate;
}
/* =========================================
   7. SECCIONES DE LA PÁGINA
   ========================================= */

/* --- HEADER --- */
.header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 80%;
    height: 80vh;
    margin: auto;
    padding: 5%;
    margin-top: 5%;
}
.headerText {
    position: relative;
    width: 70%;
    min-height: 300px;
    padding: 5%;
    padding-top: 0%;
    margin-top: -3%;
    font-size: 1.5em;
    letter-spacing: 0.7px;
    color: var(--color-general);
}
.headerText b { font-weight: 500; }
.header h1 {
    position: relative;
    padding-left: 2%;
    color: #121212;
    text-shadow: 4px 4px 0px rgba(70, 0, 234, 0.473);
    display: inline-block;
    padding-right: 20px;
    transform: skew(-5deg);
    background: none;
    font-size: 2.6em;
    font-family: Teko, sans-serif;
    text-transform: uppercase;
    font-weight: 500;
}
h1 span {
    font-size: 0.5em;
    color: #696969;
    font-weight: 400;
    text-shadow: none;
    text-transform: capitalize;
}


/* --- PROYECTOS --- */
.projects {
    position: relative;
    width: 70%;
    height: auto;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    margin-bottom: 2%;
    flex-direction: column;
    padding: 1%;
}
.projectsGrid {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 5%;
    gap: 20px;
}
.projectsCard {
    position: relative;
    display: block;
    width: 48%;
    height: 70vh;
    background-color: transparent;
    overflow: hidden;
    border-radius: 10px;
    border: 3px solid;
}

/* Colores de borde y sombra de las tarjetas */
.projectsCard:nth-of-type(1) { border-color: #9400ea30; box-shadow: -4px 4px 1px #9400ea30; }
.projectsCard:nth-of-type(2) { border-color: #6544ea3f; box-shadow: 4px 4px 1px #6544ea3f; }
.projectsCard:nth-of-type(3) { border-color: #9966ff38; box-shadow: -4px 4px 1px #9966ff38; }
.projectsCard:nth-of-type(4) { border-color: #33007537; box-shadow: 4px 4px 1px #33007537; }
.projectsCard img { width: 100%; }
.cardInfo {
    width: 100%;
    height: 65%;
    background-color: #ffffff;
    position: absolute;
    color: black;
    text-align: center;
    top: 35%;
    padding: 5%;
    padding-top: 5%;
    font-size: 1.4em;
    font-weight: 300;
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    align-items: center;
}

/* .cardInfo.hover-active podría usarse con JS, se define aquí para soporte */
.cardInfo.hover-active { opacity: 1; }
.cardInfo h3 {
    width: 100%;
    margin-bottom: 2%;
    letter-spacing: 0.10em;
    word-spacing: 0.25em;
}
.cardInfo p { font-size: 0.8em; }
.cardInfo a { width: 100%; }

/* Botones y Etiquetas */
.etiquetasCartas {
    display: block;
    width: 15%;
    height: auto;
    padding: 1%;
    background-color: aliceblue;
    color: rgb(128, 42, 240);
    font-weight: 600;
    letter-spacing: 1px;
    margin-left: 2%;
    border-radius: 10px;
    border: 2px solid rgb(128, 42, 240);
    box-shadow: 4px 4px 1px rgb(128, 42, 240);
}
.etiquetasCartas:hover {
    box-shadow: 1px 1px 1px rgb(128, 42, 240);
    transition: all 0.3s;
}
.ampliar {
    display: block;
    width: 40%;
    height: auto;
    padding: 1%;
    background-color: #ffffff;
    color: #f1cc5d;
    font-weight: 600;
    letter-spacing: 1px;
    margin-left: 2%;
    border-radius: 10px;
    border: 2px solid #f1cc5d;
    margin-left: 30%;
    box-shadow: 4px 4px 1px #f1cc5d;
}
.ampliar:hover {
    box-shadow: 1px 1px 1px #f1cc5d;
    transition: all 0.3s;
}

/* --- SKILLS --- */
.skills {
    position: relative;
    width: 70%;
    height: auto;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    margin-bottom: 2%;
    flex-direction: column;
    padding: 1%;
}
.gridSkills {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 5%;
    gap: 20px;
}
.gridSkills div {
    position: relative;
    width: auto;
    height: auto;
    margin: 2.5%;
    text-align: center;
    overflow: hidden;
}
.gridSkills img {
    width: 60px;
    height: 60px;
}
.gridSkills p {
    width: 100%;
    margin: 0;
    font-size: 17px;
    letter-spacing: 0.7px;
    font-family: Lemon;
    color: rgb(83, 83, 83);
}
.gridSkills .glassEffect {
    display: block;
    width: 140%;
    height: 5%;
    position: absolute;
    top: -50%;
    left: -20%;
    background-color: white;
    transform: rotate(45deg);
    transition: 0.5s all ease;
}
.gridSkills div:hover .glassEffect {
    top: 140%;
}

/* --- SOBRE MI --- */
.aboutme {
    width: 70%;
    height: auto;
    margin: 0 auto;
    padding: 2%;
    margin-bottom: 2%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap
}
.aboutme h2{
    width: 100%;
}
.aboutme p {
    width: 60%;
    margin-top: 2%;
    margin-left: 5%;
    font-size: 1.3em;
    color: #696969;
}
.sobremiLogo {
    position: relative;
    width: 30%;
    height: 100%;
    padding: 5%;
    padding-top: 0;
}
.sobremiLogo img {
    width: 100%;
    height: auto;
    margin: 0 auto;
    border: 2px solid rgb(128, 42, 240);
    box-shadow: 4px 4px 1px rgb(128, 42, 240);
    border-radius: 10px;
}

/* --- CONTACTO --- */
.contact {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 auto;
    padding: 10%;
    padding-top: 5%;
    background: #33007537;
}
.social {
    position: relative;
    margin-left: 5%;
    margin-top: 3%;
    width: 30%;
    height: 40vh;
}
.social p {
    margin-top: 5%;
    font-size: 1.4em;
    letter-spacing: 0.10em;
    word-spacing: 0.15em;
}
.social p span i {
    color: #696969;
    font-family: Lemon;
    font-size: 1em;
}
.social-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-left: 15%;
}
.social-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
.social-nav li {
    margin-right: 10px;
    margin-bottom: 5%;
}
.social-nav a { text-decoration: none; color: #333; }
.social-nav img {
    width: 30%;
    height: 100%;
    filter: invert(21%) sepia(100%) saturate(5000%) hue-rotate(270deg) brightness(80%);
}
.social-nav img:hover {
    filter: invert(21%) sepia(100%) saturate(5000%) hue-rotate(270deg) brightness(40%);
}

/* Formulario */
form {
    width: 40%;
    min-width: 30rem;
    height: 50vh;
    background-color: transparent;
    margin-right: 15%;
    border-radius: 10px;
    padding: 30px 40px;
}
form h1 {
    font-size: 40px;
    text-align: center;
    font-family: "Poppins", sans-serif;
}
.input_box, .textarea_box {
    width: 100%;
    margin: 30px 0;
    position: relative;
}
.input_box { height: 50px; }
.textarea_box { height: 100px; }
.input_box input,
.textarea_box textarea {
    width: 100%;
    height: 100%;
    background: white;
    outline: none;
    border: 2px solid rgb(102, 0, 234);
    border-radius: 5px;
    font-size: 16px;
    color: black;
    font-family: "Poppins", sans-serif;
    box-shadow: 4px 4px 1px rgb(102, 0, 234);
}
.input_box input { padding: 20px 45px 20px 20px; }
.textarea_box textarea {
    padding: 11px 45px 20px 20px;
    overflow: hidden;
    resize: none;
}
.input_box input::placeholder,
.textarea_box textarea::placeholder {
    color: black;
    font-family: "Poppins", sans-serif;
}
input:focus, textarea:focus {
    border: 2px solid #EAB000;
}
form button {
    width: 20%;
    height: 50px;
    border-radius: 5px;
    border: none;
    outline: none;
    font-family: "Poppins", sans-serif;
    font-size: 30px;
    font-weight: 500;
    background-color: white;
    color: rgb(102, 0, 234);
    border: 2px solid rgb(102, 0, 234);
    cursor: pointer;
    box-shadow: 4px 4px 1px rgb(102, 0, 234);
}
form button:hover {
    box-shadow: 1px 1px 1px rgb(102, 0, 234);
    background-color: rgb(102, 0, 234);
    color: white;
}
:focus-visible {
    outline: 2px solid var(--color-general);
    outline-offset: 2px;
}

/* --- FOOTER --- */
footer {
    height: 5px;
    text-align: center;
    padding: 1%;
    padding-bottom: 2%;
    background-color: var(--color-general);
    font-size: 1.3em;
    color: white;
}

/* =========================================
   8. ANIMACIONES
   ========================================= */

/* Elementos ocultos inicialmente para efecto scroll */
.header, .projectsCard, .skills, .contact, .aboutme {
    -webkit-transform: translateY(50px);
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.8s ease;
}
.visible {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
}
@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}
@keyframes floatSubtleDesktop {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; transform: translateY(90vh) scale(1); }
    90% { opacity: 0.6; transform: translateY(10vh) scale(1); }
    100% { opacity: 0; transform: translateY(0) scale(0); }
}

/* =========================================
   9. RESPONSIVE (MEDIA QUERIES)
   ========================================= */
/* Tablets / Laptops Pequeños (576px - 1024px) */
@media (min-width: 575.99px) and (max-width: 1024px) {
    
    /* Utilidad para <br> */
    .mobile-break { display: none; }
    
    /* Nav */
    .hamburger img {
        width: 7%;
        position: fixed;
        top: 3.25%;
        right: 5%;
    }
    .nav span {
        top: -200%;
        padding-top: 0;
    }

    /* Header */
    .header {
        width: 95%;
        height: auto;
        flex-direction: column;
    }
    .header h1 { font-size: 3em; }
    .headerText {
        position: relative;
        width: auto;
        height: 100%;
    }
    .headerText p { font-size: 1.5em; }
    .subtitle { display: block; margin: 0.5%; }
    .headerLogo { width: 80%; }
    .headerLogo img {
        width: 100%;
        border-radius: 300px;
    }
    .flechaScroll { display: none; }

    /* Projects */
    .projects {
        width: 95%;
        margin-top: 20%;
    }
    .projectsCard {
        width: 100%;
        height: 28vh;
    }
    .projectsCard img { margin-top: 0; }
    .cardInfo p { font-size: 0.7em; }
    .etiquetasCartas {
        display: block;
        width: 35%;
        margin-top: 2%;
    }

    /* Skills */
    .skills { width: 95%; padding: 5%; }
    .gridSkills { width: 100%; padding: 5%; justify-content: space-around; }
    .gridSkills img { width: 90px; height: 90px; }
    /* About */
    .aboutme { width: 95%; margin-bottom: 5%; }
    .aboutme p {
        width: 100%;
        text-align: center;
        word-spacing: -0.5px;
        overflow-wrap: break-word;
    }

    /* Contact */
    .contact {
        width: 100%;
        flex-direction: column;
    }
    .contact h2 { font-size: 2.9em; }
    .contact p { font-size: 2.3em; }
    .social {
        margin-left: 5%;
        margin-top: 3%;
        width: 90%;
        height: auto;
        text-align: center;
        word-spacing: -0.5px;
        overflow-wrap: break-word;
    }
    .social-nav { padding-left: 0; }
    .social-nav li { margin-right: 5px; margin-bottom: 5%; }
    .social-nav img { width: 30%; }
    form {
        width: 100%;
        min-width: 10rem;
        height: auto;
        margin: 5% 0 0 0;
        padding: 0;
    }
    form button { width: 100%; }
    footer {
        height: 55px;
        padding-top: 1.5%;
    }
}

/* Móviles (< 576px) */
@media (max-width: 575.98px) {
    /* Nav */
    .nav span {
        transition: all 300ms;
        top: -100%;
        opacity: 0;
    }
    .hamburger {
        width: 40px;
        height: 40px;
        top: 3%;
        right: 5%;
    }
    .hamburger img {
        width: 7%;
        height: auto;
        position: fixed;
        top: 3%;
        right: 5%;
    }
    .containerdarkmode {
        position: relative;
        width: 40px;
        height: 40px;
        margin-top: -3%;
        margin-left: 5%;
        z-index: 9999;
    }
    
    /* General Typography */
    h1 { font-size: 1.5em; }
    
    /* Header */
    .header {
        width: 95%;
        height: auto;
        flex-direction: column;
        margin-top: 5%;
    }
    .headerText {
        width: 100%;
        height: 100%;
        font-size: 1.3em;
        text-align: center;
        word-spacing: -0.5px;
        overflow-wrap: break-word;
        line-height: 1.4;
    }
    .headerText p.text-light-mode { margin-top: 10%; }
    .subtitle { display: block; }
    .headerLogo { width: 80%; }
    .flechaScroll { display: none; }
    
    /* Projects */
    .projects { width: 95%; margin-top: 20%; }
    .projectsCard { width: 100%; height: 60vh; background-position-y: 0px; }
    .cardInfo p { font-size: 0.7em; }
    .etiquetasCartas { display: none; }
    
    /* Skills */
    .skills { width: 95%; padding: 5%; margin-top: 20%; }
    .gridSkills { width: 100%; padding: 10%; justify-content: space-around; }
    
    /* About */
    .aboutme { width: 95%; margin-bottom: 5%; }
    .aboutme p {
        width: 100%;
        text-align: center;
        word-spacing: -0.5px;
        overflow-wrap: break-word;
        margin-top: 5%;
    }
    
    /* Contact */
    .contact {
        width: 100%;
        flex-direction: column;
        flex-wrap: wrap;
        height: auto;
    }
    .social {
        margin: 5% 2%;
        width: 95%;
        height: auto;
        text-align: center;
    }
    .social h2 { font-size: 1.8em; }
    .social p { word-spacing: -0.5px; overflow-wrap: break-word; }
    .social-nav { padding-left: 0; }
    .social-nav li { margin-right: 5px; margin-bottom: 5%; }
    .social-nav img { width: 45%; }
    form {
        position: relative;
        width: 100%;
        min-width: 10rem;
        min-height: 50vh;
        height: auto;
        margin-top: 1%;
        padding: 0;
    }
    form button { width: 100%; }
    footer {
        height: 55px;
        padding-top: 4%;
    }
}

/* utilidades Desktop */
@media (min-width: 768px) {
    .mobile-break { display: none; }
}