/* ==========================================================
   Sunqutech Ingeniería E.I.R.L. — Landing Page
   Índice:
   1. Variables y base      5. Secciones y tarjetas
   2. Utilidades            6. Contacto y formulario
   3. Navbar                7. Footer
   4. Hero                  8. Animaciones y responsive
   ========================================================== */

/* ---------- 1. Variables y base ---------- */
:root {
  --bg: #0a0e17;
  --bg-alt: #0d1117;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e6edf3;
  --muted: #94a3b8;
  --primary: #0070f3;
  --neon: #38e8ff;
  --success: #2dd4a7;
  --danger: #ff6b81;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --glow: 0 0 32px rgba(0, 112, 243, 0.35);
  --nav-h: 72px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h); /* evita que el navbar fijo tape los títulos */
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 2. Utilidades ---------- */
.container {
  width: min(1140px, 100% - 40px);
  margin-inline: auto;
}

/* Efecto glassmorphism reutilizable */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--neon));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon);
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--neon);
  background: rgba(56, 232, 255, 0.07);
  border: 1px solid rgba(56, 232, 255, 0.25);
  border-radius: 999px;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0a8cff);
  box-shadow: var(--glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 0 44px rgba(0, 112, 243, 0.55); }
.btn--ghost { color: var(--text); background: var(--surface); border-color: var(--border); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--neon); }

/* ---------- 3. Navbar ---------- */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
/* Clase añadida por JS al hacer scroll */
.navbar.is-scrolled {
  background: rgba(10, 14, 23, 0.78);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.navbar__actions { display: flex; align-items: center; gap: 14px; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark { width: 32px; height: 32px; filter: drop-shadow(0 0 8px rgba(0, 112, 243, 0.6)); }
.logo__text { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.logo__text span { color: var(--neon); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__link {
  position: relative;
  padding: 6px 0;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--neon));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}
.nav__link:hover,
.nav__link.is-active { color: var(--text); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__cta-mobile { display: none; }

/* Selector de idioma */
.lang {
  display: flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang__btn {
  padding: 4px 11px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang__btn.is-active { color: #fff; background: var(--primary); }

/* Botón hamburguesa */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hamburger span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 4. Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 90px) 0 100px;
  text-align: center;
  overflow: hidden;
  /* Rejilla técnica sutil de fondo */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero__glow {
  position: absolute;
  top: -180px;
  left: 50%;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(0, 112, 243, 0.32), transparent),
    radial-gradient(closest-side at 70% 60%, rgba(56, 232, 255, 0.14), transparent);
  filter: blur(20px);
  pointer-events: none;
}
.hero::after { /* funde la rejilla con la siguiente sección */
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 160px;
  background: linear-gradient(transparent, var(--bg));
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__title {
  max-width: 900px;
  margin: 26px auto 22px;
  font-size: clamp(2.2rem, 5.6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.hero__subtitle {
  max-width: 680px;
  margin: 0 auto 36px;
  font-size: clamp(1rem, 1.6vw, 1.16rem);
  color: var(--muted);
}
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 860px;
  margin: 70px auto 0;
}
.metric { padding: 26px 18px; transition: transform 0.25s, border-color 0.25s; }
.metric:hover { transform: translateY(-4px); border-color: rgba(56, 232, 255, 0.4); }
.metric__value {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(90deg, #fff, var(--neon));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.metric__label { display: block; margin-top: 8px; font-size: 0.9rem; color: var(--muted); }

/* ---------- 5. Secciones y tarjetas ---------- */
.section { padding: 100px 0; }
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section__head { max-width: 680px; margin: 0 auto 54px; text-align: center; }
.section__title {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.section__lead { margin-top: 14px; color: var(--muted); }

/* Nosotros */
.about { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.about__text p { margin-top: 18px; color: var(--muted); }
.about__facts { display: grid; gap: 16px; }
.about__facts li {
  padding: 20px 22px;
  border-left: 3px solid var(--primary);
}
.about__facts strong { display: block; font-weight: 600; }
.about__facts span { font-size: 0.92rem; color: var(--muted); }

/* Rejillas y tarjetas */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  padding: 30px;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 112, 243, 0.55);
  box-shadow: var(--shadow), var(--glow);
}
.card__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 20px;
  background: rgba(0, 112, 243, 0.12);
  border: 1px solid rgba(0, 112, 243, 0.35);
  border-radius: 13px;
}
.card__icon svg,
.contact__mail svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--neon);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card h3 { margin-bottom: 10px; font-size: 1.15rem; font-weight: 600; line-height: 1.35; }
.card p { font-size: 0.95rem; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags li {
  padding: 3px 11px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #a9c8ff;
  background: rgba(0, 112, 243, 0.1);
  border: 1px solid rgba(0, 112, 243, 0.25);
  border-radius: 999px;
}

/* ---------- 6. Contacto y formulario ---------- */
.contact { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.contact__info p { margin-top: 16px; color: var(--muted); }
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 16px 22px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.contact__mail:hover { border-color: var(--neon); box-shadow: var(--shadow), var(--glow); }
.contact__mail small { display: block; font-size: 0.78rem; color: var(--muted); }
.contact__mail strong { font-weight: 600; word-break: break-all; }

.form { display: grid; gap: 18px; padding: 32px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 0.86rem; font-weight: 500; color: var(--muted); }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.25);
}
.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--danger); }

/* Estados del botón Enviar (controlados desde script.js) */
.form__submit { width: 100%; }
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.form__submit.is-sending { pointer-events: none; opacity: 0.85; }
.form__submit.is-sending .spinner { display: block; }
.form__submit.is-sent {
  background: linear-gradient(135deg, #12a37f, var(--success));
  box-shadow: 0 0 32px rgba(45, 212, 167, 0.4);
  animation: pop 0.45s ease;
}
.form__status { min-height: 1.4em; font-size: 0.88rem; text-align: center; color: var(--success); }
.form__status.is-error { color: var(--danger); }

/* ---------- 7. Footer ---------- */
.footer { padding: 34px 0; font-size: 0.88rem; color: var(--muted); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}
.footer .logo__text { font-size: 1.05rem; color: var(--text); }
.footer a:hover { color: var(--neon); }

/* ---------- 8. Animaciones y responsive ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Aparición al hacer scroll (la clase .is-visible la añade JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* Tablet */
@media (max-width: 960px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }

  /* El menú pasa a ser un panel desplegable */
  .hamburger { display: flex; }
  .navbar__cta { display: none; }
  .nav {
    position: absolute;
    top: calc(var(--nav-h) + 8px);
    left: 20px;
    right: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    background: rgba(13, 17, 23, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    /* oculto por defecto */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__link { padding: 12px 10px; font-size: 1rem; }
  .nav__link::after { display: none; }
  .nav__cta-mobile { display: inline-flex; margin-top: 8px; }
}

/* Móvil */
@media (max-width: 640px) {
  .section { padding: 72px 0; }
  .hero { padding: calc(var(--nav-h) + 56px) 0 72px; }
  .grid--2, .grid--3, .metrics, .form__row { grid-template-columns: 1fr; }
  .metrics { margin-top: 50px; }
  .hero__cta .btn { width: 100%; }
  .card, .form { padding: 24px; }
  .contact__mail { display: flex; }
  .footer__inner { flex-direction: column; text-align: center; }
}
