/* ==========================================================================
   DeepDatas · rediseño 2026 (se carga después de site.css)

   «Luz sobre los datos»: secciones claras para las personas y el negocio, y
   secciones «profundas» (azul noche) donde viven los datos, iluminadas por
   el naranja de la marca y una luz azul eléctrica. Tipografía grande, paneles
   redondeados a lo ancho de la pantalla, imágenes propias (núcleo de datos,
   portadas de industrias, recortes de la foto de oficina) y movimiento.
   ========================================================================== */
:root {
  --deep: #060913;
  --deep-2: #0b1224;
  --deep-3: #121b33;
  --deep-fg: #f4f6fb;
  --deep-fg-2: #aab4c8;
  --deep-line: rgba(255, 255, 255, 0.1);
  --glow-blue: #5b8cff;
  --glow-cyan: #67d8ff;
  --glow-violet: #8b5cf6;
  --ember: #ff6a3a;
  --ember-2: #ff8f61;
  --fs-display: clamp(2.8rem, 1.5rem + 4.4vw, 5.6rem);
  --fs-h2: clamp(2.1rem, 1.3rem + 2.7vw, 3.7rem);
  --r-xl: clamp(22px, 3vw, 40px);
  --tile-inset: clamp(0px, 1.2vw, 18px);
}

html {
  overflow-x: clip;
}

/* Transición entre páginas (navegadores compatibles) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 160ms ease-out both vt-out;
  }

  ::view-transition-new(root) {
    animation: 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both vt-in;
  }
}

@keyframes vt-out {
  to { opacity: 0; }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(10px); }
}

/* ---------- Botones ---------- */
.btn {
  border-radius: 999px;
  letter-spacing: -0.005em;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn .icon {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn:hover .icon {
  transform: translateX(3px);
}

.btn-lg {
  min-height: 56px;
  padding: 16px 28px;
  font-size: 1.04rem;
}

.btn-primary,
[data-theme="claro"] .btn-primary {
  background: linear-gradient(180deg, #ff8a5c 0%, var(--ember) 100%);
  color: #1a0e08;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 30px -12px rgba(255, 106, 58, 0.75);
}

.btn-primary:hover,
[data-theme="claro"] .btn-primary:hover {
  background: linear-gradient(180deg, #ff9a70 0%, #ff7646 100%);
  color: #1a0e08;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 18px 40px -14px rgba(255, 106, 58, 0.85);
}

.btn-secondary,
[data-theme="claro"] .btn-secondary {
  border-color: var(--hairline-strong);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover,
[data-theme="claro"] .btn-secondary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(11, 18, 32, 0.35);
}

/* ---------- Encabezado ---------- */
.site-header {
  transition: background-color 0.3s, border-color 0.3s;
}

.on-deep .site-header .brand,
.on-deep .site-header .nav-lang,
.on-deep .site-header .nav-toggle {
  color: #fff;
}

.on-deep .site-header .brand img {
  filter: brightness(0) invert(1);
}

.on-deep .site-header.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(6, 9, 19, 0.7);
}

@media (min-width: 1024px) {
  .on-deep .site-header .site-nav a {
    color: rgba(255, 255, 255, 0.82);
  }

  .on-deep .site-header .site-nav a:hover,
  .on-deep .site-header .site-nav a[aria-current="page"] {
    color: #fff;
  }
}

/* ---------- Paneles profundos ---------- */
.section-deep {
  position: relative;
  isolation: isolate;
  margin-inline: var(--tile-inset);
  border-radius: var(--r-xl);
  background: var(--deep);
  color: var(--deep-fg);
  clip-path: inset(0 round var(--r-xl));
}

.section-deep + .section-deep,
.section-deep + .site-footer {
  margin-top: 12px;
}

.section-deep::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 80% 0%, color-mix(in srgb, var(--glow-blue) 18%, transparent), transparent 70%),
    radial-gradient(50% 40% at 10% 100%, color-mix(in srgb, var(--ember) 14%, transparent), transparent 70%);
  pointer-events: none;
}

.section-deep p {
  color: var(--deep-fg-2);
}

.section-deep h2,
.section-deep h3,
.section-deep .lead {
  color: #fff;
}

.section-deep .eyebrow,
.section-deep .eyebrow-light {
  color: var(--glow-cyan);
}

.section-deep .section-head > p:not(.eyebrow) {
  color: var(--deep-fg-2);
}

.section-deep .btn-secondary,
.section-deep .btn-ghost-light {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.section-deep .btn-secondary:hover,
.section-deep .btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.section-deep .link-arrow,
.section-deep .link-arrow .icon {
  color: #fff;
}

.section-deep .pl-cta p {
  color: #fff;
}

/* ---------- Núcleo de datos: secuencia de cuadros con el scroll ---------- */
.core {
  padding: 0;
}

.core-stage {
  position: relative;
}

.motion .core-stage {
  height: 320vh;
}

.core-sticky {
  position: relative;
  display: grid;
  min-height: min(90vh, 760px);
  overflow: hidden;
}

.motion .core-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 0;
}

.core-canvas,
.core-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.core-canvas {
  display: none;
}

.motion .core-canvas {
  display: block;
}

.core-poster {
  object-position: 50% 32%;
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* Sin animación: el núcleo ya ordenado con todo el texto debajo, sobre un velo que lo deja leer */
html:not(.motion) .core-sticky {
  min-height: min(96vh, 860px);
}

html:not(.motion) .core-sticky::after {
  background:
    linear-gradient(to top, rgba(6, 9, 19, 0.97) 0%, rgba(6, 9, 19, 0.82) 45%, rgba(6, 9, 19, 0.2) 70%, transparent 100%),
    linear-gradient(to bottom, rgba(6, 9, 19, 0.5), transparent 24%);
}

html:not(.motion) .core-copy {
  padding-top: clamp(240px, 42vh, 420px);
}

html:not(.motion) .core-captions {
  margin-top: 28px;
}

.motion .core-stage.is-live .core-poster {
  opacity: 0;
}

.core-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(6, 9, 19, 0.92) 0%, rgba(6, 9, 19, 0.35) 38%, transparent 62%),
    linear-gradient(to bottom, rgba(6, 9, 19, 0.5), transparent 24%);
  pointer-events: none;
}

