:root {
  --lila: #CFC6FB;
  --lima: #E8F76B;
  --tinta: #0A0A0B;
  --papel: #FFFFFF;
  --gris: #6E6B78;
  --hero-gradient: linear-gradient(150deg, #0A0A0B 0%, #171420 60%, #15140F 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: 'Inter', sans-serif;
}

a { text-decoration: none; }
button { font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 56px;
}

/* HEADER */
.site-header { background: var(--tinta); }
.header-inner {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.01em; color: var(--papel); }
.brand-name-sm { font-size: 17px; }

.header-nav { display: flex; align-items: center; gap: 28px; }
.nav-link { font-weight: 500; font-size: 14px; color: #B7B3C0; }

.btn { display: inline-block; }
.btn-primary {
  background: var(--lima);
  color: var(--tinta);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 12px;
  transition: background 150ms ease;
}
.btn-primary:hover { background: #D8EC55; }
.btn-secondary {
  background: transparent;
  border: 1px solid #3A3644;
  color: var(--papel);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border-radius: 12px;
  transition: color 150ms ease, border-color 150ms ease;
}
.btn-secondary:hover { color: var(--lila); border-color: var(--lila); }
.btn-sm { font-size: 13px; padding: 10px 18px; border-radius: 10px; }

/* HERO */
.hero { background: var(--hero-gradient); }
.hero-inner {
  padding: 76px 56px;
  display: flex;
  align-items: center;
  gap: 56px;
}
.hero-copy { flex: 1.1; display: flex; flex-direction: column; gap: 22px; }

.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  background: rgba(207,198,251,0.14);
  padding: 7px 14px;
  border-radius: 999px;
}
.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--lima); }
.badge span:last-child { font-weight: 600; font-size: 12px; letter-spacing: 0.03em; color: var(--lila); }

.hero h1 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--papel);
}

