/* ---------- Tokens & Variables ---------- */
:root {
  --bg: #0A0A0A;
  --bg-panel: #161616;
  --bg-panel-2: #1C1C1C;
  --yellow: #FFD100;
  --yellow-dim: #D6AE00;
  --text: #FFFFFF;
  --muted: #B3B3B3;
  --line: #272727;
  --radius: 4px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  line-height: 1.1;
  margin: 0 0 0.5em;
  font-weight: 600;
}

p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------- Espacios optimizados para celular ---------- */
section { 
  position: relative; 
  padding: 3rem 1.5rem; /* Espaciado reducido para móvil */
  max-width: var(--maxw); 
  margin: 0 auto; 
}
section > h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.section-lede { max-width: 46ch; margin-top: -0.5rem; margin-bottom: 2.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; /* Evita el salto brusco al hacer scroll */
  top: 0; 
  left: 0;
  width: 100%;
  z-index: 40;
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 1rem; 
  /* Centra el logo y el menú al mismo ancho del texto de la página */
  padding: 1.5rem max(1.5rem, calc((100vw - var(--maxw)) / 2)); 
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  /* Reduce el alto pero mantiene el centrado lateral */
  padding: 0.75rem max(1.5rem, calc((100vw - var(--maxw)) / 2));
  border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; }

.logo-img { 
  height: 120px; 
  width: auto; 
  transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.site-header.scrolled .logo-img { height: 46px; }

/* ---------- Menú de Navegación ---------- */
.main-nav { 
  display: none; 
  gap: 3rem; 
  align-items: center;
}

.main-nav a { 
  color: var(--text); 
  font-size: 1.05rem; 
  font-weight: 500;
  transition: color 0.15s ease; 
}

.main-nav a:hover { color: var(--yellow); }

.btn-wsp {
  display: none;
  background: var(--yellow); 
  color: #0A0A0A; 
  font-weight: 600;
  padding: 0.6rem 1.1rem; 
  border-radius: var(--radius); 
  font-size: 0.9rem;
  white-space: nowrap; 
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-wsp:hover { 
  background: var(--yellow-dim); 
  transform: translateY(-1px); 
}

/* Botón Hamburguesa (Móvil) */
.nav-toggle {
  background: none; 
  border: 1px solid var(--line); 
  border-radius: var(--radius);
  width: 44px; 
  height: 40px; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 6px; 
  cursor: pointer;
  padding: 0;
}

.nav-toggle span { 
  display: block; 
  width: 20px; 
  height: 2px; 
  background-color: var(--text); 
  border-radius: 2px;
}

@media (min-width: 860px) {
  .site-header.scrolled .logo-img { height: 54px; }
  .main-nav { display: flex; }
  .btn-wsp { display: inline-block; }
  .nav-toggle { display: none; }
}

/* Menú desplegable en móvil */
.main-nav.open {
  display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-panel); padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
  gap: 1.5rem;
}

/* ---------- Hero (Banner 50/50) ---------- */
.hero { 
  /* Agregamos espacio superior para que el texto no quede debajo del logo flotante */
  padding-top: 10rem; 
  padding-bottom: 3rem; 
  position: relative; 
  z-index: 1; 
}

.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  width: 100%;
}

.hero-copy { max-width: 640px; }
.hero-visual { width: 100%; }
.hero-visual img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--line);
}

@media (min-width: 860px) {
  .hero {
    /* Espacio superior extra para monitores de PC */
    padding-top: 12rem; 
    padding-bottom: 4rem;
  }
  
  .hero-wrapper {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
  }
  .hero-copy { flex: 1 1 50%; max-width: 50%; }
  .hero-visual { flex: 1 1 50%; max-width: 50%; }
}

.hero-kicker {
  color: var(--yellow); font-size: 0.95rem; margin-bottom: 0.75rem;
  opacity: 0; animation: rise 0.6s ease forwards;
}
.hero h1 {
  font-size: clamp(2rem, 5.4vw, 3.4rem); color: var(--text);
  opacity: 0; animation: rise 0.6s ease 0.1s forwards;
}
.hero-lede {
  font-size: 1.05rem; max-width: 52ch;
  opacity: 0; animation: rise 0.6s ease 0.2s forwards;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.75rem 0;
  opacity: 0; animation: rise 0.6s ease 0.3s forwards;
}
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  opacity: 0; animation: rise 0.6s ease 0.4s forwards;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-kicker, .hero h1, .hero-lede, .hero-actions, .hero-badges, .hero-visual { opacity: 1; animation: none; }
}

.btn-primary {
  background: var(--yellow); color: #0A0A0A; font-weight: 600;
  padding: 0.85rem 1.6rem; border-radius: var(--radius);
  display: inline-block; transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { background: var(--yellow-dim); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,209,0,0.25); }
.btn-primary--lg { font-size: 1.05rem; padding: 1rem 2rem; }

.btn-ghost {
  border: 1px solid var(--line); padding: 0.85rem 1.6rem; border-radius: var(--radius); color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }

.hero-badges span {
  border: 1px solid var(--line); border-left: 3px solid var(--yellow);
  padding: 0.4rem 0.8rem; font-size: 0.85rem; color: var(--muted); border-radius: 2px;
}

/* SECCIONES AMARILLAS (Servicios, Nosotros, Contacto)  */

.services, .about, .contact {
  color: #0A0A0A;
  z-index: 1;
}

