/* ============================================================
   IngTech — Sistema de diseño
   Tokens fijos de marca (no modificar sin razón de marca)
   ============================================================ */
:root {
  --carbon: #0F1314;        /* texto principal / fondos oscuros */
  --teal: #3AA2A3;          /* acento primario de marca (firma, usar con moderación) */
  --teal-deep: #256F70;     /* hover states, variante oscura */
  --surface: #F7F9F8;       /* fondo principal, blanco roto frío */
  --surface-alt: #ECEFEE;   /* tarjetas sobre --surface */
  --signal: #E8623A;        /* CTA crítico, solo 1-2 usos por vista */

  /* Derivados funcionales */
  --ink-soft: #3C4446;      /* texto secundario sobre claro */
  --ink-light: #B9C4C4;     /* texto secundario sobre oscuro */
  --line: #D8DEDC;          /* bordes sutiles sobre claro */
  --line-dark: #263032;     /* bordes sutiles sobre carbón */
  --term-green: #5FBF77;    /* estados OK en terminal */
  --term-amber: #D9A441;    /* estados en progreso */

  /* Tipografía */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Ritmo */
  --radius: 10px;
  --section-pad: clamp(4rem, 9vw, 7.5rem);
  --container: 1160px;
}

/* ============================================================
   Reset mínimo + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--carbon);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.mono { font-family: var(--font-mono); }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

/* Foco de teclado siempre visible (accesibilidad) */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   Botones
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease,
              color 160ms ease, transform 160ms ease;
}
.btn:active { transform: translateY(1px); }

/* CTA crítico: único uso del acento --signal */
.btn-signal {
  background: var(--signal);
  color: #FFF;
}
.btn-signal:hover { background: #C94E2A; }

/* Botón secundario: contorno sobre fondo claro */
.btn-ghost {
  border-color: var(--carbon);
  color: var(--carbon);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--teal-deep);
  color: var(--teal-deep);
}

.btn-sm { font-size: 0.9rem; padding: 0.55rem 1.1rem; }
.btn-block { width: 100%; }

/* ============================================================
   Wordmark — recreación CSS del logo real:
   "I" carbón + "n" teal con barra inferior + "GTECH" carbón
   ============================================================ */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; }

.wm-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  line-height: 1; /* también fuera de .wordmark (ej. footer) */
  color: var(--carbon);
}

/* La "n" teal con línea baja, como en el logo original.
   Se eleva levemente para alinearla con las mayúsculas;
   la barra es un pseudo-elemento para no invadir el tagline. */
.wm-n {
  color: var(--teal);
  position: relative;
  display: inline-block;
  transform: translateY(-0.09em);
}
.wm-n::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.14em;
  height: 0.09em;
  background: var(--teal);
}

.wm-tagline {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 7px;
}

/* Variante clara para el footer (fondo carbón) */
.wm-text-light { color: var(--surface); }
.wm-tagline-light { color: var(--ink-light); }

/* ============================================================
   Header — sticky; blur sutil SOLO al hacer scroll (clase .scrolled
   la agrega js/main.js)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.site-header.scrolled {
  background: rgba(247, 249, 248, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.9rem;
}

.site-nav { display: none; gap: 2rem; }

.site-nav a {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--carbon);
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}
.site-nav a:hover { color: var(--teal-deep); border-bottom-color: var(--teal); }

.header-cta { display: none; }

/* Hamburguesa (móvil) */
.nav-toggle {
  display: grid;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--carbon);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-family: var(--font-display);
  font-weight: 500;
}

@media (min-width: 860px) {
  .site-nav { display: flex; }
  .header-cta { display: inline-block; }
  .nav-toggle, .mobile-nav { display: none !important; }
}

/* ============================================================
   Hero — 60/40 asimétrico
   ============================================================ */
.hero { padding-block: clamp(3.5rem, 8vw, 3.5rem); }

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

/* Evita que contenidos con ancho intrínseco (canvas, textos mono)
   desborden las columnas del grid en pantallas angostas */
.hero-grid > *,
.service-row > *,
.contact-grid > *,
.footer-grid > * { min-width: 0; }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 60fr 40fr; gap: 4rem; }
}