.hero p { margin: 0; font-weight: 400; font-size: 17px; line-height: 1.6; color: #A9A6B3; max-width: 460px; }

.hero-actions { display: flex; gap: 14px; margin-top: 6px; }

.hero-phone-wrap { flex: 0.9; display: flex; justify-content: center; }

.phone {
  width: 300px;
  border-radius: 34px;
  background: #0F0D14;
  border: 1px solid #2A2632;
  padding: 14px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}
.phone-screen {
  background: #E9E5F4;
  border-radius: 22px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 380px;
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #D8D2EA;
}
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--tinta);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-header-text { display: flex; flex-direction: column; }
.chat-name { font-weight: 700; font-size: 13px; color: #17141F; }
.chat-status { font-weight: 500; font-size: 11px; color: var(--gris); }

.bubble { font-size: 13px; line-height: 1.5; color: #17141F; padding: 10px 12px; }
.bubble-in { align-self: flex-start; max-width: 84%; background: var(--papel); border-radius: 4px 14px 14px 14px; }
.bubble-out { align-self: flex-end; max-width: 78%; background: var(--lila); border-radius: 14px 4px 14px 14px; font-weight: 500; }

.typing-dots { align-self: flex-start; margin-top: auto; display: flex; gap: 6px; padding-left: 4px; }
.typing-dots span { width: 6px; height: 6px; border-radius: 999px; background: #A9A6B3; }

/* AGENTES */
.agentes { background: var(--papel); }
.agentes-inner {
  padding: 76px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.agentes-heading { display: flex; flex-direction: column; gap: 10px; max-width: 600px; }
.kicker { font-weight: 600; font-size: 13px; letter-spacing: 0.08em; color: #A9A6B3; text-transform: uppercase; }
.agentes-heading h2 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.01em;
  color: var(--tinta);
}

.agentes-cards { display: flex; gap: 24px; }

.card {
  flex: 1;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card-andi { background: #F1EEF7; border: 1px solid #E7E4ED; }
.card-mesa { background: #FAFAFA; border: 1px dashed #DAD7E0; }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.card-icon-dark { background: var(--tinta); }
.card-icon-light { background: #E7E4ED; }

.badge-pill { font-weight: 700; font-size: 11px; letter-spacing: 0.04em; padding: 6px 12px; border-radius: 999px; text-transform: uppercase; }
.badge-pill-lima { background: var(--lima); color: var(--tinta); }
.badge-pill-muted { background: #E7E4ED; color: var(--gris); }

.card-title { display: flex; flex-direction: column; gap: 6px; }
.card-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; color: var(--tinta); }
.card-name-muted { color: #8B8796; }
.card-subtitle { font-weight: 600; font-size: 13px; color: var(--gris); }
.card-subtitle-muted { color: #A9A6B3; }

.card-desc { margin: 0; font-size: 14px; line-height: 1.6; color: #4A4753; }
.card-desc-muted { color: #8B8796; }

.card-link { margin-top: auto; color: var(--tinta); font-weight: 700; font-size: 14px; }
.card-link-muted { color: #A9A6B3; }
.card-link-cta {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--lima);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.card-link-cta:hover { background: var(--lima); color: var(--tinta); transform: translateY(-2px); }

/* FOOTER */
.site-footer { background: var(--tinta); }
.footer-inner {
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.footer-top { display: flex; align-items: center; justify-content: space-between; }
.footer-nav { display: flex; gap: 26px; }
.footer-nav a { font-weight: 500; font-size: 13px; color: #B7B3C0; }
.footer-divider { width: 100%; height: 1px; background: #211E29; }
.footer-copy { font-size: 12px; color: var(--gris); }

/* PÁGINA ANDI — SCROLLYTELLING */
.scrolly { background: linear-gradient(135deg, #CFC6FB 0%, #E8F76B 100%); }
.scrolly-inner { display: flex; align-items: flex-start; gap: 56px; padding-top: 64px; padding-bottom: 64px; }

.scrolly-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scrolly-step { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.scrolly-step h2 { margin: 0; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 32px; letter-spacing: -0.01em; color: var(--tinta); }
.scrolly-step p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--gris); max-width: 420px; }
/* Contraste sobre el degradado lila/lima: los párrafos de los pasos (no el hero) usan un gris más oscuro */
.scrolly-step:not(.scrolly-hero) p { color: #4A4753; }

.andi-headline {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 56px;
  letter-spacing: -0.01em;
  color: var(--tinta);
}
.scrolly-hero-subtitle { margin: 0; font-size: 17px; line-height: 1.6; color: var(--gris); max-width: 440px; }
.scrolly-hero .btn { width: fit-content; }

/* Resaltes de texto dentro del tutorial: tinta sobre el degradado, contrasta en la zona lila y en la lima */
.scrolly-step .hl { color: var(--tinta); font-weight: 700; }
.scrolly-step .hl-underline { color: var(--tinta); font-weight: 700; text-decoration: underline; }

/* Columna fija de celulares (ancho fijo: 2 celulares de 290px + gap + margen, cabe en el content-box de 1088px del .container) */
.scrolly-sticky {
  flex: 0 0 620px;
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.phone-tabs { display: none; }
.phone-tab {
  border: 1px solid #3A3644;
  background: transparent;
  color: var(--tinta);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.phone-tab.active { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }

.mode-toggle {
  display: flex;
  gap: 8px;
  background: #F1EEF7;
  padding: 5px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.mode-toggle.visible { opacity: 1; pointer-events: auto; }
.mode-toggle-btn {
  border: 1px solid #3A3644;
  background: transparent;
  color: var(--tinta);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}
.mode-toggle-btn:not(.active):hover { color: var(--lila); border-color: var(--lila); }
.mode-toggle-btn.active { background: var(--lima); color: var(--tinta); border-color: var(--lima); }

.phones-wrap { display: flex; gap: 16px; align-items: flex-start; justify-content: center; width: 100%; }
.phone-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  opacity: 0.9;
  transform: scale(1);
  transition: opacity 350ms ease, transform 350ms ease, flex 350ms ease, margin 350ms ease;
}
.phone-slot.is-focused { opacity: 1; transform: scale(1.03); }
.phone-label { font-weight: 600; font-size: 12px; color: var(--gris); margin-bottom: 4px; opacity: 0; transition: opacity 300ms ease; }
.phone-label.visible { opacity: 1; }

.demo-phone { width: 290px; padding: 10px; }
.demo-phone .phone-screen { height: 610px; min-height: 0; gap: 8px; }
.phone-with-banner { position: relative; }

/* Mensajes dentro del celular: SOLO auto-scroll por JS, sin scroll del usuario */
.chat-messages { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow: hidden; }
.demo-phone .bubble { font-size: 12px; }

.bubble-typing { display: flex; gap: 4px; align-items: center; padding: 10px 12px; }
.bubble-typing .dot { width: 5px; height: 5px; border-radius: 999px; background: #A9A6B3; animation: dotPulse 1s infinite ease-in-out; }
.bubble-typing .dot:nth-child(2) { animation-delay: 0.15s; }
.bubble-typing .dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

.msg-enter { animation: msgIn 350ms ease forwards; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Burbuja de confirmación: entrada con un pequeño "pop" para que se sienta como un alivio */
.msg-pop { animation: msgPop 380ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes msgPop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
/* El banner ya tiene su propio transform de centrado (translateX(-50%)); msgIn lo pisaría */
.phone-banner.msg-enter { animation: bannerIn 350ms ease forwards; }
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.msg-buttons-block { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.msg-buttons { display: flex; gap: 6px; }
.decision-note { display: flex; align-items: center; gap: 5px; color: var(--tinta); font-weight: 700; font-size: 10px; }
.decision-note svg { flex-shrink: 0; }
.msg-pill {
  -webkit-appearance: none;
  appearance: none;
  background: #FFFFFF;
  border: 1px solid #D8D2EA;
  color: #17141F;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease, opacity 200ms ease;
}
.msg-pill:hover:not(.tapped):not(.dimmed) { border-color: var(--lila); background: rgba(207, 198, 251, 0.18); }
.msg-pill:focus-visible { outline: 2px solid var(--lila); outline-offset: 2px; }
.msg-pill.tapped { background: var(--lima); border-color: var(--lima); color: var(--tinta); }
.msg-pill.dimmed { opacity: 0.5; }

.config-card { background: #FFFFFF; border: 1px solid #D8D2EA; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.config-card-title { font-size: 11px; font-weight: 700; color: #17141F; }
.config-card-options { display: flex; gap: 6px; }
.config-pill {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  border: 1px solid #D8D2EA;
  background: #F6F4FC;
  color: #17141F;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.config-pill:not(.active):hover { border-color: var(--lila); background: rgba(207, 198, 251, 0.25); }
.config-pill:focus-visible { outline: 2px solid var(--lila); outline-offset: 2px; }
.config-pill.active { background: var(--lima); border-color: var(--lima); color: var(--tinta); }

.mini-schedule { display: flex; flex-direction: column; gap: 2px; background: #FFFFFF; border-radius: 12px; padding: 8px; }
.mini-schedule-row { display: flex; gap: 2px; }
.mini-schedule-name { width: 34px; flex-shrink: 0; font-size: 8px; font-weight: 700; color: #17141F; display: flex; align-items: center; }
.mini-schedule-cell { flex: 1; height: 20px; border-radius: 4px; background: #F1EEF7; display: flex; align-items: center; justify-content: center; font-size: 6px; color: var(--gris); }
.mini-schedule-head .mini-schedule-cell { background: transparent; font-weight: 700; color: var(--gris); }
.mini-schedule-cell.off { background: transparent; }
.mini-schedule-cell.highlight-lila { background: var(--lila); color: #17141F; font-weight: 700; }
.mini-schedule-cell.highlight-lima { background: var(--lima); color: var(--tinta); font-weight: 700; }
/* Anillo sutil sobre el turno de Mateo en el paso "Camila revisa el cuadrante": llama la atención sin pisar el relleno lila/lima que ya usa el estado "después" */
.mini-schedule-cell.spotlight { box-shadow: 0 0 0 2px var(--tinta); }

/* [hidden] debe ganarle a .phone-banner{display:flex}, si no el atributo hidden queda sin efecto */
.phone-banner[hidden] { display: none; }
.phone-banner {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  background: #FFFFFF;
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 10px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  z-index: 2;
}
.phone-banner-icon { font-size: 16px; line-height: 1; }
.phone-banner-text { display: flex; flex-direction: column; gap: 2px; }
.phone-banner-text strong { font-size: 11px; color: #17141F; }
.phone-banner-text span { font-size: 10px; line-height: 1.4; color: #4A4753; }

/* PÁGINA ANDI — FEATURES (pausa dentro de la columna de texto del tutorial, entre el hero y el paso 1) */
.scrolly-cards { padding: 24px 0 40px; min-height: 0; }
.scrolly-cards .feature-cards { flex-direction: column; gap: 16px; }
.feature-cards { display: flex; gap: 24px; width: 100%; }
.feature-card {
  flex: 1;
  background: #F1EEF7;
  border: 1px solid #E7E4ED;
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 14px;
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #E3DDFA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.feature-title { margin: 0; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 18px; color: var(--tinta); }
.feature-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--gris); }

/* Animación de "split" del celular (solo desktop) */
@media (min-width: 900px) {
  .phones-wrap.solo .phone-slot[data-phone="jefe"] {
    flex: 0 0 0;
    opacity: 0;
    transform: translateX(-16px);
    overflow: hidden;
    margin: 0;
    pointer-events: none;
  }
  .phones-wrap.solo .phone-slot[data-phone="camila"] { margin: 0 auto; }
}

/* RESPONSIVE */
@media (max-width: 899px) {
  .hero-inner { flex-direction: column; align-items: stretch; }
  .agentes-cards { flex-direction: column; }
  .feature-cards { flex-direction: column; }

  .scrolly-inner { flex-direction: column-reverse; gap: 24px; }
  .scrolly-sticky {
    position: sticky;
    top: 84px;
    flex-basis: auto;
    width: 100%;
    z-index: 5;
    background: var(--papel);
    padding-bottom: 16px;
    padding-top: 16px;
  }
  .scrolly-step { min-height: auto; padding: 40px 0; }
  .phone-tabs { display: flex; gap: 8px; }
  .phone-slot { display: none; }
  .phone-slot.tab-active { display: flex; }
  .demo-phone { width: min(240px, 70vw); }
  .demo-phone .phone-screen { height: 46vh; }
}

@media (max-width: 599px) {
  .container { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 40px; }
  .andi-headline { font-size: 40px; }
  .header-nav .nav-link { display: none; }
}

/* ACCESIBILIDAD */
@media (prefers-reduced-motion: reduce) {
  .msg-enter { animation: none; opacity: 1; transform: none; }
  .msg-pop { animation: none; opacity: 1; transform: none; }
  .phone-banner.msg-enter { transform: translateX(-50%); }
  .bubble-typing .dot { animation: none; }
  .phone-slot, .phone-banner, .phone-label, .mode-toggle,
  .btn-primary, .btn-secondary, .mode-toggle-btn, .phone-tab,
  .msg-pill, .config-pill {
    transition: none;
  }
}
