/* ============================================================
   FRANCISCA BUSTOS — Psicología Perinatal
   Sistema visual v2 — auditado para audiencia perinatal
   Prioridades: legibilidad nocturna, calidez, humanidad clínica
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Paleta — fondos más cremosos, tierra más humana */
  --bg: #FAF6F0;              /* leche cremosa, menos amarilla que arena */
  --bg-2: #EFE7DB;            /* fondo secundario */
  --bg-3: #E2D8C9;
  --paper: #FDFBF7;

  /* Tinta — contrastes AAA */
  --ink: #231F1C;             /* casi negro cálido, 14:1 sobre bg */
  --ink-2: #5A534D;           /* AAA: 7.2:1 sobre bg */
  --ink-3: #8A8178;           /* AA Large: 4.5:1 */
  --line: rgba(35, 31, 28, 0.12);
  --line-strong: rgba(35, 31, 28, 0.22);

  /* Acento: malva-rosado profundo — propio, no genérico wellness */
  --malva: #8A5A6B;           /* ancla cromática clínica cálida */
  --malva-deep: #6D4454;
  --malva-soft: #C9A8B3;
  --sage: #94A38C;
  --sage-deep: #72826A;

  --accent: var(--malva);
  --accent-deep: var(--malva-deep);
  --accent-soft: var(--malva-soft);

  /* Tipografía */
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  /* Escala subida para lectura nocturna en mobile */
  --fs-micro: 12px;
  --fs-eyebrow: 12.5px;
  --fs-body: 17.5px;          /* era 16 */
  --fs-body-sm: 15.5px;       /* era 14.5 */
  --fs-lede: 20px;            /* era 19 */
  --fs-h4: 23px;
  --fs-h3: 30px;
  --fs-h2: 46px;
  --fs-h1: 76px;
  --fs-display: 108px;

  /* Ritmo vertical */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px; --s-11: 160px;

  /* Radios y sombras */
  --r-sm: 6px; --r-md: 10px; --r-lg: 18px; --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(35,31,28,.04), 0 2px 6px rgba(35,31,28,.04);
  --shadow-md: 0 2px 4px rgba(35,31,28,.05), 0 12px 32px rgba(35,31,28,.07);
  --shadow-lg: 0 4px 8px rgba(35,31,28,.06), 0 24px 64px rgba(35,31,28,.09);

  --container: 1240px;
  --container-narrow: 920px;
  --container-reading: 680px;
}

