/* =============================================================
   Fluxus — web comercial
   1. Tokens  2. Base  3. Utilidades  4. Tipografía  5. Componentes
   6. Secciones  7. Recorrido de la gota  8. Movimiento reducido
   ============================================================= */

/* ---------- Fuentes ----------
   Titulares: Unbounded (SIL OFL). Sustituye a Stretch Pro, cuyo archivo
   declara «Free For Personal Use». Con la licencia comercial, basta con
   añadir su @font-face y ponerla la primera en --font-display.            */
@font-face {
  font-family: "Unbounded";
  src: url("assets/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Text";
  src: url("assets/fonts/red-hat-text-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Fondo y superficies */
  --black: #000000;
  --bg: #0a0b0b;
  --surface: #121414;
  --surface-2: #1b1e1e;
  --line: #272b2b;
  --line-2: #3d4342;

  /* Texto: blanco cálido y grises */
  --text: #f5f2ea;
  --text-2: #bbbcb3;
  --text-3: #8d8f87;

  /* Acentos, tomados del símbolo y de la X del logotipo */
  --lime: #eaf13a;
  --lime-hi: #f3f86e;
  --mint: #92d392;
  --cyan: #3fbdf0;
  --coral: #ff8f76;
  --ink: #0a0b0b;
  --ink-2: #3d4012;
  --paper: #f3f1ea;

  --gel: linear-gradient(90deg, var(--lime), var(--mint) 52%, var(--cyan));
  --gel-down: linear-gradient(180deg, var(--lime), var(--mint) 52%, var(--cyan));
  --gel-up: linear-gradient(180deg, var(--cyan), var(--mint) 48%, var(--lime));

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Red Hat Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Retícula: margen, carril del recorrido y ancho máximo */
  --pad: clamp(16px, 4.4vw, 64px);
  --lane: clamp(26px, 5vw, 72px);
  --rail-x: calc(var(--pad) + 9px);
  --page-max: 1440px;
  --nav-h: 60px;

  --r-s: 10px;
  --r-m: 18px;
  --shadow-lift: 0 28px 56px -26px rgba(0, 0, 0, 0.9), 0 6px 14px -8px rgba(0, 0, 0, 0.6);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}
@media (min-width: 720px) {
  :root { --nav-h: 68px; }
}

/* =============================================================
   2. Base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scrollbar-color: var(--line-2) var(--black);
  background: var(--black);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  caret-color: var(--lime);
}
@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
}

img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
fieldset { border: 0; padding: 0; min-width: 0; }
p { text-wrap: pretty; }

::selection { background: var(--lime); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

a, button, label, [role="button"] { touch-action: manipulation; }
button, .btn, .nav a, .seg label {
  -webkit-user-select: none;
  user-select: none;
}

/* =============================================================
   3. Utilidades
   ============================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  padding: 0.7rem 1rem; border-radius: 999px;
  background: var(--lime); color: var(--ink); font-weight: 600;
}
.skip-link:focus { top: 12px; }

.wrap {
  position: relative;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-left: calc(var(--pad) + var(--lane));
  padding-right: var(--pad);
}

.icon {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-fill { fill: currentColor; stroke: none; }

/* =============================================================
   4. Tipografía
   ============================================================= */
h1, h2, h3, h4 { text-wrap: balance; overflow-wrap: anywhere; }

h1, h2, .svc h3, .stage-item h3, .chain h4 {
  font-family: var(--font-display);
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.45rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 17em;
}

.band-lead {
  margin-top: 1.1rem;
  max-width: 36rem;
  font-size: 1.125rem;
  color: var(--text-2);
}
@media (min-width: 720px) {
  .band-lead { font-size: 1.1875rem; }
}

.tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-2); border-radius: 1.2em;
  font-size: 0.8125rem; font-weight: 500; line-height: 1.3;
  color: var(--text-2);
}
.tag::before {
  content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime);
}

.note { font-size: 0.875rem; color: var(--text-3); }

/* =============================================================
   5. Componentes
   ============================================================= */

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.7rem 1.45rem;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 1rem; font-weight: 600; line-height: 1.2; text-align: center;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-compact { min-height: 46px; padding: 0.5rem 1.15rem; font-size: 0.9375rem; }

.btn-primary { background: var(--lime); color: var(--ink); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn .icon { transition: transform 200ms var(--ease-out); }

.btn[disabled] { opacity: 0.42; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:not([disabled]):hover { background: var(--lime-hi); }
  .btn-ghost:not([disabled]):hover { border-color: var(--text); }
  .hero-actions .btn-ghost:hover .icon { transform: translateY(3px); }
  .form .btn-primary:not([disabled]):hover .icon { transform: translateX(3px); }
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  min-height: var(--nav-h);
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color 240ms ease, border-color 240ms ease;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.nav-inner {
  max-width: var(--page-max); min-height: var(--nav-h); margin-inline: auto;
  padding-inline: var(--pad);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 1rem;
}
.nav-logo { display: flex; align-items: center; min-height: 44px; margin-left: -6px; padding: 0 6px; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 clamp(0.15rem, 1.4vw, 0.9rem); }
.nav-links a {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem;
  font-size: 0.9375rem; font-weight: 500; color: var(--text-2);
  transition: color 160ms ease;
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0.6rem; right: 0.6rem; bottom: 9px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 220ms var(--ease-out);
}
.nav-links .nav-cta {
  min-height: 40px; margin-left: 0.35rem; padding: 0 1rem;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--text);
  transition: border-color 160ms ease, transform 140ms var(--ease-out);
}
.nav-links .nav-cta:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); }
  .nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }
  .nav-links .nav-cta:hover { border-color: var(--text); }
}
@media (min-width: 420px) {
  .nav-logo img { height: 26px; }
}
@media (min-width: 720px) {
  .nav-logo img { height: 30px; }
}

