:root {
    --color1: #1793e2;
    --color2: hsl(188, 86%, 53%);
    --color3: hsl(270, 83%, 46%);
    --color4: #2e5b22;
    --color5: #3158aa;
    --color6: hsl(270, 83%, 46%, .9);
    --unit: 1.6px;
    --color7p: rgb(12,88,255);
    --color7n: rgb(243, 167, 0);
    --color-back: rgb(20, 20, 20);
}

html, body {
    overflow: visible !important;
    overflow-x: clip !important; /* Permite el scroll vertical normal sin romper el sticky */
}

html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: calc(var(--unit) * 20);
    background-color: var(--color-back);
    color: white;
}

h1, h2, h3, p {
    margin: 0;
    padding: 0;
}

header {
    background-color: #000000;
    height: 80px; /* Alto fijo estable en píxeles */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    
    /* Sticky Header */
    position: -webkit-sticky; /* Soporte para Safari */
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-evenly;
    gap: 45px;
    font-weight: 400;
}

a:hover {
    color: var(--color2);
}

.object-logo {
    display: flex;
}

#logo {
    height: 90px;
}

#head-logo {
    width: 150px;
}

.hamb_menu {
    display: none;
}

@media (max-width: 728px) {
    header {
        position: fixed;
        width: 100%;
        height: auto;
        padding: 15px 25px;
        flex-wrap: wrap; /* Permite que el nav baje al hacer clic */
    }

    .hamb_menu {
        display: flex;
        height: 40px;
        cursor: pointer;
        transition: transform 0.25s ease;
    }

    .hamb_menu:hover {
        transform: scale(1.05);
    }

    nav {
        display: flex;
        flex-direction: column; /* Despliegue vertical */
        width: 100%;
        gap: 20px;
        padding: 0;

        /* Efecto de cascada */
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    /* Estado visible cuando JavaScript activa la clase */
    nav.menu-active {
        max-height: 300px; /* Altura máxima suficiente para revelar los 3 enlaces */
        opacity: 1;
        padding: 20px 0 10px 0;
    }

    nav a {
        font-size: 20px;
        text-align: center;
    }
}

nav a {
    font-size: 22px;
    text-decoration: none;
    color: white;
}

/* Transición suave para la propiedad opacity */
header {
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Clase que aplicará JavaScript para desvanecer y ocultar la barra */
header.header-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Evita interacciones mientras está oculta */
}

/* SUPER CONTAINER */
.super-container {
    padding: 0px;
}

/* Welcome section */
.welcome {
    background: url("../img/back11.png") 30% no-repeat;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: calc(100vh - 80px); /* Ocupa el resto de la pantalla inicial */
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    row-gap: 2.5vh;
    padding: 0 36px 0 10%;
    box-sizing: border-box;
}

h1 {
    font-size: 75px;
}

#icon1 {
    width: 225px;
    position: absolute;
    left: 0%;
    opacity: 75%;
    transform: rotate(-15deg);
    z-index: 0;
}

.welcome-subtext {
    font-size: 42px;
}

.web-dev {
    color: #ff44bb;
    font-weight: 700;
    font-size: 40px;
}

.data {
    color: var(--color2);
    font-weight: 700;
    font-size: 40px;
}

@media(max-width: 728px) {
    .welcome {
        height: 100vh;
    }
}

@media(max-width: 420px) {
    h1 {
        font-size: 70px;
    }

    .welcome-subtext {
        font-size: 32px;
    }
}

/* Ajustes para el texto y botones en Welcome */
.welcome {
    /* Mantenemos tus propiedades actuales y ajustamos el flujo vertical */
    row-gap: 2.5vh;
}

.welcome-subtext .data {
    color: var(--color2); /* Tu azul/cian de marca */
    font-weight: 700;
    font-size: 38px;
    line-height: 1.2;
}

/* Tagline explicativo */
.hero-tagline {
    font-size: 1.1rem;
    color: #b0b0c0;
    max-width: 580px;
    line-height: 1.5;
    margin: 0;
}