.services::before, .about::before, .contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  height: 100%;
  background: var(--yellow);
  z-index: -1;
}

.services h2, .services h3, .services p,
.about h3, .about p,
.contact h2, .contact p, .contact .section-lede {
  color: #0A0A0A;
}

/* ---------- Servicios (Tarjetas Blancas) ---------- */
.services-grid { display: grid; gap: 1.5rem; margin-top: 2.5rem; }

.service-card {
  background: #FFFFFF; 
  border: none;
  border-left: 4px solid #0A0A0A; 
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 1.75rem; 
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.service-card h3 { color: #0A0A0A; font-size: 1.2rem; }
.service-card p { margin: 0; color: #333333; }

@media (min-width: 720px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .service-card--offset { transform: translateY(1.75rem); }
  .service-card--offset:hover { transform: translateY(1.35rem); }
}

/* ---------- Nosotros (Misión y Visión) ---------- */
.about { padding-top: 3rem; padding-bottom: 3rem; }

.about-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* Reducimos el espacio en móvil para compactar la vista */
}

.about-intro {
  font-size: 0.95rem; /* Letra ajustada para pantallas pequeñas */
  color: #0A0A0A;
  margin-bottom: 1rem;
  max-width: 60ch;
}

.about-grid { display: grid; gap: 1.5rem; }

.about-item {
  background: #FFFFFF; 
  border: none;
  border-left: 4px solid #0A0A0A; 
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); 
  padding: 1.75rem; 
  border-radius: var(--radius);
}

.about-item h3 { 
  color: #0A0A0A; 
  font-size: 1.2rem; 
  margin-bottom: 0.5rem; 
}

.about-item p { 
  margin: 0; 
  color: #333333; 
  font-size: 1rem; 
}

.about-visual { width: 100%; }
.about-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 2px solid #0A0A0A;
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

/* Devolvemos los espacios amplios en computadores */
@media (min-width: 860px) {
  section { padding: 5rem 1.5rem; }
  .hero { padding-top: 12rem; padding-bottom: 4rem; }
  
  .about-container { flex-direction: row; align-items: center; justify-content: space-between; gap: 2.5rem; }
  .about-intro { font-size: 1.05rem; margin-bottom: 2.5rem; }
  .about-content { flex: 1.2; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .about-visual { flex: 0.8; max-width: 450px; }
}

/* ---------- Modal de Proyectos ---------- */
.project-item { cursor: pointer; } 

.modal {
  display: none; 
  position: fixed; z-index: 100; left: 0; top: 0;
  width: 100%; height: 100%; overflow: auto;
  background-color: rgba(10, 10, 10, 0.95); 
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center; flex-direction: column;
}

.modal.show { display: flex; } 

.modal-content {
  max-width: 90%; max-height: 80vh;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

#modalCaption {
  margin-top: 1rem; color: var(--yellow);
  font-size: 1.1rem; font-weight: 600;
}

.close-modal {
  position: absolute; top: 20px; right: 35px;
  color: var(--muted); font-size: 40px; font-weight: bold;
  cursor: pointer; transition: color 0.2s ease;
}

.close-modal:hover { color: var(--yellow); }

/* ---------- Contacto ---------- */
.contact { text-align: center; }
.contact .section-lede { margin-left: auto; margin-right: auto; }

.contact .btn-primary {
  background: #0A0A0A;
  color: var(--yellow);
}
.contact .btn-primary:hover {
  background: #222222;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* SECCIONES OSCURAS                */

/* ---------- Cómo trabajamos ---------- */
.process { z-index: 1; }
.process-list { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
.process-list li { display: flex; gap: 1.25rem; align-items: flex-start; }
.process-num { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.4rem; color: var(--yellow); line-height: 1.2; }
.process-list h3 { font-size: 1.05rem; color: var(--text); margin-bottom: 0.25rem; }
.process-list p { margin: 0; }
@media (min-width: 720px) { .process-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Proyectos ---------- */
.projects { z-index: 1; }
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 720px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }
.project-item { margin: 0; overflow: hidden; border-radius: var(--radius); }
.project-img {
  aspect-ratio: 4/3; border-radius: var(--radius); border: 1px solid var(--line);
  width: 100%; object-fit: cover; display: block; transition: transform 0.35s ease;
}
.project-item:hover .project-img { transform: scale(1.05); }
.project-item figcaption { margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 1.5rem 2rem; }
.footer-main { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2rem; }
@media (min-width: 720px) { .footer-main { grid-template-columns: repeat(3, 1fr); } }

.footer-logo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--yellow); margin-bottom: 0.4rem; }
.footer-contact p { margin: 0 0 0.3rem; font-size: 0.9rem; }
.footer-social { display: flex; gap: 1rem; align-self: start; flex-wrap: wrap; }
.footer-social p { width: 100%; margin: 0 0 0.3rem; font-size: 0.85rem; }
.footer-social a { transition: color 0.15s ease; }
.footer-social a:hover { color: var(--yellow); }
.footer-legal { text-align: center; font-size: 0.8rem; color: var(--muted); margin: 2rem 0 0; }

/* ---------- Floating WhatsApp ---------- */
.wsp-float {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 50;
  background: var(--yellow); color: #0A0A0A; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  transition: background 0.15s ease, transform 0.15s ease;
}
.wsp-float:hover { background: var(--yellow-dim); transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
