/* ==========================================================================
   BotSolutions 2.0 — Componentes (prototipo de referencia)
   Cada bloque corresponde a un componente Astro documentado en
   docs/design-system.md. Los valores salen de tokens.css.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bs-header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--surface); color: var(--text-body);
  font-family: var(--bs-font-body); font-size: var(--bs-text-body); line-height: var(--bs-leading-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--bs-sky-500); color: var(--bs-night-950); }
[hidden] { display: none !important; }
.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; }

[data-surface] { background: var(--surface); color: var(--text-body); }

/* ---------- Tipografía ---------- */
.t-display, .t-h1, .t-h2, .t-h3, .t-h4 { font-family: var(--bs-font-display); color: var(--text-heading); text-wrap: balance; }
.t-display { font-size: var(--bs-text-display); line-height: var(--bs-leading-display); letter-spacing: var(--bs-tracking-display); font-weight: 700; }
.t-h1 { font-size: var(--bs-text-h1); line-height: 1.05; letter-spacing: var(--bs-tracking-h1); font-weight: 700; }
.t-h2 { font-size: var(--bs-text-h2); line-height: var(--bs-leading-heading); letter-spacing: var(--bs-tracking-h2); font-weight: 700; }
.t-h3 { font-size: var(--bs-text-h3); line-height: var(--bs-leading-h3); letter-spacing: var(--bs-tracking-h3); font-weight: 700; }
.t-h4 { font-size: var(--bs-text-h4); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.t-lead { font-size: var(--bs-text-lead); line-height: 1.55; color: var(--text-body); max-width: 60ch; text-wrap: pretty; }
.t-small { font-size: var(--bs-text-small); line-height: 1.5; }
.t-accent { color: var(--accent-text); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--bs-font-mono); font-size: var(--bs-text-label); font-weight: 500; line-height: 1.4;
  letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--label);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 20%, transparent); }
.prose { max-width: 68ch; display: grid; gap: 1em; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--bs-container) + 2 * var(--bs-gutter)); margin-inline: auto; padding-inline: var(--bs-gutter); }
.section { padding-block: var(--bs-section-y); position: relative; }
.section--tight { padding-block: var(--bs-section-y-tight); }
.section--round-bottom { border-radius: 0 0 var(--bs-radius-2xl) var(--bs-radius-2xl); }
.section-head { display: grid; gap: 16px; margin-bottom: var(--bs-stack-heading); max-width: 760px; }
.section-head--split { max-width: none; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 1024px) { .section-head--split { grid-template-columns: 1.1fr 0.9fr; gap: 48px; } }
.grid { display: grid; gap: var(--bs-grid-gap); grid-template-columns: repeat(var(--cols-sm, 1), minmax(0, 1fr)); }
@media (min-width: 768px)  { .grid { grid-template-columns: repeat(var(--cols-md, 2), minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(var(--cols-lg, 3), minmax(0, 1fr)); } }
.stack { display: grid; gap: var(--gap, 16px); }
.stack > .btn { justify-self: start; }

/* ---------- Skip link ---------- */
.skip-link { position: fixed; left: 16px; top: -100px; z-index: var(--bs-z-skip); background: var(--bs-gray-0); color: var(--bs-night-950); padding: 12px 16px; border-radius: var(--bs-radius-md); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- Botones ---------- */
.btn {
  --btn-h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 22px; border-radius: var(--bs-radius-md);
  font-family: var(--bs-font-body); font-size: 1rem; font-weight: 600; line-height: 1; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer; border: 1px solid transparent;
  transition: background-color var(--bs-dur-fast) var(--bs-ease-out), border-color var(--bs-dur-fast) var(--bs-ease-out), color var(--bs-dur-fast) var(--bs-ease-out), transform var(--bs-dur-fast) var(--bs-ease-out), box-shadow var(--bs-dur-base) var(--bs-ease-out);
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform var(--bs-dur-base) var(--bs-ease-out); }
.btn:hover svg.icon-arrow { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn--sm { --btn-h: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn--lg { --btn-h: 56px; padding: 0 28px; font-size: 1.0625rem; }
.btn--block { width: 100%; }

.btn--primary { background: var(--bs-pulse-600); color: #fff; }
.btn--primary:hover { background: var(--bs-pulse-700); color: #fff; box-shadow: 0 8px 24px rgb(208 19 108 / 0.28); }
.btn--primary:active { background: var(--bs-pulse-800); }

.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-input); }
.btn--secondary:hover { color: var(--text); border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }

.btn--ghost { background: transparent; color: var(--link); padding-inline: 4px; min-height: 44px; }
.btn--ghost:hover { color: var(--link-hover); }

.btn[aria-disabled="true"], .btn:disabled { background: var(--surface-sunken); color: var(--text-placeholder); border-color: var(--border); box-shadow: none; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .btn__label { opacity: 0.85; }
.btn .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: bs-spin 0.8s linear infinite; }
@keyframes bs-spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--bs-z-header);
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-base) var(--bs-ease-out), backdrop-filter var(--bs-dur-base);
}
.site-header.is-scrolled { background: rgb(7 20 48 / 0.86); backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px); border-bottom-color: var(--bs-night-700); }
.site-header__bar { height: var(--bs-header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header__logo { display: inline-flex; align-items: center; padding: 6px 0; border-radius: 6px; }
.site-header__logo img { height: 32px; width: auto; }
@media (min-width: 1024px) { .site-header__logo img { height: 36px; } }
.site-nav { display: none; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px;
  color: var(--bs-slate-300); text-decoration: none; font-size: 0.9375rem; font-weight: 500; position: relative;
}
.site-nav a:hover { color: var(--bs-text-on-dark); background: rgb(255 255 255 / 0.04); }
.site-nav a[aria-current="page"] { color: var(--bs-text-on-dark); }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--bs-gradient-brand); }
.site-header__actions { display: flex; align-items: center; gap: 8px; }
.site-header__cta { display: none; }
.menu-toggle {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--bs-radius-md);
  background: transparent; border: 1px solid var(--bs-night-700); color: var(--bs-text-on-dark); cursor: pointer;
}
.menu-toggle svg { width: 22px; height: 22px; }
@media (min-width: 768px) { .site-header__cta { display: inline-flex; } }
@media (min-width: 1024px) { .site-nav { display: block; } .menu-toggle { display: none; } }

/* ---------- Menú mobile ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: var(--bs-z-menu); background: var(--bs-night-950);
  display: grid; grid-template-rows: auto 1fr auto; padding-bottom: env(safe-area-inset-bottom, 0px);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity var(--bs-dur-base) var(--bs-ease-out), transform var(--bs-dur-base) var(--bs-ease-out), visibility 0s linear var(--bs-dur-base);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.mobile-menu__nav { padding-top: 24px; overflow-y: auto; }
.mobile-menu__nav ul { list-style: none; margin: 0; padding: 0; display: grid; }
.mobile-menu__nav a {
  display: flex; align-items: center; justify-content: space-between; min-height: 64px;
  border-bottom: 1px solid var(--bs-night-700); color: var(--bs-text-on-dark); text-decoration: none;
  font-family: var(--bs-font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em;
}
.mobile-menu__nav a[aria-current="page"] { color: var(--bs-sky-400); }
.mobile-menu__nav a svg { width: 22px; height: 22px; color: var(--bs-slate-300); }
.mobile-menu__foot { display: grid; gap: 16px; padding-block: 24px; }
.mobile-menu__foot p { color: var(--bs-slate-300); font-size: var(--bs-text-small); }
body.menu-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bs-halo-hero), var(--surface); margin-top: calc(-1 * var(--bs-header-h)); padding-top: calc(var(--bs-header-h) + clamp(40px, 6vw, 96px)); padding-bottom: clamp(72px, 9vw, 144px); }
.hero__grid { display: grid; gap: 40px; align-items: center; position: relative; z-index: 1; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; } }
.hero__copy { display: grid; gap: 24px; justify-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero__visual { position: relative; justify-self: center; width: min(100%, 520px); aspect-ratio: 515 / 415; }
.hero__visual img { width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgb(84 170 220 / 0.25)); }
@media (max-width: 1023.98px) { .hero__visual { width: min(70%, 360px); order: -1; justify-self: start; } }
@media (max-width: 767.98px) { .hero__visual { width: 168px; } }
.hero__lines { position: absolute; inset: auto 0 0 0; height: 70%; background: url("../assets/illustrations/flow-lines-on-dark.svg") center bottom / cover no-repeat; opacity: 0.5; pointer-events: none; }

.page-hero { position: relative; overflow: hidden; background: var(--bs-halo-hero), var(--surface); margin-top: calc(-1 * var(--bs-header-h)); padding-top: calc(var(--bs-header-h) + clamp(48px, 6vw, 96px)); padding-bottom: clamp(56px, 7vw, 112px); }
.page-hero__inner { display: grid; gap: 20px; max-width: 820px; position: relative; z-index: 1; }
.page-hero__symbol { position: absolute; right: max(-60px, calc(50% - 760px)); top: 50%; transform: translateY(-40%); width: clamp(220px, 32vw, 440px); opacity: 0.18; pointer-events: none; }
@media (max-width: 767.98px) { .page-hero__symbol { right: -60px; top: 28%; width: 220px; opacity: 0.1; } }
.breadcrumb { font-size: var(--bs-text-small); color: var(--text-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border-input); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Franja de categorías bajo el hero ---------- */
.overlap { position: relative; z-index: 2; margin-top: calc(-1 * clamp(40px, 5vw, 72px)); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; border-top: 1px solid var(--border); padding-top: 28px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { display: grid; gap: 6px; }
.stat__value { font-family: var(--bs-font-display); font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.stat__label { font-size: var(--bs-text-small); color: var(--text-muted); max-width: 22ch; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--bs-radius-sm); background: var(--tag-bg); color: var(--tag-text); font-family: var(--bs-font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Card base ---------- */
.card {
  position: relative; display: grid; gap: 14px; align-content: start;
  padding: clamp(20px, 2vw, 28px); border-radius: var(--bs-radius-lg);
  background: var(--surface-raised); border: 1px solid var(--border); color: var(--text-body);
  transition: box-shadow var(--bs-dur-base) var(--bs-ease-out), transform var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-base) var(--bs-ease-out);
}
.card { box-shadow: var(--card-shadow); }
.card__title { font-family: var(--bs-font-display); color: var(--text-heading); font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; }
.card__text { font-size: 0.9375rem; line-height: 1.6; }
.card__link { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 600; font-size: 0.9375rem; color: var(--link); text-decoration: none; }
.card__link svg { width: 18px; height: 18px; transition: transform var(--bs-dur-base) var(--bs-ease-out); }
/* Toda la card es clickeable mediante el link estirado */
.card--link .card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card--link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card--link:hover { box-shadow: var(--card-shadow-hover); background: var(--card-hover-bg); }
.card--link:hover .card__link svg { transform: translateX(4px); }
.card--link:has(.card__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.card--link .card__link:focus-visible { outline: none; }

.icon-tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--tag-bg); color: var(--text-heading); }
.icon-tile svg { width: 26px; height: 26px; }

/* Service card */
.card-service__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-service__list { display: grid; gap: 6px; padding: 0; margin: 4px 0 0; list-style: none; font-size: 0.9375rem; }
.card-service__list li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.card-service__list svg { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }

/* Category card (Automatizar / Conectar / Mejorar) */
.card-category { gap: 10px; }
.card-category .card__title { font-size: 1.375rem; }
.card-category__services { font-size: var(--bs-text-small); color: var(--text-muted); }

/* Case card */
.card-case { gap: 16px; }
.card-case__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.card-case__sector { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--label); }
.card-case__rows { display: grid; gap: 12px; margin: 0; }
.card-case__rows div { display: grid; gap: 2px; }
.card-case__rows dt { font-family: var(--bs-font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.card-case__rows dd { margin: 0; font-size: 0.9375rem; color: var(--text-body); }
.card-case__result { padding: 12px 14px; border-radius: var(--bs-radius-md); background: var(--result-bg); }
.card-case__rows .card-case__result dt { color: var(--result-label); }
.card-case__rows .card-case__result dd { color: var(--result-text); font-weight: 500; }

/* Problem card (paso 1 de la narrativa) */
.card-problem { grid-template-columns: 40px 1fr; gap: 14px; align-items: start; padding: 20px; box-shadow: none !important; }
.card-problem .icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.card-problem .icon-tile svg { width: 22px; height: 22px; }
.card-problem h3 { font-family: var(--bs-font-display); font-size: 1.0625rem; color: var(--text-heading); line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.card-problem p { font-size: 0.9375rem; margin-top: 4px; }

/* ---------- Metodología (pasos) ---------- */
.steps { display: grid; gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } }
.step { position: relative; display: grid; gap: 10px; align-content: start; padding: 24px; border: 1px solid var(--border); border-radius: var(--bs-radius-lg); background: var(--surface-raised); }
@media (min-width: 1024px) {
  .step { border-radius: 0; border-right-width: 0; }
  .step:first-child { border-radius: var(--bs-radius-lg) 0 0 var(--bs-radius-lg); }
  .step:last-child { border-radius: 0 var(--bs-radius-lg) var(--bs-radius-lg) 0; border-right-width: 1px; }
}
.step__num { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); color: var(--label); }
.step__title { font-family: var(--bs-font-display); font-size: 1.25rem; font-weight: 700; color: var(--text-heading); letter-spacing: -0.02em; }
.step p { font-size: 0.9375rem; }
.step__bar { height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 6px; }
.step__bar span { display: block; height: 100%; background: var(--bs-gradient-brand); background-size: calc(100% * 100 / var(--pn, 25)) 100%; width: var(--p, 25%); }

/* ---------- Tecnologías ---------- */
.tech-groups { display: grid; gap: 16px; }
@media (min-width: 768px) { .tech-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tech-group { display: grid; gap: 14px; align-content: start; padding: 22px; border-radius: var(--bs-radius-lg); border: 1px solid var(--border); background: var(--surface-raised); }
.tech-group h3 { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--label); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--bs-radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 0.9375rem; font-weight: 500; }

/* ---------- Testimonio ---------- */
.testimonial { display: grid; gap: 20px; align-content: space-between; padding: clamp(22px, 2.4vw, 32px); border-radius: var(--bs-radius-lg); background: var(--surface-raised); border: 1px solid var(--border); }
.testimonial blockquote { font-family: var(--bs-font-display); font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem); line-height: 1.4; letter-spacing: -0.01em; color: var(--text-heading); font-weight: 500; }
.testimonial blockquote::before { content: ""; display: block; width: 36px; height: 3px; border-radius: 3px; background: var(--bs-gradient-brand); margin-bottom: 16px; }
.testimonial figcaption { display: grid; gap: 2px; font-size: var(--bs-text-small); }
.testimonial figcaption b { color: var(--text); font-weight: 600; }
.testimonial figcaption span { color: var(--text-muted); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: var(--bs-radius-xl); background: var(--bs-halo-cta), var(--bs-night-950); color: var(--bs-slate-300); padding: clamp(32px, 5vw, 72px); display: grid; gap: 24px; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: url("../assets/illustrations/flow-lines-on-dark.svg") center bottom / cover no-repeat; opacity: 0.45; z-index: -1; }
@media (min-width: 1024px) { .cta-band { grid-template-columns: 1.4fr auto; align-items: end; gap: 48px; } }
.cta-band h2 { color: var(--bs-text-on-dark); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band__note { font-size: var(--bs-text-small); color: var(--bs-slate-300); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--bs-sky-500), var(--bs-pulse-600)); border-radius: 2px; }
.timeline__item { position: relative; display: grid; gap: 6px; padding: 0 0 32px 44px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before { content: ""; position: absolute; left: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--bs-azure-600); }
.timeline__item.is-current::before { background: var(--bs-pulse-600); border-color: var(--bs-pulse-600); box-shadow: 0 0 0 6px rgb(208 19 108 / 0.15); }
.timeline__label { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--label); }
.timeline__title { font-family: var(--bs-font-display); font-size: 1.25rem; font-weight: 700; color: var(--text-heading); letter-spacing: -0.02em; }
.timeline__text { max-width: 60ch; font-size: 0.9375rem; }
@media (min-width: 1024px) {
  .timeline--horizontal { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 24px; }
  .timeline--horizontal::before { left: 8px; right: 8px; top: 11px; bottom: auto; width: auto; height: 2px; background: var(--bs-gradient-brand); }
  .timeline--horizontal .timeline__item { padding: 44px 0 0 0; }
  .timeline--horizontal .timeline__item::before { left: 0; top: 4px; }
}