/* Variantes de acento */
[data-accent="sage"]    { --accent: var(--sage); --accent-deep: var(--sage-deep); --accent-soft: #BCCAB3; }
[data-accent="neutral"] { --accent: #9A9085; --accent-deep: #6E655C; --accent-soft: #C9C1B6; }

/* Densidad */
[data-density="compact"] { --s-9: 72px; --s-10: 96px; --s-11: 120px; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
  overflow-x: clip;              /* evita scroll horizontal fantasma Android */
  /* iOS safe areas */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Typography utilities ---------- */
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: -0.02em; }
.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow-mark { display: inline-flex; align-items: center; gap: 10px; }
.eyebrow-mark::before {
  content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.5;
}

h1, h2, h3, h4 {
  font-family: var(--serif); font-weight: 300;
  letter-spacing: -0.02em; line-height: 1.08; margin: 0; color: var(--ink);
}
h1 { font-size: clamp(40px, 6vw, var(--fs-h1)); }
h2 { font-size: clamp(30px, 4vw, var(--fs-h2)); line-height: 1.12; }
h3 { font-size: clamp(22px, 2.4vw, var(--fs-h3)); line-height: 1.22; }
h4 { font-size: var(--fs-h4); line-height: 1.28; }
p { margin: 0; text-wrap: pretty; }
.lede {
  font-size: clamp(17px, 1.5vw, var(--fs-lede));
  line-height: 1.55; color: var(--ink-2); max-width: 58ch;
}
em.ital { font-family: var(--serif); font-style: italic; font-weight: 300; }

.display {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(48px, 8vw, var(--fs-display));
  line-height: 1.02; letter-spacing: -0.035em;
}

/* Marcador malva manuscrito — detalle humano */
.accent-underline {
  background-image: linear-gradient(transparent 70%, color-mix(in srgb, var(--accent) 22%, transparent) 70%, color-mix(in srgb, var(--accent) 22%, transparent) 95%, transparent 95%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0 .04em;
}

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.section { padding-block: clamp(40px, 6.5vw, 96px); }
.section-sm { padding-block: clamp(32px, 5vw, 72px); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
/* Fallback para Chrome Android viejo: fondo sólido */
@supports not (backdrop-filter: blur(1px)) {
  .nav { background: var(--bg); }
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

/* Logo monograma — fb cursiva en marca */
.brand { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, var(--malva-soft) 0%, var(--malva) 100%);
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 20px;
  font-weight: 400; color: #fff;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 3px rgba(138,90,107,.25), inset 0 1px 0 rgba(255,255,255,.15);
}
.brand-name {
  font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: -0.015em;
  line-height: 1.1;
}
.brand-name small {
  display: block;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 500; margin-top: 2px;
}
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 15px; color: var(--ink); font-weight: 400;
  padding: 10px 0; min-height: 44px;
  display: inline-flex; align-items: center;
  position: relative; transition: color .2s ease;
}
.nav-link[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 14px;
  height: 1px; background: var(--ink);
}
.nav-link:hover { color: var(--accent-deep); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-burger {
  display: none; background: transparent; border: 0;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  padding: 0; cursor: pointer;
}
.nav-burger svg { width: 24px; height: 24px; stroke: var(--ink); stroke-width: 1.5; fill: none; }

/* Mobile panel */
.nav-panel {
  position: fixed; inset: 72px 0 0 0;
  background: var(--bg);
  padding: 32px clamp(20px, 4vw, 48px) 48px;
  display: flex; flex-direction: column; gap: 4px;
  transform: translateY(-100%);
  transition: transform .35s cubic-bezier(.3,.8,.3,1);
  z-index: 49;
  overflow-y: auto;
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}
.nav-panel.open { transform: translateY(0); }
.nav-panel a {
  font-family: var(--serif); font-size: 26px; font-weight: 400;
  color: var(--ink); padding: 16px 0;
  border-bottom: 1px solid var(--line);
  min-height: 60px; display: flex; align-items: center;
}
.nav-panel .btn {
  margin-top: 24px;
  width: 100%; justify-content: center;
  font-size: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 22px; min-height: 48px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px; font-weight: 500; letter-spacing: 0.005em;
  cursor: pointer; transition: all .25s ease; white-space: nowrap;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #0f0c0a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.btn-wa { background: #25D366; color: #fff; border-color: #1fb558; }
.btn-wa:hover { background: #1fb558; }
.btn-text {
  padding: 10px 0; min-height: 44px;
  border-radius: 0; background: transparent;
  border-bottom: 1px solid var(--line-strong);
  font-size: 14.5px; letter-spacing: 0.02em;
  font-weight: 500;
}
.btn-text:hover { border-bottom-color: var(--ink); }
.btn-lg { padding: 16px 28px; font-size: 16px; min-height: 52px; }
.btn .arrow { transition: transform .25s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 500; color: var(--ink-2);
}
.input, .textarea, .select {
  width: 100%; padding: 14px 16px; min-height: 48px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 16px;                       /* ⚠ no bajar: iOS hace zoom bajo 16px */
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent);
}
.textarea { min-height: 140px; resize: vertical; }
.checkbox {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.5; cursor: pointer;
  min-height: 44px;
}
.checkbox input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: color-mix(in srgb, var(--bg) 90%, transparent);
  padding: 72px 0 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 56px; border-bottom: 1px solid rgba(250, 246, 240, 0.14);
}
.footer-brand-name {
  font-family: var(--serif); font-size: 32px; font-weight: 300;
  color: var(--bg); letter-spacing: -0.02em;
}
.footer-brand-desc {
  color: color-mix(in srgb, var(--bg) 75%, transparent);
  font-size: 15px; margin-top: 16px; max-width: 38ch; line-height: 1.6;
}
.footer-col h5 {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: color-mix(in srgb, var(--bg) 65%, transparent); margin: 0 0 20px; font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.footer-col a, .footer-col li {
  color: color-mix(in srgb, var(--bg) 88%, transparent);
  font-size: 15px; line-height: 1.4; transition: color .2s ease;
  min-height: 24px; display: block;
}
.footer-col a:hover { color: var(--bg); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; font-size: 12.5px;
  color: color-mix(in srgb, var(--bg) 58%, transparent);
  letter-spacing: 0.02em;
}
.footer-bottom a { color: inherit; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-ready .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Ornamental ---------- */
.rule-short { width: 40px; height: 1px; background: var(--ink); display: block; }
.dot-sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin: 0 10px; vertical-align: middle; opacity: 0.5; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: 12.5px; letter-spacing: 0.05em;
}

/* ---------- Page frame ---------- */
.page-header {
  padding-block: clamp(48px, 9vw, 128px) clamp(32px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}
.page-header .eyebrow { margin-bottom: 20px; }
.page-header h1 { max-width: 20ch; }

/* ===================== WHATSAPP FLOATING ===================== */
.wa-float {
  position: fixed; z-index: 40;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  bottom: calc(clamp(16px, 3vw, 28px) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  background: #25D366; color: #fff;
  padding: 0 20px 0 14px;
  height: 56px; min-width: 56px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, .35), 0 12px 32px rgba(0,0,0,.18);
  font-family: var(--sans);
  font-size: 15px; font-weight: 500;
  transition: transform .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37,211,102,.45), 0 16px 40px rgba(0,0,0,.2); }
.wa-float svg { width: 26px; height: 26px; fill: #fff; flex-shrink: 0; }
.wa-float .wa-text { white-space: nowrap; }
@media (max-width: 640px) {
  .wa-float { padding: 0; width: 56px; justify-content: center; }
  .wa-float .wa-text { display: none; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 640px) {
  :root {
    --fs-h1: 44px; --fs-h2: 32px; --fs-display: 60px;
  }
  .section { padding-block: clamp(40px, 8vw, 64px); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; }
  .brand-name small { font-size: 9.5px; }
  .nav-inner { height: 64px; }
  .nav-panel { top: 64px; }
}

/* ---------- Utility ---------- */
.grid { display: grid; gap: var(--s-6); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 24px; } .gap-6 { gap: 32px; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; } .mt-6 { margin-top: 64px; }
.text-muted { color: var(--ink-2); }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
