/* ═══════════════════════════════════════════════════════════════
   GROWTH STUDIO — CORE
   ───────────────────────────────────────────────────────────────
   Los cimientos que no pertenecen a ninguna sección: tokens, reset,
   tipografía, cursor, nav y menú mobile. Debajo, el motor de
   animación.

   Se carga ANTES que clinicas.css. El bloque de abajo es exactamente
   el arranque de esa hoja, movido tal cual y en el mismo orden: entre
   el final de este archivo y el principio del otro no se interpone
   nada, así que la cascada queda intacta.

   Escrito para que index.html lo adopte cuando se migre.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07070F;
  --bg2:      #0C0C1A;
  --bg3:      #101022;
  --card:     rgba(255,255,255,0.025);
  --lime:     #C1FF5A;
  --lime-glow:rgba(193,255,90,0.12);
  --lime-dim: rgba(193,255,90,0.06);
  --text:     #ECEAE0;
  --muted:    rgba(236,234,224,0.62);   /* subido 0.45 → 0.62 (WCAG AA) */
  --muted-strong: rgba(236,234,224,0.78); /* para texto crítico */
  --dim:      rgba(236,234,224,0.28);   /* solo decorativo */
  --border:   rgba(236,234,224,0.08);
  --border2:  rgba(236,234,224,0.14);
  --r:        16px;
  --r-sm:     10px;
  --r-lg:     24px;
  /* Spacing scale (fase 1.3) */
  --s-section:        7rem;
  --s-section-mobile: 4rem;  /* 64px = mínimo touch */
  --s-block:          3rem;
  --s-block-mobile:   2rem;
  --teal:     #1a9e7a;
  --teal-2:   #2bd4a1;
  --teal-glow:rgba(26,158,122,.18);

  /* Sistema tipográfico oficial Growth Studio v1.0 */
  --font-sans:  'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono:  'Geist Mono', 'JetBrains Mono', 'Courier New', monospace;
  /* Las ETIQUETAS van en redonda. El mono queda solo para dígitos que
     tienen que alinearse: en un contador, el ancho fijo es lo que evita
     que el número baile mientras cuenta. */
  --font-etiqueta: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Helper class para acento editorial: Fraunces italic en 1-2 palabras */
.it { font-family:var(--font-serif); font-style:italic; font-weight:500; }