/* ---------- Conmutador de caso ---------- */
.seg {
  position: relative;
  display: inline-grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 4px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--surface);
}
.seg::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px); border-radius: 999px; background: var(--text);
  transition: transform 260ms var(--ease-out);
}
.seg[data-value="falta"]::before { transform: translateX(100%); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 0.95rem; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 500; line-height: 1.2; text-align: center; color: var(--text-2);
  transition: color 200ms ease;
}
.seg input:checked + span { color: var(--ink); }
@media (max-width: 379px) {
  .seg span { padding: 0 0.35rem; font-size: 0.875rem; }
  .demo-bar .tag { font-size: 0.75rem; }
}
.seg input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* ---------- Maquetas (documentos, mensajes, tablas) ---------- */
.mock {
  position: relative;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.mock-cap { margin-top: 1.1rem; font-size: 0.8125rem; color: var(--text-3); }
.mock.is-bare { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* =============================================================
   6. Secciones
   ============================================================= */
.band { position: relative; z-index: 1; scroll-margin-top: var(--nav-h); }
.band > .wrap { padding-block: clamp(76px, 11vw, 148px); }
.band-head { margin-bottom: clamp(32px, 5vw, 64px); }

/* ---------- Hero ---------- */
.hero {
  --h1: min(6.5vw, 5.4rem);
  --stage: min(76vw, 35svh, 420px);
  position: relative; z-index: 2;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-bottom: clamp(36px, 7svh, 88px);
  background: linear-gradient(180deg, var(--black) 72%, var(--bg));
  overflow-x: clip; /* el brillo del símbolo sobresale por la derecha; hacia abajo debe poder salir */
}
.hero-wrap {
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100svh - var(--nav-h) - clamp(36px, 7svh, 88px));
}

.hero h1 {
  position: relative; z-index: 3;
  font-size: var(--h1);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.02em;
  word-spacing: 0.1em;
}
.hero h1 span { display: block; }

.hero-lead {
  position: relative; z-index: 3;
  margin-top: clamp(14px, 2.6svh, 28px);
  max-width: 34rem;
  font-size: 1.0625rem;
  color: var(--text-2);
}
.hero-actions {
  position: relative; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-top: clamp(18px, 3.2svh, 36px);
}
.hero-actions .btn { flex: 1 1 100%; padding-inline: 0.75rem; font-size: 0.9375rem; }

.hero-brand {
  position: relative; z-index: 1; order: -1;
  height: calc(var(--stage) * 0.89);
  margin-top: calc(var(--stage) * -0.1);
  pointer-events: none;
}
.stage {
  position: absolute; top: 0; right: calc(var(--stage) * -0.11);
  width: var(--stage); height: var(--stage);
}
.stage-video, .traveler, .traveler-skin {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.stage-video {
  object-fit: cover; opacity: 0;
  -webkit-mask-image: radial-gradient(closest-side, #000 86%, transparent);
  mask-image: radial-gradient(closest-side, #000 86%, transparent);
  transition: opacity 260ms ease;
}
.traveler { transform-origin: 49.6% 49.8%; }
.intro .traveler { transition: opacity 260ms ease; }
.traveler-skin { transform-origin: 49.6% 49.8%; }
/* La gota del vídeo del logotipo: el símbolo se convierte en ella al salir del hero. */
.traveler-drop {
  position: absolute; left: 49.6%; top: 49.8%; width: 43.9%; height: auto; max-width: none;
  opacity: 0; transform: translate(-50%, -49%);
}

.hero-wordmark {
  position: absolute; left: 0; bottom: 20%;
  width: min(29vw, 140px);
  transition: clip-path 700ms var(--ease-out);
  clip-path: inset(0 0 0 0);
}

/* Entrada: la gota cae (vídeo), se asienta y aparece el logotipo. */
.intro .traveler { opacity: 0; animation: intro-safety 1ms linear 7s forwards; }
.intro .hero-wordmark { clip-path: inset(0 100% 0 0); animation: intro-safety-clip 1ms linear 7s forwards; }
.intro.intro-playing .stage-video { opacity: 1; }
.intro.intro-settled .hero-wordmark { clip-path: inset(0 0 0 0); }
.intro.intro-handoff .traveler { opacity: 1; animation: none; }
@keyframes intro-safety { to { opacity: 1; } }
@keyframes intro-safety-clip { to { clip-path: inset(0 0 0 0); } }

.traj, .outfall {
  position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  overflow: visible; pointer-events: none;
}
.traj { z-index: 0; transition: opacity 500ms ease; }
.intro:not(.intro-settled) .traj { opacity: 0; }

@media (min-width: 540px) {
  .hero-actions .btn { flex: 0 1 auto; padding-inline: 1.45rem; font-size: 1rem; }
}

@media (min-width: 720px) {
  .hero {
    --h1: min(5.5vw, 8.4svh, 4.6rem);
    --stage: min(46vw, 66svh, 660px);
    padding-top: calc(var(--nav-h) + clamp(20px, 6svh, 64px));
    display: grid; align-content: center;
  }
  .hero-wrap {
    display: block;
    min-height: calc(var(--h1) * 0.62 + var(--stage) * 0.99);
  }
  .hero-lead {
    max-width: min(34rem, 100% - var(--stage) * 0.84);
    font-size: 1.1875rem;
  }
  .hero-actions { max-width: calc(100% - var(--stage) * 0.8); }
  .hero-brand {
    position: absolute; order: 0;
    top: calc(var(--h1) * 0.62); right: calc(var(--pad) - var(--stage) * 0.11);
    width: var(--stage); height: var(--stage); margin: 0;
  }
  .stage { right: 0; }
  .hero-wordmark {
    left: 49.6%; bottom: auto; top: 89.5%;
    width: 40%; transform: translateX(-50%);
  }
}

@media (min-width: 720px) and (max-width: 959px) {
  /* Con el símbolo al lado queda menos ancho para las líneas largas del titular. */
  .hero { --h1: min(4.7vw, 8.4svh, 4.6rem); }
}
@media (min-width: 720px) and (max-aspect-ratio: 1/1) {
  /* Tablet en vertical: el titular arriba y la siguiente sección asomando, sin vacío centrado. */
  .hero { min-height: 0; align-content: start; padding-bottom: clamp(48px, 9svh, 110px); }
}

/* ---------- Demo ---------- */
.demo { background: var(--bg); }

.demo-bar {
  --bar-fold: 104px; /* alto de lo que se pliega bajo la navegación en móvil: etiqueta + conmutador */
  position: sticky; top: calc(var(--nav-h) - var(--bar-fold)); z-index: 4;
  display: grid; grid-template-columns: 1fr; gap: 10px 14px; align-items: center;
  margin-inline: 0 -4px;
  padding: 12px clamp(12px, 2vw, 20px);
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: 0 18px 30px -22px rgba(0, 0, 0, 0.9);
}
.demo-bar > * { min-width: 0; }
.demo-bar .tag { justify-self: start; max-width: 100%; }
.demo-bar .seg { justify-self: stretch; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-buttons .btn { flex: 0 0 auto; max-width: 100%; }
.demo-buttons .btn-primary { flex: 1 1 auto; }
@media (max-width: 419px) {
  /* En pantallas estrechas «Reiniciar» queda como botón de icono; el texto sigue para lectores de pantalla. */
  .demo-buttons [data-reset] { width: 46px; padding: 0; }
  .demo-buttons [data-reset] .btn-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
.demo-status {
  min-height: 1.45em;
  font-size: 0.9375rem; color: var(--text-2);
}

.demo-stage {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(28px, 4vw, 48px);
}

/* Nodos del flujo */
.flow-node {
  --dot: 18px;
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 14px;
  align-content: start;
  padding-bottom: 26px;
}
.flow-body { display: contents; }
.flow-node h3 {
  order: 1; overflow-wrap: anywhere;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.3;
}
.flow-node .state { order: 2; }
.flow-node .flow-what { order: 3; }
.flow-node .flow-result { order: 4; }
.flow-what { margin-top: 0.2rem; font-size: 0.9375rem; color: var(--text-2); }
.flow-result {
  margin-top: 0.45rem; min-height: 2.9em;
  font-size: 0.9375rem; line-height: 1.45; color: var(--text);
  transition: opacity 240ms ease;
}
.flow-result:empty { opacity: 0; }

.state {
  justify-self: start; margin: 0.4rem 0 0.15rem;
  padding: 0.16rem 0.6rem; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; line-height: 1.35; color: var(--text-3);
  white-space: nowrap;
  transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.dot {
  position: absolute; z-index: 1;
  left: calc(9px - var(--lane)); top: 2px;
  width: var(--dot); height: var(--dot); margin-left: calc(var(--dot) / -2);
  display: grid; place-items: center;
  border: 2px solid var(--line-2); border-radius: 50%;
  background: var(--bg); color: var(--ink);
  transition: background-color 220ms ease, border-color 220ms ease, transform 260ms var(--ease-out);
}
.dot .icon { grid-area: 1 / 1; width: 11px; height: 11px; stroke-width: 3; opacity: 0; }

.flow-node.is-entry, .flow-node.is-exit { --dot: 22px; }
.flow-node.is-entry .dot, .flow-node.is-exit .dot { top: 0; }
.flow-node.is-entry .dot {
  border-color: transparent;
  background: linear-gradient(135deg, var(--lime), var(--mint) 55%, var(--cyan));
}
.journey .demo:not(.is-arrived) .is-entry .dot {
  background: var(--bg); border-color: var(--line-2); transform: scale(0.8);
}

/* Estados */
.flow-node[data-state="curso"] .dot { border-color: var(--lime); background: var(--bg); }
.flow-node[data-state="curso"] .dot::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--lime); border-right-color: transparent; border-bottom-color: transparent;
  animation: spin 800ms linear infinite;
}
.flow-node[data-state="curso"] .state { color: var(--lime); border-color: var(--lime); }

.flow-node[data-state="hecho"] .dot,
.flow-node[data-state="resuelto"] .dot { border-color: var(--cyan); background: var(--cyan); }
.flow-node[data-state="hecho"] .dot .icon:not(.icon-person):not(.icon-minus),
.flow-node[data-state="resuelto"] .dot .icon-check { opacity: 1; }
.flow-node[data-state="hecho"] .state,
.flow-node[data-state="resuelto"] .state { color: var(--cyan); border-color: rgba(63, 189, 240, 0.5); }

.flow-node[data-state="persona"] .dot { border-color: var(--lime); background: var(--lime); transform: scale(1.25); }
.flow-node[data-state="persona"] .dot .icon-person { opacity: 1; }
.flow-node[data-state="persona"] .state { color: var(--ink); background: var(--lime); border-color: var(--lime); }

.flow-node[data-state="omitido"] .dot,
.flow-node[data-state="anulado"] .dot { border-color: var(--line-2); background: var(--surface-2); color: var(--text-3); }
.flow-node[data-state="omitido"] .dot .icon-minus,
.flow-node[data-state="anulado"] .dot .icon-minus { opacity: 1; }
.flow-node[data-state="omitido"] h3, .flow-node[data-state="anulado"] h3 { color: var(--text-2); }

.flow-node.is-exit[data-state="hecho"] .dot { border-color: var(--cyan); background: var(--cyan); }
.flow-node.is-exit[data-state="persona"] .dot { border-color: var(--lime); background: var(--lime); transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Rama de revisión: se aparta del carril */
.flow-node.is-branch { --indent: 22px; padding-left: var(--indent); }
.flow-node.is-branch .dot { left: calc(9px - var(--lane) + var(--indent)); }
.elbow {
  position: absolute; left: calc(8px - var(--lane)); top: -8px;
  width: var(--indent); height: 20px;
  border: solid var(--line-2); border-width: 0 0 2px 2px; border-bottom-left-radius: 14px;
  transition: border-color 240ms ease;
}
.flow-node.is-branch[data-state="persona"] .elbow { border-color: var(--lime); }
.flow-node.is-branch[data-state="resuelto"] .elbow { border-color: var(--cyan); }

/* Carril de la demo */
.demo-rail {
  position: absolute; left: calc(8px - var(--lane)); width: 2px;
  top: var(--rail-top, 11px); height: var(--rail-h, calc(100% - 22px));
}
.demo-rail-base, .demo-rail-live {
  position: absolute; inset: 0; transform-origin: top;
}
.demo-rail-base { background: var(--line-2); }
.demo-rail-live {
  left: -1px; right: -1px; border-radius: 2px;
  background: var(--gel-up);
  transform: scaleY(var(--live, 0));
  transition: transform 700ms var(--ease-in-out);
}

/* Correo y PDF de ejemplo */
.mail {
  position: relative; margin: 2px 0 34px;
  padding: 18px 18px 0;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transition: opacity 380ms var(--ease-out), transform 480ms var(--ease-out);
}
.journey .demo:not(.is-arrived) .mail { opacity: 0; transform: translateY(20px) scale(0.985); }
.mail-from { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9375rem; line-height: 1.3; }
.mail-from > span:last-child { display: grid; min-width: 0; }
.mail-addr { color: var(--text-3); font-size: 0.8125rem; overflow-wrap: anywhere; }
.avatar {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.mail-subject { margin-top: 0.9rem; font-weight: 600; }
.mail-text { margin-top: 0.15rem; font-size: 0.9375rem; color: var(--text-2); }
.mail-file {
  display: inline-flex; align-items: center; gap: 0.45rem; margin-top: 0.8rem;
  padding: 0.3rem 0.7rem 0.3rem 0.55rem; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--text-2);
}

.pdf {
  position: relative; isolation: isolate;
  margin: 16px -6px 0 8px; padding: 14px 14px 18px;
  border-radius: 5px 5px 0 0;
  background: var(--paper); color: #17191c;
  box-shadow: 0 -14px 34px -18px rgba(0, 0, 0, 0.85);
  transform: rotate(-0.8deg); transform-origin: 0 100%;
  font-size: 0.875rem; line-height: 1.45;
}
.pdf-title {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.5rem; margin-bottom: 0.65rem; border-bottom: 1.5px solid #17191c;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
}
.pdf-fields { display: grid; gap: 0.5rem; }
.pdf-fields > div { display: grid; grid-template-columns: 4.3rem minmax(0, 1fr); gap: 0.5rem; }
.pdf-fields dt { font-size: 0.75rem; color: #666a63; padding-top: 0.12rem; }
.pdf-fields dd { display: grid; justify-items: start; gap: 0.1rem; font-variant-numeric: tabular-nums; }
.pdf-sign {
  margin-top: 1.1rem; padding-top: 0.7rem; border-top: 1px solid #d6d2c4;
  font-size: 0.75rem; color: #666a63;
}
.field { position: relative; padding: 0 3px; margin: 0 -3px; border-radius: 3px; }
.field::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
  background: rgba(234, 241, 58, 0.85);
  transform: scaleX(0); transform-origin: left;
  transition: transform 360ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.pdf.is-read .field::before { transform: scaleX(1); }
.field.is-missing {
  margin: 0; padding: 0 8px; border: 1.5px dashed #a7a08a; color: #6f6a58; font-style: italic;
}
.pdf.is-read .field.is-missing { border-color: #c2452b; color: #9a2f18; }
.pdf.is-read .field.is-missing::before { background: rgba(255, 143, 118, 0.38); }

/* Salida */
.out {
  min-height: 236px; margin-top: 2px;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
  transition: border-color 260ms ease;
}
.out-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.out-body { margin-top: 0.6rem; display: grid; gap: 0.5rem; font-size: 0.9375rem; color: var(--text-2); }
.out-body strong { color: var(--text); font-weight: 600; }
.out-body .quote {
  margin-top: 0.3rem; padding-top: 0.8rem; border-top: 1px solid var(--line);
  color: var(--text);
}
.out-body .quote span { display: block; margin-bottom: 0.15rem; font-size: 0.8125rem; color: var(--text-3); }
.out-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.out-actions[hidden] { display: none; }
.out[data-kind="idle"] .out-title { color: var(--text-2); }
.out[data-kind="ok"] { border-color: rgba(63, 189, 240, 0.55); }
.out[data-kind="review"] { border-color: var(--lime); }

@media (min-width: 540px) {
  .flow-node { grid-template-columns: minmax(0, 1fr) auto; }
  .flow-node h3 { grid-column: 1; }
  .state { grid-column: 2; grid-row: 1; justify-self: end; margin: 0; }
  .flow-what, .flow-result { grid-column: 1 / -1; }
  .demo-bar { top: var(--nav-h); grid-template-columns: auto auto; justify-content: space-between; }
  .demo-bar .seg { min-width: max-content; }
  .seg span { white-space: nowrap; }
  .demo-bar .seg { justify-self: end; }
  .demo-buttons { order: 3; }
  .demo-status { order: 4; text-align: right; }
}
@media (min-width: 960px) {
  .demo-bar { grid-template-columns: auto auto 1fr auto; }
  .demo-bar .seg { justify-self: start; }
  .demo-buttons { order: 4; justify-content: flex-end; }
  .demo-status { order: 3; text-align: left; }
  .demo-stage {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(32px, 5vw, 80px);
  }
  .flow-node.is-entry { grid-column: 1; grid-row: 1; }
  .mail { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; margin-bottom: 26px; }
  .pdf { flex: 1; }
  .flow { grid-column: 1; grid-row: 2; }
  .flow-node.is-exit { grid-column: 1; grid-row: 3; }
  .out { grid-column: 2; grid-row: 3; align-self: start; }
  .flow-node.is-branch { --indent: 30px; }
  .flow-result { min-height: 1.45em; }
  .pdf { display: flex; flex-direction: column; margin: 16px -8px 0 18px; padding: 16px 18px 20px; }
  .pdf-sign { margin-top: auto; }
}

/* ---------- Servicios ---------- */
.services { background: var(--bg); }
.svc { position: relative; }
.svc + .svc, .svc + .svc-pair, .svc-pair + .svc { margin-top: clamp(64px, 9vw, 128px); }
.svc h3 {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.005em;
}
.svc h3 + p, .svc-copy > p { margin-top: 0.9rem; max-width: 34rem; color: var(--text-2); }
.svc .mock { margin-top: 1.6rem; }

.channels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.2rem; }
.channels li {
  padding: 0.3rem 0.8rem; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 0.875rem; font-weight: 500;
}
.svc-assist .note { margin-top: 0.6rem; }

.chat { display: grid; gap: 10px; }
.bubble {
  max-width: 82%; padding: 0.65rem 0.95rem; border-radius: 18px;
  font-size: 0.9375rem; line-height: 1.4;
}
.bubble-in { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble-out { justify-self: end; background: var(--text); color: var(--ink); border-bottom-right-radius: 6px; }
.handoff {
  justify-self: center; display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem;
  padding: 0.35rem 0.85rem; border: 1px solid var(--lime); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--lime); text-align: center;
}

.svc-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(64px, 9vw, 128px) clamp(28px, 4vw, 56px); }
.svc-pair .svc + .svc { margin-top: 0; }

.stock { display: grid; gap: 14px; padding-top: 20px !important; border-top: 1px solid var(--line) !important; }
.stock-row { display: grid; grid-template-columns: minmax(0, 7.2rem) minmax(1.5rem, 1fr) auto; align-items: center; gap: 12px; font-size: 0.9375rem; }
.stock-qty { font-variant-numeric: tabular-nums; color: var(--text-2); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i {
  display: block; height: 100%; border-radius: 999px; background: var(--text-2);
  transform: scaleX(var(--fill)); transform-origin: left;
  transition: transform 700ms var(--ease-out) 120ms;
}
.js:not(.reduced) .stock-row:not(.is-in) .bar i { transform: scaleX(0); }
.stock-row.is-low .bar i { background: var(--lime); }
.stock-row.is-low .stock-qty { color: var(--lime); }
.stock-alert {
  padding: 0.65rem 0.9rem; border-radius: var(--r-s);
  background: var(--lime); color: var(--ink); font-size: 0.9375rem; font-weight: 500; line-height: 1.4;
}

.check { display: grid; gap: 0; }
.sheet {
  padding: 16px 20px 6px; border-radius: 5px;
  background: var(--paper); color: #17191c;
  box-shadow: var(--shadow-lift);
  transform: rotate(0.7deg); transform-origin: 100% 0;
}
.sheet .pdf-title { margin-bottom: 0.2rem; }
.sheet .check-row { border-bottom-color: #d6d2c4; }
.sheet .check-row:last-child { border-bottom: 0; }
.sheet .check-row > span:first-child { color: #666a63; }
.sheet .verdict.ok { color: #0d6f8f; }
.sheet .verdict.off { color: #b3321a; }
.check-row {
  display: grid; grid-template-columns: minmax(min-content, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.9375rem; font-variant-numeric: tabular-nums;
}
.check-row > span:first-child { color: var(--text-2); }
.verdict { min-width: 5.4rem; text-align: right; font-size: 0.8125rem; font-weight: 600; }
.verdict.ok { color: var(--cyan); }
.verdict.off { color: var(--coral); }
.check-result {
  display: inline-flex; align-items: center; gap: 0.5rem; justify-self: start; margin-top: 1rem;
  padding: 0.35rem 0.85rem; border: 1px solid var(--lime); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--lime);
}

.sort { display: grid; }
.sort-row {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px 14px; align-items: center;
  padding: 0.8rem 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem;
}
.sort-row:first-child { padding-top: 0; }
.sort-subject { font-weight: 500; }
.sort-tag {
  justify-self: start; padding: 0.12rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); font-size: 0.8125rem; font-weight: 500; color: var(--text-2);
}
.sort-to { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); }
.sort-to::before { content: ""; width: 22px; height: 1.5px; background: var(--gel); }

.chain {
  margin-top: clamp(28px, 4vw, 48px);
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}
.chain-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.chain h4 { font-size: clamp(0.95rem, 1.4vw, 1.15rem); font-weight: 700; line-height: 1.2; max-width: 26em; }
.chain-steps { display: grid; margin-top: clamp(24px, 3vw, 40px); }
.chain-steps li {
  position: relative; display: grid; gap: 0.2rem;
  padding: 0 0 22px 28px;
}
.chain-steps li::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px;
  background: var(--line-2); transform-origin: top;
  transition: transform 480ms var(--ease-in-out); transition-delay: calc(var(--i, 0) * 60ms);
}
.chain-steps li:last-child::before { display: none; }
.chain-steps li::after {
  content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text-2);
}
.chain-steps li.is-gate::after { background: var(--lime); border-color: var(--lime); }
.chain-tool {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em;
}
.is-gate .chain-tool { color: var(--lime); }
.chain-do { font-size: 0.9375rem; line-height: 1.4; color: var(--text-2); }
.chain-note { margin-top: 0.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--text-2); }
.js:not(.reduced) .chain:not(.is-in) .chain-steps li::before { transform: scaleY(0); }

@media (min-width: 960px) {
  .svc-assist, .svc-mail, .svc-integra {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center;
  }
  .svc .mock { margin-top: 0; }
  .svc-assist .svc-copy { grid-column: 1 / span 5; }
  .svc-assist .mock { grid-column: 7 / -1; }
  .svc-pair { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .svc-pair .svc .mock { margin-top: 1.8rem; }
  .svc-mail .svc-copy { grid-column: 8 / -1; grid-row: 1; }
  .svc-mail .mock { grid-column: 1 / span 6; grid-row: 1; }
  .svc-integra .svc-copy { grid-column: 1 / span 6; }
  .svc-integra .chain { grid-column: 1 / -1; }
  .sort-row { grid-template-columns: minmax(45%, 1fr) minmax(0, auto) minmax(0, 11rem); }

  .chain-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 0; row-gap: 34px; }
  .chain-steps li { padding: 30px 20px 0 0; }
  .chain-steps li::before {
    left: 7px; right: -7px; top: 6px; bottom: auto; width: auto; height: 2px;
    transform-origin: left;
  }
  .chain-steps li:nth-child(4)::before { display: none; }
  .chain-steps li::after { top: 0; }
  .js:not(.reduced) .chain:not(.is-in) .chain-steps li::before { transform: scaleX(0); }
}

/* ---------- Cómo trabajamos: campo de color ---------- */
.process { background: var(--lime); color: var(--ink); }
.process ::selection { background: var(--ink); color: var(--lime); }
.process :focus-visible { outline-color: var(--ink); }
.process .band-lead { color: var(--ink-2); }
.stages { display: grid; gap: 44px clamp(24px, 3.4vw, 48px); }
.stage-item { padding-top: 18px; border-top: 2px solid var(--ink); }
.stage-num {
  display: block; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: 0.9; letter-spacing: -0.03em;
}
.stage-item h3 { margin-top: 1rem; font-size: clamp(1rem, 1.45vw, 1.2rem); font-weight: 700; line-height: 1.18; }
.stage-item > p { margin-top: 0.8rem; color: var(--ink-2); }
.stage-item .stage-q {
  margin-top: 1.4rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink);
}
.stage-item ul { margin-top: 0.5rem; display: grid; gap: 0.4rem; }
.stage-item li { position: relative; padding-left: 1.2rem; font-weight: 500; line-height: 1.4; }
.stage-item li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; background: var(--ink);
}
@media (min-width: 960px) {
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Contacto ---------- */
.contact { background: var(--black); }
.contact-wrap { display: grid; gap: clamp(36px, 6vw, 72px); }
.outfall-slot {
  --slot: clamp(170px, 50vw, 250px);
  position: relative; width: var(--slot); height: var(--slot);
  margin: calc(var(--slot) * -0.14) 0 calc(var(--slot) * -0.06) calc(var(--slot) * -0.13);
  pointer-events: none;
}
.contact h2 { max-width: 12.5em; }

.form { display: grid; gap: 18px; align-content: start; }
.form-preview {
  padding: 0.8rem 1rem; border: 1px dashed var(--lime); border-radius: var(--r-s);
  font-size: 0.9375rem; line-height: 1.45; color: var(--text-2);
}
.form-preview strong { color: var(--lime); font-weight: 600; }
.form-preview[hidden] { display: none; }
.field-row { display: grid; gap: 18px; }
.fld { display: grid; gap: 6px; }
.fld label { font-size: 0.9375rem; font-weight: 500; }
.fld input, .fld textarea {
  width: 100%; min-height: 52px; padding: 0.8rem 0.95rem;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1.45;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.fld textarea { min-height: 148px; resize: vertical; }
.fld input:focus-visible, .fld textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px; border-color: var(--cyan);
}
.fld [aria-invalid="true"] { border-color: var(--coral); }
.fld-hint { font-size: 0.875rem; color: var(--text-3); }
.fld-error { font-size: 0.875rem; font-weight: 500; color: var(--coral); }
.fld-error:empty { display: none; }
.fld-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 4px; }
.form-msg { flex: 1 1 16rem; font-size: 0.9375rem; line-height: 1.45; color: var(--text-2); }
.form-msg:empty { display: none; }
.form-msg[data-kind="ok"] { color: var(--cyan); }
.form-msg[data-kind="error"] { color: var(--coral); }
.form-msg[data-kind="preview"] { color: var(--lime); }
.form-legal { font-size: 0.8125rem; line-height: 1.5; color: var(--text-3); }
.form-legal a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) {
  .form-legal a:hover { color: var(--text); text-decoration-color: var(--text-2); }
}
@media (hover: hover) and (pointer: fine) {
  .fld input:hover, .fld textarea:hover { border-color: var(--text-3); }
}
@media (min-width: 720px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .outfall-slot { --slot: clamp(230px, 26vw, 380px); }
}
@media (min-width: 960px) {
  .contact-wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

/* ---------- Pie ---------- */
.footer { position: relative; z-index: 1; background: var(--black); border-top: 1px solid var(--line); }
.footer-wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px;
  padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px));
}
.footer-logo img { height: 26px; width: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-inline: -0.6rem; }
.footer-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem;
  font-size: 0.9375rem; color: var(--text-2); transition: color 160ms ease;
}
.footer-meta {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 20px; padding-top: 14px; border-top: 1px solid var(--line);
}
.footer-legal { font-size: 0.875rem; color: var(--text-3); }
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin-inline: -0.5rem; }
.footer-legal-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.5rem;
  font-size: 0.875rem; color: var(--text-3); overflow-wrap: anywhere; transition: color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover, .footer-legal-links a:hover { color: var(--text); }
}

