/* ============================================================
   WAHAPPY DESIGN SYSTEM
   Estructura y ritmo: Deck (referente principal)
   Piezas de energia: Zeeframes (glow de hero, panel acido)
   Marca: Wahappy (verde WhatsApp + chartreuse del logo)
   Modo B (adaptar): colores remapeados por rol, estructura intacta
   ============================================================ */

/* Fuentes autoalojadas (igual que produccion): woff2 variables del subset latin
   en fonts/, con su rango real de pesos para pintar 600/650/700 verdaderos.
   Nada de @import ni de Google Fonts: las paginas precargan los dos woff2 con
   <link rel=preload> (ver scripts/build_home.py). Licencias en fonts/OFL-*.txt. */
@font-face { font-family: 'Inter'; src: url('fonts/inter-latin-wght-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Inter Tight'; src: url('fonts/inter-tight-latin-wght-var.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* Fondos (heredados de Deck, calzan con Wahappy por sus verdes oscuros) */
  --bg-primary: #0D100F;
  --bg-secondary: #092C23;
  --bg-card: #111816;
  --bg-card-green: #19483D;
  --bg-elevated: #1E1E1E;

  /* Texto */
  --text-primary: #F6F6F6;
  --text-secondary: #CDCDCD;
  --text-muted: #8A8A8A;
  --text-soft: rgba(255,255,255,0.6);

  /* Bordes (patron Deck: finos, sin sombras) */
  --border-color: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.15);
  --border-strong: rgba(255,255,255,0.4);

  /* Marca Wahappy */
  --brand: #25D366;          /* verde WhatsApp: checks, realces, links de accion */
  --brand-deep: #1F7A45;     /* verde profundo: derivados, hovers */
  --brand-dark: #092C23;     /* superficie verde oscura */
  --accent: #C1D82F;         /* chartreuse del logo: CTA primario, glow, panel acido */
  --accent-dim: rgba(193,216,47,0.08);
  --acid-alt: #F3FE00;       /* amarillo Zeeframes, alternativa documentada */

  /* Paleta de superficie verde de Deck (se conserva, es marca compatible) */
  --green-100: #60917E;
  --green-200: #286650;
  --green-300: #19483D;
  --green-400: #092C23;

  /* Semanticos */
  --red: #F87171;
  --orange: #FB923C;

  /* Tipografia: Plain (Deck) -> Inter Tight titulares + Inter cuerpo */
  --font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Menlo', monospace;

  /* Radios */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-pill: 999px;

  /* Layout */
  --max-width: 1300px;
  --container-pad: 24px;

  /* Movimiento */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ Reset y base ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* Anti scroll lateral. `clip` no crea contexto de scroll, asi no rompe position:sticky.
   `hidden` queda de respaldo para navegadores viejos. */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; background: none; border: none; cursor: pointer; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 500; }

/* ============ Contenedor ============ */
.container {
  max-width: calc(var(--max-width) + 2 * var(--container-pad));
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ============ Tipografia semantica ============ */
.h-hero    { font-size: clamp(32px, 5vw, 60px);  line-height: 1;    letter-spacing: -0.03em; font-weight: 500; }
.h-section { font-size: clamp(28px, 4.5vw, 60px); line-height: 1.1;  letter-spacing: -0.03em; font-weight: 500; }
.h-solid   { font-size: clamp(40px, 4.5vw, 60px); line-height: 1.1;  letter-spacing: -0.03em; font-weight: 500; }
.h-cta     { font-size: clamp(32px, 5vw, 70px);  line-height: 1.1;  letter-spacing: -0.03em; font-weight: 500; }
.h-card    { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.subtitle  { font-size: clamp(16px, 1.4vw, 18px); color: rgba(255,255,255,0.8); line-height: 1.5; letter-spacing: -0.01em; }
.body-muted { font-size: 15px; color: var(--text-soft); line-height: 1.6; }
.eyebrow   { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }

/* ============ Botones ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; padding: 10px 20px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  font-family: var(--font-body);
}
.btn-primary { background: var(--accent); color: var(--bg-primary); }
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-secondary {
  color: rgba(255,255,255,0.6);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { color: #fff; border-color: var(--border-strong); }
.btn-hero-outline { background: rgba(0,0,0,0.25); color: #fff; border: 2px solid var(--accent); border-radius: 10px; transition: all var(--transition); }
.btn-hero-outline:hover { background: rgba(193,216,47,0.1); transform: translateY(-1px); }
.btn-arrow { transition: transform var(--transition); }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn-lg { border-radius: var(--radius-sm); padding: 12px 22px; font-size: 15px; }

/* ============ Cards base ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.12) }

/* ============ Marco de mockup (patron central Deck) ============
   Todo visual de producto va maquetado en HTML dentro de este marco,
   nunca screenshot pegado. Full width dentro del wrapper. */
.mockup-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}
.mockup-frame-pad { padding: 24px; }

/* ============ Inputs ============ */
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  color: var(--text-primary); font-family: var(--font-body); font-size: 14px;
  padding: 10px 12px; transition: border-color var(--transition);
}
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(193,216,47,0.5); }

