:root {
  --aubergine: #2a1f3d;
  --wax: #b0382c;
  --paper: #f3ecdf;
  --apricot: #e8955a; /* accent only, never text (2.0:1 on paper) */
  --ink-soft: #5a4f6b;
  --line: #ddd2c0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--aubergine);
  font: 400 1.125rem/1.6 Lato, system-ui, sans-serif;
}

a { color: var(--wax); }

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 900; }
h3 { font-size: 1.25rem; font-weight: 700; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.3rem; }
.top nav { display: flex; align-items: center; gap: 24px; }
.top nav a:not(.btn) { color: inherit; text-decoration: none; }

.btn {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--aubergine);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--aubergine);
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 8px 18px; }
.btn-ghost { background: transparent; color: var(--aubergine); }
.btn-light { background: var(--paper); color: var(--aubergine); border-color: var(--paper); }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 24px;
  max-width: 1120px;
  min-height: calc(100vh - 90px);
  margin: 0 auto;
  padding: 24px;
}
.eyebrow { color: var(--wax); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 16px; }
.lead { font-size: 1.3rem; color: var(--ink-soft); max-width: 32ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-bird { width: 100%; max-width: 520px; justify-self: center; overflow: visible; }

.steps, .prose, .story, .contact, .channels, .features { max-width: 1120px; margin: 0 auto; padding: 96px 24px; }
.channels h2, .features h2, .steps h2 { max-width: 20ch; }

.channel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.channel {
  background: #fbf6ee;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px;
  /* Hover uses `translate` so it never fights GSAP, which owns `transform` during the reveal. */
  transition: translate 0.25s ease, box-shadow 0.25s ease;
}
.channel:hover { translate: 0 -6px; box-shadow: 0 20px 40px -24px rgba(42, 31, 61, 0.5); }
.channel h3 { margin-top: 18px; }
.channel p { color: var(--ink-soft); font-size: 1rem; margin: 0; }
.icon { width: 44px; height: 44px; padding: 9px; border-radius: 14px; background: var(--aubergine); fill: none; stroke: var(--paper); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.channel:first-child .icon { background: var(--wax); }

.feature-list { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.feature-list li { border-top: 2px solid var(--aubergine); padding-top: 18px; }
.feature-list p { color: var(--ink-soft); font-size: 1rem; margin: 0; }
/* "Cómo funciona": one sticky stage; the scroll length drives the active step (main.js). */
.steps-stage { display: grid; grid-template-columns: 1fr 360px; gap: 64px; align-items: center; }
.steps-copy h2 { font-size: clamp(2rem, 4vw, 3rem); }
.step-list { list-style: none; padding: 0; margin: 0; }
.step-list li { margin-bottom: 40px; }
.step-list .num { font-size: 3rem; line-height: 1; margin-bottom: 12px; }
.step-list h3 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
.step-list li p { color: var(--ink-soft); font-size: 1.2rem; max-width: 34ch; }
.prose p { color: var(--ink-soft); }
.steps-progress { display: none; }

.js .steps { padding-top: 0; padding-bottom: 0; }
.js .steps-scroll { height: 400vh; }
.js .steps-stage { position: sticky; top: 0; height: 100vh; }
.js .step-list { position: relative; min-height: 260px; }
.js .step-list li { position: absolute; inset: 0 0 auto 0; margin: 0; opacity: 0; transform: translateY(24px); transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.js .step-list li.active { opacity: 1; transform: none; }
.js .steps-progress { display: grid; grid-template-columns: repeat(4, auto) 1fr; align-items: center; gap: 14px; margin: 28px 0 32px; font-weight: 900; font-size: 0.9rem; color: var(--line); }
.steps-progress span { transition: color 0.3s ease; }
.steps-progress span.on { color: var(--wax); }
.steps-progress i { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.steps-progress b { display: block; height: 100%; width: 0; background: var(--wax); }

/* Phone mock-up: illustrative only, brand colors, not WhatsApp's. */
.phone-wrap { position: relative; }
.phone {
  position: relative;
  height: 520px;
  border-radius: 40px;
  border: 10px solid var(--aubergine);
  background: var(--aubergine);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(42, 31, 61, 0.45);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
}
.phone-top { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; background: var(--aubergine); color: var(--paper); }
.phone-top small { display: block; opacity: 0.7; font-size: 0.75rem; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--wax); font-weight: 900; font-size: 0.8rem; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; flex: 1; min-height: 0; overflow: hidden; background: #eadfcc; }

.pill, .bubble, .status { transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2,.8,.2,1); }
.pill { align-self: center; padding: 5px 12px; border-radius: 999px; background: var(--paper); font-size: 0.75rem; font-weight: 700; }
.bubble { max-width: 85%; padding: 8px 12px 6px; border-radius: 14px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.08); }
.bubble p { margin: 0; line-height: 1.4; }
.bubble.out { align-self: flex-end; background: #fbe0cb; border-bottom-right-radius: 4px; }
.bubble.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--ink-soft); }
.chip { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; background: var(--aubergine); color: var(--paper); font-size: 0.7rem; font-weight: 700; }
.status { align-self: flex-end; font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); margin-top: -6px; }
.status span { display: none; }
.phone[data-ticks="sent"] [data-for="sent"],
.phone[data-ticks="delivered"] [data-for="delivered"],
.phone[data-ticks="read"] [data-for="read"] { display: inline; }

.ticks { width: 18px; height: 11px; fill: none; stroke: #8a8196; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ticks .t2 { opacity: 0; transition: opacity 0.3s ease; }
.ticks path { transition: stroke 0.3s ease; }
.phone[data-ticks="delivered"] .t2, .phone[data-ticks="read"] .t2 { opacity: 1; }
.phone[data-ticks="read"] .ticks path { stroke: #2f8fd8; }

/* What each step shows; states are cumulative classes s1..s4. Hidden items take no space. */
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.phone .connect-card, .phone .connected, .phone .template, .phone .status,
.phone .reply, .phone .answer, .phone .window { display: none; }
.phone.s1:not(.s2) .connect-card { display: flex; }
.phone.s2 .connected, .phone.s2 .template, .phone.s3 .status,
.phone.s4 .reply, .phone.s4 .answer, .phone.s4 .window { display: block; animation: pop 0.45s cubic-bezier(.2,.8,.2,1) both; }
.phone.s2 .connected { align-self: center; }
.phone.s4 .answer { align-self: flex-end; animation-delay: 0.5s; }
.phone.s4 .window { align-self: center; animation-delay: 0.9s; }
.phone.s2:not(.s3) .template { outline: 2px dashed var(--wax); outline-offset: 3px; }
.phone.s2:not(.s3) .template .meta { visibility: hidden; }
.phone.s3 .chip { display: none; }
.phone.s4 .chat { justify-content: flex-end; } /* newest messages stay in view */

/* Step 1 fills the screen with the connection itself. */
.connect-card {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: auto 8px;
  padding: 28px 18px;
  border-radius: 20px;
  background: #fbf6ee;
  box-shadow: 0 12px 30px -18px rgba(42, 31, 61, 0.5);
  animation: pop 0.45s cubic-bezier(.2,.8,.2,1) both;
}
.connect-title { font-weight: 900; font-size: 1.15rem; }
.connect-number { color: var(--ink-soft); }
.connect-btn { margin-top: 14px; padding: 10px 20px; border-radius: 999px; background: var(--aubergine); color: var(--paper); font-weight: 700; font-size: 0.9rem; transition: background 0.3s ease; }
.connect-btn .done { display: none; }
.phone.linked .connect-btn { background: var(--wax); }
.phone.linked .connect-btn .todo { display: none; }
.phone.linked .connect-btn .done { display: inline; }

.courier { position: absolute; width: 84px; left: 0; top: 0; opacity: 0; pointer-events: none; overflow: visible; }

.reveal { will-change: transform; }

.num { display: block; color: var(--wax); font-weight: 900; font-size: 1rem; margin-bottom: 8px; }

.prose { max-width: 780px; }
.prose h2:not(:first-child) { margin-top: 56px; }

.story { max-width: 780px; border-left: 6px solid var(--apricot); padding-left: 32px; margin-top: 24px; margin-bottom: 24px; }
.story p { font-size: 1.3rem; }

.contact {
  max-width: none;
  background: var(--aubergine);
  color: var(--paper);
  text-align: center;
}
.contact p { max-width: 40ch; margin: 0 auto 28px; opacity: 0.85; }

.foot { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; font-size: 0.9rem; color: var(--ink-soft); }
.foot p { margin: 4px 0; }

@media (max-width: 1000px) and (min-width: 761px) {
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 8px; }
  .hero-bird { grid-row: 1; max-width: 260px; }
  .steps-stage { grid-template-columns: 1fr; gap: 0; }
  .channel-grid, .feature-list { grid-template-columns: 1fr; }
  .js .steps-stage { height: 100svh; align-content: start; padding-top: 12px; gap: 12px; }
  .phone-wrap { grid-row: 1; }
  .phone { height: min(48svh, 400px); max-width: 290px; margin: 0 auto; border-width: 7px; font-size: 0.8rem; }
  .steps-copy .eyebrow { margin-bottom: 4px; }
  .steps-copy h2 { font-size: 1.4rem; margin-bottom: 0; }
  .js .steps-progress { margin: 12px 0 16px; }
  .step-list .num { display: none; }
  .step-list h3 { font-size: 1.3rem; }
  .step-list li p { font-size: 1rem; }
  .top nav a:not(.btn) { display: none; }
  .steps, .prose, .story, .contact, .channels, .features { padding-top: 64px; padding-bottom: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