.hero-kicker {
  font-size: 0.85rem;
  color: var(--teal-deep);
  margin-bottom: 1rem;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-note {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------
   Panel de monitoreo simulado (terminal)
   ------------------------------------------------------------ */
.terminal {
  background: var(--carbon);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(15, 19, 20, 0.45);
  border: 1px solid var(--line-dark);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-dark);
}

.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #E0604F; }
.dot-y { background: #D9A441; }
.dot-g { background: #5FBF77; }

.terminal-title {
  margin-left: 0.6rem;
  font-size: 0.72rem;
  color: var(--ink-light);
}

.terminal-body {
  padding: 1rem 1.1rem;
  min-height: 172px;
  font-size: 0.78rem;
  line-height: 1.8;
  color: #D6E2E1;
}

/* Colores semánticos de las líneas de log (se asignan desde JS) */
.log-ok { color: var(--term-green); }
.log-warn { color: var(--term-amber); }
.log-info { color: var(--teal); }
.log-dim { color: #6E7C7D; }

/* Cursor del typewriter */
.log-cursor {
  display: inline-block;
  width: 7px; height: 13px;
  background: var(--teal);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.terminal-chart {
  padding: 0.4rem 1.1rem 0.6rem;
  border-top: 1px solid var(--line-dark);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--ink-light);
  padding-block: 0.4rem;
}

.chart-value { color: var(--teal); }

#latChart { width: 100%; height: 74px; }

.terminal-status {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.65rem 1.1rem;
  border-top: 1px solid var(--line-dark);
  font-size: 0.68rem;
  color: var(--ink-light);
}

.status-item { display: inline-flex; align-items: center; gap: 6px; }

.status-led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--term-green);
  box-shadow: 0 0 6px rgba(95, 191, 119, 0.7);
}

/* ============================================================
   Encabezados de sección
   ============================================================ */
.section-head { max-width: 44rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }

.section-kicker {
  font-size: 0.8rem;
  color: var(--teal-deep);
  margin-bottom: 0.8rem;
}

.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }

.section-sub { margin-top: 1rem; color: var(--ink-soft); }

/* Variante sobre fondo carbón */
.section-head-dark h2 { color: var(--surface); }
.section-head-dark .section-sub { color: var(--ink-light); }
.section-head-dark .section-kicker { color: var(--teal); }

/* ============================================================
   Servicios — filas alternadas con diagramas SVG a medida
   ============================================================ */
.services { padding-block: var(--section-pad); }

.service-row {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  margin-bottom: 2rem;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

/* Hover: leve elevación (el diagrama se anima vía reglas más abajo) */
.service-row:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(15, 19, 20, 0.25);
}

@media (min-width: 860px) {
  .service-row { grid-template-columns: 55fr 45fr; gap: 3.5rem; }
  /* Filas alternadas: el diagrama cambia de lado */
  .row-alt .service-text { order: 2; }
  .row-alt .service-visual { order: 1; }
}

.service-tag { font-size: 0.75rem; color: var(--teal-deep); margin-bottom: 0.7rem; }

.service-text h3 { font-size: 1.45rem; margin-bottom: 0.9rem; }

.service-text p { color: var(--ink-soft); margin-bottom: 1.1rem; }

.service-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}
/* Viñeta cuadrada teal, coherente con la geometría del logo */
.service-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.52em;
  width: 8px; height: 8px;
  background: var(--teal);
}

/* ------------------------------------------------------------
   Diagramas SVG lineales
   ------------------------------------------------------------ */
.diagram { width: 100%; height: auto; }

.d-stroke, .d-stroke-teal, .d-lines path, .d-lines line, .d-pulse,
.d-arrow line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.d-stroke { stroke: var(--carbon); }
.d-stroke-teal { stroke: var(--teal); }
.d-arrow line { stroke: var(--teal); }
.d-lines path, .d-lines line { stroke: var(--ink-soft); opacity: 0.55; }
.d-teal-fill { fill: var(--teal); }

.d-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--ink-soft);
  text-anchor: middle;
}
.d-label-in { fill: var(--carbon); dominant-baseline: middle; }

/* Trazos punteados que se desplazan al hover de la tarjeta */
.d-dash { stroke-dasharray: 6 6; }
@media (prefers-reduced-motion: no-preference) {
  .service-row:hover .d-dash { animation: dashFlow 1.2s linear infinite; }
}
@keyframes dashFlow { to { stroke-dashoffset: -24; } }

/* Pulso del diagrama de soporte */
.d-pulse { stroke: var(--teal); }
@media (prefers-reduced-motion: no-preference) {
  .service-row:hover .d-pulse {
    stroke-dasharray: 320;
    animation: pulseDraw 1.6s ease-out;
  }
}
@keyframes pulseDraw {
  from { stroke-dashoffset: 320; }
  to { stroke-dashoffset: 0; }
}

/* ============================================================
   Proceso — timeline horizontal con línea que se dibuja
   ============================================================ */
