/* Mate Digital — estilos compartidos (landing + páginas legales).
   Layout: hero en dos columnas (texto | escena celular↔sistema); bandas de contenido a una
   columna de lectura; páginas legales en .doc. Lo memorable es la escena del hero: todo lo demás
   queda quieto y sobrio. */
:root {
  --bg: #eef1ea;          /* blanco mineral verdoso */
  --surface: #f9faf6;
  --ink: #14201a;         /* tinta verde casi negra */
  --muted: #55634f;
  --line: #d3dacb;
  --yerba: #3e6b2e;
  --yerba-deep: #2a4a1f;
  --yerba-soft: #dde8d3;
  --calabaza: #7a4b2a;    /* marrón del mate */
  --bombilla: #b98c34;    /* bronce, solo detalles */
  --chat-in: #ffffff;
  --chat-out: #d7ecc9;
  --chat-bg: #e7ebe1;
  --font-display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111811; --surface: #172017; --ink: #e3eadc; --muted: #9eab95; --line: #2a3527;
    --yerba: #93c47a; --yerba-deep: #b8dca4; --yerba-soft: #1f2e1a; --calabaza: #d39a6a; --bombilla: #d9ad55;
    --chat-in: #1e281c; --chat-out: #2c4524; --chat-bg: #141c13;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font-body); }
img, svg { max-width: 100%; }
a { color: var(--yerba); text-underline-offset: 3px; }
a:hover { color: var(--yerba-deep); }
:focus-visible { outline: 2px solid var(--yerba); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Cabecera */
.top { padding-block: 22px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 21px/1 var(--font-display); letter-spacing: -.015em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand:hover { color: var(--ink); }
.top nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: 40px 88px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: center; }
.hero-text { display: grid; gap: 22px; align-content: start; }
.hero-text .where { margin: 0; color: var(--calabaza); font-size: 15px; font-weight: 500; }
h1 { font: 700 clamp(38px, 5.4vw, 64px)/1.02 var(--font-display); letter-spacing: -.03em; margin: 0; text-wrap: balance; font-variation-settings: "opsz" 96; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 46ch; margin: 0; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1.5px solid var(--yerba); transition: background-color .18s ease, color .18s ease, transform .18s ease; }
.btn.primary { background: var(--yerba); color: var(--surface); }
.btn.primary:hover { background: var(--yerba-deep); border-color: var(--yerba-deep); color: var(--surface); transform: translateY(-1px); }
.btn.ghost { color: var(--yerba); }
.btn.ghost:hover { background: var(--yerba-soft); }

/* Escena: celular ↔ Meta ↔ sistema */
.scene { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1.15fr); align-items: center; min-height: 430px; }
.device { background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; overflow: hidden; height: 400px; }
.phone { border-radius: 30px; border-width: 6px; border-color: var(--ink); box-shadow: 0 30px 60px -38px rgba(20, 32, 26, .55); }
.panel { border-radius: 12px; box-shadow: 0 30px 60px -42px rgba(20, 32, 26, .45); }
.dev-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.dev-head .av { width: 28px; height: 28px; border-radius: 50%; background: var(--yerba-soft); color: var(--yerba); display: grid; place-items: center; font: 700 12px var(--font-display); flex: none; }
.dev-head b { display: block; font-size: 13.5px; line-height: 1.2; }
.dev-head small { color: var(--muted); font-size: 11.5px; }
.panel .dev-head { justify-content: space-between; }
.panel .dev-head .title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.estado { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: var(--yerba-soft); color: var(--yerba); white-space: nowrap; transition: background-color .3s, color .3s; }
.estado.pausa { background: color-mix(in srgb, var(--bombilla) 22%, transparent); color: var(--calabaza); }
.chat { background: var(--chat-bg); padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; }
.panel .chat { background: var(--surface); }
.msg { max-width: 88%; padding: 7px 10px 5px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.msg small { display: block; text-align: right; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.msg.in { background: var(--chat-in); border-bottom-left-radius: 3px; align-self: flex-start; box-shadow: 0 1px 0 var(--line); }
.msg.out { background: var(--chat-out); border-bottom-right-radius: 3px; align-self: flex-end; }
.panel .msg.in { background: var(--bg); box-shadow: none; }
.panel .msg.out { background: var(--yerba-soft); }
.who { display: block; font-size: 10.5px; font-weight: 600; color: var(--yerba); margin-bottom: 1px; }
.who.persona { color: var(--calabaza); }
.typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: 9px 11px; border-radius: 12px; background: var(--yerba-soft); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--yerba); opacity: .4; animation: tip 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tip { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.wire { position: relative; height: 100%; display: grid; place-items: center; }
.wire::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--line); }
.node { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); display: grid; place-items: center; font: 700 10.5px var(--font-display); color: var(--muted); text-align: center; line-height: 1; }
.pulse { position: absolute; top: calc(50% - 5px); left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bombilla); opacity: 0; z-index: 2; }
.pulse.to-right { animation: viajeDer .9s ease-in-out forwards; }
.pulse.to-left { animation: viajeIzq .9s ease-in-out forwards; }
@keyframes viajeDer { 0% { left: -6px; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 4px); opacity: 0; } }
@keyframes viajeIzq { 0% { left: calc(100% - 4px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: -6px; opacity: 0; } }
.node.ping { animation: ping .5s ease-out; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bombilla) 55%, transparent); border-color: var(--bombilla); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* Aparición de mensajes en la escena (solo con JS y sin reduced-motion) */
.anim .chat > * { display: none; }
.anim .chat > .on { display: block; animation: entra .35s cubic-bezier(.2, .8, .3, 1.2) both; }
.anim .chat > .typing.on { display: inline-flex; }
@keyframes entra { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.scene-cap { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; min-height: 1.5em; transition: opacity .3s; }

/* Secciones */
section.band { padding-block: 80px; border-top: 1px solid var(--line); }
h2 { font: 700 clamp(28px, 3.6vw, 40px)/1.1 var(--font-display); letter-spacing: -.022em; margin: 0 0 14px; text-wrap: balance; }
.sub { color: var(--muted); max-width: 58ch; margin: 0 0 44px; font-size: 18px; }

.hace { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.hace > div { display: grid; gap: 8px; align-content: start; }
.hace h3 { font: 600 21px/1.25 var(--font-display); margin: 0; letter-spacing: -.01em; }
.hace p { margin: 0; color: var(--muted); font-size: 16px; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: paso; padding: 0; margin: 0; }
.steps li { list-style: none; display: grid; gap: 6px; align-content: start; }
.steps li::before { counter-increment: paso; content: counter(paso); font: 700 44px/1 var(--font-display); color: var(--yerba); letter-spacing: -.03em; }
.steps b { font-size: 17px; }
.steps span { color: var(--muted); font-size: 15.5px; }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.compare > div { padding: 28px 30px; }
.compare > div + div { border-left: 1px solid var(--line); }
.compare h3 { margin: 0 0 14px; font: 600 19px var(--font-display); }
.compare ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: 16px; }
.compare .ours { background: var(--yerba-soft); }
.compare .ours h3 { color: var(--yerba-deep); }
.compare .ours ul { color: var(--ink); }

.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.contact dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 22px; font-size: 17px; }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* Pie */
footer.foot { border-top: 1px solid var(--line); padding-block: 28px 40px; font-size: 14px; color: var(--muted); }
footer.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer.foot a { color: var(--muted); }

