/* =============================================================================
   YY 3D STUDIOS ART — SISTEMA DE DISEÑO
   Estilo: Dark futurista · glassmorphism · acentos neón
   -----------------------------------------------------------------------------
   ÍNDICE
   01. Tokens (colores, tipografía, espaciado, sombras)
   02. Reset y base
   03. Accesibilidad (skip link, focus, reduced motion)
   04. Fondo animado
   05. Tipografía y utilidades de layout
   06. Botones
   07. Navegación
   08. Hero
   09. Métricas
   10. Servicios
   11. Proceso
   12. Portafolio
   13. Calculadora de cotización
   14. FAQ
   15. Contacto
   16. Footer
   17. Chatbot
   18. Toast
   19. Animaciones de entrada
   20. Responsive
   ========================================================================== */

/* =============================================================================
   01. TOKENS
   ========================================================================== */
:root {
  /* --- Superficies --- */
  --bg-base:        #05070D;
  --bg-elevated:    #0A0E1A;
  --surface:        rgba(255, 255, 255, 0.035);
  --surface-hover:  rgba(255, 255, 255, 0.06);
  --surface-solid:  #0E1424;

  /* --- Bordes --- */
  --border:         rgba(255, 255, 255, 0.09);
  --border-strong:  rgba(255, 255, 255, 0.16);
  --border-accent:  rgba(34, 211, 238, 0.42);

  /* --- Texto (contraste verificado sobre --bg-base) --- */
  --text-primary:   #F2F6FC;   /* 17.4:1  AAA */
  --text-secondary: #A7B4CB;   /* 8.6:1   AAA */
  --text-muted:     #7B8AA5;   /* 5.3:1   AA  */

  /* --- Marca --- */
  --primary:        #22D3EE;
  --primary-strong: #06B6D4;
  --primary-soft:   rgba(34, 211, 238, 0.12);
  --secondary:      #A855F7;
  --secondary-soft: rgba(168, 85, 247, 0.12);
  --accent:         #38BDF8;

  /* --- Semánticos --- */
  --success:        #34D399;
  --success-soft:   rgba(52, 211, 153, 0.12);
  --danger:         #FB7185;
  --danger-soft:    rgba(251, 113, 133, 0.12);
  --warning:        #FBBF24;

  /* --- Degradados --- */
  --grad-brand:  linear-gradient(135deg, #22D3EE 0%, #818CF8 50%, #A855F7 100%);
  --grad-text:   linear-gradient(120deg, #F2F6FC 0%, #7DD3FC 45%, #C4B5FD 100%);
  --grad-subtle: linear-gradient(160deg, rgba(34,211,238,.10), rgba(168,85,247,.06));

  /* --- Tipografía --- */
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  /* Escala tipográfica fluida */
  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.875rem;   /* 14 */
  --fs-base: 1rem;       /* 16 */
  --fs-md:   1.0625rem;  /* 17 */
  --fs-lg:   clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
  --fs-xl:   clamp(1.375rem, 1vw + 1.1rem, 1.625rem);
  --fs-2xl:  clamp(1.75rem, 2vw + 1.2rem, 2.25rem);
  --fs-3xl:  clamp(2.125rem, 3.2vw + 1.2rem, 3rem);
  --fs-4xl:  clamp(2.5rem, 5.5vw + 1rem, 4.5rem);

  /* --- Espaciado (escala de 4px) --- */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem;  --sp-6: 1.5rem;   --sp-8: 2rem;     --sp-10: 2.5rem;
  --sp-12: 3rem;    --sp-16: 4rem;    --sp-20: 5rem;    --sp-24: 6rem;
  --sp-section: clamp(4rem, 9vw, 7.5rem);

  /* --- Radios --- */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 18px;  --r-xl: 26px;  --r-full: 999px;

  /* --- Elevación --- */
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 6px 20px -6px rgba(0,0,0,.55);
  --sh-3: 0 18px 44px -12px rgba(0,0,0,.7);
  --sh-4: 0 32px 70px -18px rgba(0,0,0,.8);
  --glow-primary:   0 0 0 1px rgba(34,211,238,.35), 0 8px 32px -8px rgba(34,211,238,.45);
  --glow-secondary: 0 0 40px -10px rgba(168,85,247,.5);

  /* --- Movimiento --- */
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-slow: 380ms;
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Capas --- */
  --z-bg: 0;  --z-content: 1;  --z-sticky: 40;  --z-nav: 50;
  --z-chat: 90;  --z-modal: 100;  --z-toast: 120;

  /* --- Layout --- */
  --container: 1200px;
  --container-narrow: 760px;
}

/* =============================================================================
   02. RESET Y BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compensa la nav fija al saltar con anclas */
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-feature-settings: 'cv02', 'cv03', 'cv04';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* Cifras alineadas en columnas de datos y precios */
.tabular { font-variant-numeric: tabular-nums; }

/* =============================================================================
   03. ACCESIBILIDAD
   ========================================================================== */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--primary);
  color: #04121A;
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--sp-4); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Respeta la preferencia del sistema de reducir animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .bg-orb, .bg-scan { display: none !important; }
}