.core-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  width: min(100% - 2 * var(--gutter), 980px);
  margin: 0 auto;
  padding: clamp(96px, 20vh, 160px) 0 clamp(40px, 8vh, 96px);
  text-align: center;
}

.core-copy .eyebrow {
  margin-bottom: 20px;
}

.core-title {
  max-width: 16ch;
  margin: 0 auto 0.35em;
  color: #fff;
  font-size: var(--fs-display);
  line-height: 1.02;
}

.core-title em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ember-2);
}

.core-captions {
  position: relative;
  display: grid;
  gap: 10px;
}

.core-caption {
  max-width: 34ch;
  margin: 0 auto;
  color: #fff;
  font-size: clamp(1.15rem, 1rem + 1vw, 1.7rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.core-caption strong {
  color: var(--glow-cyan);
  font-weight: 600;
}

.core-caption:nth-child(2) strong {
  color: var(--ember-2);
}

.core-caption:nth-child(3) strong {
  color: #fff;
}

/* Con animación: un subtítulo por vez; el título aparece cuando el núcleo se ordena */
.core-text {
  position: relative;
}

.motion .core-text {
  min-height: 3.8em;
}

.motion .core-title {
  position: absolute;
  inset: auto 0 0;
}

.motion .core-copy .eyebrow {
  transition: opacity 0.4s ease;
}

.motion .core-stage.is-final .core-copy .eyebrow {
  opacity: 0;
}

.motion .core-captions {
  display: block;
}

.motion .core-caption {
  position: absolute;
  inset: 0 0 auto;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.motion .core-caption.is-on {
  opacity: 1;
  transform: none;
}

.motion .core-title {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.motion .core-stage.is-final .core-title {
  opacity: 1;
  transform: none;
}

.core-diagram {
  padding: clamp(48px, 6vw, 96px) 0 clamp(72px, 7vw, 120px);
}

/* El gráfico del recorrido de los datos, sobre el panel profundo */
.section-deep .pl-canvas {
  border-color: var(--deep-line);
  background: var(--deep-2);
}

.section-deep .pl-detail {
  border-color: var(--deep-line);
  background: var(--deep-3);
  color: #fff;
}

.section-deep .pl-detail p {
  color: var(--deep-fg-2);
}

.section-deep .pl-detail .pl-detail-title {
  color: #fff;
}

/* ---------- Logos y cifras ---------- */
.trust {
  padding-block: clamp(56px, 5vw, 96px) clamp(72px, 7vw, 128px);
}

.trust .logos-row {
  gap: 28px clamp(48px, 7vw, 120px);
}

.trust .logos-row img {
  height: 40px;
}

.trust .logos-title {
  margin-bottom: 28px;
  text-align: center;
}

.trust .logos-caption {
  text-align: center;
}

.stats dd {
  background: linear-gradient(135deg, var(--text) 0%, var(--text) 35%, var(--ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats dd span {
  -webkit-text-fill-color: var(--fg-3);
}

/* ---------- Carrusel de industrias ---------- */
.rail {
  position: relative;
}

.rail-track {
  display: flex;
  gap: 18px;
  margin-inline: calc(-1 * var(--gutter));
  padding: 8px var(--gutter) 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.rail-track::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1240px) {
  .rail-track {
    margin-inline: calc(50% - 50vw);
    padding-inline: calc(50vw - 50%);
    scroll-padding-inline: calc(50vw - 50%);
  }
}

.rail-card {
  position: relative;
  display: flex;
  flex: 0 0 min(80vw, 340px);
  flex-direction: column;
  min-height: 300px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  scroll-snap-align: start;
  box-shadow: var(--lift);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s, border-color 0.3s;
}

/* Un leve color propio de cada industria, en la esquina superior derecha */
.rail-card::before {
  content: "";
  position: absolute;
  top: -42%;
  right: -28%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint, var(--ember)) 16%, transparent), transparent);
  pointer-events: none;
}

.rail-card:hover {
  transform: translateY(-6px);
  border-color: var(--hairline-strong);
  box-shadow: var(--lift-hover);
}

.rail-card > * {
  position: relative;
}

.rail-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 22px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint, var(--ember)) 10%, var(--surface));
  color: var(--tint-ink, var(--accent-700));
}

.rail-icon .icon {
  width: 24px;
  height: 24px;
}

.rail-kicker {
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-title {
  display: block;
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.rail-text {
  display: block;
  margin: 0 0 20px;
  color: var(--fg-2);
  font-size: 0.95rem;
  line-height: 1.45;
}

.rail-card .case-card-more {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.rail-card:hover .case-card-more {
  color: var(--accent-300);
}

.rail-card .case-card-more .icon {
  transition: transform 0.3s;
}

.rail-card:hover .case-card-more .icon {
  transform: translateX(3px);
}

.rail-consumo { --tint: #ff6a3a; --tint-ink: #b5420e; }
.rail-distribucion { --tint: #5b8cff; --tint-ink: #2353d6; }
.rail-pymes { --tint: #8b5cf6; --tint-ink: #6d28d9; }
.rail-retail { --tint: #ff4d8d; --tint-ink: #be185d; }
.rail-materiales { --tint: #ffb020; --tint-ink: #a16207; }
.rail-autopartes { --tint: #67d8ff; --tint-ink: #0e7490; }
.rail-industria { --tint: #5b8cff; --tint-ink: #1d4ed8; }
.rail-agro { --tint: #34d399; --tint-ink: #047857; }

.rail-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.rail-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, opacity 0.2s, transform 0.2s;
}

.rail-btn:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.rail-btn-prev .icon {
  transform: rotate(180deg);
}

.rail-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.section-head-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* ---------- Etapa fija: el teléfono y los pasos ---------- */
.pin-grid {
  display: grid;
  gap: 48px;
}

.pin-step h3 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.pin-step p {
  max-width: 44ch;
  margin: 0;
  color: var(--fg-2);
  font-size: 1.1rem;
}

.pin-step .label {
  color: var(--accent-300);
}

.pin-stage {
  display: grid;
  place-items: center;
}

@media (min-width: 1024px) {
  .pin-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 120px);
    align-items: start;
  }

  .motion .pin-stage {
    position: sticky;
    top: calc(var(--header-h) + 4vh);
    height: calc(92vh - var(--header-h));
  }

  .motion .pin-steps {
    padding-block: 10vh;
  }

  .motion .pin-step {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 62vh;
  }

  .motion .pin-step h3,
  .motion .pin-step p {
    transition: color 0.5s ease;
  }

  .motion .pin-step:not(.is-current) h3 {
    color: #858c9b;
  }

  .motion .pin-step:not(.is-current) p {
    color: var(--fg-3);
  }
}

@media (max-width: 1023.98px) {
  .pin-steps {
    display: grid;
    gap: 36px;
  }
}

/* Teléfono */
.phone {
  position: relative;
  width: min(330px, 82vw);
  aspect-ratio: 9 / 19;
  padding: 11px;
  border-radius: 48px;
  background: linear-gradient(160deg, #2a2d36, #0b0d14 40%, #1b1e27);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 50px 90px -40px rgba(11, 18, 32, 0.75),
    0 0 0 6px rgba(11, 18, 32, 0.04);
}

.phone::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 3;
  width: 92px;
  height: 26px;
  border-radius: 999px;
  background: #0b0d14;
  transform: translateX(-50%);
}

.phone-screen {
  position: absolute;
  inset: 11px;
  overflow: hidden;
  border-radius: 38px;
  background: #ece5dd;
  container-type: inline-size;
}

.phone-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-view.is-current,
html:not(.motion) .phone-view:first-child {
  opacity: 1;
  transform: none;
}

.chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 50px 16px 12px;
  background: #075e54;
  color: #fff;
}

.wa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  color: #075e54;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chat-top strong {
  display: block;
  font-size: 14px;
  line-height: 1.1;
}

.chat-top small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.chat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.4;
  color: #111b21;
}

.chat-msg {
  position: relative;
  max-width: 86%;
  padding: 8px 10px 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.chat-msg p {
  margin: 0;
  color: inherit;
}

.chat-msg p + p {
  margin-top: 6px;
}

.chat-msg strong {
  font-weight: 650;
}

.chat-out {
  align-self: flex-end;
  background: #d9fdd3;
}

.chat-time {
  display: block;
  margin-top: 4px;
  color: #667781;
  font-size: 10.5px;
  text-align: right;
}

.chat-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.chat-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 12.5px;
}

.chat-list li span:last-child {
  font-weight: 650;
  white-space: nowrap;
}

.chat-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fde8e0;
  color: #b4472c;
  font-size: 11px;
  font-weight: 650;
}

.chat-tag-ok {
  background: #dcf5e4;
  color: #1e7a4c;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 26px;
  background: #f0f2f5;
  color: #8696a0;
  font-size: 13px;
}

.chat-input span:first-child {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
}

.chat-input .chat-send {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
}

.pin-stage .phone-halo {
  position: absolute;
  inset: 20% 10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ember) 22%, transparent), transparent);
  filter: blur(30px);
}

/* ---------- Brillo que sigue al cursor ---------- */
.glow-card {
  position: relative;
}

.glow-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--ember) 13%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .glow-card:hover::after {
    opacity: 1;
  }
}

