/* ==========================================================================
   Kameron AI — Landing
   Se carga DESPUÉS de styles.css y reutiliza sus tokens. Componentes portados
   a HTML/CSS sin dependencias desde el catálogo de 21st.dev:
   - Cabecera:  "Morphing Scroll Navbar" (laziekiki)
   - Servicios: "bento grid 01" (avanishverma4)
   - Proceso:   "How It Works Timeline" (7ovr)
   - Precios:   "Pricing Section 1" (shadcnstore)
   - FAQ:       "Two-Column FAQ" (ln-dev7)
   Las transiciones solo tocan transform, opacity y clip-path (nunca layout).
   ========================================================================== */

:root {
  --surface: oklch(98.5% 0.008 85);

  /* Escala de espaciado (base 8px) */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;

  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 22px;
}

/* ---- Barra de progreso de lectura ---- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 120;
  background: var(--cobalt);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
html:not(.js) .scroll-progress { display: none; }
/* Donde el navegador lo admite, la barra la mueve el propio scroll (compositor, sin JS). */
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: page-progress linear both;
    animation-timeline: scroll(root block);
  }
}
@keyframes page-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Cabecera que se transforma en cápsula ---- */
.site-header--morph {
  --cap: 1080px;
  --w: min(1200px, 100vw - clamp(2.5rem, 6vw, 5rem));
  --edge: calc((100vw - var(--w)) / 2);
  --inset: max(0.6rem, calc((100vw - var(--cap)) / 2));
  --shift: max(0px, calc(var(--inset) + 1.25rem - var(--edge)));

  position: fixed;
  inset: 0 0 auto 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 0;
}
.site-header--morph.is-compact { --cap: 640px; }
.site-header--morph .site-header__inner { position: relative; padding-block: 1rem; }

.site-header__shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  filter:
    drop-shadow(0 0 1px oklch(23% 0.04 265 / 0.4))
    drop-shadow(0 12px 18px oklch(23% 0.04 265 / 0.12));
}
.site-header__bg {
  position: absolute;
  inset: 0;
  background: var(--surface);
  opacity: 0;
  clip-path: inset(0 0 0 0 round 0px);
  transition: clip-path 0.3s var(--ease-in-out), opacity 0.2s var(--ease);
}
.is-floating .site-header__bg {
  opacity: 1;
  clip-path: inset(8px var(--inset) 8px var(--inset) round 16px);
}

.site-header--morph .logo,
.site-header--morph .site-nav { transition: transform 0.3s var(--ease-in-out); }
.site-header--morph .logo__img { transition: transform 0.3s var(--ease-in-out); transform-origin: 0 50%; }
.site-header--morph .site-nav a:not(.btn) {
  position: relative;
  padding-block: 0.4rem;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.site-header--morph .site-nav a:not(.btn)::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.3s var(--ease);
}
.site-header--morph .site-nav a[aria-current="location"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
  .site-header--morph .site-nav a:not(.btn):hover::after { transform: scaleX(1); }
}
.site-header--morph .site-nav a[aria-current="location"] { color: var(--ink); }
.site-header--morph .site-nav .btn { padding: 0.7rem 1.25rem; font-size: 0.95rem; }

@media (min-width: 721px) {
  .site-header--morph.is-floating .logo { transform: translateX(var(--shift)); }
  .site-header--morph.is-floating .site-nav { transform: translateX(calc(-1 * var(--shift))); }
  .site-header--morph.is-compact .logo__img { transform: scale(0.88); }
  .site-header--morph.is-compact .site-nav a:not(.btn) {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    visibility: hidden;
    transition: color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s 0.2s;
  }
}
@media (max-width: 720px) {
  .site-header--morph { --inset: 0.5rem; }
  .site-header--morph .site-nav {
    left: 0.5rem; right: 0.5rem;
    top: calc(100% - 2px);
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 18px 30px -18px oklch(23% 0.04 265 / 0.35);
  }
  .site-header--morph .site-nav a:not(.btn) { padding-block: 0.65rem; width: 100%; }
  .site-header--morph .nav-toggle { min-width: 44px; min-height: 44px; }
}