/* ---------- FAQ (acordeón) ---------- */
.faq { display: grid; border-top: 1px solid var(--border); }
.faq__item { border-bottom: 1px solid var(--border); }
.faq__q { margin: 0; }
.faq__btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; text-align: left;
  min-height: 64px; padding: 18px 0; background: none; border: 0; cursor: pointer; color: var(--text-heading);
  font-family: var(--bs-font-display); font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem); font-weight: 600; letter-spacing: -0.01em; line-height: 1.35;
}
.faq__btn:hover { color: var(--link); }
.faq__icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-input); transition: transform var(--bs-dur-base) var(--bs-ease-out), background-color var(--bs-dur-base); }
.faq__icon svg { width: 16px; height: 16px; }
.faq__btn[aria-expanded="true"] .faq__icon { transform: rotate(45deg); background: var(--tag-bg); }
.faq__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--bs-dur-base) var(--bs-ease-out); }
.faq__panel > div { overflow: hidden; }
.faq__panel.is-open { grid-template-rows: 1fr; }
.faq__panel p { padding: 0 56px 22px 0; max-width: 72ch; }
@media (max-width: 767.98px) { .faq__panel p { padding-right: 0; } }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 20px; }
.form__row { display: grid; gap: 20px; }
@media (min-width: 768px) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 8px; }
.field__label { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.field__label .opt { font-weight: 400; color: var(--text-muted); }
.field__hint { font-size: var(--bs-text-small); color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--bs-radius-md);
  border: 1px solid var(--border-input); background: var(--surface-raised); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.4;
  transition: border-color var(--bs-dur-fast), box-shadow var(--bs-dur-fast);
}
.textarea { min-height: 140px; resize: vertical; }
.select { appearance: none; padding-right: 44px; 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='%235B6577' 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; }
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.field[data-invalid] .input, .field[data-invalid] .select, .field[data-invalid] .textarea { border-color: var(--error); }
.field[data-invalid] .input:focus-visible, .field[data-invalid] .textarea:focus-visible, .field[data-invalid] .select:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 25%, transparent); }
.field__error { display: none; align-items: flex-start; gap: 6px; font-size: var(--bs-text-small); color: var(--error); font-weight: 500; }
.field__error svg { width: 16px; height: 16px; margin-top: 2px; flex: none; }
.field[data-invalid] .field__error { display: flex; }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--surface-sunken); color: var(--text-placeholder); cursor: not-allowed; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: var(--bs-text-small); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--bs-azure-600); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Alertas / estados ---------- */
.alert { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding: 14px 16px; border-radius: var(--bs-radius-md); border: 1px solid; font-size: 0.9375rem; }
.alert svg { width: 22px; height: 22px; }
.alert b { display: block; color: inherit; }
.alert--error { background: var(--bs-error-bg); border-color: #F5C2BC; color: #7A1A12; }
.alert--success { background: var(--bs-success-bg); border-color: #B7E3CB; color: #0B5434; }
.alert--info { background: var(--bs-info-bg); border-color: #C3DCF2; color: #0A3D70; }
.alert--warning { background: var(--bs-warning-bg); border-color: #F3D3A6; color: #6B3F00; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert a { color: inherit; font-weight: 600; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-sunken) 0%, color-mix(in srgb, var(--surface-sunken) 50%, var(--surface-raised)) 50%, var(--surface-sunken) 100%); background-size: 200% 100%; animation: bs-shimmer 1.4s linear infinite; }
@keyframes bs-shimmer { to { background-position: -200% 0; } }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: start; } }
.contact-channels { display: grid; gap: 12px; }
.channel { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; padding: 16px; border-radius: var(--bs-radius-lg); border: 1px solid var(--border); background: var(--surface-raised); }
.channel .icon-tile { width: 44px; height: 44px; }
.channel .icon-tile svg { width: 22px; height: 22px; }
.channel b { display: block; color: var(--text); font-size: 0.9375rem; }
.channel span, .channel a { font-size: 0.9375rem; overflow-wrap: anywhere; }
.form-card { padding: clamp(20px, 3vw, 40px); border-radius: var(--bs-radius-xl); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--card-shadow); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bs-night-950); color: var(--bs-slate-300); padding-top: clamp(56px, 7vw, 96px); padding-bottom: 32px; position: relative; overflow: hidden; }
.site-footer__top { display: grid; gap: 40px; }
@media (min-width: 768px) { .site-footer__top { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .site-footer__top { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; } }
.site-footer__brand { display: grid; gap: 18px; align-content: start; max-width: 340px; }
.site-footer__brand img { height: 40px; width: auto; }
.site-footer h2 { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--bs-sky-500); font-weight: 500; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.site-footer a { color: var(--bs-text-on-dark); text-decoration: none; display: inline-flex; min-height: 36px; align-items: center; font-size: 0.9375rem; }
.site-footer a:hover { color: var(--bs-sky-400); text-decoration: underline; }
.site-footer address { font-style: normal; font-size: 0.9375rem; display: grid; gap: 6px; }
.site-footer__bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--bs-night-700); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: var(--bs-text-small); }
.social { display: flex; gap: 8px; }
.social a { width: 44px; height: 44px; justify-content: center; border-radius: 50%; border: 1px solid var(--bs-night-700); font-family: var(--bs-font-mono); font-size: 0.75rem; letter-spacing: 0.04em; }
.social a:hover { border-color: var(--bs-sky-500); text-decoration: none; }