.glow-card > * {
  position: relative;
  z-index: 1;
}

/* ---------- Cierre y pie ---------- */
.finale {
  padding: clamp(104px, 12vw, 200px) 0;
  text-align: center;
}

.finale-bg {
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  width: 116%;
  height: 124%;
  object-fit: cover;
  opacity: 0.6;
  filter: blur(1.5px) saturate(1.15);
  pointer-events: none;
}

.finale::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 60% at 50% 50%, rgba(6, 9, 19, 0.2), rgba(6, 9, 19, 0.85) 100%);
  pointer-events: none;
}

.finale h2 {
  max-width: 17ch;
  margin: 0 auto 0.4em;
  font-size: var(--fs-display);
  line-height: 1.02;
}

.finale h2 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ember-2);
}

.finale p {
  max-width: 52ch;
  margin: 0 auto 36px;
  color: var(--deep-fg-2);
  font-size: 1.12rem;
}

.finale .cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.site-footer,
[data-theme="claro"] .site-footer {
  margin-top: 12px;
  margin-inline: var(--tile-inset);
  border-top: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--deep);
  color: var(--deep-fg-2);
}

.site-footer .footer-title {
  color: var(--glow-cyan);
}

.site-footer a,
[data-theme="claro"] .site-footer a {
  color: var(--deep-fg-2);
}

.site-footer a:hover,
[data-theme="claro"] .site-footer a:hover {
  color: #fff;
}

.site-footer .brand,
[data-theme="claro"] .site-footer .brand,
[data-theme="claro"] .site-footer .brand:hover {
  color: #fff;
}

.site-footer .brand img {
  filter: brightness(0) invert(1);
}

.site-footer .footer-about p {
  color: var(--deep-fg-2);
}

.site-footer .footer-bottom {
  border-top-color: var(--deep-line);
}

/* ---------- Encabezados de página con imagen ---------- */
.page-hero-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(72vh, 680px);
  overflow: hidden;
}

.page-hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
}

.page-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 36%, color-mix(in srgb, var(--bg) 40%, transparent) 60%, transparent 85%),
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 30%, transparent 60%);
}

.page-hero-cover .container {
  position: relative;
}

.page-hero-cover h1 {
  max-width: 14ch;
}

.page-hero-cover .lead {
  max-width: 44ch;
}

@media (max-width: 767.98px) {
  .page-hero-cover {
    min-height: 0;
    padding-top: calc(var(--header-h) + 52vw);
  }

  .page-hero-media img {
    height: 60%;
    object-position: 60% 50%;
  }

  .page-hero-media::after {
    background: linear-gradient(to top, var(--bg) 0%, var(--bg) 40%, color-mix(in srgb, var(--bg) 40%, transparent) 60%, transparent 90%);
  }
}