/* =============================================================================
   04. FONDO ANIMADO
   ========================================================================== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}

/* Rejilla técnica */
.bg-grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 25%, #000 30%, transparent 78%);
}

/* Halos de color */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.bg-orb--1 {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  top: -12%; left: -8%;
  background: radial-gradient(circle, rgba(34,211,238,.5), transparent 68%);
  animation: orbFloat 22s var(--ease-in-out) infinite;
}
.bg-orb--2 {
  width: 40vw; height: 40vw; min-width: 280px; min-height: 280px;
  top: 8%; right: -10%;
  background: radial-gradient(circle, rgba(168,85,247,.42), transparent 68%);
  animation: orbFloat 28s var(--ease-in-out) infinite reverse;
}
.bg-orb--3 {
  width: 36vw; height: 36vw; min-width: 260px; min-height: 260px;
  bottom: -14%; left: 28%;
  background: radial-gradient(circle, rgba(56,189,248,.3), transparent 70%);
  animation: orbFloat 34s var(--ease-in-out) infinite;
}

@keyframes orbFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(4vw, 5vh, 0) scale(1.1); }
  66%      { transform: translate3d(-3vw, -4vh, 0) scale(0.94); }
}

/* Línea de escaneo */
.bg-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.55), transparent);
  animation: scanDown 9s linear infinite;
  will-change: transform;
}
@keyframes scanDown {
  0%   { transform: translate3d(0, -5vh, 0); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate3d(0, 105vh, 0); opacity: 0; }
}

/* Viñeta inferior para asentar el contenido */
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, transparent 40%, var(--bg-base) 100%);
}

/* =============================================================================
   05. TIPOGRAFÍA Y LAYOUT
   ========================================================================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p  { margin: 0; text-wrap: pretty; }

.text-grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { position: relative; z-index: var(--z-content); padding-block: var(--sp-section); }

.section-head {
  max-width: 680px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-full);
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow svg { width: 14px; height: 14px; flex-shrink: 0; }

.section-lead {
  margin-top: var(--sp-5);
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: var(--fs-lg);
  line-height: 1.7;
}
.section-head--center .section-lead { margin-inline: auto; }

/* Tarjeta de vidrio, base reutilizable */
.glass {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* =============================================================================
   06. BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;                 /* área táctil ≥ 44px */
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-base) var(--ease-out),
    border-color     var(--dur-base) var(--ease-out),
    box-shadow       var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-out),
    opacity          var(--dur-base) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary {
  background: var(--grad-brand);
  color: #03121A;
  box-shadow: var(--glow-primary);
}
.btn--primary:hover:not(:disabled) {
  box-shadow: 0 0 0 1px rgba(34,211,238,.6), 0 14px 44px -8px rgba(34,211,238,.6);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--border-accent);
  background: var(--surface-hover);
}