/* ============ Utilidades de seccion ============ */
.section { padding: 60px var(--container-pad) 80px; max-width: calc(var(--max-width) + 48px); margin: 0 auto; }
.section-tight { padding: 40px var(--container-pad) 50px; }
.check { color: var(--brand); }
.text-brand { color: var(--brand); }
.text-accent { color: var(--accent); }

/* Glow radial reutilizable (recalculado desde la marca, no del template) */
.glow-brand  { background: radial-gradient(ellipse, rgba(37,211,102,0.14), transparent 70%); }
.glow-accent { background: radial-gradient(ellipse, rgba(193,216,47,0.12), transparent 70%); }

/* Reveal elegante a la entrada (scroll): sube y aparece, sin desenfoque.
   Se activa agregando .reveal-on al <html> desde el script de reveal.
   Respeta prefers-reduced-motion. */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal-on [data-reveal].revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Sub-glow global que sigue el cursor (capa fija bajo el contenido).
   Uso: <div class="cursor-glow"></div> al inicio del body + el script de seguimiento.
   Solo pointer fine; pointer-events none; queda debajo del contenido y encima del fondo. */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 300px; height: 300px;
  border-radius: 50%; filter: blur(70px); z-index: -1;
  background: radial-gradient(circle, rgba(193,216,47,0.10), rgba(37,211,102,0.05) 50%, transparent 70%);
  pointer-events: none; will-change: transform;
  opacity: 0; transition: opacity 0.6s ease;
}

/* Banda de puntos decorativa pre-footer (Deck) */
.dots-band {
  height: 130px;
  background-image: radial-gradient(rgba(255,255,255,0.13) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000);
  mask-image: linear-gradient(to bottom, transparent, #000);
}

/* Animaciones (Deck: blur-in del hero; entrada suave general) */
@keyframes heroBlurIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes heroFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes glowDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(60px, -30px) scale(1.08); }
  66%  { transform: translate(-40px, 25px) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}
.anim-blur-in { opacity: 0; animation: heroBlurIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-fade-in { opacity: 0; animation: heroFadeIn 0.8s ease forwards; }

/* Responsive base */
@media (max-width: 900px) {
  :root { --container-pad: 16px; }
}

/* ============ Rendimiento en movil ============
   Los filter: blur() grandes obligan a rasterizar capas enormes y son lo que
   mas cuesta en un telefono. Los glows ya son radial-gradient, asi que en
   movil se quita el blur y se conserva el degradado (se ve casi igual, cuesta
   una fraccion). Tambien se apagan las animaciones puramente decorativas que
   repintan sin parar. */
@media (max-width: 900px) {
  .hero-glow, .cursor-glow, .acid-glow, .hgl-blob { filter: none !important; }
  .hero-glow, .hgl-blob { animation: none !important; }
  .cursor-glow, .acid-glow { display: none !important; }
  .dots-band { display: none; }
}
@media (hover: none) {
  .cursor-glow, .acid-glow { display: none !important; }
}
