/* =========================================================
   Home de magnia.cl — línea de /sistema (12-oct-2026)

   Se carga después de styles.css y sistema.css: los tokens y los componentes lp- vienen de
   sistema.css (la línea que Gabriel aprobó, firma/marca/visual.md). Acá vive solo lo que el
   home tiene y la landing no: la barra con secciones, el héroe a dos columnas en escritorio,
   el camino (visual.md §5.1), las tarjetas de qué construimos y de las tres puertas, y el pie.
   Prefijo `hm-`.
   ========================================================= */

.home { --wrap-home: 1120px; }
.hm-wrap { max-width: var(--wrap-home); margin-inline: auto; padding-inline: 20px; }
.home .lp-section { scroll-margin-top: 72px; }
.home #formulario { scroll-margin-top: 88px; }

/* ---------- 1 · Barra ----------
   Fija arriba, blanca y casi transparente; el filete aparece recién al bajar (home.js). */
.hm-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.hm-bar.is-scrolled { border-bottom-color: var(--hairline); box-shadow: 0 6px 20px -16px rgba(22,33,62,.25); }
.hm-bar__inner { display: flex; align-items: center; gap: 2rem; height: 68px; }
.hm-bar__brand img { display: block; height: 30px; width: auto; }
.hm-bar__links { display: flex; gap: 1.75rem; margin-left: auto; }
.hm-bar__links a { font-size: .92rem; font-weight: 500; color: var(--ink-soft); transition: color .2s var(--ease); }
.hm-bar__links a:hover { color: var(--brand); }
.hm-bar__cta.lp-btn { padding: .62rem 1.1rem; font-size: .9rem; border-radius: 10px; box-shadow: 0 8px 18px -10px rgba(68,62,222,.55); }

/* ---------- 2 · Héroe ----------
   Escritorio: dos columnas, el título alineado a la izquierda. Móvil: una columna centrada, como
   /sistema, con el formulario bajo el título. */
.hm-hero {
  padding: clamp(1.5rem, 4vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem);
  background:
    radial-gradient(ellipse 60% 60% at 30% 0%, rgba(68,62,222,.10), transparent 70%),
    var(--paper);
}
.hm-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hm-hero__copy { text-align: left; }
.hm-hero__copy .lp-pill { max-width: 25rem; text-wrap: pretty; }
.hm-hero__copy .lp-hero__title { font-size: clamp(2.2rem, 1.3rem + 2.9vw, 3.5rem); max-width: 17ch; }
.hm-hero__copy .lp-hero__lead { margin-left: 0; max-width: 26rem; font-size: 1.12rem; }
.hm-hero__form { min-width: 0; }
.home .hm-hero .form-card {
  margin: 0; text-align: left; padding: clamp(1.25rem, 2.6vw, 1.9rem);
  border: 1px solid var(--hairline); border-radius: 18px;
  box-shadow: var(--shadow-form); background: var(--paper); color: var(--ink);
}
/* El sello de Google Partner, grande: es la credencial verificable más fuerte del héroe. */
.home .hm-hero .lp-proof { display: flex; align-items: center; gap: 1.1rem; margin-top: 1.25rem; }
.home .hm-hero .lp-proof img { width: 104px; height: 104px; }
.home .hm-hero .lp-proof p { font-size: .95rem; }

/* Los dos canales, bajo la bajada: símbolo + nombre en una píldora blanca. */
.hm-channels { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; padding: 0; }
.hm-channels li {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem .95rem .55rem .7rem; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--hairline); box-shadow: var(--shadow-card);
  font-size: .92rem; font-weight: 600; color: var(--ink);
}
.hm-channels svg { width: 22px; height: 22px; flex: none; }

/* ---------- 3 · Clientes: la franja ----------
   Dos grupos idénticos en una pista que se desplaza la mitad de su ancho: el ciclo no tiene
   salto. Se detiene con el cursor encima; con movimiento reducido queda quieta y centrada. */