.btn--whatsapp {
  background: #1FAF54;
  color: #04140A;
  box-shadow: 0 8px 28px -8px rgba(31,175,84,.6);
}
.btn--whatsapp:hover:not(:disabled) { background: #24C75F; }

.btn--sm { min-height: 44px; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }
.btn--lg { min-height: 56px; padding: var(--sp-4) var(--sp-8); font-size: var(--fs-md); }
.btn--block { width: 100%; }

/* Estado de carga */
.btn[data-loading='true'] { pointer-events: none; opacity: 0.7; }
.btn[data-loading='true'] .btn-label { opacity: 0.6; }
.btn-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================================================
   07. NAVEGACIÓN
   ========================================================================== */
.nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-nav);
  padding-block: var(--sp-4);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              padding var(--dur-base) var(--ease-out);
}
.nav[data-scrolled='true'] {
  padding-block: var(--sp-3);
  border-bottom-color: var(--border);
  background: rgba(5, 7, 13, 0.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 44px;              /* área táctil mínima */
  color: var(--text-primary);
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo__mark {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--grad-brand);
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
}
.logo__mark svg { width: 22px; height: 22px; color: #03121A; }
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.logo__tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
}

.nav__links { display: flex; align-items: center; gap: var(--sp-1); }
.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.nav__link:hover { color: var(--text-primary); background: var(--surface); text-decoration: none; }
.nav__link[aria-current='true'] { color: var(--primary); background: var(--primary-soft); }

.nav__actions { display: flex; align-items: center; gap: var(--sp-3); }

/* Botón de idioma ES / EN */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface);
}
.lang-switch__btn {
  min-width: 38px;
  min-height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.lang-switch__btn:hover { color: var(--text-primary); }
.lang-switch__btn[aria-pressed='true'] {
  background: var(--grad-brand);
  color: #03121A;
}
.lang-switch--mobile {
  width: 100%;
  justify-content: center;
  margin-top: var(--sp-4);
}
.lang-switch--mobile .lang-switch__btn { min-height: 44px; flex: 1; }

/* Botón hamburguesa */
.nav__toggle {
  display: none;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-primary);
}
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded='true'] .icon-menu { display: none; }
.nav__toggle[aria-expanded='true'] .icon-close { display: block; }

