/* ============================================================
   Nebulon Engineering — v2.0
   Paleta: azul petróleo profundo + aqua (agua / naturaleza)
   ============================================================ */
:root {
  --bg: #f2f8f7;
  --bg-alt: #ffffff;
  --ink: #10262e;
  --ink-soft: #46626c;
  --primary: #0b3b4f;
  --primary-dark: #082b3a;
  --accent: #0ea5a0;
  --accent-bright: #2dd4bf;
  --accent-soft: #d9f2ee;
  --gold: #f5b301;
  --line: #d9e6e3;
  --card-shadow: 0 10px 30px rgba(11, 59, 79, .12);
  --radius: 16px;
  --header-h: 78px;
  /* Header según el tema: claro en modo claro, oscuro en modo oscuro */
  --header-bg: #ffffff;
  --header-ink: #0a2c3f;
  --header-hover: rgba(10,44,63,.07);
  --header-btn: rgba(10,44,63,.06);
  --header-border: rgba(10,44,63,.12);
}
html[data-theme="dark"] {
  --bg: #08161d;
  --bg-alt: #0d222c;
  --ink: #eaf4f2;
  --ink-soft: #a9c3bd;
  --primary: #0e4a63;
  --accent: #2dd4bf;
  --accent-soft: #123b3a;
  --line: #1e3a46;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  --header-bg: #0a2c3f;
  --header-ink: #e8f4f2;
  --header-hover: rgba(255,255,255,.12);
  --header-btn: rgba(255,255,255,.10);
  --header-border: rgba(255,255,255,.14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { text-decoration: underline; }

/* Accesibilidad */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--accent); color: #04282e; padding: .7rem 1.2rem; border-radius: 0 0 8px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
section.block { padding: 4.5rem 0; }

/* Animación de aparición */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Cabecera (clara en modo claro, oscura en modo oscuro) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  min-height: var(--header-h);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: var(--header-h); }
/* Logo bien pegado a la izquierda y controles bien pegados a la derecha */
.site-header .wrap { max-width: 1440px; padding-left: .9rem; padding-right: .9rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand:hover { text-decoration: none; }
/* Logo real del cliente (PNG sin fondo, optimizado a WebP).
   Se intercambia según el tema: blanco en header oscuro, navy en header claro. */
.brand-logo { width: 200px; height: auto; }
.mainnav { margin: 0 auto; }
.mainnav ul { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.mainnav a {
  display: block; padding: .65rem 1rem; border-radius: 10px;
  color: var(--header-ink); text-decoration: none; font-weight: 600; font-size: 1.02rem;
  transition: background .2s;
}
.mainnav a:hover { background: var(--header-hover); text-decoration: none; }
.mainnav a.active { background: var(--accent); color: #04282e; }
.nav-toggle { display: none; background: none; border: 1px solid var(--header-border); border-radius: 8px; padding: .6rem; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--header-ink); margin: 4px 0; }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.flag-btn, .theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--header-btn); border: 2px solid transparent;
  text-decoration: none; font-size: 1.15rem; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.flag-btn svg { border-radius: 3px; display: block; }
.flag-btn:hover, .theme-btn:hover { transform: scale(1.1); background: var(--header-hover); text-decoration: none; }
/* Submenú "Divisiones" */
.mainnav .has-sub { position: relative; }
.mainnav .submenu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 200;
  min-width: 270px; list-style: none; margin: .3rem 0 0; padding: .5rem;
  background: var(--header-bg); border: 1px solid var(--header-border);
  border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,.25);
}
.mainnav .has-sub:hover > .submenu, .mainnav .has-sub:focus-within > .submenu { display: block; }
.mainnav .submenu a { white-space: nowrap; font-size: .98rem; }

