/* ═══════════════════════════════════════════════════════════════
   Adagio Masoterapia — hoja de estilos única.
   Todo lo ajustable vive en :root (abajo). Sin frameworks.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Marca */
  --accent: #707A5E;            /* verde salvia. Alternativas del diseño:
                                   #B5602E terracota · #4F6B6A petróleo · #33312C carbón */
  --cream: #F5F1EA;
  --ink: #1E1B18;
  --body: #4A453D;
  --muted: #8A8377;
  --line: #E4DCCC;
  --chip-bg: #EDE8D9;
  --chip-ink: #6B6656;
  --deep: #4A453D;              /* fondo de la sección Reservar */
  --on-dark: #EDE8DC;

  /* Tipografía */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  /* Layout */
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(48px, 7vw, 88px);

  /* Cuánto se queda quieta cada sección antes de que la siguiente la tape.
     En 0 las secciones se encadenan sin pausa (como estaba). Al subirlo, la
     pausa se ve como una franja de fondo plano: 15vh es un respiro discreto,
     más de 25vh empieza a sentirse vacío. */
  --stack-dwell: 0vh;

  /* Foto del hero: reemplaza none por url('../img/hero.jpg') cuando la tengas */
  --hero-image: none;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: clip;   /* clip y no hidden: hidden rompería position:sticky */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--ink); text-decoration: none; transition: opacity .2s ease; }