/* Páginas legales */
.doc { max-width: 720px; padding-block: 24px 72px; }
.doc h1 { font-size: clamp(30px, 4.5vw, 44px); margin-bottom: 10px; }
.doc .meta { font-size: 14px; color: var(--muted); margin: 0 0 36px; }
.doc h2 { font-size: 22px; margin: 40px 0 10px; }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-size: 13px; font-weight: 600; color: var(--muted); }
.table-scroll { overflow-x: auto; }
.callout { background: var(--yerba-soft); border-radius: 14px; padding: 18px 20px; margin: 20px 0; }
.callout p { margin: 0; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hace { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare { grid-template-columns: 1fr; }
  .compare > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .contact { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 46px auto; min-height: 0; }
  .device { height: 300px; }
  .wire::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--line); }
  .pulse.to-right, .pulse.to-left { left: calc(50% - 5px); }
  .pulse.to-right { animation-name: viajeAbajo; } .pulse.to-left { animation-name: viajeArriba; }
  @keyframes viajeAbajo { 0% { top: -6px; opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: calc(100% - 4px); opacity: 0; } }
  @keyframes viajeArriba { 0% { top: calc(100% - 4px); opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: -6px; opacity: 0; } }
  .steps { grid-template-columns: 1fr; }
  .top nav { gap: 14px; font-size: 14px; }
  section.band { padding-block: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Viñetas de "Qué hacemos" ----------
   Estado final por defecto (sin JS o con reduced-motion se ve completo).
   Con html.revela arrancan ocultas y se animan al recibir .visto. */
.hace .vin { margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 13px; min-height: 148px; display: grid; gap: 8px; align-content: start; }
.vf-head { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.vf-head span { color: var(--muted); }
.vf-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.vf-row span:last-child { color: var(--ink); text-align: right; }
.vf-total { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.sello { display: inline-block; font: 700 15px var(--font-display); color: var(--yerba) !important; border: 2px solid var(--yerba); border-radius: 6px; padding: 0 7px; transform: rotate(-6deg); }
.vin-chat .m { max-width: 85%; padding: 6px 9px; border-radius: 10px; }
.vin-chat .m.in { background: var(--bg); align-self: start; justify-self: start; }
.vin-chat .m.out { background: var(--yerba-soft); justify-self: end; }
.vin-chat .quien { display: block; font-size: 10.5px; font-weight: 600; color: var(--yerba); }
.deriva { justify-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--calabaza); background: color-mix(in srgb, var(--bombilla) 16%, transparent); padding: 4px 10px; border-radius: 999px; }
.deriva svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.vp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-weight: 600; }
.vp-estado { position: relative; display: inline-grid; font-size: 12px; font-weight: 600; }
.vp-estado > span { grid-area: 1 / 1; padding: 3px 10px; border-radius: 999px; text-align: center; }
.vp-estado .antes { background: color-mix(in srgb, var(--bombilla) 20%, transparent); color: var(--calabaza); opacity: 0; }
.vp-estado .despues { background: var(--yerba); color: var(--surface); }
.vp-noti { background: var(--chat-out); border-radius: 10px; border-bottom-right-radius: 3px; padding: 8px 10px; justify-self: end; max-width: 90%; }
.vp-noti b { display: block; font-size: 10.5px; color: var(--yerba-deep); }

.revela .hace:not(.visto) .vf-row,
.revela .hace:not(.visto) .m,
.revela .hace:not(.visto) .deriva,
.revela .hace:not(.visto) .vp-noti { opacity: 0; transform: translateY(6px); }
.revela .hace:not(.visto) .sello { opacity: 0; transform: rotate(-6deg) scale(1.8); }
.revela .hace:not(.visto) .vp-estado .antes { opacity: 1; }
.revela .hace:not(.visto) .vp-estado .despues { opacity: 0; transform: scale(.8); }
.revela .hace .vf-row, .revela .hace .m, .revela .hace .deriva, .revela .hace .vp-noti { transition: opacity .4s ease, transform .4s cubic-bezier(.2, .8, .3, 1.2); }
.revela .hace .sello { transition: opacity .3s ease, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.revela .hace .vp-estado > span { transition: opacity .3s ease, transform .3s ease; }
.visto .vf-row:nth-of-type(2) { transition-delay: .1s; }
.visto .vf-row:nth-of-type(3) { transition-delay: .35s; }
.visto .vf-total { transition-delay: .6s; }
.visto .sello { transition-delay: 1s; }
.visto .m.in { transition-delay: .2s; }
.visto .m.out { transition-delay: .9s; }
.visto .deriva { transition-delay: 1.6s; }
.visto .vp-estado .antes { transition-delay: 1.1s; }
.visto .vp-estado .despues { transition-delay: 1.1s; }
.visto .vp-noti { transition-delay: 1.7s; }

/* ---------- Pasos con íconos y línea de progreso ---------- */
.steps { position: relative; }
.steps li::before { content: none; }
.steps .ico { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); display: grid; place-items: center; color: var(--yerba); position: relative; z-index: 1; margin-bottom: 10px; transition: border-color .3s, background-color .3s; }
.steps .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.steps::before, .steps::after { content: ""; position: absolute; top: 26px; left: 26px; right: calc(25% - 26px); height: 2px; background: var(--line); }
.steps::after { background: var(--yerba); transform-origin: left; transform: scaleX(1); }
.steps li:last-child .ico { background: var(--yerba); border-color: var(--yerba); color: var(--surface); }
.revela .steps:not(.visto)::after { transform: scaleX(0); }
.revela .steps::after { transition: transform 1.6s cubic-bezier(.6, 0, .2, 1) .2s; }
.revela .steps:not(.visto) li:last-child .ico { background: var(--surface); border-color: var(--line); color: var(--yerba); }
.revela .steps li:last-child .ico { transition-delay: 1.7s; }

/* ---------- Preguntas frecuentes ---------- */
.faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.faq { display: grid; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 2px; font: 600 18px/1.35 var(--font-display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 12px; height: 12px; border-right: 2px solid var(--yerba); border-bottom: 2px solid var(--yerba); transform: rotate(45deg) translate(-3px, -3px); transition: transform .25s ease; }
.faq details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq summary:hover { color: var(--yerba); }
.faq details p { margin: 0; padding: 0 2px 20px; color: var(--muted); max-width: 62ch; }
.faq details[open] p { animation: abre .3s ease; }
@keyframes abre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Footer completo (solo landing) ---------- */
.foot-full { position: relative; overflow: hidden; padding-block: 56px 8px; background: var(--surface); }
footer.foot-full .foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 36px; justify-content: initial; }
.foot-brand { display: grid; gap: 14px; align-content: start; justify-items: start; }
.foot-brand p { margin: 0; max-width: 32ch; font-size: 15px; }
.foot-full h4 { margin: 0 0 12px; font: 600 15px var(--font-display); color: var(--ink); }
footer.foot-full nav { display: grid; gap: 8px; align-content: start; }
footer.foot-full nav a { text-decoration: none; }
.foot-full nav a:hover { color: var(--yerba); }
.foot-full p { margin: 0 0 6px; overflow-wrap: anywhere; }
.btn-sm { padding: 9px 16px; font-size: 14px; }
footer.foot-full .foot-legal { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin-top: 44px; padding-block: 18px; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 900px) {
  .faq-wrap { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  footer.foot-full .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
  .steps::before, .steps::after { display: none; }
}
@media (max-width: 560px) {
  footer.foot-full .foot-grid { grid-template-columns: minmax(0, 1fr); }
  }
footer.foot-full a.brand { color: var(--ink); }