/* Variante profunda (industrias): la portada a la derecha, texto blanco */
.page-hero-deep {
  margin-inline: var(--tile-inset);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: var(--deep);
  color: var(--deep-fg);
  clip-path: inset(0 round 0 0 var(--r-xl) var(--r-xl));
}

.page-hero-deep::before {
  display: none;
}

.page-hero-deep .page-hero-media::after {
  background:
    linear-gradient(90deg, var(--deep) 0%, color-mix(in srgb, var(--deep) 86%, transparent) 40%, color-mix(in srgb, var(--deep) 30%, transparent) 65%, transparent 90%),
    linear-gradient(to top, var(--deep) 0%, transparent 45%);
}

.page-hero-deep h1,
.page-hero-deep .lead,
.page-hero-deep .label {
  color: #fff;
}

.page-hero-deep h1 em {
  color: var(--ember-2);
}

.page-hero-deep .eyebrow {
  color: var(--glow-cyan);
}

.page-hero-deep .text-link-quiet {
  color: rgba(255, 255, 255, 0.8);
}

.page-hero-deep .text-link-quiet:hover {
  color: #fff;
}

.page-hero-deep .ind-trust {
  border-top-color: var(--deep-line);
}

.page-hero-deep .ind-trust .logos-row img {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

@media (max-width: 767.98px) {
  .page-hero-deep .page-hero-media::after {
    background: linear-gradient(to top, var(--deep) 0%, var(--deep) 40%, color-mix(in srgb, var(--deep) 40%, transparent) 60%, transparent 90%);
  }
}

/* ---------- Detalles ---------- */
.section-head h2 {
  max-width: 20ch;
}

.plan-card-featured,
[data-theme="claro"] .plan-card-featured {
  background: var(--deep) !important;
  color: #fff;
  box-shadow: 0 40px 80px -40px rgba(6, 9, 19, 0.7);
}

.plan-card-featured h3,
.plan-card-featured .plan-link {
  color: #fff;
}

.plan-card-featured p,
.plan-card-featured .plan-for {
  color: var(--deep-fg-2) !important;
}

.plan-card-featured .label {
  color: var(--glow-cyan);
}

.plan-card-featured .plan-icon {
  border-color: var(--deep-line);
  background: var(--deep-3);
  color: var(--ember-2);
}

.reasons-list dt {
  font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem);
  letter-spacing: -0.025em;
}


/* El gráfico del recorrido de los datos dentro de un panel profundo (gana a las reglas del tema claro) */
[data-theme="claro"] .section-deep .pl-stage,
[data-theme="claro"] .section-deep .pl-detail {
  border-color: var(--deep-line);
  background: var(--deep-2);
  box-shadow: none;
}

[data-theme="claro"] .section-deep .pl-stage-title,
[data-theme="claro"] .section-deep .pl-detail-title,
[data-theme="claro"] .section-deep .pl-chips strong,
[data-theme="claro"] .section-deep .pl-steps strong,
[data-theme="claro"] .section-deep .pl-legend strong {
  color: #fff;
}

[data-theme="claro"] .section-deep .pl-chips li,
[data-theme="claro"] .section-deep .pl-steps li {
  background: rgba(255, 255, 255, 0.06);
  color: var(--deep-fg-2);
}

[data-theme="claro"] .section-deep .pl-stage-agent {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-500) 18%, transparent), rgba(255, 255, 255, 0.03));
}

[data-theme="claro"] .section-deep .pl-arrow span {
  background: var(--deep);
}

[data-theme="claro"] .section-deep .pl-detail-stage,
[data-theme="claro"] .section-deep .pl-detail-text,
[data-theme="claro"] .section-deep .pl-legend {
  color: var(--deep-fg-2);
}

.section-deep .pl-cur-title {
  fill: #fff;
}

.section-deep .pl-cur-kicker {
  fill: var(--ember-2);
}

.section-deep .pl-columns text {
  fill: var(--deep-fg-2);
}

.section-deep .pl-track {
  stroke: rgba(255, 255, 255, 0.14);
}

/* ---------- Formas de empezar: la etiqueta «recomendado» ya no se superpone ---------- */
.plan-card {
  display: flex;
  flex-direction: column;
}

.plan-card .chip-recommended {
  position: static;
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 14px;
}

.plan-card-featured .chip-recommended {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--ember-2);
}

/* ---------- Gráfico del recorrido en el panel profundo: apagado de base, se enciende al pasar ---------- */
.section-deep .pl-box {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.16);
}

.section-deep .pl-title {
  fill: #fff;
}

.section-deep .pl-sub {
  fill: var(--deep-fg-2);
}

.section-deep .pl-icon {
  color: var(--glow-cyan);
}

.section-deep .pl-step .pl-icon,
.section-deep .pl-out .pl-icon {
  color: var(--ember-2);
}

.section-deep .pl-svg.is-focus .pl-node:not(.is-on),
.section-deep .pl-svg.is-focus .pl-link:not(.is-on),
.section-deep .pl-svg.is-focus .pl-cur:not(.is-on) > :not(.pl-node) {
  opacity: 0.5;
}

.section-deep .pl-node.is-on .pl-box {
  fill: #fff;
  stroke: #fff;
}

.section-deep .pl-node.is-on .pl-title {
  fill: var(--text);
}

.section-deep .pl-node.is-on .pl-sub {
  fill: var(--fg-2);
}

.section-deep .pl-node.is-on .pl-icon {
  color: var(--accent-700);
}

.section-deep .pl-node.is-current .pl-box {
  fill: #fff;
  stroke: var(--ember);
  stroke-width: 2;
}

.section-deep .pl-node:focus-visible .pl-box {
  stroke: var(--glow-cyan);
  stroke-width: 2.5;
}