/* ---- Hero ---- */
.hero--landing { padding-top: calc(clamp(4rem, 9vw, 7.5rem) + 4.25rem); }
.hero__facts {
  list-style: none;
  margin: var(--sp-4) 0 0;
  padding: var(--sp-3) 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  font-size: 0.95rem;
  font-weight: 560;
  color: var(--ink);
}
.hero__facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__facts li::before,
.tier__list li::before {
  content: '';
  width: 1.05em; height: 1.05em;
  flex: none;
  background: var(--cobalt);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero--landing .hero__who { margin-top: var(--sp-3); font-size: 0.98rem; }

/* Entrada escalonada del texto del hero */
html.js .hero__copy > * {
  opacity: 0;
  transform: translateY(18px);
  animation: hero-in 0.7s var(--ease) forwards;
}
html.js .hero__copy > :nth-child(1) { animation-delay: 0.05s; }
html.js .hero__copy > :nth-child(2) { animation-delay: 0.12s; }
html.js .hero__copy > :nth-child(3) { animation-delay: 0.22s; }
html.js .hero__copy > :nth-child(4) { animation-delay: 0.32s; }
html.js .hero__copy > :nth-child(5) { animation-delay: 0.42s; }
html.js .hero__copy > :nth-child(6) { animation-delay: 0.52s; }
@keyframes hero-in { to { opacity: 1; transform: none; } }

/* ---- Servicios: bento ---- */
.bento {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-2);
}
.bento__cell {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: clamp(1.4rem, 2.4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
/* Ritmo asimétrico por filas: [4+2] / [3+3] / [2+4] */
.bento__cell--wide { grid-column: span 3; }
.bento__cell--feature {
  grid-column: span 4;
  flex-direction: row;
  align-items: stretch;
  gap: clamp(1.4rem, 2.6vw, 2.25rem);
}
.bento__cell--feature > * { flex: 1 1 0; min-width: 0; }
.bento__cell--feature .bento__body { align-self: center; }
.bento__cell--flip { flex-direction: row-reverse; }
.bento__cell--drenched {
  background: var(--cobalt-deep);
  border-color: var(--cobalt-deep);
  color: var(--on-cobalt);
}
html.js .bento__cell.reveal {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
@media (hover: hover) {
  .bento__cell:hover {
    border-color: var(--cobalt);
    box-shadow: 0 18px 32px -24px oklch(44% 0.165 264 / 0.55);
  }
}
.bento__cell:nth-child(even) { --reveal-delay: 0.08s; }

.bento__head { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.5rem; }
.bento__num {
  font-variation-settings: var(--wide);
  font-weight: 880;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cobalt);
}
.bento__head h3 { margin: 0; }
.bento__body p { margin: 0 0 0.7em; color: var(--ink-soft); font-size: 1rem; }
.bento__body .ledger__example { margin: 0; }
.bento__cell--drenched .bento__num { color: var(--signal); }
.bento__cell--drenched h3 { color: var(--on-cobalt); }
.bento__cell--drenched .bento__body p { color: var(--on-cobalt-soft); }
.bento__cell--drenched .ledger__example { color: var(--on-cobalt); }
.bento__cell--drenched .ledger__example strong { color: var(--signal); }

/* Micro-demos: un ejemplo concreto por servicio (decorativas, aria-hidden) */
.demo {
  flex: 1;
  min-height: 9.5rem;
  display: grid;
  align-content: center;
  gap: 0.6rem;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--paper-deep);
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--ink);
}
.bento__cell--drenched .demo { background: oklch(23% 0.06 266); color: var(--on-cobalt); }
.demo__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.demo__muted { color: var(--ink-soft); }
.demo__pill {
  flex: none;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--cobalt-tint);
  color: var(--cobalt-deep);
  font-weight: 700;
  font-size: 0.75rem;
}

/* Las piezas de cada demo entran una vez, al revelarse la celda */
html.js .demo [data-step] { opacity: 0; transform: translateY(8px); }
html.js .is-visible .demo [data-step] { animation: hero-in 0.5s var(--ease) forwards; }
html.js .is-visible .demo [data-step="1"] { animation-delay: 0.35s; }
html.js .is-visible .demo [data-step="2"] { animation-delay: 0.75s; }
html.js .is-visible .demo [data-step="3"] { animation-delay: 1.15s; }
html.js .is-visible .demo [data-step="4"] { animation-delay: 1.55s; }

