/* =========================================================
   Nodo8 · Estilos (mobile-first)
   ========================================================= */

:root {
  --bg: #071A24;
  --bg-deep: #050F15;
  --surface: #0E2B3A;
  --navy: #0B3D57;
  --amber: #F6AE10;
  --amber-hover: #FFC23D;
  --text: #EEF4F7;
  --text-soft: #B9CBD6;
  --muted: #9FB3C2;
  --line: rgba(238, 244, 247, .16);
  --line-strong: rgba(238, 244, 247, .3);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --radius: 20px;
  --radius-lg: 24px;
  --gutter: 20px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hover); }
h1, h2, h3 { font-family: var(--font-display); color: #fff; margin: 0; letter-spacing: -.02em; }
h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.15; font-weight: 700; margin-bottom: 24px; }
h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.lead { font-size: 17px; color: var(--text-soft); line-height: 1.6; }
.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 12px;
}
.only-desktop { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--amber); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 100; }
.skip-link:focus { left: 8px; }
.icon { flex-shrink: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 16px; border: 1px solid transparent;
  font: 700 16px/1 var(--font-body); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s;
  text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; border-radius: 999px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--amber); color: var(--bg); }
.btn-primary:hover { background: var(--amber-hover); color: var(--bg); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); font-weight: 500; }
.btn-ghost:hover { border-color: var(--text); color: #fff; }
.btn-outline { border-color: var(--amber); color: var(--amber); background: transparent; }
.btn-outline:hover { background: var(--amber); color: var(--bg); }
.btn-dark { background: var(--bg); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.btn-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text); font-size: 13px; font-weight: 500;
}
.btn-pill:hover { border-color: var(--text); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .25s, box-shadow .25s;
}
.site-header.is-scrolled, .site-header.menu-open {
  background: rgba(7, 26, 36, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { height: 30px; width: auto; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-desktop { display: none; }
.menu-toggle {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--amber); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.menu-toggle .i-close { display: none; }
.menu-toggle[aria-expanded="true"] .i-open { display: none; }
.menu-toggle[aria-expanded="true"] .i-close { display: inline-flex; }
.menu-toggle span { display: inline-flex; }

.nav-mobile {
  margin: 0 12px 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.nav-mobile[hidden] { display: none; }
.nav-mobile > a:not(.btn) {
  padding: 14px; color: var(--text); font: 600 18px/1.2 var(--font-display); border-radius: 12px;
}
.nav-mobile > a:not(.btn):hover { background: rgba(255,255,255,.05); }
.nav-mobile .btn { margin-top: 6px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: flex; align-items: flex-end; overflow: hidden; background: var(--bg);
  padding: calc(var(--header-h) + 40px) 0 48px;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-fade {
  position: absolute; inset: auto 0 0 0; height: 70%;
  background: linear-gradient(180deg, rgba(7,26,36,0) 0%, var(--bg) 72%);
  pointer-events: none;
}
.hero-content { position: relative; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(36px, 9.6vw, 68px); line-height: 1.1; font-weight: 700; max-width: 14ch; }
.hero .lead { max-width: 560px; }
.hero .eyebrow { margin-bottom: 0; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }

/* ---------- Números ---------- */
.stats { padding: 8px 0 48px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--surface); border-radius: 18px; padding: 18px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
}
.stat strong { font: 700 30px/1.1 var(--font-display); color: var(--amber); }
.stat span { font-size: 13px; line-height: 1.3; color: var(--text-soft); }

/* ---------- Logos ---------- */
.logos { padding: 0 0 56px; }
.logos-title { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.logos-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: center; justify-items: center; }
.logos-grid img { max-height: 40px; width: auto; opacity: .75; filter: grayscale(1); }

/* ---------- Secciones ---------- */
.section { padding: 64px 0; }
.section-navy { background: var(--navy); }
.section-surface { background: var(--surface); }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px 20px; }

/* Servicios */
.services-grid { display: grid; gap: 16px; }
.service { display: flex; flex-direction: column; gap: 12px; }
.service-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.service-icon {
  width: 48px; height: 48px; border-radius: 14px; background: var(--amber); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
}
.tag { font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; }
.service h3 { font-size: 21px; }
.service p { color: var(--text-soft); font-size: 15px; }
.link-cta { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: 15px; margin-top: auto; }
.link-cta .icon { transition: transform .2s; }
.link-cta:hover .icon { transform: translateX(4px); }

/* Proceso */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.step { display: flex; gap: 16px; }
.step-num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 999px; background: var(--amber); color: var(--bg);
  font: 700 16px/1 var(--font-display); display: inline-flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 18px; margin-bottom: 4px; }
.step p { color: #CFE0EA; font-size: 15px; }

/* Trabajos */
#trabajos h2 { margin-bottom: 8px; }
#trabajos .muted { margin-bottom: 16px; font-size: 15px; }
.reel {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 8px var(--gutter) 12px; scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
.reel-item {
  position: relative; flex: 0 0 62%; max-width: 260px; aspect-ratio: 9 / 16; margin: 0;
  border-radius: 20px; overflow: hidden; background: var(--surface); scroll-snap-align: start;
}
.reel-item img, .reel-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-item.is-placeholder { border: 1px dashed var(--line-strong); }
.reel-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 16px;
  background: linear-gradient(180deg, rgba(5,15,21,0), rgba(5,15,21,.85));
  display: flex; flex-direction: column; gap: 2px;
}
.reel-item figcaption span { font-size: 12px; color: var(--muted); }
.reel-item figcaption strong { font: 600 15px/1.3 var(--font-display); color: #fff; }

/* Nosotros + portal */
.about-grid { display: grid; gap: 48px; }
.about { display: flex; flex-direction: column; gap: 16px; }
.about h2 { margin-bottom: 0; }
.about p { color: var(--text-soft); font-size: 16px; }
.portal {
  background: var(--amber); color: var(--bg); border-radius: var(--radius-lg); padding: 28px 22px;
  display: flex; flex-direction: column; gap: 12px; align-self: start;
}
.portal-tag { align-self: flex-start; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--amber); border-radius: 999px; padding: 6px 12px; }
.portal h2 { color: var(--bg); font-size: 26px; margin: 0; }
.portal p { color: #1E2A30; font-size: 15px; }
.portal .btn { margin-top: 4px; }
.portal small { text-align: center; font-size: 13px; color: #3A4A52; }

/* FAQ */
.faq-wrap h2 { margin-bottom: 20px; }
.faq { display: grid; gap: 12px; }
.faq-item { background: var(--surface); border-radius: 18px; }
.faq-item summary {
  list-style: none; cursor: pointer; min-height: 60px; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: 600 16px/1.35 var(--font-display); color: #fff;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { color: var(--amber); display: inline-flex; transition: transform .25s; }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-item p { padding: 0 18px 18px; color: var(--text-soft); font-size: 15px; }

/* Contacto */
.contact-grid { display: grid; gap: 16px; }
.contact-intro { display: flex; flex-direction: column; gap: 16px; }
.contact-intro h2 { margin-bottom: 0; }
.contact-mail { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: 14px; font-weight: 500; color: var(--text); padding: 0; }
.field legend { margin-bottom: 10px; }
.field input, .field textarea {
  width: 100%; min-height: 52px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); padding: 14px 16px; font: 16px/1.4 var(--font-body);
  transition: border-color .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: #6F8796; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); }
.field input[aria-invalid="true"] { border-color: #FF8A7A; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text); font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.chip input:checked + span { background: var(--amber); border-color: var(--amber); color: var(--bg); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #FFB4A8; font-size: 14px; }
.form-note { font-size: 13px; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-deep); padding: 48px 0 120px; }
.footer-inner { display: flex; flex-direction: column; gap: 22px; }
.footer-brand img { height: 28px; width: auto; margin-bottom: 12px; }
.footer-brand p { color: var(--muted); font-size: 14px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.footer-social a:hover { border-color: var(--amber); color: var(--amber); }
.footer-legal { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--text); }

/* ---------- Botón flotante de WhatsApp (celular) ---------- */
.wa-float {
  position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  min-height: 56px; border-radius: 16px; background: var(--amber); color: var(--bg);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  transform: translateY(140%); transition: transform .3s ease;
}
.wa-float.is-visible { transform: translateY(0); }
.wa-float:hover { color: var(--bg); background: var(--amber-hover); }

/* ---------- Animación de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Páginas internas ---------- */
.page { padding: calc(var(--header-h) + 48px) 0 72px; }
.page .container { max-width: 760px; }
.page h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.15; margin-bottom: 24px; }
.page h2 { font-size: 22px; margin: 32px 0 10px; }
.page p, .page li { color: var(--text-soft); }
.page p + p { margin-top: 12px; }

/* =========================================================
   Tablet (≥ 640px)
   ========================================================= */
@media (min-width: 640px) {
  :root { --gutter: 32px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .stat { padding: 26px 16px; }
  .stat strong { font-size: 40px; }
  .stat span { font-size: 15px; }
  .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .reel-item { flex-basis: 240px; }
  .logos-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* =========================================================
   Escritorio (≥ 960px)
   ========================================================= */
@media (min-width: 960px) {
  :root { --header-h: 84px; }
  .only-mobile { display: none !important; }
  .only-desktop { display: inline-flex !important; }
  .brand img { height: 34px; }
  .menu-toggle, .nav-mobile { display: none !important; }
  .nav-desktop { display: flex; gap: 4px; }
  .nav-desktop a { color: var(--text-soft); font-size: 15px; font-weight: 500; padding: 10px 12px; border-radius: 10px; }
  .nav-desktop a:hover { color: #fff; background: rgba(255,255,255,.05); }

  .hero { align-items: center; padding-bottom: 96px; }
  .hero-fade { inset: 0; height: auto; background: linear-gradient(90deg, var(--bg) 0%, rgba(7,26,36,.85) 38%, rgba(7,26,36,0) 70%); }
  .hero-content { gap: 24px; }
  .hero .lead { font-size: 19px; }

  .stats { margin-top: -48px; position: relative; padding-bottom: 72px; }
  .section { padding: 104px 0; }
  .card { padding: 32px 28px; }
  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .service { transition: transform .25s, background .25s; }
  .service:hover { transform: translateY(-4px); background: #12354A; }

  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .step { flex-direction: column; gap: 16px; }
  .step-num { width: 48px; height: 48px; font-size: 18px; }

  .reel { max-width: 1200px; margin: 0 auto; overflow: visible; scroll-snap-type: none; padding: 8px var(--gutter) 0;
          display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .reel-item { max-width: none; }

  .about-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 64px; align-items: center; }
  .about p { font-size: 18px; }
  .portal { padding: 36px 32px; }

  .faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 64px; align-items: start; }

  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
  .contact-intro .btn { align-self: flex-start; }
  .contact-form { background: var(--bg); border-radius: var(--radius-lg); padding: 32px; }

  .site-footer { padding: 56px 0; }
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .footer-legal { align-items: flex-end; text-align: right; }

  .wa-float {
    left: auto; right: 24px; bottom: 24px; width: 60px; min-height: 60px; height: 60px; border-radius: 999px; padding: 0;
  }
  .wa-float span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

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