/* ---------- Inicio: la oficina, los sistemas y una sola respuesta (src/hero.html) ----------
   Sin animación: texto, foto y respuesta en flujo normal. Con animación (html.motion) la escena
   queda fija: el scroll acerca la cámara al monitor de la foto, los dos monitores (ERP y planillas;
   CRM y WhatsApp) quedan de frente y se funden en uno solo con el asistente. site.js mueve las
   capas y escribe las variables --veil, --shade, --cop, --cty, --bar, --flash y --hop. */
.hp {
  position: relative;
  background: var(--bg);
}

.hp-stage {
  position: relative;
  display: grid;
  gap: clamp(24px, 4vh, 40px);
  padding-top: calc(var(--header-h) + clamp(24px, 4vh, 48px));
  padding-bottom: clamp(28px, 6vh, 64px);
  overflow: hidden;
}

/* Texto del inicio */
.hp-copy {
  position: relative;
  z-index: 3;
  text-align: center;
}

.hp-copy .eyebrow {
  margin-bottom: 16px;
}

.hp-copy h1 {
  max-width: 20ch;
  margin: 0 auto 18px;
  font-size: clamp(2.2rem, 1rem + 2.6vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

@media (min-width: 768px) {
  .hp-copy h1 {
    max-width: none;
  }
}

.hp-copy h1 em {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent-300);
}

.hp-lead {
  max-width: 56ch;
  margin: 0 auto 22px;
}

/* La pregunta, los tres pasos y el estado (en el texto y en la barra compacta) */
.hp-ask {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hp-bubble {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 500;
  box-shadow: 0 20px 50px -24px rgba(11, 18, 32, 0.4), 0 0 0 1px var(--hairline);
}

.hp-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ember);
  color: #1a0e08;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.hp-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hp-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px 5px 5px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--fg-3);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.hp-step-n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  transition: background 0.3s, color 0.3s;
}

.hp-step.is-done {
  color: var(--fg-2);
}

.hp-step.is-done .hp-step-n {
  background: var(--text);
  color: var(--bg);
}

.hp-step.is-on {
  border-color: var(--ember);
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 30px -18px rgba(255, 106, 58, 0.8);
}

.hp-step.is-on .hp-step-n {
  background: var(--ember);
  color: #1a0e08;
}

.hp-status {
  position: relative;
  width: 100%;
  height: 1.6em;
  margin: 12px 0 0;
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.hp-status span {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.hp-status span.is-on {
  opacity: 1;
}

.hp-status span::before {
  content: "● ";
  color: var(--ember);
}

/* La foto: en flujo normal es una imagen; con animación, la capa que site.js mueve */
.hp-photo {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--gutter), 1200px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 16 / 9;
}

.hp-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-veil,
.hp-shade,
.hp-bar,
.hp-mons,
.hp-hint {
  display: none;
}

/* La respuesta del asistente (tarjeta estática y pantalla del monitor final) */
.hp-answer {
  position: relative;
  z-index: 2;
  width: min(100% - 2 * var(--gutter), 860px);
  margin: 0 auto;
  padding: 26px 30px;
  border-radius: 26px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 40px 90px -40px rgba(11, 18, 32, 0.45), 0 0 0 1px var(--hairline);
}

.hp-answer .label,
.hp-ai-answer .label {
  margin-bottom: 10px;
  color: var(--accent-700);
}

.hp-answer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

.hp-big {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hp-up {
  display: inline-block;
  margin: 10px 0 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dcf5e4;
  color: #1e7a4c;
  font-size: 0.85rem;
  font-weight: 650;
}

.hp-answer p,
.hp-ai-answer p {
  margin: 0;
  color: var(--fg-2);
  font-size: 0.98rem;
}

.hp-bars {
  display: grid;
  align-content: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-bars li {
  display: grid;
  grid-template-columns: 90px 1fr 56px;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
}

.hp-bars i {
  display: block;
  width: var(--w);
  height: 10px;
  border-radius: 4px;
  background: var(--text);
}

.hp-bars .is-neg i {
  background: #b4472c;
}

.hp-bars b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hp-sources {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  color: var(--fg-3);
  font-size: 0.8rem;
}

.hp-actions {
  position: relative;
  z-index: 3;
  align-items: center;
  justify-content: center;
}

/* Ventanas de los sistemas dentro de los monitores */
.hp-win {
  position: absolute;
  color: #1f2937;
  font-size: 12px;
}

.hp-card {
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 50px -24px rgba(11, 18, 32, 0.5), 0 0 0 1px rgba(11, 18, 32, 0.08);
}

.hp-label {
  position: absolute;
  top: -15px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 24px -12px rgba(11, 18, 32, 0.6);
}

.hp-label .icon {
  width: 16px;
  height: 16px;
  color: var(--ember);
}

.hp-tb {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  font-weight: 600;
}

.hp-tb i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}

.hp-tb i:first-child {
  background: var(--ember);
}

.hp-body {
  padding: 10px;
}

.hp-win table {
  width: 100%;
  border-collapse: collapse;
}

.hp-win td {
  padding: 4px 6px;
  border-bottom: 1px solid #eef0f3;
  font-variant-numeric: tabular-nums;
}

.hp-win td.h {
  color: #6b7280;
  font-size: 10px;
  font-weight: 600;
}

.hp-win .hl {
  background: #fff3ea;
}

.hp-win-wa .hp-card {
  background: #ece5dd;
}

.hp-win-wa .hp-tb {
  background: #075e54;
  color: #fff;
}

.hp-win-wa .hp-tb i {
  background: #fff;
}

.hp-win-wa .hp-label {
  background: #075e54;
}

.hp-win-wa .hp-label .icon {
  color: #fff;
}

.hp-msg {
  max-width: 88%;
  margin: 0 0 6px;
  padding: 6px 9px;
  border-radius: 9px;
  background: #fff;
}

.hp-msg-out {
  margin-left: auto;
  background: #d9fdd3;
}

.hp-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0b1220;
  color: #67d8ff;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Enlace para saltar la animación: fijo abajo a la derecha mientras dura; sin animación, solo con el teclado */
.hp-skip {
  position: absolute;
  top: calc(var(--header-h) + 12px);
  left: 16px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.hp:not(.is-animated) .hp-skip:not(:focus) {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hp.is-animated .hp-skip {
  position: fixed;
  top: auto;
  right: 20px;
  bottom: 20px;
  left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--lift);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.3s;
}

.hp.is-animated .hp-skip .icon {
  transform: rotate(90deg);
}

.hp.is-animated.is-done .hp-skip,
.hero-copy-visible .hp.is-animated .hp-skip:not(:focus-visible) {
  opacity: 0;
  pointer-events: none;
}

/* El botón del encabezado espera a que se vaya el texto del inicio */
.nav-cta,
.nav-cta-mobile {
  transition: opacity 0.3s;
}

.hero-copy-visible .nav-cta,
.hero-copy-visible .nav-cta-mobile {
  opacity: 0;
  pointer-events: none;
}

/* ===== Modo animado ===== */
.motion .hp-track {
  height: 400vh;
}

.motion .hp-stage {
  position: sticky;
  top: 0;
  display: block;
  height: 100vh;
  height: 100svh;
  padding: 0;
}

.motion .hp-photo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: auto;
  margin: 0;
  overflow: visible;
  border-radius: 0;
  aspect-ratio: auto;
  transform-origin: 0 0;
}

.motion .hp-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  background: var(--bg);
  opacity: var(--veil, 0);
  pointer-events: none;
}

.motion .hp-shade {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 94%, transparent) 0%, color-mix(in srgb, var(--bg) 74%, transparent) 38%, transparent 66%),
    linear-gradient(0deg, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 30%);
  opacity: var(--shade, 1);
  pointer-events: none;
}