/* 01 · factura → asiento */
.demo--invoice { gap: 0.9rem; justify-items: stretch; }
.doc {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
.doc__name { font-weight: 700; font-size: 0.78rem; }
.doc__line { height: 6px; border-radius: 3px; background: var(--line); }
.doc__line:nth-of-type(2) { width: 82%; }
.doc__line:nth-of-type(3) { width: 64%; }
.doc__total { justify-self: end; font-weight: 800; font-variation-settings: var(--wide); }
.doc__scan {
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--signal);
  opacity: 0;
}
html.js .is-visible .doc__scan { animation: scan 1.3s var(--ease) 0.4s 1 both; }
@keyframes scan {
  0% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(7.2rem); }
}
.demo__arrow { justify-self: center; width: 18px; height: 18px; color: var(--signal); }
.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  padding: 0.8rem 0.85rem;
  border-radius: 8px;
  border: 1px solid oklch(38% 0.08 266);
  background: oklch(33% 0.07 266);
}
.entry strong { font-variation-settings: var(--wide); font-weight: 800; }
.entry__ok { grid-column: 1 / -1; color: oklch(80% 0.16 150); font-weight: 640; font-size: 0.78rem; }
.bento__cell--drenched .demo__muted { color: var(--on-cobalt-soft); }

/* 03 · buscador de documentos */
.demo__search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1.5px solid var(--cobalt);
  background: var(--surface);
  font-weight: 560;
}
.demo__search svg { width: 15px; height: 15px; flex: none; color: var(--cobalt); }
.demo__file { display: grid; gap: 0.1rem; min-width: 0; }
.demo__file b { font-weight: 660; overflow-wrap: anywhere; }

/* 04 · burbujas */
.demo--chat { justify-items: start; }
.demo__bubble {
  max-width: 88%;
  padding: 0.55rem 0.8rem;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.demo__bubble--user {
  justify-self: end;
  border-radius: 14px 14px 4px 14px;
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--on-cobalt);
  font-weight: 540;
}
.demo__time { justify-self: center; color: var(--ink-soft); font-size: 0.75rem; }

/* 05 · calendario semanal */
.demo__week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.4rem; }
.demo__day {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.2rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.demo__day i {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
}
.demo__day--on { color: var(--ink); border-color: var(--cobalt); }
.demo__day--on i { background: var(--signal); border-color: var(--signal); }

/* 06 · 9:03 → 9:04 */
.demo--quote { grid-template-columns: auto 1fr auto; align-items: center; gap: 0.8rem; }
.demo__stamp { display: grid; gap: 0.15rem; }
.demo__stamp b {
  font-variation-settings: var(--wide);
  font-weight: 880;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--cobalt);
}
.demo__wire { height: 2px; background: var(--signal); transform-origin: 0 50%; }
html.js .demo__wire { transform: scaleX(0); }
html.js .is-visible .demo__wire { animation: wire 0.7s var(--ease) 0.7s forwards; }
@keyframes wire { to { transform: scaleX(1); } }

/* ---- Proceso: pasos con progreso ligado al scroll ---- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.split__aside { position: sticky; top: 6.5rem; }
.split__aside .section__head { margin-bottom: var(--sp-4); }

.steps {
  --progress: 0;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps::before,
.steps::after {
  content: '';
  position: absolute;
  left: 21px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: var(--line);
}
.steps::after {
  background: var(--cobalt);
  transform: scaleY(var(--progress));
  transform-origin: 50% 0;
}
.steps__item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: clamp(1.1rem, 2.6vw, 2rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.steps__item:last-child { padding-bottom: 0; }
/* El raíl termina en el último marcador */
.steps__item:last-child::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  bottom: 0;
  width: 6px;
  background: var(--paper-deep);
}
.steps__dot {
  position: relative;
  z-index: 1;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-variation-settings: var(--wide);
  font-weight: 800;
  font-size: 0.85rem;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.steps__item.is-active .steps__dot {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--on-cobalt);
}
.steps__when {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--cobalt-tint);
  color: var(--cobalt-deep);
  font-variation-settings: var(--wide);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.steps__body h3 { margin-bottom: 0.3em; }