a:hover { opacity: .7; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #FFF; padding: 12px 18px; font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

.ta-right { text-align: right; }

/* ── Marcadores de imagen (placeholders del diseño) ───────────── */
.ph {
  background: repeating-linear-gradient(135deg, #E8E1D3, #E8E1D3 16px, #DED4C1 16px, #DED4C1 32px);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ph-fine {
  background: repeating-linear-gradient(45deg, #E8E1D3, #E8E1D3 12px, #DED4C1 12px, #DED4C1 24px);
}
.ph-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--muted);
  background: rgba(245, 241, 234, .85);
  padding: 4px 10px; border-radius: 2px;
}

/* ── Botones ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 15px 28px; border-radius: 2px; font-size: 15px; line-height: 1;
  white-space: nowrap; transition: opacity .2s ease, transform .2s ease;
}
.btn:hover { opacity: .88; }
.btn-sm { padding: 10px 20px; font-size: 13px; }
.btn-accent { background: var(--accent); color: #FFF; }
.btn-light { background: #FFF; color: var(--ink); }
.btn-outline-light { border: 1px solid #FFF; color: #FFF; }

/* ── Nav fija ─────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  transition: background .3s ease, backdrop-filter .3s ease, box-shadow .3s ease;
}
.nav.is-scrolled {
  background: rgba(245, 241, 234, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 12px rgba(30, 27, 24, .06);
}
/* Con el menú abierto el nav vuelve a ser opaco: si no, se lee la página
   por detrás de los links. */
.nav.is-menu-open,
.nav.is-menu-open.is-scrolled {
  background: var(--cream);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 40px; width: auto; }
.nav-links {
  display: flex; gap: clamp(14px, 2vw, 28px); flex-wrap: wrap;
  font-size: 14px; justify-content: center;
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Botón del menú: solo existe en mobile (ver media query al final) */
.nav-toggle {
  display: none; width: 40px; height: 40px; padding: 0;
  align-items: center; justify-content: center;
  background: none; border: none; color: var(--ink); cursor: pointer;
}
.nav-toggle-bars { position: relative; display: block; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  width: 20px; height: 1.5px; background: currentColor;
  transition: transform .25s ease, background .2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative; margin-top: -1px; padding-top: 1px;
  min-height: min(88vh, 780px);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  align-items: flex-end; padding-bottom: 20px;
  background-image: var(--hero-image);
  background-size: cover; background-position: center;
}
/* Al definir --hero-image, el JS marca .has-photo y esconde el rótulo y las rayas */
.hero-bg.has-photo { background-image: var(--hero-image); }
.hero-bg.has-photo .ph-label { display: none; }
.hero-scrim { position: absolute; inset: 0; background: rgba(30, 27, 24, .46); }
.hero-content {
  position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
  padding: 0 var(--gutter); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.hero-title {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(44px, 7vw, 76px); line-height: 1.05;
  color: #FFF; text-transform: uppercase; letter-spacing: -1px;
}
.hero-lead {
  margin: 0; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.6;
  color: var(--on-dark); max-width: 480px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ── Tipografía compartida ────────────────────────────────────── */
.eyebrow {
  margin: 0; font-size: 14px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.eyebrow-light { color: var(--on-dark); }
.eyebrow-sm {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.h2 {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 4vw, 42px); line-height: 1.15;
}
.chip {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--chip-bg); color: var(--chip-ink);
  padding: 6px 14px; border-radius: 999px;
}

.section { background: var(--cream); padding: var(--section-y) var(--gutter); }
.section-inner { max-width: var(--wrap); margin: 0 auto; }
.section-head { max-width: 560px; margin: 0 auto 48px; display: flex; flex-direction: column; gap: 14px; }
.section-head-center { text-align: center; align-items: center; }
.section-sub { margin: 0; font-size: 16px; color: var(--body); }

.grid { display: grid; gap: 24px; }
.grid-320 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ── Sobre Rebeca ─────────────────────────────────────────────── */
.about {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  min-height: 640px;
}
.about-photo { position: relative; min-height: 400px; }
.about-text {
  background: var(--accent); color: #FFF;
  padding: clamp(28px, 4vw, 48px);
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 28px; min-height: 400px;
}
.about-meta {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.about-quote {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4vw, 46px); line-height: 1.15; text-transform: uppercase;
}
.about-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px; font-size: 14px; line-height: 1.6;
}
.about-cols p { margin: 0; }

/* ── Certificaciones ──────────────────────────────────────────── */
.cert-card {
  background: #FFF; border: 1px solid var(--line); border-radius: 8px;
  padding: 32px; display: flex; flex-direction: column; gap: 18px;
}
.cert-card-dark { background: var(--accent); border-color: transparent; color: #FFF; }
.cert-card-dark .eyebrow-sm,
.cert-card-dark .fact-k { color: #D8DDD3; }
.cert-card-dark .cert-title { color: #FFF; }
.cert-card-dark .cert-desc { color: #EDF0E9; }
.cert-card-dark .fact { background: rgba(255, 255, 255, .12); }
.cert-card-dark .fact-v { color: #FFF; }

.cert-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 24px; }
.cert-desc { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body); }
.cert-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px; margin-top: 4px;
}
.fact { background: var(--cream); border-radius: 6px; padding: 12px 14px; }
.fact-k { font-size: 12px; color: var(--muted); }
.fact-v { font-size: 15px; color: var(--ink); overflow-wrap: break-word; }
.fact-v-sm { font-size: 14px; }

/* ── Servicios ────────────────────────────────────────────────── */
.service {
  background: #FFF; border: 1px solid var(--line); border-radius: 4px;
  padding: 32px 28px; display: flex; flex-direction: column; gap: 14px;
}
.service-name {
  margin: 0; font-family: var(--sans); font-weight: 500; font-size: 21px;
  text-transform: uppercase; letter-spacing: -.6px;
}
.service-duration {
  margin: 0; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.service-desc { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body); flex: 1; }
.service-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 6px;
}
.service-price { font-family: var(--serif); font-size: 22px; color: var(--ink); }
.service-foot a { font-size: 13px; text-decoration: underline; }
.services-note { margin: 32px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ── Reservar ─────────────────────────────────────────────────── */
.reservar { background: var(--deep); }
.reservar-inner {
  max-width: 640px; margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--gutter); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.reservar-title {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 3.6vw, 40px); color: #FFF;
}
.reservar-lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--cream); opacity: .9; }
.reservar .btn { margin-top: 8px; padding: 16px 32px; }

/* ── Instagram ────────────────────────────────────────────────── */
.ig-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap; margin-bottom: 32px;
}
.ig-handle {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 3.4vw, 34px);
}
.ig-head a { font-size: 14px; text-decoration: underline; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.ig-tile {
  aspect-ratio: 1 / 1; border-radius: 2px; padding: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ig-tile img { width: 100%; height: 100%; object-fit: cover; }
a.ig-tile { padding: 0; }
a.ig-tile:hover { opacity: .85; }

/* ── FAQ ──────────────────────────────────────────────────────── */
.faq { background: var(--cream); padding: var(--section-y) var(--gutter); }
.faq-inner { max-width: 760px; margin: 0 auto; }
.faq-title {
  margin: 0 0 32px; font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 3.4vw, 34px); text-align: center;
}
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 18px 4px; font-size: 16px; font-family: inherit; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; cursor: pointer;
}
.faq-sign { color: var(--accent); font-size: 18px; line-height: 1; }
.faq-a {
  padding: 0 4px; max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .3s ease, opacity .2s ease, padding .3s ease;
}
.faq-a.is-open {
  padding: 0 4px 20px; max-height: 320px; opacity: 1;
  transition: max-height .35s ease, opacity .3s ease, padding .35s ease;
}
.faq-a p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--body); max-width: 600px; }

