/* ============================================================
   BASE — reset, tipografía, elementos globales
   ============================================================ */

/* ---- Tipografías de marca, autoalojadas --------------------
   Host Grotesk (primaria) y Public Sans (secundaria), ambas en
   variable. Sin pedidos a Google Fonts. Host Grotesk viene en
   dos cortes por rango unicode: el segundo sólo carga si la
   página usa caracteres fuera del latín básico. */

@font-face {
  font-family: "Host Grotesk";
  src: url("../fonts/HostGrotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Host Grotesk";
  src: url("../fonts/HostGrotesk-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
                 U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Italic-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--f-ui);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-weight: var(--w-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, picture { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---- Tipografía ------------------------------------------- */

.t-display,
.t-h2,
.t-h3 {
  font-family: var(--f-display);
  font-weight: var(--w-title);
}

.t-display {
  font-size: var(--t-display);
  font-weight: var(--w-display);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.t-h2 {
  font-size: var(--t-h2);
  line-height: var(--lh-title);
  letter-spacing: -0.018em;
  max-width: 20ch;
}

.t-h3 {
  font-size: var(--t-h3);
  line-height: var(--lh-title);
  letter-spacing: -0.01em;
}

.t-lead {
  font-size: var(--t-lead);
  line-height: var(--lh-sub);
  color: var(--c-ink-soft);
  max-width: 46ch;
}

.t-body { max-width: 62ch; color: var(--c-ink-soft); }
.t-small { font-size: var(--t-small); }
.t-micro { font-size: var(--t-micro); letter-spacing: 0.01em; }

/* Marca de contenido provisional. Al pasar la versión final,
   basta con quitar la clase .ph del HTML. */
.ph {
  color: var(--c-muted);
  border-bottom: 1px dotted var(--c-muted);
  padding-bottom: 0.05em;
}
.on-dark .ph { color: rgba(251, 248, 247, 0.72); border-bottom-color: rgba(251, 248, 247, 0.32); }

/* ---- Layout ----------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.block { padding-block: var(--s-section); }
.block--tight { padding-block: calc(var(--s-section) * 0.66); }

.block__head {
  display: grid;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}

@media (min-width: 900px) {
  .block__head--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: end;
    gap: var(--s-5);
  }
}

.rule { height: 1px; background: var(--c-line); border: 0; margin: 0; }

.on-dark { background: var(--c-ink); color: var(--c-paper); }
.on-dark .t-lead, .on-dark .t-body { color: rgba(251, 248, 247, 0.84); }
.on-dark .rule { background: var(--c-line-dark); }

/* ---- Botones ---------------------------------------------- */

.btn {
  --btn-bg: var(--c-ink);
  --btn-fg: var(--c-paper);
  --btn-bd: var(--c-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95em 1.7em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  font-weight: 500;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:hover { background: var(--c-ink-deep); border-color: var(--c-ink-deep); }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-ink);
  --btn-bd: var(--c-line);
}
.btn--ghost:hover { background: transparent; border-color: var(--c-ink); }

.on-dark .btn--ghost,
.btn--ghost-light {
  --btn-bg: transparent;
  --btn-fg: var(--c-paper);
  --btn-bd: var(--c-line-dark);
}
.on-dark .btn--ghost:hover,
.btn--ghost-light:hover { background: rgba(251, 248, 247, 0.07); border-color: rgba(251, 248, 247, 0.45); }

.btn--light {
  --btn-bg: var(--c-paper);
  --btn-fg: var(--c-ink);
  --btn-bd: var(--c-paper);
}
.btn--light:hover { background: #fff; border-color: #fff; }

.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* Enlace de texto con subrayado activo */
.link-u {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size var(--dur) var(--ease-out), opacity var(--dur-fast) var(--ease);
}
.link-u:hover { background-size: 0% 1px; opacity: 0.65; }

/* ---- Foco visible ----------------------------------------- */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  background: var(--c-ink);
  color: var(--c-paper);
  padding: 0.7em 1.2em;
  border-radius: var(--r-pill);
  font-size: var(--t-small);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease);
}
.skip:focus { top: 14px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

/* ---- Barra de administración de WordPress ------------------
   El header es fijo, así que cuando hay un usuario logueado la admin bar
   de WordPress se le superpone. Estos desplazamientos sólo se aplican con
   la clase admin-bar en el body: un paciente no logueado no ve diferencia.
   ------------------------------------------------------------ */

body.admin-bar .site-header { top: 32px; }

/* El menú desplegable de celular arranca debajo del header: hay que
   bajarlo lo mismo que se bajó el header. */
@media (max-width: 960px) {
  body.admin-bar .nav { top: calc(var(--header-h) + 32px); }
}

@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .nav { top: calc(var(--header-h) + 46px); }
}

.site-header.is-stuck {
  background: rgba(251, 248, 247, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--c-line);
}

.site-header__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}


.brand__tag {
  font-size: var(--t-micro);
  color: var(--c-muted);
  letter-spacing: 0.04em;
}

.chip-demo {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--c-accent);
  border: 1px solid var(--c-accent);
  border-radius: var(--r-pill);
  padding: 0.15em 0.7em;
  line-height: 1.6;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: var(--s-4); }

.nav__list { display: flex; gap: var(--s-4); }

.nav__link {
  font-size: var(--t-small);
  color: var(--c-ink-soft);
  text-decoration: none;
  position: relative;
  padding-block: 4px;
  white-space: nowrap;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--c-ink);
  transition: width var(--dur) var(--ease-out);
}
.nav__link:hover { color: var(--c-ink); }
.nav__link:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1px;
  background: var(--c-ink);
  position: relative;
  transition: background var(--dur-fast) var(--ease);
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute; left: 0;
  width: 22px; height: 1px;
  background: var(--c-ink);
  transition: transform var(--dur) var(--ease-out);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .header-cta { display: none; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--c-paper);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: var(--s-4) var(--gutter) var(--s-6);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out), visibility var(--dur);
  }
  .nav.is-open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }

  .nav__list { flex-direction: column; gap: 0; }
  .nav__list li { border-bottom: 1px solid var(--c-line); }
  .nav__link {
    display: block;
    padding: 1.05rem 0;
    font-family: var(--f-display);
    font-size: 1.5rem;
    color: var(--c-ink);
  }
  .nav__link::after { display: none; }
  .nav .btn { margin-top: var(--s-4); }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer { background: var(--c-ink); color: var(--c-paper); padding-block: var(--s-6) var(--s-4); }

.site-footer__grid {
  display: grid;
  gap: var(--s-5);
  padding-bottom: var(--s-5);
}

@media (min-width: 800px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--s-4);
  }
}


.f-col__title {
  font-size: var(--t-micro);
  color: rgba(251, 248, 247, 0.72);
  margin-bottom: var(--s-2);
}

.f-list { display: grid; gap: 0.5rem; font-size: var(--t-small); }
.f-list a { color: rgba(251, 248, 247, 0.85); text-decoration: none; }
.f-list a:hover { color: #fff; }

.site-footer__base {
  border-top: 1px solid var(--c-line-dark);
  padding-top: var(--s-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  justify-content: space-between;
  font-size: var(--t-micro);
  color: rgba(251, 248, 247, 0.72);
}
.site-footer__base a { color: inherit; }

/* ============================================================
   MOVIMIENTO REDUCIDO
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