.hm-logos { padding: 0 0 clamp(2.5rem, 5vw, 3.5rem); }
.hm-logos__label { margin: 0 0 1.25rem; padding-inline: 20px; text-align: center; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.hm-logos__strip {
  overflow: hidden; max-width: 1180px; margin-inline: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.hm-logos__track { display: flex; width: max-content; animation: hm-strip 42s linear infinite; }
.hm-logos__strip:hover .hm-logos__track { animation-play-state: paused; }
.hm-logos__group { display: flex; align-items: center; gap: clamp(2.5rem, 5vw, 4.5rem); padding-right: clamp(2.5rem, 5vw, 4.5rem); }
.hm-logos__group img { height: 32px; width: auto; max-width: 150px; object-fit: contain; filter: grayscale(1) brightness(.35); opacity: .62; flex: none; }
/* Los anchos y bajos se igualan a la vista, no al alto. */
.hm-logos__group img[data-logo="Mappin"] { height: 18px; }
.hm-logos__group img[data-logo="Samay"] { height: 23px; }
.hm-logos__group img[data-logo="Fred Astaire"] { height: 24px; }
.hm-logos__group img[data-logo="Cachapoal"], .hm-logos__group img[data-logo="Cassá"] { height: 48px; }
.hm-logos__group img[data-logo="Blue Home"] { height: 36px; }
@keyframes hm-strip { to { transform: translateX(-50%); } }

/* ---------- 4 · El problema: el ícono del paso, en vez del signo ---------- */
.hm-pains .lp-pains__mark { padding: 7px; }
.hm-pains .lp-pains__mark svg, .hm-path__dot svg {
  width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 5 · El camino ----------
   Seis hitos sobre un riel que se enciende con el scroll; debajo, la medición de punta a punta
   con la flecha hacia el anuncio. home.js fija --p (0 a 1) y marca .is-lit en cada paso que la
   luz alcanzó; con .is-done (la luz llegó a la venta) se dibuja la medición. Sin JS (o con
   movimiento reducido) todo queda encendido. */
.hm-path { position: relative; margin: clamp(2.25rem, 5vw, 3.25rem) auto 0; max-width: 1040px; --p: 1; --n: 6; }
.hm-path__track { position: relative; }
.hm-path__sub strong { display: inline-block; text-wrap: balance; }
.hm-path__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: .75rem; position: relative; z-index: 1; }
.hm-path__step { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }

/* El riel une el centro del primer círculo con el del último. */
.hm-path__rail {
  position: absolute; z-index: 0; top: 26px; height: 3px; border-radius: 3px;
  left: calc(100% / 12); right: calc(100% / 12);
  background: var(--hairline); overflow: hidden;
}
.hm-path__fill {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%);
  background: linear-gradient(90deg, var(--brand), #7C77F0);
  box-shadow: 0 0 12px rgba(68,62,222,.55);
}

.hm-path__dot {
  display: grid; place-items: center; width: 54px; height: 54px; padding: 14px; flex: none;
  border-radius: 50%; background: var(--paper); color: var(--brand); border: 2px solid var(--brand);
  box-shadow: 0 0 0 6px var(--mist);
  transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}
.hm-path__body { margin-top: .9rem; transition: opacity .45s var(--ease), transform .45s var(--ease); }
.hm-path__num { display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; color: var(--brand); background: var(--brand-tint); padding: .18rem .5rem; border-radius: 6px; }
.hm-path__step h3 { margin: .55rem 0 0; font-family: var(--sans); font-size: 1.02rem; font-weight: 600; color: var(--ink); }
.hm-path__step p { margin: .3rem auto 0; max-width: 11rem; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }

/* La venta: el hito que importa, en índigo sólido. */
.hm-path__step--key .hm-path__dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 6px var(--mist), 0 14px 28px -10px rgba(68,62,222,.65); }
.hm-path__step--key .hm-path__num { background: var(--brand); color: #fff; }

/* Encendido con el scroll. */
.hm-path.is-live .hm-path__step:not(.is-lit) .hm-path__dot { border-color: var(--hairline); color: var(--ink-muted); background: var(--paper); box-shadow: 0 0 0 6px var(--mist); }
.hm-path.is-live .hm-path__step:not(.is-lit) .hm-path__body { opacity: .45; transform: translateY(4px); }
.hm-path.is-live .hm-path__step--key:not(.is-lit) .hm-path__num { background: var(--brand-tint); color: var(--brand); }
.hm-path.is-live .hm-path__step.is-lit .hm-path__dot { transform: scale(1.04); }

/* La medición: una línea bajo los seis pasos, de la venta de vuelta al anuncio. Cada paso
   baja una conexión punteada hasta ella. */
.hm-path__step::after {
  content: ""; position: absolute; left: 50%; bottom: -30px; height: 22px; width: 0;
  border-left: 1.5px dashed rgba(68,62,222,.35);
}
.hm-path__measure { position: relative; height: 12px; margin: 30px calc(100% / 12) 0; }
.hm-path__line {
  position: absolute; left: 0; right: 0; top: 5px; height: 2px; border-radius: 2px;
  background: var(--brand); transform-origin: right center;
  transition: transform 1.1s var(--ease);
}
/* La punta de flecha, a la izquierda: vuelve al anuncio. */
.hm-path__line::before {
  content: ""; position: absolute; left: -2px; top: -5px; width: 12px; height: 12px;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(45deg); border-radius: 1px;
}
.hm-path__label {
  margin: .9rem 0 0; text-align: center;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand);
  transition: opacity .6s var(--ease) .5s;
}
.hm-path.is-live:not(.is-done) .hm-path__line { transform: scaleX(0); }
.hm-path.is-live:not(.is-done) .hm-path__label { opacity: 0; }
.hm-path.is-live:not(.is-done) .hm-path__step::after { opacity: 0; }
.hm-path__step::after { transition: opacity .5s var(--ease); }

.hm-path__sub { margin-top: clamp(2rem, 4vw, 2.75rem); max-width: 36rem; text-wrap: balance; }.hm-path__sub strong { color: var(--ink); font-weight: 600; }

/* ---------- 12 · Cierre: dos formas de empezar ----------
   Viven dentro del cierre (27-oct-2026). La del centro de la oferta va destacada (borde y fondo índigo tenue, como la garantía de
   /sistema) y es la única con botón sólido. */
.hm-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; max-width: 860px; margin: clamp(2rem, 4vw, 2.5rem) auto 0; align-items: stretch; }
.hm-door {
  display: flex; flex-direction: column; padding: 1.6rem 1.5rem 1.6rem; text-align: left;
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 18px; box-shadow: var(--shadow-card);
}
.hm-door--key { background: var(--brand-soft); border-color: rgba(68,62,222,.3); box-shadow: 0 2px 6px rgba(22,33,62,.04), 0 24px 50px -26px rgba(68,62,222,.45); }
.hm-door__tag { margin: 0; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.hm-door h3 { margin: .7rem 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.55rem; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); }
.hm-door__who { margin: .7rem 0 0; font-size: .9rem; line-height: 1.45; color: var(--ink-muted); }
.hm-door__what { margin: .6rem 0 1.4rem; flex: 1; font-size: .98rem; line-height: 1.5; color: var(--ink-soft); }
.hm-door .lp-btn { align-self: flex-start; }
.hm-link { align-self: flex-start; display: inline-flex; gap: .4rem; font-weight: 600; font-size: .98rem; color: var(--brand); padding: .95rem 0 .2rem; }
.hm-link span { transition: transform .2s var(--ease); }
.hm-link:hover span { transform: translateX(3px); }