.process {
  padding-block: var(--section-pad);
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.timeline { position: relative; }

.timeline-line {
  display: none;
  position: absolute;
  top: 21px; /* alinea con el centro de .step-num */
  left: 0;
  width: 100%;
  height: 4px;
}

.timeline-line line {
  stroke: var(--teal);
  stroke-width: 3;
  /* El dibujo progresivo (dashoffset) lo controla js/main.js */
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

.timeline-steps {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 860px) {
  .timeline-line { display: block; }
  .timeline-steps { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
}

.timeline-step { position: relative; }

.step-num {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--carbon);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1; /* sobre la línea conectora */
  border: 3px solid var(--surface-alt);
}

.timeline-step h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.timeline-step p { font-size: 0.92rem; color: var(--ink-soft); }

/* ============================================================
   Stack — badges estilo terminal sobre carbón
   ============================================================ */
.stack {
  padding-block: var(--section-pad);
  background: var(--carbon);
}

.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.stack-badge {
  font-size: 0.82rem;
  color: var(--teal);
  background: rgba(58, 162, 163, 0.06);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.stack-badge::before { content: "$ "; color: #6E7C7D; }
.stack-badge:hover {
  border-color: var(--teal-deep);
  background: rgba(58, 162, 163, 0.12);
}

/* ============================================================
   Diferenciadores — cualitativos, sin contadores decorativos
   ============================================================ */
.differentiators { padding-block: var(--section-pad); }

.diff-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 860px) {
  .diff-grid { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.diff-item {
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.diff-key { font-size: 0.75rem; color: var(--teal-deep); margin-bottom: 0.9rem; }
.diff-item h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.diff-item p { font-size: 0.93rem; color: var(--ink-soft); }

/* ============================================================
   Contacto — fondo carbón + formulario
   ============================================================ */
.contact {
  padding-block: var(--section-pad);
  background: var(--carbon);
  color: var(--surface);
}

.contact-grid {
  display: grid;
  gap: 3rem;
}
@media (min-width: 960px) {
  .contact-grid { grid-template-columns: 55fr 45fr; gap: 5rem; align-items: start; }
}

.contact-copy .section-kicker { color: var(--teal); }
.contact-copy h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); color: var(--surface); }
.contact-copy .section-sub { color: var(--ink-light); }

.contact-data { margin-top: 2rem; display: grid; gap: 0.6rem; }
.contact-data li {
  font-size: 0.85rem;
  color: var(--ink-light);
  padding-left: 1.2rem;
  position: relative;
}
.contact-data li::before {
  content: ">";
  position: absolute;
  left: 0;
  color: var(--teal);
}

.contact-form { display: grid; gap: 1.2rem; }

.form-field { display: grid; gap: 0.45rem; }

.form-field label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--surface);
  background: rgba(247, 249, 248, 0.05);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  transition: border-color 160ms ease;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: #5E6C6D; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.form-status { font-size: 0.78rem; color: var(--teal); min-height: 1.2em; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--carbon);
  color: var(--ink-light);
  border-top: 1px solid var(--line-dark);
  padding-top: 3.5rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
@media (min-width: 860px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
}

.footer-brand { display: flex; flex-direction: column; }
.footer-desc { margin-top: 1rem; font-size: 0.88rem; max-width: 22rem; }

.footer-col { display: grid; gap: 0.55rem; align-content: start; }
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.footer-col a, .footer-col span { font-size: 0.88rem; color: var(--ink-light); }
.footer-col a:hover { color: var(--surface); }

.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-block: 1.4rem;
}
.footer-bottom p { font-size: 0.72rem; color: #6E7C7D; }

/* ------------------------------------------------------------
   Línea EOF — easter egg de fin de página
   ------------------------------------------------------------ */
.eof-line {
  margin-top: 0.7rem;
  color: var(--teal);
  transition: opacity 300ms ease;
}
/* Se desvanece al alejarse del fondo (mantiene su espacio para
   no provocar saltos de layout); reaparece al volver a bajar */
.eof-line.eof-fade { opacity: 0; }

/* Cursor de bloque parpadeante, como el del terminal del hero */
.eof-cursor {
  display: inline-block;
  width: 6px;
  height: 11px;
  margin-left: 3px;
  background: var(--teal);
  vertical-align: -1px;
  animation: blink 1s steps(1) infinite;
}

.eof-link {
  margin-left: 0.6rem;
  color: var(--term-green);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.eof-link:hover { border-bottom-color: var(--term-green); }

/* Rebote elástico cuando se insiste en seguir bajando */
.eof-line.eof-bounce {
  animation: eofBounce 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes eofBounce {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-7px); }
  70%  { transform: translateY(2px); }
  100% { transform: translateY(0); }
}

/* ============================================================
   Cursor personalizado circular
   Solo en dispositivos con puntero fino; JS agrega la clase
   .custom-cursor al <html> y crea el punto + anillo.
   ============================================================ */
@media (pointer: fine) {
  html.custom-cursor,
  html.custom-cursor a,
  html.custom-cursor button {
    cursor: none;
  }
  /* En campos de texto se mantiene el cursor nativo (usabilidad) */
  html.custom-cursor input,
  html.custom-cursor textarea {
    cursor: text;
  }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 120;
  will-change: transform;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--teal-deep);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--teal);
  transition: width 200ms ease, height 200ms ease,
              background-color 200ms ease, opacity 200ms ease;
}

/* Sobre elementos interactivos el anillo crece y se rellena sutil */
.cursor-ring.is-hover {
  width: 52px;
  height: 52px;
  background: rgba(58, 162, 163, 0.10);
}

/* Sobre campos de texto el cursor personalizado se oculta */
.cursor-dot.is-off,
.cursor-ring.is-off { opacity: 0; }

/* ============================================================
   Widget flotante de WhatsApp
   ============================================================ */
.wa-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366; /* verde oficial de WhatsApp, reconocible */
  color: #FFF;
  box-shadow: 0 8px 24px -6px rgba(15, 19, 20, 0.4);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.wa-widget:hover {
  transform: scale(1.07);
  box-shadow: 0 12px 28px -6px rgba(15, 19, 20, 0.45);
}
.wa-widget:active { transform: scale(0.98); }

@media (min-width: 860px) {
  .wa-widget { right: 1.75rem; bottom: 1.75rem; }
}

/* ------------------------------------------------------------
   Burbuja de invitación del widget (aparece tras unos segundos)
   ------------------------------------------------------------ */
.wa-bubble {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + 56px + 0.9rem); /* sobre el botón */
  z-index: 59;
  width: min(290px, calc(100vw - 2.5rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 16px 40px -16px rgba(15, 19, 20, 0.35);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 300ms ease, transform 300ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
.wa-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Flecha apuntando al botón */
.wa-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 22px;
  width: 13px;
  height: 13px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.wa-bubble-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.2rem;
}
.wa-bubble-close:hover { color: var(--carbon); }

.wa-bubble-kicker {
  font-size: 0.68rem;
  color: var(--teal-deep);
  margin-bottom: 0.35rem;
}
/* LED "en línea" */
.wa-bubble-kicker::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--term-green);
  box-shadow: 0 0 6px rgba(95, 191, 119, 0.7);
}