/* Botones CTA */
.welcome-cta {
    display: flex;
    gap: 16px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-primary-hero {
    background-color: var(--color2);
    color: #000000;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-primary-hero:hover {
    transform: translateY(-2px);
    background-color: #ffffff;
}

.btn-secondary-hero {
    border: 2px solid #3b3b4d;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-secondary-hero:hover {
    transform: translateY(-2px);
    border-color: var(--color2);
    color: var(--color2);
}

/* Adaptación para pantallas pequeñas */
@media(max-width: 728px) {
    .welcome {
        padding-left: 36px; /* Centra el margen en móviles */
    }

    .welcome-subtext .data {
        font-size: 28px;
    }

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

    .welcome-cta {
        width: 100%;
    }

    .btn-primary-hero, .btn-secondary-hero {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@media(max-width: 420px) {
    h1 {
        font-size: 52px; /* Reducido ligeramente para evitar saltos bruscos en teléfonos muy estrechos */
    }
}

/* About container */
/* About container */
#about {
    padding: 64px 20px;
    max-width: 1050px;
    margin: 0 auto;
}
.about-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Columna de texto ligeramente más ancha */
    align-items: center;
    justify-items: center;
    margin-top: 32px;
    gap: 48px; /* Gap reducido para mejor distribución */
}

#about-logo {
    width: 100%;
    max-width: 300px; /* Evita que la imagen se desborde */
    height: auto;
}

.about-container article {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Reducido de 40px para acercar el botón al texto */
    align-items: flex-start; /* Alinea botón y párrafos a la izquierda */
}

.about-container article p {
    font-size: 1.05rem; /* ~17px */
    font-weight: 400;
    line-height: 1.6; /* Aire entre líneas de texto */
    letter-spacing: 0.3px; /* Reducido para lectura fluida */
    color: #e0e0e0;
    margin: 0;
}

/* Botón estilizado y alineado */
.boton-cv {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    border: 2px solid #1fe8e8;
    background-color: #1fe8e8;
    color: #000000;
    width: auto;
    padding: 10px 24px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
}

.boton-cv:hover {
    background-color: transparent;
    color: #1fe8e8;
    cursor: pointer;
    transform: translateY(-2px);
}

/* Responsivo para tablets y móviles */
@media (max-width: 768px) {
    .about-container {
        display: flex;
        flex-direction: column-reverse; /* Pone la imagen abajo o arriba según prefieras */
        text-align: center;
        gap: 32px;
    }

    .about-container article {
        align-items: center; /* Centra el botón en móvil */
    }
}

/* Evita que el header pegajoso tape los títulos al hacer clic en el menú */
#about, #projects, #contact {
    scroll-margin-top: 90px;
}