.motion .hp-copy {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  text-align: left;
  opacity: var(--cop, 1);
  transform: translateY(var(--cty, 0px));
  pointer-events: none;
}

.motion .hp-copy.is-out {
  visibility: hidden;
}

.motion .hp-copy .container {
  pointer-events: auto;
}

.motion .hp-copy h1 {
  max-width: 13ch;
  margin-inline: 0;
  font-size: clamp(2.2rem, 1rem + 2.8vw, 3.7rem);
}

.motion .hp-copy .hp-lead {
  max-width: 42ch;
  margin-inline: 0;
}

.motion .hp-copy .hp-ask {
  align-items: flex-start;
}

.motion .hp-copy .hp-steps {
  justify-content: flex-start;
}

.motion .hp-copy .hp-status {
  text-align: left;
}

/* Barra compacta con la pregunta y los pasos, arriba, mientras dura el recorrido */
.motion .hp-bar {
  position: absolute;
  top: calc(var(--header-h) + 10px);
  right: var(--gutter);
  left: var(--gutter);
  z-index: 5;
  display: flex;
  justify-content: center;
  opacity: var(--bar, 0);
  pointer-events: none;
}

.hp-bar .hp-bubble {
  padding: 8px 14px 8px 10px;
  font-size: 0.96rem;
}

.hp-bar .hp-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.66rem;
}

.hp-bar .hp-steps {
  margin-top: 8px;
}

.hp-bar .hp-step {
  padding: 4px 11px 4px 4px;
  font-size: 0.82rem;
}

.hp-bar .hp-step-n {
  width: 22px;
  height: 22px;
  font-size: 0.68rem;
}

.hp-bar .hp-status {
  margin-top: 6px;
  font-size: 0.72rem;
}

/* Los monitores: site.js les da tamaño en píxeles y los lleva en perspectiva a su lugar */
.motion .hp-mons {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}

.hp-mon {
  --rim: 12px;
  --chin: 26px;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #303033 0%, #232325 60%, #1c1c1e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 50px 90px -40px rgba(11, 18, 32, 0.55);
  transform-origin: 0 0;
}

.hp-screen {
  position: absolute;
  inset: var(--rim) var(--rim) var(--chin);
  overflow: hidden;
  border-radius: 3px;
  background: #f3f2ee;
}

.hp-desk {
  background: linear-gradient(135deg, #e9e4dc, #d8dce6);
}

/* Reflejo suave sobre la pantalla */
.hp-desk::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 38%, transparent 60%);
  pointer-events: none;
}

.hp-desk .hp-w1 {
  top: 10%;
  left: 3%;
  z-index: 1;
  width: 58%;
}

.hp-desk .hp-w3 {
  bottom: 5%;
  left: 5%;
  z-index: 2;
  width: 46%;
}

.hp-desk .hp-w2 {
  top: 34%;
  right: 3%;
  z-index: 3;
  width: 54%;
}

.hp-line {
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hp-line b {
  color: #111827;
}

.hp-line span {
  color: #6b7280;
}

/* Post-its pegados en el marco del monitor */
.hp-note {
  position: absolute;
  z-index: 5;
  width: 74px;
  padding: 8px 8px 10px;
  background: linear-gradient(180deg, #fff6a8, #ffe86b);
  color: #4a3f10;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 12px;
  line-height: 1.15;
  box-shadow: 0 8px 16px -8px rgba(11, 18, 32, 0.55);
}

.hp-note::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 26px;
  height: 9px;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%) rotate(-3deg);
}

.hp-note-1 {
  top: -8px;
  right: 18px;
  transform: rotate(4deg);
}

.hp-note-2 {
  right: -14px;
  bottom: 22%;
  background: linear-gradient(180deg, #ffd3e0, #ffb3c9);
  color: #5a1f33;
  transform: rotate(-5deg);
}

.hp-mon-b .hp-note-1 {
  top: 14%;
  right: auto;
  left: -12px;
  transform: rotate(-4deg);
}

.hp-mon-b .hp-note-2 {
  right: 26px;
  bottom: -6px;
  background: linear-gradient(180deg, #d6ecff, #b3d9ff);
  color: #173a5e;
  transform: rotate(3deg);
}

/* Destello al fundirse los dos monitores en uno */
.hp-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80vmin;
  height: 80vmin;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe3d2 22%, rgba(255, 138, 92, 0.7) 45%, transparent 70%);
  opacity: var(--flash, 0);
  transform: translate(-50%, -50%);
  filter: blur(10px);
  mix-blend-mode: screen;
}

/* Pantalla del monitor final: el asistente */
.hp-ai {
  display: flex;
  flex-direction: column;
  background: #faf9f5;
}