/* ---------- Service detail (página Servicios) ---------- */
.service-nav { position: sticky; top: var(--bs-header-h); z-index: 5; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.service-nav ul { display: flex; gap: 4px; overflow-x: auto; list-style: none; margin: 0; padding: 10px 0; scrollbar-width: none; }
.service-nav ul::-webkit-scrollbar { display: none; }
.service-nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--bs-radius-full); white-space: nowrap; text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.9375rem; border: 1px solid transparent; }
.service-nav a svg { width: 18px; height: 18px; flex: none; }
.service-nav a:hover { color: var(--text); border-color: var(--border); }
.service-nav a[aria-current="true"] { color: var(--bs-gray-0); background: var(--bs-night-950); }
.category-block { display: grid; gap: 28px; padding-block: var(--bs-section-y-tight); border-top: 1px solid var(--border); }
.category-block:first-child { border-top: 0; }
.category-block__head { display: grid; gap: 12px; }
@media (min-width: 1024px) { .category-block__head { grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; } }
.service-detail { display: grid; gap: 20px; padding: clamp(20px, 2.6vw, 36px); border-radius: var(--bs-radius-xl); border: 1px solid var(--border); background: var(--surface-raised); box-shadow: var(--card-shadow); scroll-margin-top: calc(var(--bs-header-h) + 72px); }
@media (min-width: 1024px) { .service-detail { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; } }
.service-detail__intro { display: grid; gap: 14px; align-content: start; }
.service-detail__body { display: grid; gap: 20px; align-content: start; }
.service-detail h4 { font-family: var(--bs-font-mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }
.check-list svg { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }

/* ---------- Valores / equipo ---------- */
.value { display: grid; gap: 10px; padding-top: 20px; border-top: 2px solid var(--rule-accent); }
.value h3 { font-family: var(--bs-font-display); font-size: 1.25rem; font-weight: 700; color: var(--text-heading); letter-spacing: -0.02em; }
.team { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; padding: 0; margin: 0; }
@media (min-width: 768px) { .team { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .team { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }
.member { display: grid; gap: 10px; }
.member__photo { aspect-ratio: 1 / 1; border-radius: var(--bs-radius-lg); background: var(--bs-gradient-app); display: grid; place-items: center; overflow: hidden; }
.member__photo span { font-family: var(--bs-font-display); font-size: 2rem; font-weight: 700; color: rgb(255 255 255 / 0.9); }
.member b { color: var(--text); font-weight: 600; display: block; }
.member small { color: var(--text-muted); font-size: var(--bs-text-small); }

/* ---------- Reveal on scroll ---------- */
/* El contenido es visible por defecto; JS agrega .reveal-ready para animar solo si hay soporte y sin reduced motion. */
.reveal-ready [data-reveal] { opacity: 0.001; transform: translateY(16px); }
.reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; transition: opacity var(--bs-dur-reveal) var(--bs-ease-out), transform var(--bs-dur-reveal) var(--bs-ease-out); transition-delay: calc(var(--i, 0) * 70ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Modalidades ---------- */
.mod-groups { display: grid; gap: 16px; }
@media (min-width: 1024px) { .mod-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.mod-group { display: grid; gap: 12px; align-content: start; padding: clamp(20px, 2vw, 28px); border-radius: var(--bs-radius-lg); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.mod-group__title { font-family: var(--bs-font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-heading); line-height: 1.25; }
.mod-list { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.mod-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 10px; margin: 0 -10px; border-radius: var(--bs-radius-md); text-decoration: none; color: var(--text-body); transition: background-color var(--bs-dur-base) var(--bs-ease-out); }
.mod-item:hover { background: var(--surface-sunken); color: var(--text-body); }
.mod-item .icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.mod-item .icon-tile svg { width: 22px; height: 22px; }
.mod-item b { display: block; color: var(--text-heading); font-family: var(--bs-font-display); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.mod-item small { display: block; font-size: 0.875rem; line-height: 1.5; margin-top: 2px; }
.modality-row { display: grid; gap: 20px; }
.modality-row + .modality-row { margin-top: clamp(32px, 4vw, 48px); }
.modality-row__head { display: grid; gap: 8px; max-width: 720px; }
.card-modality { scroll-margin-top: calc(var(--bs-header-h) + 72px); }
.card-modality .card__title { font-size: 1.25rem; }
.card-modality__when { font-size: 0.875rem; padding: 10px 12px; border-radius: var(--bs-radius-md); background: var(--surface-sunken); }
.card-modality__when b { color: var(--text); }
.card-modality .btn { justify-self: start; margin-top: 4px; }
@media (min-width: 1024px) { .site-footer__top { grid-template-columns: 1.3fr 1fr 1fr 0.8fr 1fr; } }

/* ---------- Servicio gestionado ---------- */
.layer-card { gap: 10px; }
.layer-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.layer-card__num { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--text-muted); }
.layer-card__code { font-family: var(--bs-font-mono); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.04em; color: var(--label); margin-top: 4px; }
.layer-strip { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.layer-strip a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; border-radius: var(--bs-radius-full); border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.layer-strip a span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--bs-azure-600), var(--bs-pulse-600)); color: #fff; font-family: var(--bs-font-mono); font-size: 0.6875rem; font-weight: 500; }
.layer-strip a:hover { border-color: var(--text); }
.managed-quote { margin-top: 6px; padding: 14px 16px; border-left: 3px solid; border-image: linear-gradient(180deg, var(--bs-sky-500), var(--bs-pulse-600)) 1; background: var(--surface-sunken); border-radius: 0 var(--bs-radius-md) var(--bs-radius-md) 0; }
.managed-quote p { font-family: var(--bs-font-display); font-size: 1rem; font-weight: 500; line-height: 1.45; color: var(--text-heading); }
.check-list--2 { display: grid; gap: 8px 20px; }
@media (min-width: 768px) { .check-list--2 { grid-template-columns: 1fr 1fr; } }
.impact { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .impact { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1280px) { .impact { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.impact__col { padding: 14px; border-radius: var(--bs-radius-md); background: var(--bs-info-bg); color: var(--bs-night-950); }
.impact__col h5 { margin: 0 0 8px; font-family: var(--bs-font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bs-azure-600); }
.impact__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.875rem; line-height: 1.45; }
.impact__col li { padding-left: 14px; position: relative; }
.impact__col li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--bs-sky-500); }

/* ---------- Roles de células ---------- */
.role-grid { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; grid-template-columns: 1fr; }
@media (min-width: 768px) { .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.role-card { display: grid; gap: 10px; align-content: start; padding: 18px 20px; border-radius: var(--bs-radius-lg); background: var(--surface-raised); border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.role-card--optional, .role-card--infra { border-style: dashed; box-shadow: none; }
.role-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.role-card__type { font-family: var(--bs-font-mono); font-size: var(--bs-text-label); letter-spacing: var(--bs-tracking-label); text-transform: uppercase; color: var(--label); }
.role-card__opt { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border-input); border-radius: var(--bs-radius-full); padding: 2px 8px; }
.role-card__name { font-family: var(--bs-font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text-heading); line-height: 1.25; }
.role-card__tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.875rem; }
.role-card__tasks li { padding-left: 14px; position: relative; }
.role-card__tasks li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 2px; background: var(--accent-2); }
.category-block > *, .service-detail > *, .service-detail__intro > *, .service-detail__body > * { min-width: 0; }
.layer-card__code, .role-card__name, .card__title { overflow-wrap: anywhere; }
@media (max-width: 479.98px) { .btn { white-space: normal; line-height: 1.25; padding-block: 10px; text-align: center; } }

/* ==========================================================================
   MOTION SYSTEM
   ========================================================================== */
@property --spot { syntax: "<number>"; inherits: false; initial-value: 0; }

/* ---------- Motion · símbolo vivo (luz que recorre las líneas del logo) ---------- */
.sym-live { display: block; width: 100%; height: auto; overflow: visible; }
.sym-live__base { animation: sym-breathe 6s ease-in-out infinite; }
.sym-live__trail, .sym-live__head { fill: none; stroke-linecap: round; }
.sym-live__trail { stroke: #CFEAF8; stroke-width: 30; opacity: 0.55; stroke-dasharray: 22 300; stroke-dashoffset: 22; animation: sym-trail var(--t, 3.6s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) infinite both; }
.sym-live__head { stroke: #FFFFFF; stroke-width: 30; stroke-dasharray: 4 300; stroke-dashoffset: 4; animation: sym-head var(--t, 3.6s) cubic-bezier(.45, 0, .25, 1) var(--d, 0s) infinite both; }
.sym-live__glow .sym-live__head { stroke: #7AC0E8; stroke-width: 34; opacity: 0.75; }
.sym-live__tip { fill: #E6F5FD; opacity: 0; transform-box: fill-box; transform-origin: center; animation: sym-tip var(--t, 3.6s) ease-out var(--d, 0s) infinite both; }
@keyframes sym-trail { 0% { stroke-dashoffset: 22; } 72%, 100% { stroke-dashoffset: -100; } }
@keyframes sym-head  { 0% { stroke-dashoffset: 4; }  72%, 100% { stroke-dashoffset: -118; } }
@keyframes sym-tip   { 0%, 62% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.5); } 88%, 100% { opacity: 0; transform: scale(2.6); } }
@keyframes sym-breathe { 0%, 100% { opacity: 0.88; } 50% { opacity: 1; } }
.sym-live .is-pink.sym-live__trail { stroke: #FFB3D6; }
.sym-live .is-pink.sym-live__head { stroke: #FFE3F0; }
.sym-live__glow .is-pink.sym-live__head { stroke: #FF5CA8; opacity: 0.8; }
.sym-live__tip.is-pink { fill: #FF8CC2; }
/* ---------- fin símbolo vivo ---------- */

/* ---------- Líneas de flujo con paquetes de datos ---------- */
.flow-live { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; pointer-events: none; opacity: 0.6; z-index: 0; }
.flow-live__packet { stroke: #E6F5FD; stroke-width: 2.5; stroke-dasharray: 5 300; stroke-dashoffset: 5; animation: flow-run var(--t, 6s) cubic-bezier(.4, 0, .6, 1) var(--d, 0s) infinite both; }
@keyframes flow-run { 0% { stroke-dashoffset: 5; opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: -100; opacity: 0; } }
.cta-band .flow-live { height: 100%; opacity: 0.5; z-index: -1; }
.cta-band::before { content: none; }

/* Hero: halo que respira detrás del símbolo */
.hero__visual::before { content: ""; position: absolute; inset: 10% 5% 0; border-radius: 50%; background: radial-gradient(closest-side, rgb(84 170 220 / 0.30), transparent); filter: blur(10px); animation: halo-pulse 6s ease-in-out infinite; z-index: -1; }
.hero__visual { isolation: isolate; }
.hero__visual .sym-live { filter: drop-shadow(0 30px 60px rgb(84 170 220 / 0.25)); }
@keyframes halo-pulse { 0%, 100% { opacity: 0.6; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
.page-hero__symbol { opacity: 0.32; }
@media (max-width: 767.98px) { .page-hero__symbol { opacity: 0.16; } }

/* ---------- Secuencia de entrada (hero y page hero) ---------- */
@keyframes bs-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bs-enter-scale { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes bs-fade { from { opacity: 0; } to { opacity: 1; } }
.hero__copy > *, .page-hero__inner > * { animation: bs-enter 0.8s var(--bs-ease-out) both; }
.hero__copy > :nth-child(2), .page-hero__inner > :nth-child(2) { animation-delay: 0.08s; }
.hero__copy > :nth-child(3), .page-hero__inner > :nth-child(3) { animation-delay: 0.16s; }
.hero__copy > :nth-child(4), .page-hero__inner > :nth-child(4) { animation-delay: 0.26s; }
.page-hero__inner > :nth-child(5) { animation-delay: 0.34s; }
.hero__visual { animation: bs-enter-scale 1.1s var(--bs-ease-out) 0.15s both; }
@keyframes bs-fade-from { from { opacity: 0; } }
.page-hero__symbol { animation: bs-fade-from 1.4s var(--bs-ease-out) 0.2s both; }
.hero .stat { animation: bs-enter 0.8s var(--bs-ease-out) both; }
.hero .stat:nth-child(1) { animation-delay: 0.45s; } .hero .stat:nth-child(2) { animation-delay: 0.53s; }
.hero .stat:nth-child(3) { animation-delay: 0.61s; } .hero .stat:nth-child(4) { animation-delay: 0.69s; }
.site-header { animation: bs-fade 0.6s var(--bs-ease-out) both; }
.overlap .card { animation: bs-enter 0.9s var(--bs-ease-out) both; }
.overlap .card:nth-child(1) { animation-delay: 0.55s; } .overlap .card:nth-child(2) { animation-delay: 0.65s; } .overlap .card:nth-child(3) { animation-delay: 0.75s; }

/* ---------- Barra de progreso de scroll ---------- */
@supports (animation-timeline: scroll()) {
  .site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--bs-gradient-brand); transform-origin: 0 50%; transform: scaleX(0); animation: bs-progress linear both; animation-timeline: scroll(root); }
  @keyframes bs-progress { to { transform: scaleX(1); } }
}

/* ---------- Spotlight que sigue al cursor en cards ---------- */
.spot { position: relative; transition: --spot var(--bs-dur-base) var(--bs-ease-out), box-shadow var(--bs-dur-base) var(--bs-ease-out), transform var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-base) var(--bs-ease-out), background-color var(--bs-dur-base);
  background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) calc(var(--spot) * 16%), transparent), transparent 70%); }
.spot:hover { --spot: 1; }

/* ---------- Brillo en el botón primario ---------- */
.btn--primary { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 0.28) 50%, transparent 70%); transform: translateX(-120%); transition: transform 0.7s var(--bs-ease-out); }
.btn--primary:hover::after { transform: translateX(120%); }

/* ---------- Menú mobile, FAQ y filtros ---------- */
.mobile-menu.is-open .mobile-menu__nav li { animation: bs-enter 0.5s var(--bs-ease-out) both; }
.mobile-menu.is-open .mobile-menu__nav li:nth-child(2) { animation-delay: 0.05s; } .mobile-menu.is-open .mobile-menu__nav li:nth-child(3) { animation-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu__nav li:nth-child(4) { animation-delay: 0.15s; } .mobile-menu.is-open .mobile-menu__nav li:nth-child(5) { animation-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu__foot { animation: bs-enter 0.5s var(--bs-ease-out) 0.25s both; }
.faq__panel.is-open p { animation: bs-enter 0.4s var(--bs-ease-out) both; }
.cases-grid .card-case:not([hidden]) { animation: bs-enter 0.45s var(--bs-ease-out) both; }
.service-detail:target, .card-modality:target { animation: bs-target 1.6s var(--bs-ease-out); }
@keyframes bs-target { 0% { box-shadow: 0 0 0 0 rgb(84 170 220 / 0.6); } 100% { box-shadow: 0 0 0 18px rgb(84 170 220 / 0); } }

/* ---------- Transiciones entre páginas (View Transitions, navegación de documento) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: site-header; }
  ::view-transition-old(root) { animation: vt-out 0.28s var(--bs-ease-in-out) both; }
  ::view-transition-new(root) { animation: vt-in 0.45s var(--bs-ease-out) both; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
}



/* ==========================================================================
   SEGUNDO ACENTO · MAGENTA EN COMBINACIÓN CON AZUL (v3)
   ========================================================================== */
/* Palabra destacada del H1 y de títulos: degradé azul → magenta */
.t-accent { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
@supports not (background-clip: text) { .t-accent { color: var(--accent-text); -webkit-text-fill-color: currentColor; } }
/* Íconos: el punto de acción pasa a magenta */
.icon-tile, .mod-item .icon-tile { --accent: var(--accent-2); }
.icon-tile { background: linear-gradient(135deg, var(--tag-bg), color-mix(in srgb, var(--accent-2) 12%, var(--tag-bg))); }
/* Métricas: sufijo en magenta */
.stat__suf { color: var(--accent-2); margin-left: 0.04em; }
.stats { border-image: var(--bs-gradient-brand) 1; border-top-width: 1px; border-top-style: solid; }
/* Secciones Night intermedias y footer con halos azul + magenta */
.section[data-surface="night"] { background: var(--bs-halo-section), var(--surface); }
.site-footer { border-top: 2px solid; border-image: var(--bs-gradient-brand) 1; background: radial-gradient(40% 80% at 100% 0%, rgb(208 19 108 / 0.12), transparent 70%), var(--bs-night-950); }
/* Cards: hover con borde degradé y spotlight bicolor */
.spot { background-image: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent-2) calc(var(--spot) * 12%), transparent), color-mix(in srgb, var(--accent) calc(var(--spot) * 10%), transparent) 45%, transparent 72%); }
.card--link:hover { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border)); }
.layer-card__code { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; justify-self: start; }
/* Tag alternativo magenta (frente "Mejorar", opcional) */
.card-modality .icon-tile, .layer-card .icon-tile { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 25%, transparent); }
.impact__col li::before { background: linear-gradient(135deg, var(--bs-sky-500), var(--bs-pulse-600)); }
.check-list svg, .card-service__list svg { color: var(--accent); }
.filter-chip[aria-pressed="true"], .service-nav a[aria-current="true"] { background: linear-gradient(135deg, var(--bs-night-950), #3A1240); }
/* CTA band: borde degradé sutil */
.cta-band { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06); }
.cta-band::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--bs-gradient-brand); }
.flow-live__packet.is-pink { stroke: #FF8CC2; }
.hero__visual::before { background: radial-gradient(closest-side, rgb(84 170 220 / 0.30), transparent), radial-gradient(closest-side at 70% 90%, rgb(208 19 108 / 0.25), transparent); }

/* ---------- Reduced motion: todo quieto ---------- */
@media (prefers-reduced-motion: reduce) {
  .sym-live__trail, .sym-live__head, .sym-live__tip, .sym-live__glow, .flow-live__packet { display: none; }
  .hero__visual::before, .site-header::after { animation: none; }
}
.member__photo { background: linear-gradient(155deg, #6FA8DC 0%, #0459A0 48%, #B0125F 100%); }
.channel__hint { display: block; font-size: 0.8125rem; color: var(--text-muted); }
.mobile-menu__foot a.wa-link { color: var(--bs-sky-400); }

/* ---------- Botón flotante de WhatsApp con forma de bot ---------- */
.wa-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px) + 16px); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: calc(var(--bs-z-header) + 1); display: flex; align-items: center; gap: 12px; text-decoration: none; animation: wa-pop 0.7s var(--bs-ease-out) 1.2s both; }
.wa-fab__btn { position: relative; width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(140deg, #2F78BF 0%, #0459A0 45%, #D0136C 100%); box-shadow: 0 10px 28px rgb(7 20 48 / 0.35), 0 0 0 0 rgb(208 19 108 / 0.45); transition: transform var(--bs-dur-base) var(--bs-ease-out), box-shadow var(--bs-dur-base) var(--bs-ease-out); animation: wa-ring 3.2s ease-out 2.4s infinite; }
@media (min-width: 1024px) { .wa-fab__btn { width: 64px; height: 64px; } }
.wa-fab__bot { width: 70%; height: 70%; overflow: visible; }
.wa-fab__badge { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; background: #1FAF54; border: 2.5px solid #fff; display: grid; place-items: center; }
.wa-fab__badge svg { width: 15px; height: 15px; }
.wa-fab__eyes { transform-box: fill-box; transform-origin: center; animation: wa-blink 4.5s ease-in-out infinite; }
.wa-fab__antenna { animation: wa-antenna 2.4s ease-in-out infinite; }
.wa-fab__tip { order: -1; padding: 10px 14px; border-radius: 999px; background: #fff; color: var(--bs-night-950); font: 600 0.875rem/1.2 var(--bs-font-body); white-space: nowrap; box-shadow: 0 8px 24px rgb(7 20 48 / 0.18); opacity: 0; transform: translateX(8px); pointer-events: none; transition: opacity var(--bs-dur-base) var(--bs-ease-out), transform var(--bs-dur-base) var(--bs-ease-out); }
.wa-fab:hover .wa-fab__tip, .wa-fab:focus-visible .wa-fab__tip, .wa-fab.is-hinting .wa-fab__tip { opacity: 1; transform: none; }
.wa-fab:hover .wa-fab__btn { transform: translateY(-3px) rotate(-4deg); box-shadow: 0 16px 36px rgb(7 20 48 / 0.4); }
.wa-fab:active .wa-fab__btn { transform: scale(0.96); }
.wa-fab:focus-visible { outline: none; }
.wa-fab:focus-visible .wa-fab__btn { outline: 3px solid var(--bs-sky-500); outline-offset: 3px; }
body.menu-open .wa-fab { opacity: 0; pointer-events: none; }
@media (max-width: 479.98px) { .wa-fab__tip { display: none; } }
@keyframes wa-pop { from { opacity: 0; transform: translateY(20px) scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes wa-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes wa-antenna { 0%, 100% { fill: #FF8CC2; } 50% { fill: #7AC0E8; } }
@keyframes wa-ring { 0% { box-shadow: 0 10px 28px rgb(7 20 48 / 0.35), 0 0 0 0 rgb(208 19 108 / 0.45); } 70%, 100% { box-shadow: 0 10px 28px rgb(7 20 48 / 0.35), 0 0 0 16px rgb(208 19 108 / 0); } }
@media (prefers-reduced-motion: reduce) { .wa-fab, .wa-fab__btn, .wa-fab__eyes, .wa-fab__antenna { animation: none !important; } }

/* ---------- Intro 3D de la Home (interactions.md §14) ---------- */
.intro { display: none; }
.has-intro .intro {
  display: block; position: relative; z-index: calc(var(--bs-z-header) - 1);
  height: 500svh;                 /* 300svh de viaje 3D + 100svh del símbolo final */
  margin-top: calc(-1 * var(--bs-header-h));
  margin-bottom: -100svh;   /* el hero queda debajo del último tramo (colapsa con el margen negativo del hero) */
  pointer-events: none;
  /* fondo Night solo en el tramo que no se superpone al hero: evita ver el fondo claro mientras el escenario se desvanece */
  background: linear-gradient(var(--bs-night-950), var(--bs-night-950)) top / 100% calc(100% - 100svh) no-repeat;
}
.has-intro .site-header { animation: none; }
.intro__stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden; pointer-events: auto;
  background: var(--bs-night-950); color: var(--bs-gray-0);
  opacity: calc(1 - var(--intro-reveal, 0));
}
.intro.is-done .intro__stage { visibility: hidden; pointer-events: none; }
.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro__flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;   background: radial-gradient(circle at 50% 50%, #fff 0%, #E6F3FB 18%, #7AC0E8 42%, #0459A0 72%, #071430 100%);
}
.intro__top {
  position: absolute; inset: 0 0 auto 0; height: var(--bs-header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.intro__logo { height: 32px; width: auto; opacity: clamp(0, calc(1 - (var(--intro-p, 0) - 0.05) * 8), 1); }
.intro__skip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--bs-radius-pill, 999px); border: 1px solid rgb(255 255 255 / 0.28);
  background: rgb(7 20 48 / 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--bs-gray-0); font: 600 0.875rem/1 var(--bs-font-body, inherit); cursor: pointer;
  transition: background-color var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-base) var(--bs-ease-out);
}
.intro__skip svg { width: 16px; height: 16px; }
.intro__skip:hover { background: rgb(255 255 255 / 0.12); border-color: rgb(255 255 255 / 0.5); }
.intro__skip:focus-visible { outline: 2px solid var(--bs-sky-400, #7AC0E8); outline-offset: 3px; }
.intro__lead {
  position: absolute; left: 0; right: 0; bottom: clamp(28px, 7svh, 88px);
  display: grid; justify-items: center; gap: 14px; text-align: center; pointer-events: none;
  opacity: clamp(0, calc(1 - (var(--intro-p, 0) - 0.02) * 10), 1);
  transform: translateY(calc(var(--intro-p, 0) * -240px));
}
.intro__title {
  margin: 0; max-width: 18ch; font-family: var(--bs-font-display); font-weight: 700;
  font-size: clamp(1.875rem, 1rem + 3.4vw, 3.75rem); line-height: 1.04; letter-spacing: -0.025em; color: var(--bs-gray-0);
  text-wrap: balance;
}
.intro__cue { margin: 6px 0 0; display: inline-flex; align-items: center; gap: 10px; font: 500 0.75rem/1 var(--bs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bs-sky-400, #7AC0E8); }
.intro__mouse { width: 20px; height: 30px; border: 2px solid currentColor; border-radius: 10px; position: relative; }
.intro__mouse::after { content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 6px; margin-left: -2px; border-radius: 2px; background: var(--bs-pulse-400, #FF5CA8); animation: intro-wheel 1.6s var(--bs-ease-out) infinite; }
@keyframes intro-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }
.intro__caption {
  position: absolute; left: 50%; top: 50%; margin: 0; opacity: 0; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -50%) scale(calc(0.75 + var(--k, 0) * 0.6));
  font-family: var(--bs-font-display); font-weight: 700; letter-spacing: -0.03em; color: var(--bs-gray-0);
  font-size: clamp(2.5rem, 1rem + 7vw, 7rem); line-height: 1; text-align: center;
  text-shadow: 0 0 24px rgb(84 170 220 / 0.65), 0 0 64px rgb(208 19 108 / 0.45);
}
.intro__caption span { display: block; margin-bottom: 10px; font: 500 0.8125rem/1 var(--bs-font-mono); letter-spacing: 0.2em; color: var(--bs-sky-400, #7AC0E8); text-shadow: none; }

/* durante la intro el header y el botón de WhatsApp esperan; vuelven al llegar al hero */
.has-intro body:not(.intro-past) .site-header { opacity: 0; transform: translateY(-10px); visibility: hidden; pointer-events: none; }
.has-intro body:not(.intro-past) .wa-fab { visibility: hidden; }
.has-intro .site-header { transition: opacity 0.5s var(--bs-ease-out), transform 0.5s var(--bs-ease-out), visibility 0.5s, background-color var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-base) var(--bs-ease-out); }
/* el hero "sale" de la cabeza del robot */
.has-intro .hero > .container { transform: scale(calc(1.08 - 0.08 * var(--intro-reveal, 1))); opacity: var(--intro-reveal, 1); transform-origin: 50% 40%; }

/* Final de la intro: símbolo vertical con impulsos eléctricos (sinapsis) */
.intro__veil { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(closest-side at 50% 50%, rgb(7 20 48 / 0.92) 0%, rgb(7 20 48 / 0.7) 55%, rgb(7 20 48 / 0) 100%); }
.intro__final { position: absolute; left: 50%; top: 50%; width: min(78vw, 60svh * 1.2); opacity: 0; transform: translate(-50%, -50%) scale(0.8); pointer-events: none; will-change: transform, opacity, filter; }
.syn { display: block; width: 100%; height: auto; overflow: visible; }
.intro__final:not(.is-live) .syn * { animation-play-state: paused; }
/* símbolo: brillo propio que respira, con una subida leve en cada descarga */
.syn__base { filter: drop-shadow(0 0 22px rgb(84 170 220 / 0.45)); animation: syn-breathe 4.2s ease-in-out infinite; }
/* impulsos que suben por cada trazo: halo difuso + núcleo fino */
.syn__pulse, .syn__core, .syn__flash { fill: none; stroke-linecap: round; }
.syn__pulse { stroke: #CFEAF8; stroke-width: 34; stroke-dasharray: 30 300; --o: 0.45; animation: syn-travel var(--t, 3.5s) cubic-bezier(.5, .05, .4, 1) var(--d, 0s) infinite both; }
.syn__glow .syn__pulse { stroke: #7AC0E8; stroke-width: 46; --o: 0.55; }
.syn__core { stroke: #F4FBFF; stroke-width: 11; stroke-dasharray: 9 300; --o: 0.8; animation: syn-travel var(--t, 3.5s) cubic-bezier(.5, .05, .4, 1) var(--d, 0s) infinite both; }
.syn .is-pink.syn__pulse { stroke: #FFC2DE; }
.syn__glow .is-pink.syn__pulse { stroke: #FF5CA8; }
.syn .is-pink.syn__core { stroke: #FFE9F3; }
/* descargas eléctricas: un tramo del trazo se enciende y titila un instante, el resto del ciclo está apagado */
.syn__flash { stroke: #F2FAFF; stroke-width: 30; opacity: 0; animation: syn-discharge var(--t, 5s) linear var(--d, 0s) infinite both; }
.syn__glow .syn__flash { stroke: #9FD3F0; stroke-width: 54; }
.syn .is-pink.syn__flash { stroke: #FFE3F0; }
.syn__glow .is-pink.syn__flash { stroke: #FF5CA8; }
/* puntas: se encienden como somas al llegar cada impulso */
.syn__soma { mix-blend-mode: screen; transform-box: fill-box; transform-origin: center; animation: syn-soma var(--t, 3s) ease-in-out var(--d, 0s) infinite both; }
@keyframes syn-travel { 0% { stroke-dashoffset: 36; opacity: 0; } 10% { opacity: var(--o, 0.6); } 72% { opacity: var(--o, 0.6); } 86%, 100% { stroke-dashoffset: -110; opacity: 0; } }
@keyframes syn-discharge { 0%, 86% { opacity: 0; } 87% { opacity: 0.95; } 88% { opacity: 0.25; } 89.5% { opacity: 0.85; } 91% { opacity: 0.35; } 93% { opacity: 0.6; } 97%, 100% { opacity: 0; } }
@keyframes syn-soma { 0%, 55% { opacity: 0.2; transform: scale(0.7); } 70% { opacity: 1; transform: scale(1.4); } 76% { opacity: 0.55; } 80% { opacity: 0.9; } 100% { opacity: 0.2; transform: scale(0.7); } }
@keyframes syn-breathe { 0%, 100% { opacity: 0.88; } 50% { opacity: 1; } }

/* ---------- Páginas legales ---------- */
.legal { display: grid; gap: clamp(32px, 4vw, 64px); }
@media (min-width: 1024px) { .legal { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } .legal__toc { position: sticky; top: calc(var(--bs-header-h) + 24px); } }
.legal__toc { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--bs-radius-lg); background: var(--surface-raised); font-size: var(--bs-text-small); }
.legal__toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.legal__toc a { color: var(--text); text-decoration: none; }
.legal__toc a:hover { color: var(--link); text-decoration: underline; }
.legal__toc p { margin: 0; color: var(--text-muted); }
.legal__body { max-width: 72ch; gap: 40px; }
.legal__section { display: grid; gap: 12px; scroll-margin-top: calc(var(--bs-header-h) + 24px); }
.legal__section h2 { margin: 0; color: var(--text-heading); }
.legal__section p, .legal__section ul { margin: 0; color: var(--text-body); }
.legal__section ul { padding-left: 1.2em; display: grid; gap: 8px; }
.legal__section code { font-family: var(--bs-font-mono); font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-sunken); }
.legal__note { padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--surface-sunken); border-radius: 0 8px 8px 0; font-size: var(--bs-text-small); }

/* ---------- 404 ---------- */
.nf { position: relative; overflow: hidden; min-height: 100svh; display: grid; align-items: center; background: var(--bs-halo-hero), var(--surface); margin-top: calc(-1 * var(--bs-header-h)); padding: calc(var(--bs-header-h) + 48px) 0 96px; }
.nf .flow-live { position: absolute; inset: auto 0 0 0; width: 100%; height: 55%; opacity: 0.7; pointer-events: none; }
.nf__inner { position: relative; display: grid; justify-items: center; gap: 18px; text-align: center; }
.nf__inner .t-lead { max-width: 52ch; }
.nf__symbol { width: clamp(120px, 18vw, 200px); margin-bottom: 8px; }
.nf__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* ---------- Pie: enlaces legales ---------- */
.site-footer .site-footer__legal { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.site-footer__legal a, .link-btn { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; line-height: inherit; color: inherit; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--bs-sky-400); outline-offset: 3px; border-radius: 2px; }

/* ---------- Banner de cookies (solo si hay GA4 configurado) ---------- */
.cookie-banner {
  position: fixed; z-index: calc(var(--bs-z-header) + 2); left: max(16px, env(safe-area-inset-left, 0px) + 16px); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100vw - 32px)); display: grid; gap: 12px; padding: 20px; border-radius: var(--bs-radius-lg);
  border: 1px solid var(--bs-night-700); box-shadow: 0 18px 50px rgb(7 20 48 / 0.45); color: var(--text-body);
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner__title { margin: 0; font-family: var(--bs-font-display); font-size: 1.0625rem; font-weight: 700; color: var(--text-heading); }
.cookie-banner p { margin: 0; font-size: var(--bs-text-small); line-height: 1.55; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner__actions .btn { flex: 1 1 120px; justify-content: center; }
/* en celular, el banner ocupa el ancho y el botón de WhatsApp sube para no taparse */
@media (max-width: 479.98px) { .cookie-banner { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } body.cookie-open .wa-fab { bottom: calc(var(--cookie-h, 200px) + 24px); } }
.has-intro body:not(.intro-past) .cookie-banner { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .cookie-banner:not([hidden]) { animation: bs-enter 0.5s var(--bs-ease-out) both; } }

/* ---------- Robot que recorre la página (interactions.md §17) ---------- */
.has-buddy .wa-fab { display: none; }
.buddy-layer { position: absolute; left: 0; top: 0; width: 100%; height: 0; z-index: calc(var(--bs-z-header) - 2); pointer-events: none; }
.buddy { --bw: 56px; position: absolute; left: 0; top: 0; width: var(--bw); height: calc(var(--bw) * 1.25); pointer-events: auto; will-change: transform; }
@media (max-width: 767.98px) { .buddy { --bw: 46px; } }
.buddy.is-away { visibility: hidden; }
.buddy__bot { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
.buddy__bot:focus-visible { outline: 3px solid var(--bs-sky-400); outline-offset: 4px; }
.buddy__svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 60%; filter: drop-shadow(0 6px 10px rgb(7 20 48 / 0.28)); }
.buddy__bot:hover .buddy__svg .b-body { animation: b-hop 0.5s var(--bs-ease-out); }

/* piezas: pivotes en hombros y caderas (unidades del viewBox) */
.b-body, .b-head, .b-arm, .b-leg, .b-eyes, .b-jet { transform-box: fill-box; }
.b-arm, .b-leg, .b-jet { transform-origin: 50% 8%; }     /* hombro / cadera */
.b-head, .b-body { transform-origin: 50% 100%; }         /* cuello / pies */
.b-eyes { transform-origin: 50% 50%; }
.b-jet { opacity: 0; }
/* mirada (la escribe buddy.js): ojos que se mueven y cabeza que acompaña */
.b-look { translate: var(--lx, 0px) var(--ly, 0px); }
.b-head { rotate: var(--hr, 0deg); }
.b-leg, .b-arm, .b-head { transition: transform 0.12s var(--bs-ease-out); }
.b-eyes { animation: b-blink 4.2s infinite; }
.b-ant { animation: wa-antenna 2.4s ease-in-out infinite; }

/* estados */
.buddy__svg[data-state="idle"] .b-body { animation: b-breathe 2.4s ease-in-out infinite; }
.buddy__svg[data-state="run"] .b-body { animation: b-bob 0.18s ease-in-out infinite alternate; }
.buddy__svg[data-state="run"] .b-leg--front, .buddy__svg[data-state="run"] .b-arm--back { animation: b-swing 0.36s ease-in-out infinite alternate; }
.buddy__svg[data-state="run"] .b-leg--back, .buddy__svg[data-state="run"] .b-arm--front { animation: b-swing 0.36s ease-in-out -0.18s infinite alternate; }
.buddy__svg[data-state="run"] .b-head { transform: rotate(6deg); }
.buddy__svg[data-state="jump"] .b-arm--front { transform: rotate(135deg); } .buddy__svg[data-state="jump"] .b-arm--back { transform: rotate(-135deg); }
.buddy__svg[data-state="jump"] .b-leg--front { transform: rotate(-28deg); } .buddy__svg[data-state="jump"] .b-leg--back { transform: rotate(22deg); }
.buddy__svg[data-state="fall"] .b-arm--front { animation: b-flail 0.16s linear infinite alternate; }
.buddy__svg[data-state="fall"] .b-arm--back { animation: b-flail-b 0.16s linear -0.08s infinite alternate; }
.buddy__svg[data-state="fall"] .b-leg--front, .buddy__svg[data-state="fall"] .b-leg--back { animation: b-kick 0.22s ease-in-out infinite alternate; }
.buddy__svg[data-state="fall"] .b-eyes, .buddy__svg[data-state="tumble"] .b-eyes { animation: none; transform: scale(1.25); }
.buddy__svg[data-state="tumble"] .b-arm--front { transform: rotate(140deg); } .buddy__svg[data-state="tumble"] .b-arm--back { transform: rotate(-140deg); }
.buddy__svg[data-state="climb"] .b-arm--front { animation: b-climb 0.34s ease-in-out infinite alternate; }
.buddy__svg[data-state="climb"] .b-arm--back { animation: b-climb-b 0.34s ease-in-out -0.17s infinite alternate; }
.buddy__svg[data-state="climb"] .b-leg--front { animation: b-step 0.34s ease-in-out -0.17s infinite alternate; }
.buddy__svg[data-state="climb"] .b-leg--back { animation: b-step 0.34s ease-in-out infinite alternate; }
.buddy__svg[data-state="climb"] .b-head { transform: rotate(-10deg); }
.buddy__svg[data-state="jet"] .b-jet { opacity: 1; animation: b-flame 0.09s linear infinite alternate; }
.buddy__svg[data-state="jet"] .b-arm--front { transform: rotate(-35deg); } .buddy__svg[data-state="jet"] .b-arm--back { transform: rotate(35deg); }
.buddy__svg[data-state="jet"] .b-body { animation: b-bob 0.12s linear infinite alternate; }
.buddy__svg[data-state="wave"] .b-arm--front { animation: b-wave 0.32s ease-in-out infinite alternate; }
.buddy__svg[data-state="wave"] .b-body { animation: b-breathe 2.4s ease-in-out infinite; }
/* agachado: al aterrizar y antes de saltar (las piernas se acortan y el cuerpo baja) */
.buddy__svg[data-state="crouch"] .b-body { transform: translateY(5px); }
.buddy__svg[data-state="crouch"] .b-leg { transform: scaleY(0.6); }
.buddy__svg[data-state="crouch"] .b-arm--front { transform: rotate(35deg); } .buddy__svg[data-state="crouch"] .b-arm--back { transform: rotate(-35deg); }
.buddy__svg[data-state="crouch"] .b-head { transform: rotate(4deg) translateY(1px); }
.buddy__svg.is-land .b-body { animation: b-squash 0.22s var(--bs-ease-out); }
.buddy__svg.is-thud .b-body { animation: b-thud 0.6s var(--bs-ease-out); }

@keyframes b-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes b-bob { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
@keyframes b-swing { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
@keyframes b-flail { from { transform: rotate(105deg); } to { transform: rotate(150deg); } }
@keyframes b-flail-b { from { transform: rotate(-105deg); } to { transform: rotate(-150deg); } }
@keyframes b-kick { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes b-climb { from { transform: rotate(125deg); } to { transform: rotate(160deg); } }
@keyframes b-climb-b { from { transform: rotate(-125deg); } to { transform: rotate(-160deg); } }
@keyframes b-step { from { transform: translateY(0) rotate(-12deg); } to { transform: translateY(-4px) rotate(10deg); } }
@keyframes b-flame { from { transform: scaleY(0.75); opacity: 0.85; } to { transform: scaleY(1.15); opacity: 1; } }
@keyframes b-wave { from { transform: rotate(110deg); } to { transform: rotate(150deg); } }
@keyframes b-squash { 0% { transform: scale(1.12, 0.84); } 100% { transform: none; } }
@keyframes b-thud { 0% { transform: scale(1.25, 0.7); } 30% { transform: scale(0.92, 1.1) translateY(-6px); } 60% { transform: scale(1.05, 0.95); } 100% { transform: none; } }
@keyframes b-hop { 40% { transform: translateY(-6px); } }
@keyframes b-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }

/* globo de WhatsApp */
.buddy__bubble { position: absolute; bottom: calc(100% + 14px); left: 0; width: min(270px, calc(100vw - 20px)); display: grid; gap: 10px; padding: 18px 18px 16px; border-radius: var(--bs-radius-lg); border: 1px solid var(--bs-night-700); box-shadow: 0 18px 50px rgb(7 20 48 / 0.45); color: var(--text-body); }
.buddy__bubble.is-below { bottom: auto; top: calc(100% + 14px); }
.buddy__bubble[hidden], .buddy__hint[hidden] { display: none !important; }
.buddy__title { margin: 0; padding-right: 28px; font-family: var(--bs-font-display); font-weight: 700; font-size: 1.0625rem; color: var(--text-heading); }
.buddy__text { margin: 0; font-size: var(--bs-text-small); line-height: 1.5; }
.buddy__bubble .btn { justify-self: start; }
.buddy__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
.buddy__close svg { width: 18px; height: 18px; }
.buddy__close:hover { background: rgb(255 255 255 / 0.08); color: var(--text-heading); }
.buddy__close:focus-visible { outline: 2px solid var(--bs-sky-400); outline-offset: 2px; }
.buddy__hint { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; margin: 0; padding: 8px 12px; border-radius: 999px; background: #fff; color: var(--bs-night-950); font-size: 0.8125rem; font-weight: 600; box-shadow: 0 8px 24px rgb(7 20 48 / 0.25); pointer-events: none; animation: bs-enter 0.4s var(--bs-ease-out) both; }
@media (prefers-reduced-motion: no-preference) { .buddy__bubble:not([hidden]) { animation: bs-enter-scale 0.25s var(--bs-ease-out) both; } }
/* contorno navy: el robot se lee sobre fondos claros y oscuros */
.buddy__svg .b-ol { stroke: #0B1F4A; stroke-width: 1.6; paint-order: stroke; }
.buddy__svg { filter: drop-shadow(0 6px 10px rgb(7 20 48 / 0.28)) drop-shadow(0 0 1px rgb(7 20 48 / 0.4)); }

/* ---------- Idioma, modo oscuro y volver arriba ---------- */
.lang-switch, .theme-toggle {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px;
  border-radius: var(--bs-radius-md); border: 1px solid var(--bs-night-700); background: transparent; color: var(--bs-text-on-dark);
  font: 600 0.8125rem/1 var(--bs-font-mono); letter-spacing: 0.06em; text-decoration: none; cursor: pointer;
  transition: border-color var(--bs-dur-fast), background-color var(--bs-dur-fast), transform var(--bs-dur-fast);
}
.lang-switch svg, .theme-toggle svg { width: 18px; height: 18px; }
.lang-switch:hover, .theme-toggle:hover { color: var(--bs-text-on-dark); border-color: var(--bs-sky-500); background: rgb(255 255 255 / 0.05); text-decoration: none; }
.lang-switch:active, .theme-toggle:active { transform: scale(0.95); }
.theme-toggle { padding: 0; width: 44px; }
.theme-toggle .i-sun, [data-theme="dark"] .theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (prefers-reduced-motion: no-preference) { .theme-toggle svg { transition: transform var(--bs-dur-slow) var(--bs-ease-out); } .theme-toggle:hover svg { transform: rotate(-20deg); } }
.site-header__actions .lang-switch { display: none; }
@media (min-width: 768px) { .site-header__actions .lang-switch { display: inline-flex; } }
.mobile-menu__prefs { display: flex; gap: 10px; }
.mobile-menu__prefs .lang-switch { flex: 1; }
@media (max-width: 359.98px) { .site-header__actions .theme-toggle { display: none; } }

.to-top {
  position: fixed; z-index: calc(var(--bs-z-header) - 1); left: max(16px, env(safe-area-inset-left, 0px) + 16px); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--bs-night-950); color: var(--bs-text-on-dark); border: 1px solid var(--bs-night-700);
  box-shadow: 0 10px 30px rgb(7 20 48 / 0.3); opacity: 0; transform: translateY(12px) scale(0.9); pointer-events: none;
  transition: opacity var(--bs-dur-base) var(--bs-ease-out), transform var(--bs-dur-base) var(--bs-ease-out), border-color var(--bs-dur-fast);
}
.to-top[hidden] { display: none; }
.to-top.is-shown { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }
.to-top:hover { border-color: var(--bs-sky-500); color: var(--bs-text-on-dark); }
.to-top:hover svg { transform: translateY(-2px); transition: transform var(--bs-dur-fast); }
.to-top:focus-visible { outline: 2px solid var(--bs-sky-500); outline-offset: 3px; }
body.cookie-open .to-top { visibility: hidden; }
.has-intro body:not(.intro-past) .to-top { visibility: hidden; }

/* Modo oscuro: componentes con colores propios */
[data-theme="dark"] .alert--error { background: rgb(255 138 128 / 0.10); border-color: rgb(255 138 128 / 0.35); color: #FFC9C3; }
[data-theme="dark"] .alert--success { background: rgb(79 211 154 / 0.10); border-color: rgb(79 211 154 / 0.35); color: #B9F0D6; }
[data-theme="dark"] .alert--info { background: rgb(84 170 220 / 0.10); border-color: rgb(84 170 220 / 0.35); color: #CBE6F7; }
[data-theme="dark"] .alert--warning { background: rgb(242 179 91 / 0.10); border-color: rgb(242 179 91 / 0.35); color: #FADDB0; }
[data-theme="dark"] .impact__col { background: rgb(84 170 220 / 0.10); color: var(--bs-text-on-dark); }
[data-theme="dark"] .service-nav a[aria-current="true"] { background: var(--bs-sky-500); color: var(--bs-night-950); }
[data-theme="dark"] .to-top { background: var(--bs-night-900); }
@media (prefers-reduced-motion: no-preference) {
  html.theme-anim, html.theme-anim * { transition: background-color 0.35s var(--bs-ease-out), color 0.35s var(--bs-ease-out), border-color 0.35s var(--bs-ease-out) !important; }
}
[data-theme="dark"] .filter-chip[aria-pressed="true"] { background: var(--bs-sky-500); border-color: var(--bs-sky-500); color: var(--bs-night-950); }
[data-theme="dark"] .impact__col h5 { color: var(--bs-sky-400); }

/* ---------- Modo reposo (interactions.md §22) ---------- */
.idle { position: fixed; inset: 0; z-index: calc(var(--bs-z-skip) + 5); overflow: hidden; cursor: none; background: #08142F;
  opacity: 0; transition: opacity 0.8s var(--bs-ease-out); }
.idle[hidden] { display: none; }
.idle.is-open { opacity: 1; }
.idle:not(.is-open) { transition-duration: 0.35s; }
.idle__work, .idle__sync, .idle__cell { position: absolute; inset: 0; display: none; }
.idle[data-scene="work"] .idle__work, .idle[data-scene="sync"] .idle__sync, .idle[data-scene="cell"] .idle__cell { display: block; }
.idle__bot { position: absolute; left: 0; top: 0; will-change: transform; filter: drop-shadow(0 6px 18px rgb(0 0 0 / 0.45)); }
.idle__bot .buddy__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.idle__spark { position: absolute; z-index: 5; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #7AC0E8, 0 0 4px #fff; animation: idle-spark 0.7s var(--bs-ease-out) forwards; }
.idle__logo { position: absolute; z-index: 6; left: max(24px, env(safe-area-inset-left)); top: 22px; height: 28px; width: auto; opacity: 0.75; }
.idle__hint { position: absolute; z-index: 6; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); margin: 0; text-align: center;
  font: 500 0.75rem/1.4 var(--bs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgb(243 244 248 / 0.6); animation: idle-pulse 2.6s ease-in-out infinite; }
.ix__title { position: absolute; z-index: 3; left: 0; right: 0; top: 24px; margin: 0; text-align: center; font: 500 0.75rem/1.2 var(--bs-font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: #9CCBEB; }
.ix__title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: #FF5CA8; box-shadow: 0 0 10px #FF5CA8; vertical-align: 1px; animation: idle-pulse 1.6s ease-in-out infinite; }
@media (max-width: 699.98px) { .ix__title { top: 62px; } }
.idle__toast { position: absolute; z-index: 6; transform: translate(-50%, 0); padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font: 700 0.75rem/1.2 var(--bs-font-mono); letter-spacing: 0.04em; background: #0B1F4A; border: 1px solid #22345F; color: #F3F4F8; animation: idle-toast 1.5s var(--bs-ease-out) forwards; }
.idle__toast.is-good { color: #4FD39A; border-color: rgb(79 211 154 / 0.5); }
.idle__toast.is-bad { color: #FF8A80; border-color: rgb(255 138 128 / 0.5); }
@keyframes idle-spark { to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); } }
@keyframes idle-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes idle-toast { 0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -18px); } }

/* agente de IA (esfera con visor, anillo y chispa) */
.idle__agent { position: absolute; z-index: 2; filter: drop-shadow(0 8px 20px rgb(84 170 220 / 0.35)); }
.agent__svg { width: 100%; height: 100%; display: block; overflow: visible; }
.agent__svg .a-body { transform-box: view-box; transform-origin: 50% 55%; animation: ag-float 2.6s ease-in-out infinite; }
.agent__svg .a-ring { transform-box: fill-box; transform-origin: center; animation: ag-ring 6s linear infinite; }
.agent__svg .a-spark { transform-box: fill-box; transform-origin: center; animation: ag-spark 2.4s ease-in-out infinite; }
.agent__svg .a-eyes { transform-box: fill-box; transform-origin: center; transition: transform 0.2s var(--bs-ease-out); animation: b-blink 3.8s infinite; }
.agent__svg .a-shadow { transform-box: fill-box; transform-origin: center; animation: ag-shadow 2.6s ease-in-out infinite; }
.agent__svg[data-state="think"] .a-eyes { animation: none; transform: translate(2px, -2.5px); }
.agent__svg[data-state="think"] .a-spark { animation: ag-spark 0.5s ease-in-out infinite; }
.agent__svg[data-state="think"] .a-ring { animation-duration: 1.2s; }
.agent__svg[data-state="scan"] .a-eyes { animation: ag-scan 0.6s ease-in-out infinite alternate; }
.agent__svg[data-state="scan"] .a-ring { animation-duration: 2s; }
.agent__svg[data-state="happy"] .a-eyes { animation: none; transform: scaleY(0.35); }
.agent__svg[data-state="happy"] .a-body { animation: ag-float 0.5s ease-in-out infinite; }
@keyframes ag-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ag-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.6; } }
@keyframes ag-ring { to { stroke-dashoffset: -110; } }
@keyframes ag-spark { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.25) rotate(45deg); } }
@keyframes ag-scan { from { transform: translateX(-3px); } to { transform: translateX(3px); } }

/* bot escribiendo en su puesto */
.idle .buddy__svg[data-state="type"] .b-arm--front { animation: b-type 0.18s ease-in-out infinite alternate; }
.idle .buddy__svg[data-state="type"] .b-arm--back { animation: b-type 0.18s ease-in-out -0.09s infinite alternate; }
.idle .buddy__svg[data-state="type"] .b-head { animation: b-headbob 0.6s ease-in-out infinite alternate; }
.idle .buddy__svg[data-state="type"] .b-eyes { animation: none; transform: scaleY(0.7) translateY(1px); }
@keyframes b-type { from { transform: rotate(-55deg); } to { transform: rotate(-80deg); } }

/* escena "integración" */
.idle__sync { background: radial-gradient(45% 45% at 50% 53%, rgb(84 170 220 / 0.14), transparent 70%), linear-gradient(rgb(84 170 220 / 0.05) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgb(84 170 220 / 0.05) 1px, transparent 1px) 0 0 / 32px 32px, #08142F; }
.is__wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.is__wire { fill: none; stroke: #22345F; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 8; transition: stroke 0.3s; animation: is-wire 1.2s linear infinite; }
.is__wire.is-on { stroke: #54AADC; filter: drop-shadow(0 0 6px rgb(84 170 220 / 0.7)); }
@keyframes is-wire { to { stroke-dashoffset: -20; } }
.is__sys { position: absolute; z-index: 1; display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 8px 8px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #102149, #0B1A3C); border: 1px solid #22345F; box-shadow: 0 14px 40px rgb(0 0 0 / 0.35); color: #F3F4F8; }
.is__sys svg { width: 20px; height: 20px; color: #7AC0E8; }
.is__sys b { align-self: center; font: 700 0.875rem/1.1 var(--bs-font-display); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.is__sys i { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: #1E2E55; }
.is__sys i:nth-of-type(2) { width: 78%; } .is__sys i:nth-of-type(3) { width: 56%; }
.is__sys.is-send { animation: is-send 0.5s var(--bs-ease-out); }
.is__sys.is-got { animation: is-got 0.6s var(--bs-ease-out); }
.is__sys.is-got i:first-of-type { animation: is-row 0.6s var(--bs-ease-out); }
@keyframes is-send { 40% { border-color: #54AADC; box-shadow: 0 0 24px rgb(84 170 220 / 0.45); } }
@keyframes is-got { 40% { border-color: #4FD39A; box-shadow: 0 0 24px rgb(79 211 154 / 0.45); transform: scale(1.03); } }
@keyframes is-row { from { background: #4FD39A; } }
@media (max-width: 699.98px) { .is__sys { padding: 9px 10px; gap: 6px; } .is__sys b { font-size: 0.75rem; } .is__sys i:nth-of-type(3) { display: none; } }
.is__pkt { position: absolute; z-index: 3; left: 0; top: 0; width: 14px; height: 14px; margin: -7px; border-radius: 4px; background: #7AC0E8; box-shadow: 0 0 12px #54AADC;
  display: grid; place-items: center; font: 800 10px/1 var(--bs-font-body); color: #fff; transition: background 0.2s, border-radius 0.2s, box-shadow 0.2s; }
.is__pkt.is-clean { border-radius: 50%; background: #FF8CC2; box-shadow: 0 0 12px #FF5CA8; }
.is__pkt.is-bad { background: #E5484D; box-shadow: 0 0 14px #FF8A80; border-radius: 50%; width: 18px; height: 18px; margin: -9px; }
.is__pkt.is-ok { background: #0F7A4A; box-shadow: 0 0 14px #4FD39A; border-radius: 50%; width: 18px; height: 18px; margin: -9px; }
.is__pkt.is-hub { opacity: 0.6; }
.is__status { position: absolute; z-index: 3; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); text-align: center; padding: 10px 18px; border-radius: 12px; background: #050C22; border: 1px solid #22345F; }
.is__status small { display: block; font: 500 0.6875rem/1.2 var(--bs-font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #9CCBEB; }
.is__count { display: block; margin-top: 4px; font: 800 clamp(1.5rem, 1rem + 1.6vw, 2.25rem)/1 var(--bs-font-display); background: var(--bs-gradient-brand-text-dark); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 699.98px) { .is__status { bottom: auto; top: 50%; left: auto; right: 10px; transform: translateY(-50%); padding: 8px 10px; } .is__status small { font-size: 0.5625rem; max-width: 92px; } }

/* escena "célula digital" */
.idle__cell { background: radial-gradient(50% 40% at 50% 85%, rgb(255 227 154 / 0.08), transparent 70%), linear-gradient(180deg, #0B1A3C 0%, #08142F 100%); }
.ic__floor { position: absolute; background: linear-gradient(180deg, #13244D 0%, #0A1534 30%, #060E26 100%); border-top: 2px solid #22345F; }
.ic__board { position: absolute; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; border-radius: 14px; background: #0D1C40; border: 6px solid #1A2B57; box-shadow: 0 20px 50px rgb(0 0 0 / 0.35); }
.ic__col { display: flex; flex-direction: column; gap: 6px; padding: 10px; overflow: hidden; border-radius: 8px; background: #08142F; }
.ic__col small { margin-bottom: 4px; font: 500 0.6875rem/1.2 var(--bs-font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #9CCBEB; white-space: nowrap; }
.ic__count { color: #4FD39A; }
.ic__card { flex: none; padding: 6px 9px; border-radius: 6px; background: #F4F7FB; color: #0B1F4A; font: 600 0.75rem/1.25 var(--bs-font-body); border-left: 4px solid #7AC0E8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-col="doing"] .ic__card { border-left-color: #FFE39A; }
[data-col="done"] .ic__card { border-left-color: #4FD39A; opacity: 0.85; }
[data-col="done"] .ic__card::after { content: " ✓"; color: #0F7A4A; }
.ic__card.is-in { animation: ic-in 0.35s var(--bs-ease-out); }
@keyframes ic-in { from { opacity: 0; transform: translateY(-8px) scale(0.92); } }
@media (max-width: 699.98px) { .ic__board { gap: 6px; padding: 8px; border-width: 4px; } .ic__col { padding: 6px; } .ic__col small { font-size: 0.5625rem; letter-spacing: 0.06em; } .ic__card { font-size: 0.625rem; padding: 4px 6px; border-left-width: 3px; } }
.ic__desk { position: absolute; z-index: 2; overflow: visible; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #2A3D6E 0 8px, #16295A 8px 100%); border: 2px solid #0B1F4A; }
.ic__screen { position: absolute; z-index: 3; left: 6%; bottom: calc(100% + 2px); width: 34%; aspect-ratio: 4 / 3; display: grid; align-content: center; gap: 3px; padding: 4px 5px; border-radius: 4px; background: #050C22; border: 2px solid #22345F; }
.ic__screen i { height: 3px; border-radius: 2px; background: #22345F; }
.ic__desk.is-busy .ic__screen { border-color: #54AADC; box-shadow: 0 0 14px rgb(84 170 220 / 0.4); }
.ic__desk.is-busy .ic__screen i { background: #7AC0E8; animation: ic-code 0.5s steps(3) infinite; }
.ic__desk.is-busy .ic__screen i:nth-child(2) { background: #FF8CC2; animation-delay: -0.2s; } .ic__desk.is-busy .ic__screen i:nth-child(3) { animation-delay: -0.35s; }
@keyframes ic-code { 0% { width: 30%; } 50% { width: 85%; } 100% { width: 60%; } }
.ic__tag { position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 999px; background: #0B1F4A; border: 1px solid #22345F; font: 600 0.6875rem/1.2 var(--bs-font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: #9CCBEB; }
@media (max-width: 699.98px) { .ic__tag { font-size: 0.5rem; padding: 2px 5px; letter-spacing: 0.02em; } }
.ic__who { z-index: 1; }
.ic__who.is-hop { animation: ic-hop 0.8s var(--bs-ease-out); }
@keyframes ic-hop { 30% { transform: translateY(-26px); } 55% { transform: translateY(0); } 70% { transform: translateY(-8px); } }
.ic__tok { position: absolute; z-index: 4; width: 16px; height: 20px; margin: -10px -8px; border-radius: 3px; background: #F4F7FB; border: 2px solid #0B1F4A; box-shadow: 0 0 10px rgb(122 192 232 / 0.6); }
.ic__tok.is-flying { transition: left 0.55s cubic-bezier(0.3, 0, 0.6, 1), top 0.55s cubic-bezier(0.2, -0.6, 0.6, 1); }
.ic__tok.is-bad { background: #FFD6D3; box-shadow: 0 0 12px #FF8A80; }
.ic__tok.is-ok { background: #D7F5E6; box-shadow: 0 0 12px #4FD39A; }
.ic__confetti { position: absolute; z-index: 5; width: 7px; height: 11px; border-radius: 2px; animation: ic-confetti 1.2s var(--bs-ease-out) forwards; }
@keyframes ic-confetti { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(540deg); } }

/* robot bailando (festejo en la escena de trabajo) */
.buddy__svg[data-state="dance"] .b-body { animation: b-sway 0.5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.buddy__svg[data-state="dance"] .b-arm--front { animation: b-dance-a 0.5s ease-in-out infinite alternate; }
.buddy__svg[data-state="dance"] .b-arm--back { animation: b-dance-b 0.5s ease-in-out infinite alternate; }
.buddy__svg[data-state="dance"] .b-leg--front { animation: b-kick 0.25s ease-in-out infinite alternate; }
.buddy__svg[data-state="dance"] .b-head { animation: b-headbob 0.5s ease-in-out infinite alternate; }
.buddy__svg[data-state="dance"] .b-eyes { animation: none; transform: scaleY(0.45); }
@keyframes b-sway { from { transform: rotate(-9deg); } to { transform: rotate(9deg) translateY(-2px); } }
@keyframes b-dance-a { from { transform: rotate(160deg); } to { transform: rotate(40deg); } }
@keyframes b-dance-b { from { transform: rotate(-40deg); } to { transform: rotate(-160deg); } }
@keyframes b-headbob { from { transform: rotate(-8deg); } to { transform: rotate(8deg) translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .idle { display: none !important; } }

/* Modo reposo · escena "trabajo": el bot sigue trabajando fuera de horario */
.idle__work { position: absolute; inset: 0; display: none; --speed: 1;
  background: radial-gradient(40% 50% at 53% 78%, rgb(255 227 154 / 0.10), transparent 70%), linear-gradient(180deg, #0B1A3C 0%, #08142F 100%); }
.idle[data-scene="work"] .idle__work { display: block; }
.iw__window, .iw__monitor, .iw__clock, .iw__belt, .iw__desk, .iw__tray, .iw__cloud, .iw__floor, .iw__doc { position: absolute; }
.iw__window { --dawn: 0; overflow: hidden; border-radius: 10px; border: 6px solid #1A2B57; box-shadow: inset 0 0 0 2px #22345F, 0 20px 50px rgb(0 0 0 / 0.35);
  background: radial-gradient(1.2px 1.2px at 20% 30%, #fff 99%, transparent), radial-gradient(1px 1px at 70% 20%, #fff 99%, transparent), radial-gradient(1.4px 1.4px at 45% 55%, #B9E0F5 99%, transparent),
    radial-gradient(1px 1px at 85% 45%, #fff 99%, transparent), radial-gradient(1px 1px at 10% 60%, #FFC3DD 99%, transparent), linear-gradient(180deg, #050C24 0%, #0E2350 100%); }
.iw__window::before { content: ""; position: absolute; inset: 0; opacity: var(--dawn); background: linear-gradient(180deg, #2F5FA8 0%, #F6A6C9 70%, #FFD9A0 100%); transition: opacity 0.4s; }
.iw__window::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2.5px; background: #1A2B57; box-shadow: 0 0 0 9999px transparent; }
.iw__moon { position: absolute; right: 14%; top: calc(14% + var(--dawn) * 60%); width: 13%; aspect-ratio: 1; border-radius: 50%; background: #F4F7FB; box-shadow: 0 0 24px rgb(244 247 251 / 0.6), inset -6px -4px 0 #DCE6F2; opacity: calc(1 - var(--dawn)); }
.iw__city { position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: #040A1D;
  clip-path: polygon(0 40%, 8% 40%, 8% 15%, 16% 15%, 16% 50%, 24% 50%, 24% 0, 33% 0, 33% 35%, 42% 35%, 42% 20%, 50% 20%, 50% 55%, 58% 55%, 58% 10%, 68% 10%, 68% 45%, 77% 45%, 77% 25%, 86% 25%, 86% 50%, 100% 50%, 100% 100%, 0 100%);
  -webkit-mask: none; }
.iw__city::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.6px 1.6px at 50% 50%, #FFE39A 99%, transparent); background-size: 11px 13px; opacity: 0.55; }
.iw__clock { text-align: center; padding: 10px 14px; border-radius: 12px; background: #050C22; border: 1px solid #22345F; box-shadow: 0 0 30px rgb(255 92 168 / 0.12); }
.iw__time { display: block; font: 700 clamp(1.6rem, 1rem + 2vw, 2.6rem)/1 var(--bs-font-mono); letter-spacing: 0.06em; color: #FF8CC2; text-shadow: 0 0 14px rgb(255 92 168 / 0.6); }
.iw__clock small { display: block; margin-top: 6px; font: 500 0.6875rem/1.2 var(--bs-font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #9CCBEB; }
.iw__monitor { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #071735, #050E26); border: 6px solid #1A2B57; box-shadow: 0 0 40px rgb(84 170 220 / 0.18), 0 20px 50px rgb(0 0 0 / 0.35); color: #B8C2D8; }
.iw__monitor small { font: 500 0.6875rem/1.2 var(--bs-font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #7AC0E8; }
.iw__count { font: 800 clamp(1.8rem, 1rem + 2.6vw, 3rem)/1 var(--bs-font-display); background: var(--bs-gradient-brand-text-dark); -webkit-background-clip: text; background-clip: text; color: transparent; }
.iw__log { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font: 500 clamp(0.625rem, 0.55rem + 0.25vw, 0.8125rem)/1.35 var(--bs-font-mono); }
.iw__log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: iw-line 0.35s var(--bs-ease-out); }
.iw__log li:nth-child(n+2) { opacity: 0.7; } .iw__log li:nth-child(n+3) { opacity: 0.45; } .iw__log li:nth-child(n+4) { opacity: 0.25; }
.iw__log li span { color: #4FD39A; }
.iw__floor { background: linear-gradient(180deg, #13244D 0%, #0A1534 30%, #060E26 100%); border-top: 2px solid #22345F; }
.iw__belt { border-radius: 0 10px 10px 0; background: repeating-linear-gradient(90deg, #2A3D6E 0 16px, #1E2E55 16px 32px); border: 2px solid #0B1F4A; box-shadow: 0 6px 0 #0B1F4A; }
.iw__belt.is-moving { animation: iw-belt calc(0.6s / var(--speed)) linear; }
.iw__belt::after { content: ""; position: absolute; right: 18%; top: 100%; width: 10px; height: 999px; background: #16295A; }
.iw__desk { border-radius: 8px 8px 0 0; background: linear-gradient(180deg, #2A3D6E 0 10px, #16295A 10px 100%); border: 2px solid #0B1F4A; }
.iw__desk::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 260%; height: 180%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 60% at 50% 100%, rgb(255 227 154 / 0.16), transparent 70%); }
.iw__tray { border-radius: 6px 6px 0 0; background: repeating-linear-gradient(180deg, #1E2E55 0 26%, #0B1F4A 26% 28%), #1E2E55; border: 2px solid #0B1F4A; }
.iw__cloud svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 12px rgb(84 170 220 / 0.45)); }
.iw__cloud.is-hit svg { animation: iw-cloud 0.7s var(--bs-ease-out); }
.iw__doc { z-index: 2; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.35)); }
.iw__doc svg { width: 100%; height: 100%; display: block; }
.iw__doc.is-moving { transition: left calc(0.55s / var(--speed)) var(--bs-ease-out), top calc(0.55s / var(--speed)) var(--bs-ease-out); }
.iw__doc.is-flying { transition: left calc(0.32s / var(--speed)) cubic-bezier(0.3, 0, 0.6, 1), top calc(0.32s / var(--speed)) cubic-bezier(0.2, -0.9, 0.6, 1), transform 0.3s; }
.iw__doc.is-upload { transition: left 0.6s var(--bs-ease-in-out), top 0.6s var(--bs-ease-in-out), transform 0.6s, opacity 0.6s 0.1s; }
.iw__ok { position: absolute; right: -14%; bottom: 8%; width: 58%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%;
  background: #0F7A4A; border: 2px solid #4FD39A; color: #fff; font: 800 0.8rem/1 var(--bs-font-body); transform: rotate(-12deg); animation: iw-stamp 0.3s var(--bs-ease-out); }
.iw__bot { z-index: 1; }
.iw__desk, .iw__tray { z-index: 1; }
.idle .buddy__svg[data-state="carry"] .b-arm--front, .idle .buddy__svg[data-state="carry"] .b-arm--back { transform: rotate(-78deg); }
.idle .buddy__svg[data-state="carry"] .b-leg--front { animation: b-swing calc(0.36s / var(--speed, 1)) ease-in-out infinite alternate; }
.idle .buddy__svg[data-state="carry"] .b-leg--back { animation: b-swing calc(0.36s / var(--speed, 1)) ease-in-out calc(-0.18s / var(--speed, 1)) infinite alternate; }
.idle .buddy__svg[data-state="carry"] .b-body { animation: b-bob 0.18s ease-in-out infinite alternate; }
.idle .buddy__svg[data-state="run"] .b-leg--front, .idle .buddy__svg[data-state="run"] .b-arm--back,
.idle .buddy__svg[data-state="run"] .b-leg--back, .idle .buddy__svg[data-state="run"] .b-arm--front { animation-duration: calc(0.36s / var(--speed, 1)); }
.idle .buddy__svg[data-state="stamp"] .b-arm--front { animation: b-stamp calc(0.39s / var(--speed, 1)) cubic-bezier(0.5, 0, 0.9, 0.4) infinite; }
.idle .buddy__svg[data-state="stamp"] .b-arm--back { transform: rotate(-60deg); }
.idle .buddy__svg[data-state="stamp"] .b-head { transform: rotate(8deg); }
.idle .buddy__svg[data-state="stamp"] .b-eyes { animation: none; transform: scaleY(0.6); }
@keyframes b-stamp { 0% { transform: rotate(-165deg); } 70% { transform: rotate(-40deg); } 100% { transform: rotate(-165deg); } }
@keyframes iw-belt { from { background-position: 0 0; } to { background-position: 64px 0; } }
@keyframes iw-cloud { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes iw-stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-12deg); opacity: 1; } }
@keyframes iw-line { from { transform: translateY(-6px); opacity: 0; } }
.ic__who .buddy__svg { transform: scaleX(-1); }   /* los bots miran a su monitor */

/* ---------- Sinapsis en las divisiones entre secciones (interactions.md §23) ---------- */
.syn-line { position: absolute; z-index: 3; bottom: -1px; height: 2px; pointer-events: none; overflow: visible; }
.syn-node { position: absolute; top: 50%; left: 0; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: rgb(122 192 232 / 0.35); }
.syn-node--r { left: auto; right: 0; }
.syn-node.is-fire { animation: syn-fire 0.9s var(--bs-ease-out); }
.syn-node.is-fire.is-pink { --syn: 255 92 168; }
@keyframes syn-fire { 0% { box-shadow: 0 0 0 0 rgb(var(--syn, 122 192 232) / 0.9); background: #fff; transform: scale(1.8); } 100% { box-shadow: 0 0 0 14px rgb(var(--syn, 122 192 232) / 0); transform: scale(1); } }
.syn-pulse { position: absolute; left: 0; top: 50%; width: 160px; height: 2px; margin-top: -1px; opacity: 0; border-radius: 2px; will-change: transform, opacity;
  background: linear-gradient(90deg, rgb(122 192 232 / 0) 0%, rgb(122 192 232 / 0.25) 55%, rgb(185 224 245 / 0.85) 92%, #fff 100%); filter: drop-shadow(0 0 3px rgb(122 192 232 / 0.8)); }
.syn-pulse::after { content: ""; position: absolute; right: -3px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 2px rgb(122 192 232 / 0.85), 0 0 16px 4px rgb(122 192 232 / 0.35); animation: syn-flicker 0.11s steps(2) infinite; }
.syn-pulse.is-pink { background: linear-gradient(90deg, rgb(255 92 168 / 0) 0%, rgb(255 92 168 / 0.25) 55%, rgb(255 195 221 / 0.85) 92%, #fff 100%); filter: drop-shadow(0 0 3px rgb(255 92 168 / 0.8)); }
.syn-pulse.is-pink::after { box-shadow: 0 0 6px 2px rgb(255 92 168 / 0.85), 0 0 16px 4px rgb(255 92 168 / 0.35); }
@keyframes syn-flicker { from { opacity: 1; transform: scale(1); } to { opacity: 0.55; transform: scale(0.75); } }
@media (prefers-reduced-motion: reduce) { .syn-line { display: none; } }