.wa-bubble-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}

.wa-bubble-cta {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--teal-deep);
}
.wa-bubble-cta:hover { color: var(--carbon); }

@media (min-width: 860px) {
  .wa-bubble { right: 1.75rem; bottom: calc(1.75rem + 56px + 0.9rem); }
}

/* ============================================================
   Formulario: honeypot, estado de envío y panel de éxito
   ============================================================ */
/* Honeypot fuera de pantalla (no display:none, para engañar bots) */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Botón en estado "enviando": el texto se apaga y aparece un
   spinner circular coherente con el cursor del sitio */
#formSubmit { position: relative; }
#formSubmit .btn-label { transition: opacity 200ms ease; }
#formSubmit.is-sending { pointer-events: none; }
#formSubmit.is-sending .btn-label { opacity: 0; }
#formSubmit.is-sending::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #FFF;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Al completar el envío, los campos se pliegan con suavidad… */
.contact-form.form-done .form-field,
.contact-form.form-done #formSubmit,
.contact-form.form-done .form-status {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 350ms ease, transform 350ms ease;
}

/* …y aparece el panel de éxito */
/* Mientras tiene [hidden] no ocupa espacio: sin esta regla,
   display:grid le ganaría al display:none del navegador */
.form-success[hidden] { display: none; }

.form-success {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2.5rem 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms ease 100ms, transform 400ms ease 100ms;
}
.form-success.show {
  opacity: 1;
  transform: translateY(0);
}

/* Check dibujado con trazo animado (stroke-dashoffset) */
.success-check {
  width: 72px;
  height: 72px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.check-circle {
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
}
.check-mark {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
}
.form-success.show .check-circle {
  animation: drawStroke 600ms ease-out 200ms forwards;
}
.form-success.show .check-mark {
  animation: drawStroke 350ms ease-out 750ms forwards;
}
@keyframes drawStroke { to { stroke-dashoffset: 0; } }

.success-line {
  font-size: 0.85rem;
  color: var(--term-green);
  min-height: 1.4em;
}
.success-sub {
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* ============================================================
   Scroll-reveal — fade + 8px slide, una sola vez
   (la clase .visible la agrega el IntersectionObserver en JS)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sin animaciones para quien las desactiva en su sistema */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .log-cursor { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