/* ─── NAV ────────────────────────────────── */
.nav {
  position:fixed; top:0; left:0; right:0; z-index:200;
  height:72px; padding:0 3rem;
  display:flex; align-items:center; justify-content:space-between;
  transition: background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.stuck { background:rgba(7,7,15,.88); backdrop-filter:blur(20px); border-bottom-color:var(--border); }

.nav-logo {
  font-family:var(--font-sans); font-weight:800; font-size:1.15rem;
  letter-spacing:-.02em; color:var(--text); text-decoration:none;
  display:flex; align-items:center; gap:9px;
}
.nav { height:140px; }
.nav-logo img { height:216px; width:auto; display:block; object-fit:contain; }
.logo-dot { width:8px; height:8px; background:var(--lime); border-radius:50%; flex-shrink:0; }

.nav-links { display:flex; align-items:center; gap:2.2rem; }
.nav-links a { color:var(--muted); text-decoration:none; font-size:.86rem; font-weight:500; letter-spacing:.005em; transition:color .25s; position:relative; }
.nav-links a:not(.nav-cta):not(.nav-magnet)::after {
  content:''; position:absolute; left:0; right:0; bottom:-6px; height:1px;
  background:var(--lime); transform:scaleX(0); transform-origin:right;
  transition:transform .35s ease;
}
.nav-links a:not(.nav-cta):not(.nav-magnet):hover { color:var(--text); }
.nav-links a:not(.nav-cta):not(.nav-magnet):hover::after { transform:scaleX(1); transform-origin:left; }

.nav-magnet {
  padding:.5rem 1rem !important;
  border:1px solid rgba(26,158,122,.45);
  border-radius:100px;
  color:var(--teal-2) !important;
  background:rgba(26,158,122,.06);
  font-weight:600 !important; font-size:.8rem !important;
  display:inline-flex; align-items:center; gap:.4rem;
  transition:border-color .3s, background .3s, box-shadow .3s, transform .3s;
  box-shadow:0 0 0 0 rgba(26,158,122,0);
}
.nav-magnet:hover {
  border-color:var(--teal-2);
  background:rgba(26,158,122,.12);
  box-shadow:0 0 24px rgba(26,158,122,.25), inset 0 0 12px rgba(26,158,122,.08);
  transform:translateY(-1px);
}

/* nav-cta — mismo estilo del btn-lime del hero (lime gradient + aurora) */
.nav-cta {
  padding:.72rem 1.5rem !important;
  background:transparent !important;     /* la cara va en ::after (borde giratorio) */
  color:var(--bg) !important;
  border-radius:100px !important;
  font-family:var(--font-sans) !important;
  font-weight:600 !important;
  font-size:.85rem !important;
  letter-spacing:.005em !important;
  text-decoration:none !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:.45rem !important;
  transition:transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s !important;
  box-shadow:
    0 10px 28px rgba(193,255,90,.22),
    0 0 20px rgba(193,255,90,.16) !important;
  position:relative !important;
  overflow:hidden !important;
  isolation:isolate !important;
}
.nav-cta:hover {
  transform:translateY(-2px) !important;
  box-shadow:
    0 16px 42px rgba(193,255,90,.38),
    0 0 30px rgba(193,255,90,.28) !important;
}

/* width/height 44px = touch-target minimo (WCAG/iOS); las barras quedan en 24px fijo
   para no agrandar el ícono visualmente, solo el área táctil invisible. */
.ham { display:none; background:none; border:none; width:44px; height:44px; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:4px; }
.ham span { display:block; width:24px; height:1.5px; background:var(--text); transition:all .35s; }
.ham.open span:nth-child(1) { transform:translateY(6.5px) rotate(45deg); }
.ham.open span:nth-child(2) { opacity:0; }
.ham.open span:nth-child(3) { transform:translateY(-6.5px) rotate(-45deg); }

.mob-menu {
  position:fixed; inset:0; z-index:190;
  background:var(--bg); opacity:0; pointer-events:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  transition:opacity .4s;
}
.mob-menu.open { opacity:1; pointer-events:all; }
.mob-menu nav { display:flex; flex-direction:column; gap:2rem; text-align:center; }
.mob-menu a {
  font-family:var(--font-sans); font-size:1.6rem; font-weight:800;
  padding:.35rem 0; /* touch-target ≥44px sin achicar el gap visual entre links */
  color:var(--text); text-decoration:none; transition:color .2s;
}
.mob-menu nav { gap:1.2rem; }
.mob-menu .btn-lime { font-size:.9rem; padding:.85rem 1.6rem; }
.mob-menu a:hover { color:var(--lime); }
/* CTA del menú mobile: texto oscuro legible sobre el botón lime
   (vence a .mob-menu a que lo pintaba blanco). Mantiene oscuro en hover. */
.mob-menu .btn-lime,
.mob-menu .btn-lime:hover { color:var(--bg); }

/* --s = progreso del elemento (0→1). Hereda: los dos estados superpuestos
   de una fila son hijos de ella y tienen que leer su mismo progreso.
   --p = progreso de la sección. */
@property --s { syntax: "<number>"; initial-value: 0; inherits: true;  }
@property --p { syntax: "<number>"; initial-value: 0; inherits: true;  }

:root {
  /* expo-out: la curva que da la sensación cara */
  --e-out:  cubic-bezier(.16, 1, .3, 1);
  --e-soft: cubic-bezier(.4, 0, .2, 1);

  --t-fast: 400ms;
  --t-base: 650ms;
  --t-slow: 900ms;

  --rise-y:      24px;
  --scale-from:  .96;
  --blur-from:   6px;
}

/* ─── LAS TRES PRIMITIVAS ──────────────────────────────────── */

@keyframes gs-rise {
  from { opacity: .32; transform: translate3d(0, var(--rise-y), 0); }
  to   { opacity: 1; transform: none; }
}

@keyframes gs-mask {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  /* inset negativo: la caja del texto no contiene la bajada de las
     itálicas (g, q), y recortando a 0 quedaban cortadas al terminar. */
  to   { opacity: 1; clip-path: inset(0 -.1em -.35em -.1em); }
}

/* Variante de la entrada que NO usa transform.
   `scale` es una propiedad independiente y se compone con transform, así
   que la tarjeta puede entrar escalando y a la vez inclinarse con el
   cursor. Con la versión de arriba no se puede: una animación CSS se
   queda con la propiedad entera y le gana a cualquier declaración. */
@keyframes gs-escala-libre {
  from { opacity: .32; scale: var(--scale-from); filter: blur(var(--blur-from)); }
  to   { opacity: 1; scale: 1;                 filter: blur(0); }
}

@keyframes gs-scale {
  from { opacity: .32; transform: scale(var(--scale-from)); filter: blur(var(--blur-from)); }
  to   { opacity: 1; transform: none;                     filter: blur(0); }
}

/* Scrub puro: solo mueve el número. Lo visual lo decide quien lo consume. */
@keyframes gs-scrub { from { --s: 0 } to { --s: 1 } }
@keyframes gs-prog  { from { --p: 0 } to { --p: 1 } }

/* ─── REVEALS ──────────────────────────────────────────────────
   Uso:  <div data-reveal>            → rise (default)
         <div data-reveal="mask">     → wipe vertical
         <div data-reveal="scale">    → scale + blur
   Escalonado: style="--i:2" corre el rango de entrada.
   ────────────────────────────────────────────────────────────── */

@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: gs-rise var(--t-base) var(--e-out) both;
    animation-timeline: view();
    /* --i corre la ventana: el hermano siguiente entra un poco después */
    animation-range: entry calc(6%  + var(--i, 0) * 4%)
                     cover calc(30% + var(--i, 0) * 4%);
  }
  [data-reveal="mask"]  { animation-name: gs-mask; }
  [data-reveal="scale"] { animation-name: gs-scale; }
}