/* ---------- 8 · Cómo trabajamos: la línea de tiempo de /sistema ---------- */
.hm-time .lp-time__when { letter-spacing: .1em; }

/* ---------- Pie ---------- */
.hm-footer { border-top: 1px solid var(--hairline); padding: 2.25rem 0 2rem; background: var(--paper); }
.hm-footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.hm-footer__brand img { display: block; height: 28px; width: auto; }
.hm-footer__nap { font-style: normal; font-size: .86rem; line-height: 1.7; color: var(--ink-soft); text-align: right; }
.hm-footer__nap a { color: var(--ink-soft); }
.hm-footer__nap a:hover, .hm-footer__legal a:hover { color: var(--brand); }
.hm-footer__legal { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hairline); font-size: .8rem; color: var(--ink-muted); }
.hm-footer__legal a { color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hm-bar__links { display: none; }
  .hm-bar__cta { margin-left: auto; }
}

@media (max-width: 900px) {
  .hm-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; max-width: 640px; }
  .hm-hero__copy { text-align: center; }
  .hm-hero__copy .lp-hero__title { max-width: none; }
  .hm-hero__copy .lp-hero__lead { margin-inline: auto; }
  .home .hm-hero .lp-proof { justify-content: center; }
  .hm-channels { justify-content: center; }
  .hm-doors { grid-template-columns: minmax(0, 1fr); max-width: 560px; margin-inline: auto; }
}

/* El camino, en vertical: el riel a la izquierda (como la línea de tiempo) y la medición a la
   derecha, subiendo hasta el anuncio. */