.steps__body p { margin: 0; color: var(--ink-soft); }

/* ---- Precios: tres niveles ---- */
.tiers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 3rem);
}
.tier {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 3px solid var(--ink);
}
.tier:nth-child(2) { --reveal-delay: 0.1s; }
.tier:nth-child(3) { --reveal-delay: 0.2s; }
.tier__scope { display: flex; gap: 5px; }
.tier__scope i { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.tier__scope i.on { background: var(--signal); }
.tier__price {
  margin: 0;
  font-variation-settings: var(--wide);
  font-weight: 880;
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--cobalt);
  white-space: nowrap;
}
.tier h3 { margin: 0; }
.tier__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  color: var(--ink-soft);
  font-size: 1rem;
}
.tier__list li { display: flex; gap: 0.6rem; align-items: baseline; }
.tier__list li::before { transform: translateY(0.15em); }

.price-note {
  margin-top: var(--space-block);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--sp-5);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: var(--r-md);
  background: var(--cobalt-tint);
}
.price-note p { margin: 0; max-width: 58ch; color: var(--ink); }
.price-note .btn { flex: none; }

/* ---- FAQ a dos columnas ---- */
.contact-card {
  display: grid;
  gap: 0.35rem;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
}
.contact-card__title { margin: 0 0 0.3rem; font-weight: 700; color: var(--ink); }
.contact-card a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 640;
  text-decoration: none;
}
.contact-card a:not(.btn):hover { text-decoration: underline; }
.contact-card .btn { justify-self: start; margin-top: 0.6rem; }
.split .faq { max-width: none; }

/* ---- CTA fija en móvil ---- */
.mobile-cta { display: none; }
@media (max-width: 720px) {
  .mobile-cta {
    position: fixed;
    inset: auto 0.6rem calc(0.6rem + env(safe-area-inset-bottom)) 0.6rem;
    z-index: 90;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 16px 30px -14px oklch(23% 0.04 265 / 0.45);
    transform: translateY(140%);
    visibility: hidden;
    transition: transform 0.45s var(--ease), visibility 0s 0.45s;
  }
  .mobile-cta.is-shown {
    transform: none;
    visibility: visible;
    transition: transform 0.45s var(--ease);
  }
  .mobile-cta .btn { justify-content: center; min-height: 48px; padding-inline: 1rem; }
  .mobile-cta .btn--ghost { border-color: var(--line-strong); }
  html:not(.js) .mobile-cta { display: none; }

  /* El botón flotante de WhatsApp sube por encima de la barra mientras está visible.
     Altura de la barra: 0.5rem × 2 de relleno + botón de 48px + 2px de borde. */
  body:has(.mobile-cta.is-shown) .wa-float {
    bottom: calc(0.6rem + 1rem + 48px + 2px + 0.75rem + env(safe-area-inset-bottom));
  }
}
@media (max-width: 720px) and (prefers-reduced-motion: no-preference) {
  .wa-float { transition: bottom 0.45s var(--ease), background-color 0.25s var(--ease); }
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__cell, .bento__cell--wide { grid-column: span 1; }
  .bento__cell--feature { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .split__aside { position: static; }
  .tiers { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero--landing { padding-top: calc(clamp(2.5rem, 8vw, 4rem) + 4.25rem); }
  .bento { grid-template-columns: 1fr; }
  .bento__cell--feature, .bento__cell--flip { flex-direction: column; }
  .bento__cell--feature .bento__body { align-self: stretch; }
  .hero__facts { flex-direction: column; gap: 0.6rem; }
}

/* ---- Movimiento reducido ---- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .site-header__bg,
  .site-header--morph .logo,
  .site-header--morph .logo__img,
  .site-header--morph .site-nav,
  .site-header--morph .site-nav a,
  .site-header--morph .site-nav a::after,
  .steps__dot,
  .mobile-cta,
  .mobile-cta.is-shown { transition: none; }
  html.js .hero__copy > *,
  html.js .demo [data-step],
  html.js .demo__wire,
  html.js .is-visible .demo [data-step],
  html.js .is-visible .demo__wire { opacity: 1; transform: none; animation: none; }
  html.js .is-visible .doc__scan { animation: none; }
  html.js .bento__cell.reveal { transition: none; }
}