/* Panel móvil */
.nav__mobile {
  position: fixed;
  inset: 72px 0 auto 0;
  z-index: var(--z-nav);
  display: none;
  padding: var(--sp-5) clamp(1.25rem, 4vw, 2.5rem) var(--sp-8);
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
}
.nav__mobile[data-open='true'] {
  display: block;
  animation: slideDown var(--dur-slow) var(--ease-out);
}
@keyframes slideDown {
  from { opacity: 0; transform: translate3d(0, -12px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.nav__mobile a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
}
.nav__mobile a:hover { background: var(--surface); color: var(--text-primary); text-decoration: none; }
.nav__mobile .btn { margin-top: var(--sp-4); }

/* =============================================================================
   08. HERO
   ========================================================================== */
.hero {
  position: relative;
  z-index: var(--z-content);
  display: flex;
  align-items: center;
  min-height: 100dvh;
  padding-top: clamp(7rem, 14vh, 10rem);
  padding-bottom: var(--sp-16);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}
.hero__pulse {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.hero__pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--success);
  animation: pulseRing 2s var(--ease-out) infinite;
}
@keyframes pulseRing {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

.hero h1 { margin-bottom: var(--sp-6); }
.hero__lead {
  max-width: 54ch;
  margin-bottom: var(--sp-8);
  color: var(--text-secondary);
  font-size: var(--fs-lg);
  line-height: 1.72;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-8); }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.hero__trust li { display: flex; align-items: center; gap: var(--sp-2); }
.hero__trust svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* Panel visual del hero (terminal) */
.hero__visual { position: relative; }

.terminal {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, rgba(14,20,36,.92), rgba(5,7,13,.96));
  box-shadow: var(--sh-4), var(--glow-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.terminal__dots { display: flex; gap: 6px; }
.terminal__dots span { width: 11px; height: 11px; border-radius: 50%; }
.terminal__dots span:nth-child(1) { background: #FF5F57; }
.terminal__dots span:nth-child(2) { background: #FEBC2E; }
.terminal__dots span:nth-child(3) { background: #28C840; }
.terminal__title {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.terminal__body {
  /* El padding inferior reserva el espacio que ocupa la tarjeta flotante,
     así nunca tapa la última línea de texto. */
  padding: var(--sp-6) var(--sp-5) var(--sp-16);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 2;
}
.terminal__line { display: flex; gap: var(--sp-3); color: var(--text-secondary); }
.terminal__prompt { color: var(--primary); flex-shrink: 0; }
.terminal__ok { color: var(--success); }
.terminal__key { color: var(--secondary); }
.terminal__caret {
  display: inline-block;
  width: 9px; height: 1.05em;
  background: var(--primary);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Tarjetas flotantes sobre el terminal */
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(10, 14, 26, 0.94);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: var(--fs-xs);
  white-space: nowrap;
  animation: floatY 5s var(--ease-in-out) infinite;
}
.float-card--1 { top: -18px; right: -8px; }
.float-card--2 { bottom: -20px; left: -14px; animation-delay: 2.2s; }
.float-card__icon {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.float-card__icon svg { width: 17px; height: 17px; }
.float-card strong { display: block; font-size: var(--fs-sm); }
.float-card span { color: var(--text-muted); }
@keyframes floatY {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -9px, 0); }
}

/* =============================================================================
   09. MÉTRICAS
   ========================================================================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-8);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--grad-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.metric { text-align: center; }
.metric__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.metric__label {
  display: block;
  margin-top: var(--sp-1);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* =============================================================================
   10. SERVICIOS
   ========================================================================== */
.services {
  display: grid;
  /* 330px fuerza 3 columnas en escritorio: con 5 servicios queda 3 + 2,
     en vez de 4 + 1 con una tarjeta suelta al final. */
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: var(--sp-5);
}

.service {
  display: flex;
  flex-direction: column;
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.service:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
  box-shadow: var(--sh-3);
  transform: translate3d(0, -5px, 0);
}

.service__icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  margin-bottom: var(--sp-5);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary);
}
.service__icon svg { width: 26px; height: 26px; }

.service h3 { margin-bottom: var(--sp-3); }
.service__summary {
  margin-bottom: var(--sp-5);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.service__list { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.service__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.service__list svg {
  width: 17px; height: 17px;
  margin-top: 3px;
  color: var(--primary);
  flex-shrink: 0;
}

.service__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: auto;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.service__price { line-height: 1.3; }
.service__price small { display: block; color: var(--text-muted); font-size: var(--fs-xs); }
.service__price strong {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.service__plazo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.service__plazo svg { width: 14px; height: 14px; }

/* =============================================================================
   11. PROCESO
   ========================================================================== */
.process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-5);
}
.step {
  position: relative;
  padding: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.step:hover { border-color: var(--border-accent); transform: translate3d(0, -4px, 0); }
.step__num {
  display: block;
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 700;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.step h3 { margin-bottom: var(--sp-2); font-size: var(--fs-lg); }
.step p { color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.65; }

/* =============================================================================
   12. PORTAFOLIO
   ========================================================================== */
.portfolio {
  display: grid;
  /* 2 columnas en escritorio: las capturas se ven mucho mejor grandes,
     y con número par de proyectos la rejilla queda siempre cuadrada.
     min(400px, 100%) evita que fuerce 400px en móviles estrechos. */
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: var(--sp-5);
}

/* Si el último proyecto se queda solo en su fila, ocupa el ancho completo
   en vez de dejar un hueco vacío al lado. */
.work:last-child:nth-child(odd) { grid-column: 1 / -1; }
.work {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.work:hover {
  border-color: var(--border-accent);
  transform: translate3d(0, -6px, 0);
  box-shadow: var(--sh-3);
}
.work__media {
  position: relative;
  aspect-ratio: 16 / 10;   /* reserva espacio: evita saltos de layout */
  overflow: hidden;
  background: linear-gradient(135deg, rgba(34,211,238,.18), rgba(168,85,247,.16));
}
/* La imagen se superpone al marcador. Si el archivo falta, JS la retira
   y el marcador queda visible sin que salte el layout. */
.work__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.work__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.22);
}
.work__placeholder svg { width: 52px; height: 52px; }
.work__tag {
  position: absolute;
  top: var(--sp-3); left: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: rgba(5,7,13,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--primary);
}
.work__body { padding: var(--sp-5); }
/* Color explícito: si no, los proyectos enlazados heredan el color de enlace
   y sus títulos salen en cian mientras los no enlazados salen en blanco. */
.work__body h3 {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-lg);
  color: var(--text-primary);
}
.work__body p { color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; }

/* Indica qué tarjetas abren el sitio real */
.work__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.work__link svg {
  width: 16px; height: 16px;
  transition: transform var(--dur-base) var(--ease-out);
}
.work:hover .work__link svg { transform: translateX(4px); }

/* =============================================================================
   13. CALCULADORA DE COTIZACIÓN
   ========================================================================== */
.quote {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(14,20,36,.72), rgba(5,7,13,.85));
  box-shadow: var(--sh-4);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

/* Barra de progreso */
.quote__progress {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) clamp(1.25rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.quote__progress::-webkit-scrollbar { display: none; }
.qstep {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--dur-base) var(--ease-out);
}
.qstep__dot {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  flex-shrink: 0;
  transition: all var(--dur-base) var(--ease-out);
}
.qstep__dot svg { width: 14px; height: 14px; }
.qstep[data-state='active'] { color: var(--primary); }
.qstep[data-state='active'] .qstep__dot {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.qstep[data-state='done'] { color: var(--success); }
.qstep[data-state='done'] .qstep__dot {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}
.qstep__sep { width: 22px; height: 1px; background: var(--border-strong); flex-shrink: 0; }

.quote__body { padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.5rem); }

.quote__panel { display: none; }
.quote__panel[data-active='true'] {
  display: block;
  animation: fadeUp var(--dur-slow) var(--ease-out);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.quote__q {
  margin-bottom: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.quote__hint {
  margin-bottom: var(--sp-6);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* Tarjetas seleccionables */
.opt-grid { display: grid; gap: var(--sp-3); }
.opt-grid--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  width: 100%;
  min-height: 64px;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.opt:hover { border-color: var(--border-accent); background: var(--surface-hover); }
.opt:active { transform: scale(0.99); }
.opt[aria-pressed='true'], .opt[data-selected='true'] {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.28);
}

.opt__check {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  margin-top: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.opt__check svg { width: 14px; height: 14px; opacity: 0; transition: opacity var(--dur-fast); }
.opt[aria-pressed='true'] .opt__check,
.opt[data-selected='true'] .opt__check {
  border-color: var(--primary);
  background: var(--primary);
  color: #03121A;
}
.opt[aria-pressed='true'] .opt__check svg,
.opt[data-selected='true'] .opt__check svg { opacity: 1; }

.opt__text { flex: 1; min-width: 0; }
.opt__title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.35;
}
/* Etiqueta "Más pedido" junto al nombre del paquete */
.opt__badge {
  display: inline-block;
  margin-left: var(--sp-2);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--grad-brand);
  color: #03121A;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 2px;
  white-space: nowrap;
}

.opt__desc {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.opt__price {
  margin-left: auto;
  padding-left: var(--sp-3);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Campos de formulario */
.field { margin-bottom: var(--sp-5); }
.field__label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.field__req { color: var(--danger); margin-left: 2px; }

.input, .textarea, .select {
  width: 100%;
  min-height: 50px;                 /* táctil ≥ 44px */
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(5, 7, 13, 0.6);
  color: var(--text-primary);
  font-size: var(--fs-base);        /* 16px evita el zoom automático en iOS */
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.textarea { min-height: 118px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A7B4CB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 44px;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: 0.75; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,211,238,.16);
}
.input[aria-invalid='true'], .textarea[aria-invalid='true'], .select[aria-invalid='true'] {
  border-color: var(--danger);
}
.input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px rgba(251,113,133,.18); }

.field__help { margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--fs-xs); }
.field__error {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  color: var(--danger);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.field__error svg { width: 14px; height: 14px; flex-shrink: 0; }
.field__error[data-show='true'] { display: flex; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

/* Navegación de la calculadora */
.quote__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

/* Estimado en vivo */
.quote__live {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.quote__live strong {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

/* Resultado */
.result { text-align: center; }
.result__icon {
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  margin: 0 auto var(--sp-6);
  border: 1px solid var(--success);
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  animation: popIn var(--dur-slow) var(--ease-spring);
}
.result__icon svg { width: 36px; height: 36px; }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.result__amount {
  margin: var(--sp-6) 0 var(--sp-2);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.result__note { color: var(--text-muted); font-size: var(--fs-sm); }

.result__breakdown {
  margin: var(--sp-8) 0;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(5,7,13,.45);
  text-align: left;
}
.result__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.result__row:last-child { border-bottom: none; }
.result__row dt { color: var(--text-secondary); }
.result__row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
}

/* =============================================================================
   14. FAQ
   ========================================================================== */
.faq { max-width: var(--container-narrow); margin-inline: auto; }
.faq__item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: var(--sp-3);
  transition: border-color var(--dur-base) var(--ease-out);
}
.faq__item:hover { border-color: var(--border-strong); }
.faq__item[data-open='true'] { border-color: var(--border-accent); background: var(--surface-hover); }

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  min-height: 60px;
  padding: var(--sp-4) var(--sp-5);
  text-align: left;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
}
.faq__icon {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.faq__icon svg { width: 16px; height: 16px; }
.faq__item[data-open='true'] .faq__icon {
  transform: rotate(45deg);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-slow) var(--ease-out);
}
.faq__item[data-open='true'] .faq__a { grid-template-rows: 1fr; }
.faq__a > div { overflow: hidden; }
.faq__a p {
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.75;
  max-width: 68ch;
}

/* =============================================================================
   15. CONTACTO
   ========================================================================== */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.contact__methods { display: grid; gap: var(--sp-3); }
.cmethod {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 76px;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.cmethod:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
  transform: translate3d(4px, 0, 0);
  text-decoration: none;
}
.cmethod__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  flex-shrink: 0;
}
.cmethod__icon svg { width: 22px; height: 22px; }
.cmethod--wa .cmethod__icon { background: rgba(31,175,84,.14); color: #34D06B; }
.cmethod--mail .cmethod__icon { background: var(--primary-soft); color: var(--primary); }
.cmethod--time .cmethod__icon { background: var(--secondary-soft); color: var(--secondary); }
.cmethod__text { min-width: 0; }
.cmethod__label {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cmethod__value {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact__socials { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.social {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--dur-base) var(--ease-out);
}
.social:hover { border-color: var(--border-accent); color: var(--primary); background: var(--surface-hover); }
.social svg { width: 20px; height: 20px; }

.contact__form {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(14,20,36,.7), rgba(5,7,13,.85));
  box-shadow: var(--sh-3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Resumen de errores del formulario */
.form-summary {
  display: none;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  padding: var(--sp-4);
  border: 1px solid var(--danger);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  font-size: var(--fs-sm);
}
.form-summary[data-show='true'] { display: flex; }
.form-summary svg { width: 18px; height: 18px; color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.form-summary a { color: var(--danger); font-weight: 600; }

/* =============================================================================
   16. FOOTER
   ========================================================================== */
.footer {
  position: relative;
  z-index: var(--z-content);
  margin-top: var(--sp-16);
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--sp-10);
  padding-block: var(--sp-16) var(--sp-10);
}
.footer__about { max-width: 44ch; }
.footer__about p {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
.footer h4 {
  margin-bottom: var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.footer__links { display: grid; gap: var(--sp-1); }
.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;              /* área táctil mínima */
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.footer__links a:hover { color: var(--primary); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-6);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* =============================================================================
   17. CHATBOT
   ========================================================================== */
.chat-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: var(--z-chat);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 58px;
  padding: var(--sp-3) var(--sp-5) var(--sp-3) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--grad-brand);
  color: #03121A;
  font-size: var(--fs-sm);
  font-weight: 700;
  box-shadow: 0 12px 40px -10px rgba(34,211,238,.7), var(--sh-3);
  /* margen para la barra de gestos en móviles */
  margin-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform var(--dur-base) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-out),
              opacity var(--dur-base) var(--ease-out);
}
.chat-fab:hover { transform: translate3d(0, -3px, 0); }
.chat-fab:active { transform: scale(0.96); }
.chat-fab[data-hidden='true'] {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translate3d(0, 12px, 0);
}
.chat-fab__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(3,18,26,.16);
}
.chat-fab__icon svg { width: 20px; height: 20px; }
.chat-fab__badge {
  position: absolute;
  top: 2px; right: 6px;
  width: 12px; height: 12px;
  border: 2px solid #0BC5DE;
  border-radius: 50%;
  background: var(--danger);
}

.chat {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: var(--z-chat);
  display: none;
  flex-direction: column;
  width: min(400px, calc(100vw - 2rem));
  height: min(620px, calc(100dvh - 2rem));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(10,14,26,.98), rgba(5,7,13,.99));
  box-shadow: var(--sh-4), 0 0 0 1px rgba(34,211,238,.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.chat[data-open='true'] {
  display: flex;
  transform-origin: bottom right;
  animation: chatIn var(--dur-slow) var(--ease-spring);
}
@keyframes chatIn {
  from { opacity: 0; transform: scale(0.9) translate3d(0, 20px, 0); }
  to   { opacity: 1; transform: scale(1) translate3d(0, 0, 0); }
}

.chat__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  flex-shrink: 0;
}
.chat__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--grad-brand);
  color: #03121A;
  flex-shrink: 0;
}
.chat__avatar svg { width: 22px; height: 22px; }
.chat__status-dot {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 13px; height: 13px;
  border: 2px solid #0A0E1A;
  border-radius: 50%;
  background: var(--success);
}
.chat__id { flex: 1; min-width: 0; line-height: 1.3; }
.chat__name { font-family: var(--font-display); font-size: var(--fs-md); font-weight: 700; }
.chat__status {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: var(--fs-xs);
}
.chat__close {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;     /* área táctil mínima */
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.chat__close:hover { background: var(--surface-hover); color: var(--text-primary); }
.chat__close svg { width: 20px; height: 20px; }

.chat__log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.chat__log::-webkit-scrollbar { width: 6px; }
.chat__log::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
}

.msg {
  display: flex;
  gap: var(--sp-3);
  max-width: 92%;
  animation: msgIn var(--dur-base) var(--ease-out);
}
@keyframes msgIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.msg--user { align-self: flex-end; flex-direction: row-reverse; }

.msg__avatar {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: flex-end;
}
.msg--bot .msg__avatar { background: var(--primary-soft); color: var(--primary); }
.msg--user .msg__avatar { background: var(--secondary-soft); color: var(--secondary); }
.msg__avatar svg { width: 16px; height: 16px; }

.msg__bubble {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  line-height: 1.62;
  overflow-wrap: anywhere;
}
.msg--bot .msg__bubble {
  border: 1px solid var(--border);
  border-bottom-left-radius: var(--sp-1);
  background: var(--surface);
  color: var(--text-primary);
}
.msg--user .msg__bubble {
  border-bottom-right-radius: var(--sp-1);
  background: var(--grad-brand);
  color: #03121A;
  font-weight: 500;
}
.msg__bubble strong { font-weight: 700; }
.msg__bubble a { text-decoration: underline; }
.msg--user .msg__bubble a { color: #03121A; }

/* Indicador de escritura */
.typing { display: flex; gap: 5px; padding: var(--sp-4); align-items: center; }
.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: typingBounce 1.3s var(--ease-in-out) infinite;
}
.typing span:nth-child(2) { animation-delay: 0.16s; }
.typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* Botones de respuesta rápida */
.chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 0 var(--sp-5) var(--sp-3);
  flex-shrink: 0;
}
.chip {
  min-height: 44px;              /* área táctil mínima */
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-full);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-xs);
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.chip:hover { background: rgba(34,211,238,.22); }
.chip:active { transform: scale(0.96); }
.chip--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
}
.chip--ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

.chat__form {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  flex-shrink: 0;
}
.chat__input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: rgba(5,7,13,.7);
  color: var(--text-primary);
  font-size: var(--fs-base);
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
}
.chat__input::placeholder { color: var(--text-muted); }
.chat__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,211,238,.14);
}
.chat__send {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  background: var(--grad-brand);
  color: #03121A;
  flex-shrink: 0;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}