/* ---------- Héroe con video ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: #082b3a; }
.hero-video, .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { opacity: .5; }
.hero-bg { opacity: .35; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(8,43,58,.92) 20%, rgba(8,43,58,.55) 55%, rgba(14,165,160,.25) 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 6rem 1.25rem; max-width: 1180px; margin: 0 auto; }
.hero-kicker {
  display: inline-block; background: rgba(45,212,191,.16); border: 1px solid rgba(45,212,191,.5);
  color: var(--accent-bright); padding: .4rem 1rem; border-radius: 999px;
  font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.12; margin: 0 0 1.1rem; max-width: 17ch; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero p.lead { font-size: 1.22rem; max-width: 36rem; color: #dcefea; margin: 0 0 2.2rem; }
.hero-cta { display: flex; gap: .9rem; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: .9rem 1.9rem; border-radius: 999px;
  font-weight: 700; font-size: 1.02rem; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.btn-primary { background: linear-gradient(135deg, var(--accent-bright), var(--accent)); color: #04282e; }
.btn-ghost { border-color: rgba(255,255,255,.65); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }
.btn-dark { background: var(--primary); color: #fff; }

/* ---------- Cifras ---------- */
.stats { background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, #0d5a5e); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 2.6rem 1.25rem; max-width: 1180px; margin: 0 auto; text-align: center; }
.stat-num { font-size: 3rem; font-weight: 800; color: var(--accent-bright); line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
.stat-label { color: #d7e9e6; font-weight: 600; font-size: 1.05rem; }

/* ---------- Secciones ---------- */
.kicker { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; margin: 0 0 .6rem; }
h2.section-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0 0 1rem; color: var(--primary); line-height: 1.25; }
html[data-theme="dark"] h2.section-title { color: var(--ink); }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 46rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.4rem; margin-top: 2.2rem; }
.card {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--card-shadow); display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(11,59,79,.18); }
.card .card-img { overflow: hidden; }
.card img { width: 100%; height: 200px; object-fit: cover; transition: transform .4s ease; }
.card:hover img { transform: scale(1.06); }
.card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.18rem; color: var(--primary); }
html[data-theme="dark"] .card-body h3 { color: var(--ink); }
.card-body p { margin: 0; color: var(--ink-soft); font-size: .99rem; flex: 1; }
.card-link { font-weight: 700; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--card-shadow); }

.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; margin-top: 2.2rem; }
.value-card {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--card-shadow); border-top: 4px solid var(--accent);
}
.value-card h3 { margin: 0 0 .5rem; color: var(--primary); }
html[data-theme="dark"] .value-card h3 { color: var(--accent); }
.value-card p { margin: 0; color: var(--ink-soft); }

/* ---------- Carrusel de reconocimientos ---------- */
.carousel { overflow: hidden; margin-top: 2.5rem; padding: 1rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.carousel-track { display: flex; gap: 1.5rem; width: max-content; animation: scroll-x 36s linear infinite; }
.carousel:hover .carousel-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-50%); } }
.carousel-item {
  flex: 0 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.4rem; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--card-shadow); transition: transform .2s;
}
.carousel-item:hover { transform: scale(1.07); }
.carousel-item img { height: 84px; width: auto; max-width: 220px; object-fit: contain; }

.quote { border-left: 4px solid var(--accent); padding: 1.2rem 1.6rem; background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; margin: 2rem 0; box-shadow: var(--card-shadow); }
.quote p { font-size: 1.3rem; font-style: italic; margin: 0 0 .5rem; }
.quote cite { color: var(--ink-soft); font-style: normal; font-weight: 700; }

/* Línea de tiempo */
.timeline { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 1.2rem; }
.timeline li { display: grid; grid-template-columns: 52px 1fr; gap: 1.1rem; align-items: start; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--card-shadow); }
.timeline .dot { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-bright), var(--accent)); color: #04282e; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }
.timeline h3 { margin: 0 0 .25rem; }
.timeline p { margin: 0; color: var(--ink-soft); }

/* Equipo */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.6rem; margin-top: 2.2rem; }
.member { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); text-align: center; transition: transform .25s; }
.member:hover { transform: translateY(-6px); }
.member img { width: 100%; height: 300px; object-fit: cover; object-position: top; }
.member-body { padding: 1.4rem; }
.member-body h3 { margin: 0; font-size: 1.2rem; }
.member-role { color: var(--accent); font-weight: 700; font-size: .92rem; margin: .3rem 0 .7rem; }
.member-body p:last-child { color: var(--ink-soft); font-size: .96rem; margin: 0; }

