/* Mecai — web pública. Ámbar = alerta, verde azulado = está bien. */
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/ahn-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/ahn-600.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/ahn-800.woff2") format("woff2"); }
:root {
  --paper: #F1F3EE;
  --paper-2: #E4E9E3;
  --ink: #18303A;
  --muted: #4F6168;
  --line: #CDD6CF;
  --alert: #F5B800;
  --alert-ink: #5A4300;
  --ok: #0E6B5C;
  --ok-soft: #D7E9E3;
  --white: #FFFFFF;
  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  font-size: 1.1875rem;          /* 19px: la leen hijos de 40–65 años */
  line-height: 1.55;
}

h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.4vw, 4.75rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--alert); outline-offset: 3px; border-radius: 4px; }

/* ---------- Cabecera ---------- */
.top {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  max-width: 76rem; margin: 0 auto;
}
.brand {
  font-weight: 800; font-size: 1.9rem; letter-spacing: -0.04em; text-decoration: none;
  line-height: 1; display: inline-flex; align-items: baseline;
}
.brand .mark { align-self: center; width: 2.4rem; height: 2.4rem; margin-right: 0.55rem; border-radius: 0.6rem; }
.nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: 1rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 600;
  background: var(--ink); color: var(--paper);
  padding: 0.85rem 1.4rem; border-radius: 999px;
  transition: background-color .15s;
}
.btn:hover { background: #0D2129; }
.btn-small { padding: 0.55rem 1.1rem; font-size: 1rem; }
.btn-light { background: var(--alert); color: var(--ink); }
.btn-light:hover { background: #FFC81F; }
.link { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.link-light { color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; }
[hidden] { display: none !important; }

/* ---------- Secciones (un solo lugar define el espaciado) ---------- */
main > section {
  max-width: 76rem; margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
}
main > section > h2 { margin-bottom: 2rem; }

/* ---------- Hero ---------- */
main > .hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
  padding-top: clamp(2rem, 5vw, 4rem);
}
.hero-copy h1 { max-width: 11ch; }
.lead { margin: 1.6rem 0 2rem; max-width: 32rem; font-size: 1.3rem; color: var(--muted); }
.note { margin-top: 1.4rem; font-size: 1rem; color: var(--muted); }

.phone { margin: 0; justify-self: center; width: min(100%, 22rem); }
.screen {
  background: var(--ink); border-radius: 2.4rem; padding: 1.4rem 1rem 1.6rem;
  min-height: 27rem;
  box-shadow: 0 0 0 10px #0D2129, 0 30px 60px -30px rgba(24, 48, 58, .55);
}
.screen-time { color: var(--paper); text-align: center; font-weight: 800; font-size: 2.6rem; letter-spacing: -0.03em; margin: 0.6rem 0 1.4rem; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.msg {
  display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.6rem;
  background: var(--white); color: var(--ink); border-radius: 1.1rem; padding: 0.8rem 0.95rem;
  font-size: 0.95rem; line-height: 1.35;
}
.msg-head { font-weight: 800; display: flex; align-items: center; gap: 0.45rem; }
.msg-body { grid-column: 1 / -1; color: var(--muted); }
.msg-time { grid-row: 1; grid-column: 2; font-size: 0.8rem; color: var(--muted); }
.msg.alert { background: var(--alert); }
.msg.alert .msg-body, .msg.alert .msg-time { color: var(--alert-ink); }
.msg.ok { background: var(--ok-soft); }
.phone figcaption { margin-top: 1.4rem; text-align: center; font-size: 0.9rem; color: var(--muted); }

.pip { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; flex: none; }
.msg.alert .pip, .pip-alert { background: var(--ink); }
.msg.alert .pip { animation: pulse 1.2s ease-in-out infinite; }
.msg.ok .pip, .pip-ok { background: var(--ok); }
.pip-alert { background: var(--alert); box-shadow: 0 0 0 2px var(--ink) inset; }
.pip-quiet { background: var(--line); box-shadow: 0 0 0 2px var(--muted) inset; }
@keyframes pulse { 50% { transform: scale(1.5); opacity: .5; } }

/* Secuencia: los avisos llegan de a uno (solo con JS y sin "reducir movimiento") */
.js .feed .msg { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.js .feed .msg.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .feed .msg { opacity: 1; transform: none; transition: none; }
  .msg.alert .pip { animation: none; }
}

/* ---------- Cómo funciona (es una secuencia real: va numerada) ---------- */
main > .band { max-width: none; background: var(--paper-2); }
/* Bandas a lo ancho: el contenido se alinea con el resto de las secciones */
main > .band > *, main > .cta > * { max-width: calc(76rem - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.steps {
  list-style: none; padding: 0; counter-reset: s;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem;
}
.steps li { counter-increment: s; border-top: 3px solid var(--ink); padding-top: 1.2rem; }
.steps li::before {
  content: counter(s); display: block; font-weight: 800; font-size: 3.2rem; line-height: 1;
  letter-spacing: -0.04em; margin-bottom: 0.8rem; color: var(--ink);
}
.steps li:nth-child(2) { border-top-color: var(--alert); }
.steps li:nth-child(3) { border-top-color: var(--ok); }
.steps h3 { margin-bottom: 0.6rem; }
.steps p { color: var(--muted); max-width: 30ch; }

/* ---------- Escalada: lo que pasa cuando suena la alerta ---------- */
.esc-lead { color: var(--muted); max-width: var(--measure); margin: -1rem 0 2rem; }
.esc { list-style: none; margin: 0; padding: 0; max-width: 52rem; display: grid; gap: 0; }
.esc li { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; padding: 1.1rem 0 1.1rem 1.4rem; border-left: 3px solid var(--line); position: relative; }
.esc li::before { content: ""; position: absolute; left: -0.55rem; top: 1.45rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--line); }
.esc li:first-child::before { border-color: var(--alert); background: var(--alert); }
.esc li:last-child { border-left-color: var(--ok); }
.esc li:last-child::before { border-color: var(--ok); background: var(--ok); }
.esc .when { font-weight: 800; }
.esc .what { color: var(--muted); }

/* ---------- Qué te avisa ---------- */
.list { margin: 0; max-width: 52rem; }
.row {
  display: grid; grid-template-columns: 16rem 1fr; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.row:first-child { border-top: 1px solid var(--line); }
.row dt { font-weight: 800; display: flex; align-items: center; gap: 0.7rem; }
.row dd { margin: 0; color: var(--muted); }
.row.soon dt { color: var(--muted); }
.row em { font-style: normal; font-weight: 600; color: var(--ok); }

/* ---------- Casa / ELEAM ---------- */
main > .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 5rem); }
.split h2 { margin-bottom: 1.2rem; }
.split p { color: var(--muted); max-width: var(--measure); }
.ticks { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 0.7rem; }
.ticks li { padding-left: 2rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 0.15rem; top: 0.42em; width: 0.9rem; height: 0.5rem;
  border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg);
}

/* ---------- Privacidad ---------- */
.privacy p { max-width: var(--measure); font-size: 1.3rem; }
main > .privacy > h2 { margin-bottom: 1.2rem; }

/* ---------- Preguntas ---------- */
.faq details { max-width: 48rem; border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.15rem 2.5rem 1.15rem 0; font-weight: 600; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%);
  font-weight: 800; font-size: 1.6rem; line-height: 1; transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 1.3rem; max-width: var(--measure); }

/* ---------- Contacto ---------- */
main > .cta { max-width: none; background: var(--ink); color: var(--paper); }
.cta p { margin-bottom: 2rem; color: #C9D3D6; }
main > .cta > h2, main > .cta > p { padding-right: max(0px, calc(min(100%, 76rem - 2 * var(--gutter)) - 40rem)); }

/* ---------- Pie ---------- */
.foot {
  max-width: 76rem; margin: 0 auto; padding: 2rem var(--gutter) 3rem;
  font-size: 0.95rem; color: var(--muted); display: grid; gap: 0.5rem;
}

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  main > .hero, main > .split { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .esc li { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .nav { display: none; }
  .top .btn-small { margin-left: auto; }
  main > .cta > h2, main > .cta > p { padding-right: 0; }
}

/* ---------- Páginas de texto (privacidad) ---------- */
.doc { max-width: 46rem; margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) var(--gutter) 4rem; }
.doc h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.6rem; }
.doc h2 { font-size: 1.35rem; margin: 2.2rem 0 0.6rem; letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--ink); }
.doc p + p, .doc ul + p { margin-top: 0.8rem; }
.doc ul { padding-left: 1.3rem; margin: 0.6rem 0 0; display: grid; gap: 0.4rem; }
.doc .updated { color: var(--muted); font-size: 1rem; }
.foot a, .privacy a { color: inherit; text-underline-offset: 4px; }
.top-cta { margin-left: auto; }

/* ---------- Ilustraciones ---------- */
.steps .ill { display: block; width: 100%; max-width: 15rem; height: auto; margin: 0 0 1.2rem; }
.ill-wide { display: block; width: 100%; max-width: 20rem; height: auto; margin: 0 0 1.6rem; }
@media (max-width: 860px) { .steps .ill { max-width: 12rem; } }
.steps li { display: flex; flex-direction: column; border-top: 0; padding-top: 0; }
.steps .ill { order: -1; }
.steps li::before { border-top: 3px solid var(--ink); padding-top: 1.2rem; }
.steps li:nth-child(2)::before { border-top-color: var(--alert); }
.steps li:nth-child(3)::before { border-top-color: var(--ok); }
.hero-copy h1 .kicker {
  display: block; font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.4;
  color: var(--ok); margin-bottom: 1rem; max-width: 32rem;
}
