/*
 * styles.css — Estilos globales compartidos
 * Jonathan Reyes · yosoyjonathanreyes.com
 *
 * Contenido:
 *   1. Reset & base
 *   2. Variables CSS (design tokens)
 *   3. Starfield canvas
 *   4. Nebula / glow helpers
 *   5. Reveal animation
 *   6. Glass card utility
 *   7. Sección commons (labels, títulos, cuerpo)
 *   8. Botones globales (btn-primary, btn-secondary, btn-wa)
 *   9. Navegación (desktop + mobile hamburger)
 *  10. Footer
 */


/* ─────────────────────────────────────────
   1. RESET & BASE
   ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Scroll suave y sin desbordamiento horizontal en ambos niveles */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Lato', sans-serif;
  background: #050509;
  color: var(--text);
  overflow-x: hidden;
}

/* Tipografía consistente en todos los elementos — Lato como regla global,
   las cursivas usan Great Vibes y deben declararse explícitamente en el HTML. */
h1, h2, h3, h4, h5, h6 { font-family: 'Lato', sans-serif; }
p, li, a, span, button, input, textarea, label { font-family: 'Lato', sans-serif; }

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

a {
  text-decoration: none;
  color: inherit;
}


/* ─────────────────────────────────────────
   2. VARIABLES CSS (design tokens)
   ───────────────────────────────────────── */
:root {
  /* Fondos oscuros (navy) */
  --navy:       #050509;   /* Fondo principal */
  --navy-2:     #07070F;   /* Secciones alternas */
  --navy-3:     #090914;   /* Secciones terciarias */

  /* Verde marca */
  --green:      #22C55E;
  --green-dim:  rgba(34, 197, 94, 0.6);
  --green-glow: rgba(34, 197, 94, 0.15);

  /* Glassmorphism */
  --glass-bg:   rgba(255, 255, 255, 0.06);
  --glass-b:    rgba(255, 255, 255, 0.12);
  --glass-blur: blur(20px) saturate(160%);

  /* Escala de texto — 3 niveles de contraste sobre fondos oscuros */
  --text:     #F0F4F8;   /* Texto principal / títulos */
  --text-mid: #C8D6E4;   /* Texto secundario / párrafos */
  --text-low: #8FA3B8;   /* Texto terciario / metadatos */

  /* Curva de animación estándar */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}


/* ─────────────────────────────────────────
   3. STARFIELD CANVAS
   Fondo animado de estrellas (compartido en todas las páginas)
   ───────────────────────────────────────── */
#star-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}


/* ─────────────────────────────────────────
   4. NEBULA / GLOW HELPERS
   Manchas de color difuminadas para profundidad visual
   ───────────────────────────────────────── */
.nebula {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  z-index: 0;
}


/* ─────────────────────────────────────────
   5. REVEAL ANIMATION
   Los elementos con .reveal aparecen al entrar en viewport
   (activado por IntersectionObserver en main.js)
   ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}


/* ─────────────────────────────────────────
   6. GLASS CARD UTILITY
   Glassmorphism reutilizable como clase utilitaria
   ───────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-b);
}


/* ─────────────────────────────────────────
   7. SECCIÓN COMMONS
   ───────────────────────────────────────── */
section {
  position: relative;
}

/* Etiqueta superior de sección (ej. "Servicios", "Sobre mí") */
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

/* Título principal de sección */
.section-title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 16px;
}

/* Párrafo introductorio de sección */
.section-body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--text-mid);
}


/* ─────────────────────────────────────────
   8. BOTONES GLOBALES
   ───────────────────────────────────────── */

/* Botón de acción principal (verde sólido) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--green);
  color: #000;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 900;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}

/* Botón secundario (borde translúcido) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #CBD5E1;
  transition: border-color 0.25s, color 0.25s;
}
.btn-secondary:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Botón WhatsApp */
.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: #25D366;
  color: #000;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 900;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-wa:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}


/* ─────────────────────────────────────────
   9. NAVEGACIÓN
   Barra fija oscura con glassmorphism.
   .nav-mobile vive DENTRO de <nav id="nav"> para que
   position:absolute; top:100% se posicione relativo al nav fijo.
   ───────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 5, 9, 0.82);
  backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-logo img {
  height: 32px;
  width: auto;
}

/* Links desktop */
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
  transition: color 0.25s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
}

/* CTA en nav (texto negro sobre verde) */
.nav-cta {
  padding: 10px 22px;
  background: var(--green);
  color: #000 !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
}
.nav-cta:hover {
  background: #16A34A;
  color: #000 !important;
  transform: translateY(-1px);
}

/* Ícono hamburger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-burger:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
/* Estado abierto del hamburger */
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú desplegable mobile — DEBE estar dentro de <nav> */
.nav-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(5, 5, 9, 0.97);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px 24px 28px;
  flex-direction: column;
  gap: 6px;
}
.nav-mobile.open {
  display: flex;
}
.nav-mobile a {
  display: block;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.2s, color 0.2s;
}
.nav-mobile a:hover,
.nav-mobile a.active {
  background: rgba(34, 197, 94, 0.08);
  color: var(--green);
}
/* CTA dentro del menú mobile */
.nav-mobile .nav-cta {
  margin-top: 8px;
  text-align: center;
  display: block;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  color: #000 !important;
  background: var(--green);
}
.nav-mobile .nav-cta:hover {
  background: #16A34A;
  color: #000 !important;
}

/* Responsive nav */
@media (max-width: 768px) {
  #nav { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}


/* ─────────────────────────────────────────
   10. FOOTER
   Fondo oscuro (#030307) con grid de tres columnas
   ───────────────────────────────────────── */
#footer {
  background: #030307;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 72px 48px 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 64px;
  padding-bottom: 56px;
}

/* Columna de marca */
.footer-brand-logo {
  height: 70px;
  width: auto;
  margin-bottom: 18px;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 280px;
  margin-bottom: 28px;
}

/* Íconos sociales */
.footer-social {
  display: flex;
  gap: 10px;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.social-btn:hover {
  border-color: #22C55E;
  color: #22C55E;
  background: rgba(34, 197, 94, 0.08);
}

/* Columnas de navegación en footer */
.footer-nav-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 22px;
}

.footer-nav-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.footer-nav-col a {
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 400;
  transition: color 0.2s;
}
.footer-nav-col a:hover {
  color: #22C55E;
}

/* Barra inferior de copyright */
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-low);
}

/* Footer responsive */
@media (max-width: 900px) {
  #footer { padding: 56px 24px 0; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