.hp-ai-top {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #fff;
  font-size: 0.82rem;
  color: var(--fg-2);
}

.hp-ai-top img {
  width: 16px;
  height: auto;
}

.hp-ai-top b {
  color: var(--text);
}

.hp-ai-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 14px 20px 16px;
}

.hp-ai-body .hp-bubble {
  align-self: flex-end;
  padding: 9px 16px 9px 11px;
  font-size: 0.96rem;
}

.hp-ai-answer {
  padding: 14px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--hairline);
}

.hp-ai-chips {
  display: flex;
  flex: none;
  gap: 8px;
  margin-top: auto;
  overflow: hidden;
  white-space: nowrap;
}

.hp-ai-chips span {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-2);
  font-size: 0.82rem;
}

.hp-ai-chips span::before {
  content: "↗ ";
  color: var(--ember);
}

.hp-ai-input {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 6px 16px;
  border-radius: 16px;
  background: #fff;
  color: var(--fg-3);
  font-size: 0.92rem;
  box-shadow: 0 0 0 1px var(--hairline-strong);
}

.hp-ai-input i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--ember);
  color: #1a0e08;
}

.hp-ai-input .icon {
  width: 16px;
  height: 16px;
}

/* La tarjeta estática queda solo para los lectores de pantalla */
.motion .hp-static {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  box-shadow: none;
}

.motion .hp-actions {
  position: absolute;
  right: 0;
  bottom: clamp(28px, 6vh, 56px);
  left: 0;
  z-index: 6;
}

.motion .hp-hint {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  color: var(--fg-3);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  opacity: var(--hop, 1);
}

@media (prefers-reduced-motion: no-preference) {
  .hp-hint .icon {
    animation: hp-bounce 1.8s ease-in-out infinite;
  }
}

@keyframes hp-bounce {
  50% { transform: translateY(5px); }
}

/* Pantallas medias (tablet y portátiles bajos): la pantalla del asistente, más compacta */
@media (max-width: 1279.98px), (max-height: 839.98px) {
  .hp-ai-body {
    gap: 10px;
    padding: 12px 16px 14px;
  }

  .hp-ai-body .hp-bubble {
    padding: 7px 14px 7px 9px;
    font-size: 0.9rem;
  }

  .hp-ai-answer {
    padding: 12px 16px;
  }

  .hp-ai-answer .hp-big {
    font-size: 2.2rem;
  }

  .hp-ai-answer .hp-up {
    margin: 6px 0 8px;
    font-size: 0.78rem;
  }

  .hp-ai-answer p {
    font-size: 0.9rem;
  }

  .hp-ai-answer .hp-bars {
    gap: 7px;
  }

  .hp-ai-answer .hp-bars li {
    grid-template-columns: 80px 1fr 50px;
    font-size: 0.8rem;
  }

  .hp-ai-answer .hp-sources {
    margin-top: 10px;
    font-size: 0.74rem;
  }

  .hp-ai-chips,
  .hp-ai-input {
    display: none;
  }
}

@media (max-width: 1023.98px) {
  .motion .hp-track {
    height: 340vh;
  }

  .motion .hp-copy {
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 18px);
  }

  .motion .hp-copy h1 {
    max-width: none;
  }

  .motion .hp-copy .hp-lead {
    display: none;
  }

  /* En pantallas chicas las ventanas se escalonan para que se vean las tres etiquetas */
  .hp-desk .hp-w1 {
    width: 66%;
  }

  .hp-desk .hp-w2 {
    top: 30%;
    width: 58%;
  }

  .hp-desk .hp-w3 {
    top: 56%;
    bottom: auto;
    left: 3%;
    width: 52%;
  }

  .motion .hp-shade {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--bg) 96%, transparent) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 46%, transparent 68%),
      linear-gradient(0deg, color-mix(in srgb, var(--bg) 70%, transparent) 0%, transparent 24%);
  }

  .motion .hp-secondary {
    display: none;
  }

  .hp-mon {
    --rim: 8px;
    --chin: 18px;
    border-radius: 10px;
  }

  .hp-desk .hp-win {
    font-size: 10px;
  }

  .hp-note {
    width: 54px;
    padding: 6px 6px 7px;
    font-size: 9.5px;
  }

  .hp-note::before {
    width: 18px;
    height: 6px;
  }

  .hp-desk .hp-label {
    top: -12px;
    padding: 4px 9px 4px 7px;
    font-size: 11px;
  }

  .hp-desk .hp-label .icon {
    width: 12px;
    height: 12px;
  }

  .hp-ai-body {
    gap: 10px;
    padding: 12px 14px 14px;
  }

  .hp-ai-body .hp-bubble {
    align-self: stretch;
    align-items: flex-start;
    padding: 8px 12px 8px 8px;
    border-radius: 18px;
    font-size: 0.9rem;
  }

  .hp-ai-answer {
    padding: 12px 14px;
  }
}

@media (max-width: 639.98px) {
  .hp-copy h1 {
    font-size: 2.05rem;
  }

  .hp-bubble {
    align-items: flex-start;
    max-width: 100%;
    padding: 10px 16px 10px 12px;
    border-radius: 22px;
    font-size: 0.98rem;
    text-align: left;
  }

  .hp-bubble .hp-avatar {
    width: 26px;
    height: 26px;
    margin-top: 1px;
    font-size: 0.66rem;
  }

  /* Con animación, los pasos que no están activos muestran solo el número */
  .motion .hp-step:not(.is-on) {
    padding: 4px;
  }

  .motion .hp-step:not(.is-on) > span:last-child {
    display: none;
  }

  .hp-answer {
    padding: 18px 20px;
  }

  .hp-answer-grid {
    grid-template-columns: 1fr;
  }

  .hp-big {
    font-size: 2.3rem;
  }

  .hp-up {
    margin: 8px 0 10px;
    font-size: 0.78rem;
  }

  .hp-answer p,
  .hp-ai-answer p {
    font-size: 0.92rem;
  }

  .motion .hp-bars {
    display: none;
  }

  .hp-sources {
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    font-size: 0.74rem;
  }

  .hp-ai-answer .hp-big {
    font-size: 2rem;
  }

  .hp-ai-top span,
  .motion .hp-ai-chips,
  .motion .hp-ai-input {
    display: none;
  }
}

