/* =============================
   VARIABLES Y ESTILOS GLOBALES
   ============================= */
:root {
    --color-primary: #66DDAA;
    /* Verde menta vibrante */
    --color-dark: #121212;
    --color-light: #ffffff;
    --color-gray: #f0f0f0;
    --color-text: #333;
    --font-family: 'Inter', sans-serif;
    --container-width: 1100px;
}

/* Reset básico y box-sizing universal */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-light);
}

p {
    margin: .5rem 0 1rem
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.3s ease;
}

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

h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 3rem;
}


/* =============================
   COMPONENTES REUTILIZABLES
   ============================= */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: transparent;
    color: var(--color-primary);
    outline: none;
}

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

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--color-dark);
    color: var(--color-light);
    outline: none;
}



/* =============================
   HEADER / NAVEGACIÓN
   ============================= */
.header {
    background-color: var(--color-light);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.nav-logo {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--color-dark);
}

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

.nav-link {
    color: var(--color-text);
    font-weight: 700;
    transition: color 0.3s;
}


/* =============================
   HERO SECTION
   ============================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
    background-color: var(--color-gray);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('../images/hero-01.jpg');
    background-size: cover;
    background-position: 100% center;
    opacity: 0.25;
    z-index: 1;
}

@media (max-width: 992px) {
    .hero::before {
        background-image: none !important;
    }
}


.hero-content {
        position: relative;
        z-index: 2;
        max-width: 600px;
        margin: 0 auto;
        /* Centrado por defecto */
}

@media (max-width: 600px) {
    .hero {
        padding: 0 0.5rem;
        min-height: 70vh;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    .hero-content {
        margin: 0 auto;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 2rem 0.5rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    max-width: 800px;
    margin: 0 auto 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* =============================
   PROJECTS SECTION
   ============================= */
.projects {
    padding: 6rem 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.project-card {
    background: var(--color-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-info {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.project-description {
    text-align: justify;
    margin-bottom: 1.5rem;
}

.project-info .btn {
    display: block;
    text-align: center;
    margin: 0 auto;
    width: fit-content;
}


/* =============================
   ABOUT SECTION
   ============================= */
.about {
    padding: 6rem 2rem;
    background-color: var(--color-gray);
}

.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: var(--container-width);
    margin: 0 auto;
}

.about-image {
    width: 400px;
    height: 400px;
    object-fit: cover;
    border-radius: 10%;
}

.about-text p {
    margin-bottom: 1.5rem;
    text-align: justify;
}


/* =============================
   CONTACT SECTION
   ============================= */
.contact {
    padding: 6rem 2rem;
    text-align: center;
}

.contact-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.social-links {
    margin-top: 2rem;
}

.social-links a {
    margin: 0 1rem;
    font-weight: 700;
    font-size: 1.1rem;
}


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


/* =============================
   MEDIA QUERIES PARA RESPONSIVIDAD
   ============================= */

/* Tablets y pantallas medianas (≤ 768px) */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

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

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        margin-bottom: 2rem;
    }

    .projects,
    .about,
    .contact {
        padding: 4rem 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }
}

/* Móviles (≤ 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .navbar {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* =============================
   BOTÓN VOLVER ARRIBA
   ============================= */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-primary);
    color: var(--color-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

/* Mostrar el botón cuando se agrega la clase .show */
.back-to-top.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus {
    background-color: var(--color-gray);
    color: var(--color-primary);
    outline: none;
}


/* =============================
   ENLACE DE NAVEGACIÓN ACTIVO
   ============================= */
.nav-link.active {
    color: var(--color-primary);
    font-weight: 900;
}

.nav-link:hover,
.nav-link:focus {
    color: #47B38B;
    outline: none;
}


/* =============================
   SECCIÓN YOUTUBE
   ============================= */
.youtube-section {
    padding: 6rem 2rem;
    background-color: var(--color-gray);
    text-align: center;
}

.youtube-content {
    max-width: 900px;
    margin: 0 auto;
}

.youtube-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    text-align: justify;
}

/* Video responsivo (16:9) */
.video-responsive-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
    margin-bottom: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* ====== NAV: HAMBURGUESA (móvil/tablet) ====== */
.nav-toggle { display: none; } /* input oculto */

.nav-toggle-label {
  display: none; cursor: pointer;
  width: 44px; height: 36px;
  align-items: center; justify-content: center;
  gap: 6px; flex-direction: column;
  margin-left: auto;
  position: relative; /* Necesario para que z-index funcione */
  z-index: 1001; /* CAMBIO CLAVE 1: Lo pone por encima de todo */
}

.nav-toggle-label span {
  display: block; width: 26px; height: 3px;
  background: var(--color-dark);
  border-radius: 3px; transition: transform .25s ease, opacity .25s ease;
}

/* Estado "X" cuando el menú está abierto (checkbox checked) */
#nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
#nav-toggle:checked + .nav-toggle-label span:nth-child(2) {
  opacity: 0;
}
#nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Layout móvil/tablet */
@media (max-width: 992px) {
  .nav-toggle-label { display: flex; }
  .nav-menu {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--color-light);
    display: flex; flex-direction: column;
    gap: 1rem; padding: 1rem 1.25rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 12px 28px rgba(0,0,0,.08);
    transform: translateY(-8px) scaleY(0.98);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 999; /* CAMBIO CLAVE 2: Justo debajo del header pero encima del contenido */
  }
  .nav-menu.open {
    opacity: 1; pointer-events: auto;
    transform: none;
  }
  /* enlaces más cómodos al tacto */
  .nav-menu .nav-link {
    padding: .6rem .25rem; font-size: 1rem;
  }
  /* evitar salto de layout del header */
  .header { padding: .75rem 0; }
  .navbar { width: 92%; }
}

/* Cuando el menú está abierto, bloquea scroll del body */
body.menu-open { overflow: hidden; }

/* ====== HERO: centrado y tipografía fluid ====== */
.hero {
  display: grid; place-items: center; 
  min-height: 100vh;
  padding: clamp(70px, 7vh, 120px) 1rem 2rem; /* separación del header fijo */
  text-align: center;
}

.hero::before {
  /* tu imagen ya está; añadimos leve degradado para contraste */
  background-position: center;
  opacity: 0.28;
}

.hero-content {
  max-width: min(900px, 92vw);
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2rem, 3.2vw + 1rem, 3.6rem);
  line-height: 1.15;
  font-weight: 900;
  margin-bottom: .75rem;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: clamp(1rem, .6vw + .9rem, 1.25rem);
  margin-bottom: 1.5rem;
  color: #444;
  text-wrap: pretty;
}

/* Ajustes extra en pantallas muy pequeñas */
@media (max-width: 480px) {
  .hero { min-height: 78vh; }
  .hero-title { font-size: clamp(1.8rem, 7vw, 2.3rem); }
  .hero-subtitle { font-size: 1rem; }
}