/* División detalle */
.division { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding: 3.2rem 0; border-bottom: 1px solid var(--line); }
.division:last-child { border-bottom: 0; }
.division:nth-child(even) > :first-child { order: 2; }
.division img { border-radius: var(--radius); box-shadow: var(--card-shadow); }
.division-num { font-size: 4rem; font-weight: 800; color: var(--accent-soft); line-height: 1; }
html[data-theme="dark"] .division-num { color: #123b3a; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .6rem; }
.checklist li { padding-left: 2rem; position: relative; font-weight: 500; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; font-size: 1.2rem; }

/* Formulario */
.form-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
form.contact { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--card-shadow); display: grid; gap: 1.1rem; border-top: 4px solid var(--accent); }
.field label { display: block; font-weight: 700; margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.field textarea { min-height: 140px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 1rem 1.25rem; border-radius: 10px; font-weight: 600; }
.alert-ok { background: #d9f2ee; color: #0b5c4e; border: 1px solid #12a594; }
.alert-err { background: #fde8e8; color: #8f1d1d; border: 1px solid #e05555; }
html[data-theme="dark"] .alert-ok { background: #123b3a; color: #7ef0dd; }
html[data-theme="dark"] .alert-err { background: #3a1515; color: #f3a3a3; }

/* Banda CTA + pie */
.cta-band { background: linear-gradient(120deg, #082b3a, #0b3b4f 55%, #0d6b66); color: #fff; text-align: center; padding: 4rem 1.25rem; position: relative; overflow: hidden; }
.cta-band::before { content: "💧"; position: absolute; font-size: 16rem; opacity: .06; right: -2rem; top: -3rem; }
.cta-band h2 { margin: 0 0 .6rem; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.cta-band p { color: #cfe4e1; margin: 0 0 1.8rem; font-size: 1.1rem; }
.site-footer { background: #071e29; color: #cfe0dc; padding: 3.5rem 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.2rem; padding-bottom: 2.5rem; }
.footer-brand .brand-logo { margin-bottom: 1rem; }
/* Socios estratégicos */
.partners-row { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: center; align-items: center; }
.partners-row img { max-width: 200px; height: auto; filter: grayscale(20%); }
/* Video responsive 16:9 */
.video-wrap { position: relative; width: 100%; max-width: 860px; margin: 0 auto; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 .9rem; text-transform: uppercase; letter-spacing: .06em; font-size: .88rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer a { color: #cfe0dc; text-decoration: none; }
.site-footer a:hover { color: var(--accent-bright); text-decoration: underline; }
/* Iconos sociales estilo RAAMSOFT: grises, al hover toman el color de la red */
/* Iconos sociales estilo RAAMSOFT: grises, al hover toman el color de la red.
   Selector reforzado: .site-footer ul también les pone display:grid y debe ganar el flex. */
.site-footer ul.social, ul.social { display: flex; flex-direction: row; flex-wrap: wrap; gap: .7rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.social a {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #8a9ba8; background: rgba(255,255,255,.06); text-decoration: none;
  transition: color .3s ease, background .3s ease, transform .3s ease;
}
.social a:hover { transform: translateY(-3px) scale(1.08); background: #fff; text-decoration: none; }
.social a.social-instagram:hover { color: #E1306C; }
.social a.social-youtube:hover { color: #FF0000; }
.social a.social-whatsapp:hover { color: #25D366; }
.social a.social-linkedin:hover { color: #0A66C2; }
.social svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.footer-base { border-top: 1px solid rgba(255,255,255,.14); padding: 1.3rem 1.25rem; text-align: center; }

/* ---------- Chatbot ---------- */
.chat-widget { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: .8rem; }
.chat-fab {
  display: inline-flex; align-items: center; gap: .6rem;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #04282e; border: 0; border-radius: 999px; padding: .9rem 1.5rem;
  font-weight: 800; font-size: 1rem; cursor: pointer;
  box-shadow: 0 10px 26px rgba(14,165,160,.45);
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.05); }
.chat-fab-icon { font-size: 1.3rem; }
/* ============ Gotica por capas: cuerpo, ojos, iris, boca, brazos, zapatos ============ */
.chat-fab-gotica {
  width: 108px; padding: 4px; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 10px 14px rgba(10,60,140,.3));
  transition: transform .25s;
}
.chat-fab-gotica:hover { transform: translateY(-4px); }
.chat-fab-gotica .gx-av { display: block; width: 100%; }
.chat-avatar { width: 52px; display: block; flex: none; }
.chat-avatar .gx-av { display: block; width: 100%; }
/* Globito de invitación */
.chat-tease {
  position: fixed; bottom: 132px; right: 96px; z-index: 1001;
  max-width: 220px; padding: 10px 14px; border: 0; cursor: pointer;
  background: #fff; color: #0c2f5a; border-radius: 16px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(10,60,140,.22);
  opacity: 0; transform: translateY(8px) scale(.95); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.chat-tease.show { opacity: 1; transform: none; pointer-events: auto; }
[data-theme="dark"] .chat-tease { background: #12395e; color: #eaf4ff; }
/* Puntitos "escribiendo" */
.chat-msg.typing { display: flex; gap: 5px; padding: 13px 15px; }
.chat-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: #5aa9ef; animation: gxDot 1s infinite; }
.chat-msg.typing i:nth-child(2) { animation-delay: .18s; }
.chat-msg.typing i:nth-child(3) { animation-delay: .36s; }
/* ---- Motor del avatar (unidades = píxeles del lienzo 470x506) ---- */
.gx-av { position: relative; line-height: 0; --px: 0px; --py: 0px; }
.gx-svg { display: block; width: 100%; height: auto; overflow: visible; }
.gx-lean { transform-origin: 272px 394px; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.gx-body { transform-origin: 272px 394px; animation: gxBreathe 3.4s ease-in-out infinite; }
.gx-all { transform-origin: 272px 494px; }
.gx-pose { transition: transform .55s cubic-bezier(.3,1.25,.5,1); }
.gx-arm-l { animation: gxArmL 2.8s ease-in-out infinite; }
.gx-arm-r { animation: gxArmR 3.3s ease-in-out infinite; }
.gx-pup { transform: translate(var(--px),var(--py)); transition: transform .22s ease-out; }
.gx-blink .gx-eye { animation: gxBlink .19s ease-in-out; }
.gx-mouth { transition: transform .2s ease-out; }
.gx-tap .gx-sh-l { animation: gxTapL .3s ease-in-out 4; }
.gx-tap .gx-sh-r { animation: gxTapR .3s ease-in-out .15s 4; }
.gx-thought { opacity: 0; transition: opacity .3s; pointer-events: none; }
.gx-d1,.gx-d2,.gx-d3 { transform-box: fill-box; transform-origin: center; }
/* Estados del avatar (los pone js/gotica.js vía window.mascota) */
.gx-av[data-estado="saludando"] .gx-pose-r { transform: rotate(-140deg); }
.gx-av[data-estado="saludando"] .gx-arm-r { animation: gxWave .5s ease-in-out infinite alternate; }
.gx-av[data-estado="saludando"] .gx-all { animation: gxHop .55s ease-out 3; }
.gx-av[data-estado="saludando"] .gx-sh-l { animation: gxTapL .24s ease-in-out infinite; }
.gx-av[data-estado="escuchando"] .gx-lean { transform: rotate(-3.5deg); }
.gx-av[data-estado="escuchando"] .gx-pose-r { transform: rotate(20deg); }
.gx-av[data-estado="escuchando"] .gx-eye { transform: scale(1.04); }
.gx-av[data-estado="escuchando"] .gx-mouth { transform: scale(.82,.3); }
.gx-av[data-estado="escuchando"] .gx-sh-l { animation: gxTapL .48s ease-in-out infinite; }
.gx-av[data-estado="escuchando"] .gx-sh-r { animation: gxTapR .48s ease-in-out .24s infinite; }
.gx-av[data-estado="escuchando"] .gx-arm-l { animation-duration: 1.2s; }
.gx-av[data-estado="pensando"] .gx-lean { transform: rotate(2.5deg); }
.gx-av[data-estado="pensando"] .gx-pose-r { transform: rotate(72deg); }
.gx-av[data-estado="pensando"] .gx-arm-r { animation: gxChin .7s ease-in-out infinite alternate; }
.gx-av[data-estado="pensando"] .gx-all { animation: gxSway 3s ease-in-out infinite; }
.gx-av[data-estado="pensando"] .gx-mouth { transform: scale(.45,.8); }
.gx-av[data-estado="pensando"] .gx-thought { opacity: 1; }
.gx-av[data-estado="pensando"] .gx-d1 { animation: gxDot 1s ease-in-out infinite; }
.gx-av[data-estado="pensando"] .gx-d2 { animation: gxDot 1s ease-in-out .2s infinite; }
.gx-av[data-estado="pensando"] .gx-d3 { animation: gxDot 1s ease-in-out .4s infinite; }
.gx-av[data-estado="pensando"] .gx-sh-l { animation: gxTapL .9s ease-in-out infinite; }
.gx-av[data-estado="hablando"] .gx-all { animation: gxBounce .42s ease-in-out infinite alternate; }
.gx-av[data-estado="hablando"] .gx-arm-l { animation: gxGestL .55s ease-in-out infinite alternate; }
.gx-av[data-estado="hablando"] .gx-pose-r { transform: rotate(-38deg); }
.gx-av[data-estado="hablando"] .gx-arm-r { animation: gxGestR .7s ease-in-out infinite alternate; }
.gx-av[data-estado="hablando"] .gx-sh-l { animation: gxTapL .6s ease-in-out infinite; }
.gx-av[data-estado="hablando"] .gx-sh-r { animation: gxTapR .6s ease-in-out .3s infinite; }
/* Boca que habla: también como clase temporal (compone con cualquier estado) */
.gx-av.gx-hablando .gx-mouth { animation: gxTalk .23s ease-in-out infinite alternate; }
/* --- Nuevos estados --- */
.gx-av[data-estado="escribiendo"] .gx-pose-l { transform: rotate(-14deg); }
.gx-av[data-estado="escribiendo"] .gx-pose-r { transform: rotate(14deg); }
.gx-av[data-estado="escribiendo"] .gx-arm-l { animation: gxTypeL .3s ease-in-out infinite alternate; }
.gx-av[data-estado="escribiendo"] .gx-arm-r { animation: gxTypeR .3s ease-in-out .15s infinite alternate; }
.gx-av[data-estado="escribiendo"] .gx-eye { transform: scaleY(.85); }
.gx-av[data-estado="buscando"] .gx-pose-r { transform: rotate(-155deg); }
.gx-av[data-estado="buscando"] .gx-pup { animation: gxScan 1.1s ease-in-out infinite; }
.gx-av[data-estado="buscando"] .gx-mouth { transform: scale(.7,.6); }
.gx-av[data-estado="no_sabe"] .gx-pose-l { transform: rotate(-115deg); }
.gx-av[data-estado="no_sabe"] .gx-pose-r { transform: rotate(115deg); }
.gx-av[data-estado="no_sabe"] .gx-mouth { transform: scale(.7,.5); }
.gx-av[data-estado="no_sabe"] .gx-signo { visibility: visible; animation: gxFlota 1.4s ease-in-out infinite; }
.gx-av[data-estado="feliz"] .gx-all { animation: gxHop .6s ease-out 2; }
.gx-av[data-estado="feliz"] .gx-pose-l { transform: rotate(-150deg); }
.gx-av[data-estado="feliz"] .gx-pose-r { transform: rotate(150deg); }
.gx-av[data-estado="feliz"] .gx-mouth { transform: scale(1.25,1.15); }
.gx-av[data-estado="despidiendose"] .gx-pose-r { transform: rotate(-140deg); }
.gx-av[data-estado="despidiendose"] .gx-arm-r { animation: gxWave 1.1s ease-in-out infinite alternate; }
.gx-av[data-estado="triste"] .gx-body { animation: none; transform: scale(.97,.94); }
.gx-av[data-estado="triste"] .gx-eye { transform: scaleY(.72); }
.gx-av[data-estado="triste"] .gx-mouth { transform: scale(.85,.7); }
.gx-av[data-estado="triste"] .gx-lean { transform: rotate(2deg); }
.gx-av[data-estado="error"] .gx-all { animation: gxSusto .45s ease-in-out 2; }
.gx-av[data-estado="error"] .gx-eye { transform: scale(1.08); }
.gx-av[data-estado="error"] .gx-mouth { transform: scale(.6,.5); }
/* "?" flotante del estado no_sabe (dentro del SVG: escala solo) */
.gx-signo { transform-box: fill-box; transform-origin: center; }
/* Gestos idle que el JS dispara con clases temporales */
.gx-av.gx-gesto-guinar .gx-eye-r { transform: scaleY(.1); }
.gx-av.gx-gesto-ladear .gx-lean { transform: rotate(-9deg); }
.gx-av.gx-gesto-estirar .gx-body { animation: gxEstirar 1.6s ease-in-out; }
.gx-av.gx-gesto-salto .gx-all { animation: gxHop .55s ease-out 1; }
@keyframes gxBreathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(.992,1.016); } }
@keyframes gxArmL { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(3deg); } }
@keyframes gxArmR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(2.5deg); } }
@keyframes gxBlink { 0%,100% { transform: scaleY(1); } 45% { transform: scaleY(.07); } }
@keyframes gxTapL { 0%,100% { transform: rotate(0); } 50% { transform: rotate(3.5deg); } }
@keyframes gxTapR { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-3.5deg); } }
@keyframes gxWave { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes gxHop { 0%,100% { transform: translateY(0); } 40% { transform: translateY(-26px); } }
@keyframes gxChin { from { transform: rotate(0); } to { transform: rotate(-5deg); } }
@keyframes gxSway { 0%,100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes gxDot { 0%,100% { transform: scale(.6); opacity: .5; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes gxBounce { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes gxTalk { from { transform: scale(1.03,1); } to { transform: scale(.92,.38); } }
@keyframes gxGestL { from { transform: rotate(-7deg); } to { transform: rotate(4deg); } }
@keyframes gxGestR { from { transform: rotate(-14deg); } to { transform: rotate(12deg); } }
@keyframes gxTypeL { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes gxTypeR { from { transform: rotate(6deg); } to { transform: rotate(-6deg); } }
@keyframes gxScan { 0%,100% { transform: translate(-9px,-1px); } 50% { transform: translate(9px,-1px); } }
@keyframes gxFlota { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-7px) rotate(6deg); } }
@keyframes gxSusto { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes gxEstirar { 0%,100% { transform: scale(1,1); } 40% { transform: scale(1.03,1.07); } }
/* Movimiento reducido: expresiones sí, animaciones no */
@media (prefers-reduced-motion: reduce) {
  .gx-av .gx-arm-l, .gx-av .gx-arm-r, .gx-av .gx-all, .gx-av .gx-body,
  .gx-av .gx-pup, .gx-av .gx-signo, .gx-av .gx-mouth { animation: none !important; }
}
/* ---- Escenario de poses (cabecera del chat): espera / piensa / chao ---- */
.gx-stage { position: relative; display: block; }
.gx-poseimg { width: 100%; height: auto; display: block; }
.gx-poseimg[hidden] { display: none !important; }
.gx-stage[data-pose="espera"] .gx-poseimg:not([hidden]) { animation: gxPoseIn .3s ease-out, gxPoseBob 1.8s ease-in-out .3s infinite; }
.gx-stage[data-pose="piensa"] .gx-poseimg:not([hidden]) { animation: gxPoseIn .3s ease-out, gxPoseSway 2.6s ease-in-out .3s infinite; }
.gx-stage[data-pose="chao"] .gx-poseimg:not([hidden]) { animation: gxPoseIn .3s ease-out, gxPoseWave .55s ease-in-out .3s infinite alternate; }
@keyframes gxPoseIn { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes gxPoseBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes gxPoseSway { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes gxPoseWave { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
/* Nubecita "pensando" sobre la pose */
.gx-thinkbub { position: absolute; top: -4px; left: -2px; width: 38px; height: 27px; background: #fff; border: 2.5px solid #9cc6ef; border-radius: 50%; display: none; }
.gx-thinkbub::after { content: ""; position: absolute; bottom: -9px; left: 9px; width: 9px; height: 9px; background: #fff; border: 2px solid #9cc6ef; border-radius: 50%; }
.gx-thinkbub i { position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #2290ec; animation: gxDot 1s ease-in-out infinite; }
.gx-thinkbub i:nth-child(1) { left: 7px; }
.gx-thinkbub i:nth-child(2) { left: 15px; animation-delay: .2s; }
.gx-thinkbub i:nth-child(3) { left: 23px; animation-delay: .4s; }
.gx-stage[data-pose="piensa"] .gx-thinkbub { display: block; }
/* ---------- Imagen flotante (para elementos destacados como el cohete) ---------- */
.anim-flotar { animation: flotar 5s ease-in-out infinite; transform-origin: center; display: inline-block; }
@keyframes flotar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1.6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .anim-flotar { animation: none; }
}

/* Mensajes con saltos de línea (p. ej. fallback + WhatsApp) */
.chat-msg { white-space: pre-line; }
.chat-panel {
  display: none;
  width: min(370px, calc(100vw - 2.5rem)); height: 480px; max-height: 70vh;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3); flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .7rem; }
.chat-head strong { flex: 1; }
/* Banderita de idioma dentro del chat (una sola: la del otro idioma) */
.chat-flag { border: 2px solid transparent; background: rgba(255,255,255,.15); border-radius: 8px; padding: 3px 5px; cursor: pointer; transition: border-color .2s, background .2s; line-height: 0; }
.chat-flag svg { display: block; width: 22px; height: 15px; }
.chat-flag:hover { border-color: #fff; background: rgba(255,255,255,.3); }
.chat-close { background: none; border: 0; color: #fff; font-size: 1.2rem; cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }
.chat-close:hover { background: rgba(255,255,255,.15); }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: var(--bg); }
.chat-msg { max-width: 85%; padding: .7rem .95rem; border-radius: 14px; font-size: .94rem; line-height: 1.5; }
.chat-msg.bot { background: var(--bg-alt); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: var(--card-shadow); }
.chat-msg.user { background: var(--accent); color: #04282e; font-weight: 600; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-msg.typing { opacity: .6; font-style: italic; }
.chat-msg.bot a { color: var(--accent); font-weight: 700; }
.chat-msg.bot a:hover { text-decoration: underline; }
.chat-quick { display: flex; gap: .5rem; padding: .6rem .8rem; flex-wrap: wrap; background: var(--bg-alt); border-top: 1px solid var(--line); }
.chat-quick button { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: .35rem .85rem; font-size: .85rem; font-weight: 700; cursor: pointer; }
.chat-quick button:hover { background: var(--accent-soft); }
html[data-theme="dark"] .chat-quick button { color: var(--accent-bright); }
.chat-form { display: flex; border-top: 1px solid var(--line); background: var(--bg-alt); }
.chat-form input { flex: 1; border: 0; padding: .9rem 1rem; font: inherit; background: transparent; color: var(--ink); }
.chat-form input:focus { outline: none; }
.chat-form button { border: 0; background: var(--accent); color: #04282e; font-size: 1.2rem; padding: 0 1.2rem; cursor: pointer; font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .split, .division, .form-grid { grid-template-columns: 1fr; }
  .division:nth-child(even) > :first-child { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  .nav-toggle { display: block; margin-left: auto; }
  .mainnav { display: none; width: 100%; order: 5; margin: 0; }
  .mainnav.open { display: block; }
  .mainnav ul { flex-direction: column; padding: .6rem 0 1rem; }
  .mainnav .submenu { display: block; position: static; box-shadow: none; border: 0; border-radius: 0; margin: 0; padding: 0 0 0 1rem; min-width: 0; }
  .header-inner { flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
  .header-tools { margin-left: 0; }
  .brand img { width: 170px; }
  .stats-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .footer-grid { grid-template-columns: 1fr; }
  section.block { padding: 3rem 0; }
  .hero-inner { padding: 4rem 1.25rem; }
  .chat-fab-label { display: none; }
  .chat-fab:not(.chat-fab-gotica) { padding: .9rem 1.1rem; }
}