/* =============================================================
   7. Recorrido de la gota
   ============================================================= */
.rail-seg {
  position: absolute; z-index: 0; left: calc(var(--rail-x) - 2px); top: 0; bottom: 0; width: 4px;
  border-radius: 2px;
  transform-origin: top; pointer-events: none;
}
.rail-seg { background: var(--rail-bg); }
.rail-seg i { position: absolute; inset: 0; border-radius: 2px; background: var(--rail-bg); transform-origin: top; }
.journey .rail-seg { background: none; }
.demo .rail-seg { top: var(--exit-y, 80%); --rail-bg: var(--cyan); }
.services .rail-seg { --rail-bg: var(--gel-up); }
.process .rail-seg { --rail-bg: var(--ink); }

/* Nodos: cada bloque es una estación del carril y se enciende cuando pasa la gota */
.band-head, .svc, .svc-pair { position: relative; }
.rail-node {
  position: absolute; z-index: 1; left: calc(9px - var(--lane)); top: 6px;
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  border: 2px solid var(--mint); background: var(--mint);
  transition: background-color 240ms ease, border-color 240ms ease;
}
.rail-node::after {
  content: ""; position: absolute; left: 100%; top: 50%; height: 2px; margin-top: -1px;
  width: calc(var(--lane) - 24px); background: var(--mint);
  transform-origin: left; transition: transform 360ms var(--ease-out);
}
.band-head .rail-node { top: clamp(7px, 1.45vw, 20px); }
.process .rail-node { border-color: var(--ink); background: var(--ink); }
.process .rail-node::after { background: var(--ink); }
.journey .rail-node:not(.is-lit) { border-color: var(--line-2); background: var(--bg); }
.journey .process .rail-node:not(.is-lit) { border-color: var(--ink); background: var(--lime); }
.journey .rail-node:not(.is-lit)::after { transform: scaleX(0); }