/* Fallback: entra y se queda. Sin scrubbing continuo, pero el
   contenido llega igual y con el mismo escalonado. */
@supports not (animation-timeline: view()) {
  [data-reveal] { opacity: 0; }
  [data-reveal].is-in {
    animation: gs-rise var(--t-base) var(--e-out) both;
    animation-delay: calc(var(--i, 0) * 60ms);
  }
  [data-reveal="mask"].is-in  { animation-name: gs-mask; }
  [data-reveal="scale"].is-in { animation-name: gs-scale; }
}

/* ─── BANDA DE FOCO ────────────────────────────────────────────
   El elemento entra desenfocado, se enfoca al cruzar el centro del
   viewport y se vuelve a ir. Es continuo: solo existe en el camino
   nativo. En el fallback degrada a un reveal normal — entra y se
   queda nítido, que es un final perfectamente digno. */

@keyframes gs-foco {
  0%        { opacity: .22; filter: blur(var(--foco-blur, 5px)); transform: translate3d(0, 16px, 0); }
  38%, 62%  { opacity: 1;   filter: blur(0);                     transform: none; }
  100%      { opacity: .22; filter: blur(var(--foco-blur, 5px)); transform: translate3d(0, -16px, 0); }
}

@supports (animation-timeline: view()) {
  [data-foco] {
    animation: gs-foco linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
}
@supports not (animation-timeline: view()) {
  [data-foco] { opacity: 0; }
  [data-foco].is-in { animation: gs-rise var(--t-base) var(--e-out) both; }
}

/* Red de seguridad: si el observer nunca dispara (JS bloqueado, entornos
   raros), motion.js marca todo como visible. Nunca una página en blanco
   por culpa de una animación. */
html.gs-no-js [data-reveal] { opacity: 1 !important; animation: none !important; }

/* ─── SCRUB ────────────────────────────────────────────────────
   Uso:  <section class="gs-scrub">              define la línea de tiempo
           <div class="gs-scrub-in">             recibe --p (0→1)
             <li style="--from:20%; --to:36%">   recibe --s (0→1)

   En una sección pinneada (alto 300vh + hijo sticky de 100vh) la fase
   `contain` equivale exactamente al tramo en que el pin está activo:
   es el equivalente nativo de -rect.top / (height - innerHeight).
   ────────────────────────────────────────────────────────────── */

.gs-scrub { view-timeline: --gs-sec block; }

@supports (animation-timeline: view()) {
  .gs-scrub-in {
    animation: gs-prog linear both;
    animation-timeline: --gs-sec;
    animation-range: contain 0% contain 100%;
  }
  .gs-scrub [data-s] {
    animation: gs-scrub linear both;
    animation-timeline: --gs-sec;
    animation-range: contain var(--from, 0%) contain var(--to, 100%);
  }
}

/* ─── SUAVIZADO DE BORDES ──────────────────────────────────────
   Los `filter: blur()` grandes son lo más caro de toda la página.
   En pantallas chicas se apagan: queda la opacidad, que es gratis. */
@media (max-width: 860px) {
  :root { --blur-from: 0px; --foco-blur: 0px; }
}

/* ─── REDUCED MOTION ───────────────────────────────────────────
   Un solo bloque apaga todo el sistema. El contenido queda en su
   estado final, legible y completo. */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].is-in,
  [data-foco],
  [data-foco].is-in,
  .gs-scrub-in,
  .gs-scrub [data-s] {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
}