@media (max-width: 820px) {
  .hm-path { max-width: 520px; padding-right: 30px; }
  .hm-path__steps { grid-template-columns: minmax(0, 1fr); gap: .85rem; }
  .hm-path__step { display: grid; grid-template-columns: 48px 1fr; gap: .9rem; align-items: center; text-align: left; }
  .hm-path__dot { width: 48px; height: 48px; padding: 12px; }
  .hm-path__body {
    margin: 0; padding: .8rem 1rem; background: var(--paper);
    border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow-card);
  }
  .hm-path__num { font-size: .62rem; }
  .hm-path__step h3 { display: inline; margin: 0 0 0 .45rem; font-size: 1rem; }
  .hm-path__step p { margin: .3rem 0 0; max-width: none; font-size: .9rem; }
  .hm-path__step--key .hm-path__body { border-color: rgba(68,62,222,.35); }
  .hm-path.is-live .hm-path__step:not(.is-lit) .hm-path__body { transform: translateX(6px); box-shadow: none; }

  .hm-path__rail { top: var(--rail-top, 24px); bottom: var(--rail-bottom, 24px); left: 22.5px; right: auto; width: 3px; height: auto; }
  .hm-path__fill { inset: 0 0 auto 0; width: auto; height: calc(var(--p) * 100%); background: linear-gradient(180deg, var(--brand), #7C77F0); }

  /* Conexión de cada tarjeta a la medición, hacia la derecha. */
  .hm-path__step::after { left: auto; right: -20px; top: 50%; bottom: auto; width: 20px; height: 0; border-left: 0; border-top: 1.5px dashed rgba(68,62,222,.35); }
  .hm-path__measure { position: absolute; margin: 0; top: var(--rail-top, 24px); bottom: var(--rail-bottom, 24px); right: -26px; width: 12px; height: auto; }
  .hm-path__line { top: 0; bottom: 0; left: 5px; right: auto; width: 2px; height: auto; transform-origin: center bottom; }
  .hm-path__line::before { left: -5px; top: -1px; transform: rotate(135deg); }
  .hm-path.is-live:not(.is-done) .hm-path__line { transform: scaleY(0); }
  .hm-path__label { margin-top: 1.4rem; padding-left: 0; text-align: right; }
}

@media (max-width: 560px) {
  .hm-bar__inner { height: 60px; gap: 1rem; }
  .hm-bar__brand img { height: 25px; }
  .hm-bar__cta.lp-btn { padding: .55rem .85rem; font-size: .84rem; }
  .hm-hero { padding-top: 1rem; }
  .hm-hero__copy .lp-hero__title { font-size: 2.05rem; }
  .hm-hero__copy .lp-hero__lead { font-size: 1rem; }
  .home .hm-hero .form-card { padding: 1.1rem; }
  .hm-channels { margin-top: 1.1rem; gap: .5rem; }
  .hm-channels li { padding: .45rem .8rem .45rem .6rem; font-size: .86rem; }
  .hm-channels svg { width: 19px; height: 19px; }
  .home .hm-hero .lp-proof img { width: 86px; height: 86px; }
  .home .hm-hero .lp-proof p { font-size: .9rem; }
  .hm-logos__track { animation-duration: 32s; }
  .hm-logos__group img { height: 26px; }
  .hm-logos__group img[data-logo="Mappin"] { height: 15px; }
  .hm-logos__group img[data-logo="Samay"] { height: 19px; }
  .hm-logos__group img[data-logo="Fred Astaire"] { height: 20px; }
  .hm-logos__group img[data-logo="Cachapoal"], .hm-logos__group img[data-logo="Cassá"] { height: 40px; }
  .hm-logos__group img[data-logo="Blue Home"] { height: 30px; }
  .hm-footer__nap { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-path__dot, .hm-path__body, .hm-path__line, .hm-path__label, .hm-path__step::after, .hm-bar { transition: none; }
  /* La franja queda quieta: un solo grupo, centrado y en varias líneas si no cabe. */
  .hm-logos__strip { -webkit-mask-image: none; mask-image: none; }
  .hm-logos__track { animation: none; width: auto; justify-content: center; }
  .hm-logos__group { flex-wrap: wrap; justify-content: center; padding-inline: 20px; row-gap: 1.25rem; }
  .hm-logos__group[aria-hidden="true"] { display: none; }
}
.hm-footer__desc { margin: .75rem 0 0; max-width: 24rem; font-size: .86rem; line-height: 1.55; color: var(--ink-soft); }