.chat__send:hover:not(:disabled) { transform: scale(1.05); }
.chat__send:active:not(:disabled) { transform: scale(0.94); }
.chat__send:disabled { opacity: 0.4; cursor: not-allowed; }
.chat__send svg { width: 20px; height: 20px; }

/* =============================================================================
   18. TOAST
   ========================================================================== */
.toast-zone {
  position: fixed;
  left: 50%;
  bottom: clamp(5.5rem, 12vh, 7rem);
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  width: min(440px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: rgba(14,20,36,.97);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: var(--fs-sm);
  animation: toastIn var(--dur-slow) var(--ease-spring);
  pointer-events: auto;
}
.toast svg { width: 20px; height: 20px; flex-shrink: 0; }
.toast--ok    { border-color: rgba(52,211,153,.5); }
.toast--ok    svg { color: var(--success); }
.toast--error { border-color: rgba(251,113,133,.5); }
.toast--error svg { color: var(--danger); }
.toast--info  svg { color: var(--primary); }
.toast[data-leaving='true'] { animation: toastOut var(--dur-base) var(--ease-in-out) forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.94); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.96); }
}

/* =============================================================================
   19. ANIMACIONES DE ENTRADA
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal[data-visible='true'] { opacity: 1; transform: translate3d(0, 0, 0); }

/* =============================================================================
   20. RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--sp-12); }
  .hero { min-height: auto; }
  .contact { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
  .footer__about { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav__links, .nav__actions .btn, .nav__actions .lang-switch { display: none; }
  .nav__toggle { display: grid; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); padding: var(--sp-6); }
  .float-card--1 { top: -14px; right: 0; }
  .float-card--2 { bottom: -16px; left: 0; }
}

@media (max-width: 640px) {
  :root { --container: 100%; }
  h1 { letter-spacing: -0.02em; }
  .hero { padding-top: 6.5rem; }
  .hero__cta .btn { width: 100%; }
  .hero__trust { gap: var(--sp-3); font-size: var(--fs-xs); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .result__actions { grid-template-columns: 1fr; }
  .quote__nav { flex-direction: column-reverse; align-items: stretch; }
  .quote__nav .btn { width: 100%; }
  .quote__live { justify-content: center; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; text-align: center; }
  .terminal__body { font-size: var(--fs-xs); padding: var(--sp-5) var(--sp-4); }

  /* En móvil las tarjetas dejan de flotar y se apilan bajo el terminal:
     así no tapan el texto ni se pisan entre ellas. */
  .hero__visual { display: flex; flex-direction: column; gap: var(--sp-3); }
  .float-card {
    position: static;
    width: 100%;
    animation: none;
    white-space: normal;
  }

  /* El chat pasa a pantalla completa en móvil */
  .chat {
    right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    margin-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .chat-fab { padding-inline: var(--sp-3); }
  .chat-fab__label { display: none; }
  .toast-zone { bottom: 6rem; }
}

/* Pantallas anchas: más aire lateral */
@media (min-width: 1440px) {
  :root { --container: 1280px; }
}

/* Horizontal en móvil: no dejar que el hero ocupe toda la altura */
@media (max-height: 560px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: 6rem; padding-bottom: var(--sp-10); }
  .chat { height: 100dvh; }
}

/* Impresión: quitar efectos y ahorrar tinta */
@media print {
  .bg-layer, .nav, .chat-fab, .chat, .toast-zone, .footer__bottom { display: none !important; }
  body { background: #fff; color: #000; }
  .glass, .service, .work, .quote { border-color: #ccc; background: #fff; }
}