/* Project section */
h2 {
    text-align: center;
    font-size: 40px;
    background: linear-gradient(90deg, #ff44bb 0%, #6542d1 70%);
    -webkit-background-clip: text;
    color: transparent;
}

.grd-2 {
    background: linear-gradient(90deg, var(--color1), var(--color2));
    -webkit-background-clip: text;
    color: transparent;
}

.project-title {
    background-color: var(--color1);
}

hr {
    width: 35%;
}

.projects {
    background-color: black;
    background-image: url("../img/back-projects.png");
    background-repeat: no-repeat;
    background-position: 65%;
    background-size: cover;
    padding: 64px 0;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    padding: 20px;
    max-width: 1080px;
    margin: 0 auto;
    gap: 25px;
}

/* Tarjeta de proyecto */
.project-container {
    display: flex;
    flex-direction: row;
    background: linear-gradient(-135deg, #6542d1cc, black);
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    box-sizing: border-box;
    height: auto; /* Permite que la tarjeta crezca si hay más texto */
}

.grd-2-back {
    background: linear-gradient(-135deg, #1793e2cc 45%, black);
}

/* Contenedor e imagen */
.img-container {
    width: 40%;
    min-width: 160px;
    flex-shrink: 0;
}

.project-image {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 260px;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

.img-a {
    transition: .3s ease;
    display: block;
    height: 100%;
}

.img-a:hover {
    transform: scale(1.03);
}

/* Información del proyecto */
.title-tech-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 0 0 15px;
    width: 60%;
    height: auto; /* Eliminada la restricción rígida de 275px */
    box-sizing: border-box;
}

h3 {
    color: white;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
    margin: 0 0 10px 0;
    line-height: 1.25;
}

.project-description {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.4;
    margin: 0 0 15px 0;
    height: auto; /* Sin restricciones para que no se salga del contenedor */
}

/* Tecnologías / Íconos */
.tech-stack {
    list-style: none;
    padding: 0;
    margin: auto 0 0 0; /* Empuja los íconos al fondo de la tarjeta */
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tech {
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    width: 38px;
    height: 30px;
}

.html { background-color: #f06529; }
.css { background-color: #264de4; }
.js { background-color: #f0db4f; color: #323330; }
.python { background-color: #356f9f; }
.tf, .pd { background-color: white; }

.project_a {
    text-decoration: none;
}

.project_a h3:hover {
    color: var(--color1);
}

.svgim {
    width: 25px;
}

.svgtf {
    width: 35px;
}

/* Botones de acción del proyecto destacado */
.project-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 15px;
}

.btn-case {
    background-color: #1fe8e8;
    color: #000000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-case:hover {
    background-color: #ffffff;
}

.btn-notebook {
    color: #ff9d00;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #ff9d00;
    padding: 5px 12px;
    border-radius: 5px;
    transition: all 0.2s;
}

.btn-notebook:hover {
    background-color: rgba(255, 157, 0, 0.15);
}

.github-icon {
    display: inline-block;
    margin-top: 8px;
    color: #ffffff;
    transition: color 0.2s;
}

.github-icon:hover {
    color: #1fe8e8;
}

/* Proyecto Destacado (1 Columna completa en la cuadrícula si aplica) */
.project-container.featured-card {
    grid-column: 1 / -1;
}

/* Media Queries (Ajustes para Tablets y Teléfonos) */
@media (max-width: 850px) {
    .projects-container {
        grid-template-columns: 1fr; /* Una sola columna para móviles */
        padding: 15px;
    }

    .project-container {
        flex-direction: column; /* Apilado vertical en pantallas pequeñas */
        max-width: 100%;
    }

    .img-container {
        width: 100%;
        max-width: 100%;
    }

    .project-image {
        height: 200px;
        width: 100%;
    }

    .title-tech-stack {
        width: 100%;
        padding: 15px 0 0 0;
    }

    .project-description {
        font-size: 1rem;
    }
}
/* Contact section */
.contact {
    font-size: 25px;
    padding: 64px 20px;
    background-color: #0b0b0d;
}

.contact-container {
    display: flex;
    max-width: 1080px;
    margin: 48px auto 0 auto;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

/* Columna Izquierda: Redes Sociales y Logo */
.rs-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    width: 100%;
    max-width: 400px;
}

.rs-container {
    background-color: #16161a;
    border: 1px solid #262633;
    border-radius: 8px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.title-rs {
    width: 100%;
    margin: 0;
    background: linear-gradient(90deg, #1793e2, #106297);
    height: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
}

.socialw {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 15px;
    margin: 0;
    gap: 10px;
}

.socialw li {
    background-color: #22222b;
    border-radius: 6px;
    height: 48px;
    transition: background 0.2s, transform 0.2s;
}

.socialw li:hover {
    background-color: #2d2d3a;
    transform: translateX(4px);
}

li a {
    text-decoration: none;
    color: #ffffff;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-size: 1rem;
    font-weight: 600;
    box-sizing: border-box;
}

.logo-contact {
    width: 120px;
    height: auto;
}

/* Columna Derecha: Formulario de Mensaje */
form {
    width: 100%;
    max-width: 440px;
    height: auto; /* Permite flexibilidad */
}

.form-container {
    background-color: #16161a; /* Cambiado de rgb(150, 160, 175) a tema oscuro */
    border: 1px solid #262633;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.title-msj {
    width: 100%;
    background: linear-gradient(90deg, #ff44bb, #991d6e);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 50px;
    box-sizing: border-box;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 600;
}

.cross-svg {
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.cross-svg:hover {
    opacity: 0.8;
}

fieldset {
    display: flex;
    flex-direction: column;
    border: none;
    padding: 25px;
    margin: 0;
    gap: 15px;
}

label {
    font-size: 0.95rem;
    color: #c0c0d0;
    font-weight: 600;
    text-align: left;
    margin: 0;
    max-width: 100%;
}

input, textarea {
    width: 100%;
    border: 1px solid #2a2a38;
    border-radius: 6px;
    background-color: #0f0f11; /* Integrado al tono oscuro */
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 12px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input {
    height: 42px;
}

textarea {
    height: 100px;
    resize: vertical;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #1fe8e8;
}

#boton-send {
    margin-top: 10px;
    width: 100%;
    height: 44px;
    background-color: #1fe8e8;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

#boton-send:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
}

/* Media Queries Responsivos */
@media (max-width: 856px) {
    .contact-container {
        flex-direction: column-reverse;
        align-items: center;
    }

    .rs-logo-container, form {
        max-width: 100%;
    }
}

/* Footer Global */
footer {
    background-color: #070709;
    border-top: 1px solid #1c1c24;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.foot-container {
    color: #707080;
    font-size: 0.9rem;
    text-align: center;
}