.outfall { z-index: 0; }
.contact-intro, .form { position: relative; z-index: 1; }

.rider {
  position: fixed; z-index: 5; left: 0; top: 50%;
  width: 40px; height: 66px; margin: -33px 0 0 -20px;
  opacity: 0; transform: scale(0.85); pointer-events: none;
  transition: opacity 180ms ease, transform 260ms var(--ease-out);
}
.rider.is-on { opacity: 1; transform: none; }
.rider img { width: 100%; height: 100%; object-fit: contain; }

/* Estela del ratón (se crea desde main.js solo con puntero fino y movimiento activo) */
.cursor-trail {
  position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%;
  pointer-events: none;
}

/* Entradas escalonadas */
.js:not(.reduced) [data-reveal] {
  opacity: 0; transform: translateY(10px);
  transition: opacity 360ms var(--ease-out), transform 480ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js:not(.reduced) [data-reveal].is-in { opacity: 1; transform: none; }

/* Cada maqueta tiene su propio gesto en lugar de la misma entrada */
.js:not(.reduced) .chat [data-reveal] { transform: scale(0.94); transform-origin: 0 100%; transition-delay: calc(var(--i, 0) * 80ms); }
.js:not(.reduced) .chat .bubble-out[data-reveal] { transform-origin: 100% 100%; }
.js:not(.reduced) .chat [data-reveal].is-in { transform: none; }
.js:not(.reduced) .stock .stock-row[data-reveal],
.js:not(.reduced) .invoice .check-row[data-reveal],
.js:not(.reduced) .sort .sort-row[data-reveal] { opacity: 1; transform: none; }
.js:not(.reduced) .stock .stock-alert[data-reveal] { transform: none; transition: opacity 320ms ease 620ms; }
.verdict { transition: opacity 260ms ease; transition-delay: calc(var(--i, 0) * 70ms + 180ms); }
.js:not(.reduced) .invoice .check-row:not(.is-in) .verdict { opacity: 0; }
.sort-to { transition: opacity 300ms ease; transition-delay: calc(var(--i, 0) * 70ms + 140ms); }
.sort-to::before { transform-origin: left; transition: transform 380ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js:not(.reduced) .sort .sort-row:not(.is-in) .sort-to { opacity: 0; }
.js:not(.reduced) .sort .sort-row:not(.is-in) .sort-to::before { transform: scaleX(0); }

/* ---------- Efectos de scroll (initScrollFx en main.js; solo con GSAP y movimiento activo) ---------- */
/* Texto del hero oculto hasta que entra línea a línea. Si el script no llega, aparece solo. */
.fx-pre .hero h1 span, .fx-pre .hero-lead, .fx-pre .hero-actions {
  opacity: 0; animation: fx-safety 1ms linear 3.5s forwards;
}
@keyframes fx-safety { to { opacity: 1; } }
.fx-word { display: inline-block; }

/* Etapas de «Cómo trabajamos»: la línea superior se rellena y la etapa se activa con el scroll */
.stages.is-fx .stage-item { position: relative; border-top-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.stage-bar {
  display: none; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
  background: var(--ink); transform-origin: left; transform: scaleX(0);
}
.stages.is-fx .stage-bar { display: block; }

/* Capas que se mueven en cada fotograma de scroll */
.journey .traveler, .journey .rail-seg i, .journey .demo-rail-base, .stages.is-fx .stage-bar { will-change: transform; }

/* =============================================================
   8. Movimiento reducido: fotogramas clave estáticos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage-video { display: none; }
  .rider { display: none; }
  .btn, .btn .icon, .dot, .mail, .seg::before, .bar i, .field::before,
  .demo-rail-live, .chain-steps li::before, .nav-links a::after, .hero-wordmark {
    transition-duration: 1ms; transition-delay: 0ms;
  }
  .btn:active, .nav-links .nav-cta:active { transform: none; }
  .flow-node[data-state="curso"] .dot::after { animation: none; border-color: var(--lime); }
}