/* ─── SCRUB EN FASE `cover` ────────────────────────────────────
   Para secciones que NO están pinneadas: el progreso se mide
   mientras la sección cruza el viewport, no mientras lo contiene.
   Se activa con data-scrub="cover". */
@supports (animation-timeline: view()) {
  .gs-scrub[data-scrub="cover"] .gs-scrub-in {
    /* En fase `entry` el porcentaje se mide contra el alto del propio
       elemento, no del viewport: arranca cuando la sección terminó de
       aparecer y llega al final justo cuando empieza a irse.
       Medido por encuadre — 0% con el título todavía entrando, 43% con
       la sección completa, 100% al empezar a salir. */
    animation-range: entry 85% exit 0%;
  }
  .gs-scrub[data-scrub="cover"] [data-s] {
    animation-range: cover var(--from, 0%) cover var(--to, 100%);
  }
}

/* ─── ANIMACIONES EN REPOSO ────────────────────────────────────
   motion.js marca con .gs-quieto los bloques que salieron de
   pantalla. Acá se pausa SOLO lo decorativo, nombrado uno por uno.

   Nada de `.gs-quieto *`: eso congelaría también las scroll-driven,
   que quedarían clavadas en un fotograma equivocado al reentrar. */
.gs-quieto .lime:not(.inner),
.gs-quieto .btn-lime::before,
.gs-quieto .btn-ghost::before,
.gs-quieto .nav-cta::before,
.gs-quieto .pulse-dot,
.gs-quieto .orb,
.gs-quieto .hero-badge,
.gs-quieto .hero-badge::after,
.lime.gs-quieto:not(.inner),
em.gs-quieto,
.gs-quieto .price-card.feat::after,
.gs-quieto .map-pin circle.pin-ring,
.gs-quieto .map-arc,
.gs-quieto .bc-foot em,
.gs-quieto .bc-pill em,
.gs-quieto .cupos-label em {
  /* !important a propósito: el shorthand `animation:` de cada componente
     reescribe animation-play-state a "running", y en varios casos empata en
     especificidad y gana por orden. Un pausado de estado tiene que ganarle
     siempre a la declaración del componente, sin depender de qué hoja cargó
     después ni de cuántas clases lleve el selector. */
  animation-play-state: paused !important;
}

/* ─── PRIMITIVA: CARTA ─────────────────────────────────────────
   Entra ligeramente rotada y se endereza, como cartas que se
   acomodan sobre la mesa. Cuarta primitiva y última: cualquier
   cosa que haga falta más allá de esto se compone con rango. */
@keyframes gs-carta {
  from {
    opacity: .32;
    transform: translate3d(0, 26px, 0) rotate(var(--giro, 2deg)) scale(.97);
  }
  to { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
  [data-reveal="carta"] { animation-name: gs-carta; }
}
@supports not (animation-timeline: view()) {
  [data-reveal="carta"].is-in { animation-name: gs-carta; }
}
@media (max-width: 700px) {
  :root { --giro: 0deg; }   /* en una columna la rotación se lee como error */
}


/* ═══════════════════════════════════════════════════════════════
   Doble toque sin zoom
   ───────────────────────────────────────────────────────────────
   Dos toques seguidos sin querer hacían zoom sobre lo que estuviera
   debajo del dedo. touch-action: manipulation le dice al navegador
   que en esta página no existe el gesto de doble-toque-para-zoom,
   así que el segundo toque cuenta como otro toque y listo.

   NO se toca el meta viewport: poner user-scalable=no también mata
   el pellizco para agrandar, y eso deja afuera a quien necesita
   ampliar para leer. El pellizco sigue funcionando igual.
   ═══════════════════════════════════════════════════════════════ */
html { touch-action: manipulation; }