/* ── Footer ───────────────────────────────────────────────────── */
/* Por encima de la pila: si no, la cola de la última sección lo taparía. */
.footer { position: relative; z-index: 20; background: var(--ink); color: var(--cream); }
.footer a { color: var(--cream); }
.footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(48px, 7vw, 72px) var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.footer-brand { font-family: var(--serif); font-size: 22px; }
.footer-logo { height: 68px; width: auto; }
.footer-blurb { margin: 0; font-size: 14px; line-height: 1.6; color: #B9B3A6; max-width: 260px; }
.footer-k { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.footer-muted { color: #B9B3A6; font-size: 13px; }
.footer-bar {
  border-top: 1px solid #35312B; padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap; font-size: 12px; color: #7A756A;
}
.footer-bar a { text-decoration: underline; }

/* ── Secciones apiladas ───────────────────────────────────────────
   Cada sección queda fija mientras la siguiente sube y la tapa. Se
   consigue con position:sticky sobre hermanas dentro de un mismo padre
   (.stack): al pegarse todas arriba, se van amontonando en orden.

   Requisitos: cada sección tiene que ser OPACA y ocupar todo el ancho,
   y el z-index tiene que crecer para que la nueva pinte sobre la vieja
   (lo asigna el JS, junto con el `top` de cada una).

   Solo se activa con JS: hay que medir el alto de cada sección para que
   las más altas que la pantalla se lean completas antes de fijarse.
   ───────────────────────────────────────────────────────────────── */
.js .stack-item { position: sticky; top: 0; }
.hero, .about { background: var(--cream); }

.reservar { --stack-bg: var(--deep); }

/* La pausa: tramo de scroll en el que la sección se queda quieta y legible
   antes de que la siguiente empiece a taparla. Queda cubierto por la cola
   de arriba, así que nunca se ve como un hueco. */
.stack-gap { height: var(--stack-dwell); }
html:not(.js) .stack-gap { display: none; }

/* Una sección más baja que la pantalla, al quedar fija, dejaría ver por
   debajo las secciones ya apiladas. Esto prolonga su FONDO 100vh hacia
   abajo para taparlas.

   Va con box-shadow y no con un ::after a propósito: una sombra se pinta
   fuera de la caja pero NO cuenta como contenido desplazable. Con un
   pseudoelemento absoluto, en pantallas altas la cola sobresalía por
   debajo del footer y alargaba la página con una franja vacía.

   La sombra sólida se dibuja detrás del fondo de la propia sección:
   desplazada 50vh hacia abajo y expandida 50vh, cubre desde su borde
   inferior hasta 100vh más abajo. */
.js .stack-item { box-shadow: 0 50vh 0 50vh var(--stack-bg, var(--cream)); }

/* La sombra en el borde superior es lo que vende el "está tapando":
   la sección que sube proyecta sobre la que queda debajo. Va primero en la
   lista para quedar por encima del relleno. */
.js .stack-item + .stack-item {
  box-shadow: 0 -16px 36px -20px rgba(30, 27, 24, .5),
              0 50vh 0 50vh var(--stack-bg, var(--cream));
}

/* ── Aparición al hacer scroll ────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); }
.js .reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
/* Sin JS todo se ve igual: nada queda invisible */
html:not(.js) .reveal { opacity: 1; transform: none; }


/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* El nav fijo no puede comerse tres filas de pantalla en un teléfono:
     los links se guardan en un menú desplegable. */
  .nav-inner { gap: 0 10px; }
  .nav-toggle { display: inline-flex; }
  .nav-logo img { height: 30px; }

  .nav-links {
    order: 3; width: 100%;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    gap: 0; font-size: 16px;
    max-height: 0; overflow: hidden; visibility: hidden;
    /* Al cerrar: curva algo más rápida y decidida. */
    transition: max-height .30s cubic-bezier(.4, 0, .2, 1),
                visibility 0s linear .30s;
  }
  .nav-links.is-open {
    /* Respaldo: el JS mide el alto real y lo escribe inline, así la
       animación no gasta tiempo en píxeles que no existen. */
    max-height: 260px; visibility: visible;
    /* Al abrir: más larga y con salida suave (easeOutQuint). */
    transition: max-height .46s cubic-bezier(.22, 1, .36, 1),
                visibility 0s;
  }
  .nav-links a {
    padding: 15px 2px; border-top: 1px solid var(--line); white-space: nowrap;
    opacity: 0; transform: translateY(-8px);
    transition: opacity .24s ease, transform .24s ease;
  }
  /* Los links entran escalonados detrás del panel. */
  .nav-links.is-open a {
    opacity: 1; transform: none;
    transition: opacity .34s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
  }
  .nav-links.is-open a:nth-child(1) { transition-delay: .06s; }
  .nav-links.is-open a:nth-child(2) { transition-delay: .12s; }
  .nav-links.is-open a:nth-child(3) { transition-delay: .18s; }
  .nav-links.is-open a:nth-child(4) { transition-delay: .24s; }

  /* Sin JS el botón no sirve: los links quedan siempre a la vista. */
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-links { max-height: none; visibility: visible; }
  html:not(.js) .nav-links a { opacity: 1; transform: none; }

  .about-quote { font-size: clamp(26px, 7vw, 34px); }
  .hero-content { gap: 16px; }
}

/* ── Movimiento reducido ──────────────────────────────────────────
   Va al FINAL a propósito: tiene que poder anular las transiciones que
   definen los bloques de arriba, incluido el del menú en mobile.
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .faq-a { transition: none; }
  /* El apilado es puro movimiento de scroll: se desactiva. */
  .js .stack-item { position: static; box-shadow: none; }
  .stack-gap { display: none; }
  .nav-links,
  .nav-links a { transition: none; }
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after { transition: none; }
}