/* ---------- Cadena de cuatro pasos (inicio): Integrar, Curar, Modelar, Recomendar ----------
   Los pasos van uno al lado del otro, unidos por una línea que pasa por detrás de cada nodo.
   Con animación (html.motion), al entrar en pantalla la línea se dibuja, los nodos se encienden
   en orden y un flujo de datos recorre la cadena. En pantallas angostas la cadena se desliza. */
.chain {
  --node: 124px;
  --chain-gap: clamp(20px, 3vw, 48px);
  margin-top: clamp(40px, 5vw, 72px);
}

.chain-track {
  position: relative;
}

.chain-steps {
  /* Distancia del borde derecho al centro del último nodo (ancho de una columna menos medio nodo) */
  --tail: calc((100% - 3 * var(--chain-gap)) / 4 - var(--node) / 2);
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--chain-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* La línea de la cadena */
.chain-steps::before {
  content: "";
  position: absolute;
  top: calc(var(--node) / 2 - 1px);
  right: var(--tail);
  left: calc(var(--node) / 2);
  z-index: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--ember) 0 10px, transparent 10px 22px);
  opacity: 0.6;
  transform-origin: 0 50%;
}

/* El paquete de datos que la recorre */
.chain-steps::after {
  content: "";
  position: absolute;
  top: calc(var(--node) / 2 - 6px);
  left: calc(var(--node) / 2 - 6px);
  z-index: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 106, 58, 0.35), 0 0 20px 6px rgba(255, 106, 58, 0.55);
  opacity: 0;
}

.chain-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chain-step:nth-child(1) { --d: 0.15s; }
.chain-step:nth-child(2) { --d: 0.5s; }
.chain-step:nth-child(3) { --d: 0.85s; }
.chain-step:nth-child(4) { --d: 1.2s; }

.chain-node {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--node);
  height: var(--node);
  margin-bottom: 20px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--bg) 72%);
  box-shadow: 0 24px 44px -28px rgba(11, 18, 32, 0.4);
  transition: border-color 0.6s, box-shadow 0.6s;
}

.chain-step:hover .chain-node {
  border-color: var(--ember);
  box-shadow: 0 24px 44px -28px rgba(11, 18, 32, 0.4), 0 0 0 6px rgba(255, 106, 58, 0.12);
}

.chain-glass {
  width: 84%;
  height: auto;
}

.chain-num {
  position: absolute;
  right: -2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--bg);
  transition: background 0.4s, color 0.4s;
}

.chain-step:hover .chain-num {
  background: var(--ember);
  color: #1a0e08;
}

.chain-step h3 {
  margin: 4px 0 8px;
  font-size: clamp(1.7rem, 1rem + 1.4vw, 2.3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.chain-step p {
  margin: 0 0 18px;
  color: var(--fg-2);
}

.chain-step .link-arrow {
  margin-top: auto;
  font-size: 0.9rem;
}

.chain-hint {
  display: none;
  margin: 14px 0 0;
  color: var(--fg-3);
  font-size: 0.82rem;
}

/* Con animación: la línea se dibuja, cada paso se enciende en orden y los datos fluyen */
.motion .chain-steps::before {
  transform: scaleX(0);
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s;
}

.motion .chain.is-in .chain-steps::before {
  transform: scaleX(1);
  animation: chain-dash 1.1s linear infinite;
}

.motion .chain.is-in .chain-steps::after {
  animation: chain-packet 5.5s cubic-bezier(0.45, 0, 0.55, 1) 1.4s infinite;
}

.motion .chain-node {
  border-color: var(--hairline);
  transition: border-color 0.6s var(--d), box-shadow 0.6s var(--d);
}

.motion .chain.is-in .chain-node {
  border-color: color-mix(in srgb, var(--ember) 55%, var(--hairline-strong));
  box-shadow: 0 24px 44px -28px rgba(11, 18, 32, 0.4), 0 0 0 6px rgba(255, 106, 58, 0.1);
  animation: chain-float 7s ease-in-out calc(var(--d) + 1s) infinite;
}

.motion .chain-glass {
  opacity: 0;
  transform: scale(0.6) translateY(12px);
  transition: opacity 0.7s var(--d), transform 1s cubic-bezier(0.16, 1, 0.3, 1) var(--d);
}

.motion .chain-step .label,
.motion .chain-step h3,
.motion .chain-step p,
.motion .chain-step .link-arrow {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s calc(var(--d) + 0.15s), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--d) + 0.15s);
}

.motion .chain.is-in .chain-glass,
.motion .chain.is-in .chain-step .label,
.motion .chain.is-in .chain-step h3,
.motion .chain.is-in .chain-step p,
.motion .chain.is-in .chain-step .link-arrow {
  opacity: 1;
  transform: none;
}

@keyframes chain-dash {
  to { background-position: 22px 0; }
}

@keyframes chain-packet {
  0% { left: calc(var(--node) / 2 - 6px); opacity: 0; }
  6% { opacity: 1; }
  94% { opacity: 1; }
  100% { left: calc(100% - var(--tail) - 6px); opacity: 0; }
}

@keyframes chain-float {
  50% { transform: translateY(-7px); }
}

/* Pantallas angostas: la cadena se desliza de lado, un paso a la vez */
@media (max-width: 1023.98px) {
  .chain {
    --node: 104px;
  }

  .chain-track {
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }

  .chain-track::-webkit-scrollbar {
    display: none;
  }

  .chain-steps {
    --tail: calc(min(76vw, 300px) - var(--node) / 2);
    display: flex;
    width: max-content;
    gap: 20px;
    padding-bottom: 4px;
  }

  .chain-step {
    flex: 0 0 min(76vw, 300px);
    scroll-snap-align: start;
  }

  .chain-hint {
    display: flex;
    align-items: center;
    gap: 6px;
  }
}
