/* ==========================================================================
   Barba Informática — Design System v3
   base.css: tokens, reset, tipografía, layout, botones, nav, footer
   ========================================================================== */

:root {
  /* Color */
  --bg:            #06070a;
  --bg-raised:     #0c0f16;
  --bg-sunken:     #040507;
  --surface:       rgba(255,255,255,.035);
  --surface-2:     rgba(255,255,255,.06);
  --line:          rgba(255,255,255,.09);
  --line-strong:   rgba(255,255,255,.16);
  --text:          #eef1f5;
  --text-dim:      #a6b0bd;
  --muted:         #77818f;
  --accent:        #79c0ff;
  --accent-ink:    #04121f;       /* texto sobre fondo accent */
  --accent-dim:    rgba(121,192,255,.12);
  --accent-line:   rgba(121,192,255,.30);
  --wa:            #25d366;       /* solo para acciones de WhatsApp */
  --wa-ink:        #04170b;
  --danger:        #ff7b72;
  --ok:            #7ee787;

  /* Tipografía */
  --font-head: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --fs-0: clamp(.875rem, .85rem + .1vw, .9375rem);
  --fs-1: clamp(1rem, .97rem + .15vw, 1.0625rem);
  --fs-2: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem);
  --fs-3: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);
  --fs-4: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-5: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem);

  /* Forma */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.16,.8,.28,1);

  --nav-h: 68px;
  --container: 1160px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: clip;
}
main { flex: 1 0 auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent-dim); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Fondo ambiental (rejilla sutil) — estático, sin JS */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 420px at 70% -8%, rgba(121,192,255,.11), transparent 70%),
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 35%, transparent 85%);
}

/* ---------- Layout ---------- */
.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; position: relative; z-index: 1; }
.container--narrow { width: min(820px, calc(100% - 40px)); }
.section { padding-block: clamp(56px, 8vw, 104px); position: relative; z-index: 1; }
.section--tight { padding-block: clamp(36px, 5vw, 64px); }
.section--raised { background: var(--bg-raised); border-block: 1px solid var(--line); }

.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2 { margin-bottom: 14px; }
.section-head p { color: var(--text-dim); font-size: var(--fs-2); }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -.015em; font-weight: 700; text-wrap: balance; }
h1 { font-size: var(--fs-5); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: var(--fs-4); }
h3 { font-size: var(--fs-2); line-height: 1.25; }
h4 { font-size: var(--fs-1); }
p { text-wrap: pretty; }
.lead { font-size: var(--fs-2); color: var(--text-dim); max-width: 60ch; }
.dim { color: var(--text-dim); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-0); }
.kicker { color: var(--accent); font-weight: 600; font-size: var(--fs-0); margin-bottom: 14px; display: block; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-1); line-height: 1.2; text-align: center;
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .18s;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent-line); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); }
.btn--primary:hover { box-shadow: 0 8px 28px -8px rgba(121,192,255,.55); border-color: var(--accent); }
.btn--wa { --btn-bg: var(--wa); --btn-fg: var(--wa-ink); --btn-bd: var(--wa); }
.btn--wa:hover { box-shadow: 0 8px 28px -8px rgba(37,211,102,.5); border-color: var(--wa); }
.btn--ghost { --btn-bg: transparent; }
.btn--lg { min-height: 54px; padding: 14px 28px; font-size: var(--fs-2); }
.btn--sm { min-height: 38px; padding: 8px 16px; font-size: var(--fs-0); }
.btn--block { width: 100%; white-space: normal; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.link { color: var(--accent); font-weight: 600; border-bottom: 1px solid var(--accent-line); transition: border-color .18s; }
.link:hover { border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.js-logo svg { display: block; width: 100%; height: 100%; }
.logo-text { font-family: var(--font-head); font-weight: 700; font-size: 1.0625rem; letter-spacing: .005em; }
.logo-text span { color: var(--accent); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(6,7,10,.86); border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s, transform .3s var(--ease); }
.nav.is-scrolled { border-bottom-color: var(--line); background: rgba(6,7,10,.94); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 9px 14px; border-radius: 999px; color: var(--text-dim); font-size: var(--fs-0); font-weight: 500; transition: color .18s, background .18s; }
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-cta { margin-left: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: var(--r-sm); position: relative; }
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle span:nth-child(1) { top: 15px; } .nav-toggle span:nth-child(2) { top: 21px; } .nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 20px 22px; background: rgba(6,7,10,.985); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .25s var(--ease), visibility 0s .25s; }
  .nav-links.is-open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .nav-link { padding: 14px 12px; font-size: var(--fs-1); border-radius: var(--r-sm); }
  .nav-cta { margin: 10px 0 0; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg); padding: 56px 0 28px; position: relative; z-index: 1; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-dim); font-size: var(--fs-0); margin: 14px 0 18px; max-width: 34ch; }
.footer-col h4 { font-size: var(--fs-0); color: var(--text); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-dim); font-size: var(--fs-0); padding: 5px 0; transition: color .18s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-0); }
@media (max-width: 800px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Acciones fijas de conversión ---------- */
.wa-float { position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 58px; height: 58px; border-radius: 50%;
  background: var(--wa); color: var(--wa-ink); display: grid; place-items: center;
  box-shadow: 0 10px 30px -6px rgba(37,211,102,.55); transition: transform .2s var(--ease); }
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 28px; height: 28px; }

.mobile-bar { display: none; }
@media (max-width: 720px) {
  .wa-float { display: none; }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(6,7,10,.96); border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .3s var(--ease); }
  .mobile-bar.is-visible { transform: none; }
  body { padding-bottom: 0; }
  .footer { padding-bottom: 96px; }
}
