/* ═══════════════════════════════════════
   SCALEA — Web principal
   Sistema: Blueprint editorial / Earthy minimal
═══════════════════════════════════════ */

:root {
  --bg:        #121614;
  --surface:   #1C221F;
  --sage:      #769083;
  --sand:      #C9B59A;
  --white:     #F4F6F5;

  --ink:       #0c120c;   /* texto sobre fondos claros */

  --max-w:     1240px;
  --pad-x:     clamp(1.5rem, 6vw, 5rem);
  --section-y: clamp(6rem, 12vw, 11rem);

  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ─── Reset & base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* overflow-x: clip (no "hidden") a propósito: si overflow-x fuera "hidden" y
   overflow-y se queda en "visible", el navegador fuerza overflow-y a "auto",
   convirtiendo html/body en su propio contenedor de scroll en vez de usar el
   viewport — eso rompe position:sticky en toda la página (ej. el pin horizontal
   de #soluciones). "clip" recorta el desborde igual sin disparar esa conversión. */
html { scroll-behavior: smooth; overflow-x: clip; max-width: 100%; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

/* ════════════════════════════════════
   TEMAS POR SECCIÓN (alternancia)
════════════════════════════════════ */
.theme-dark  { --fg: var(--white); --fg-soft: rgba(244,246,245,.42); --fg-faint: rgba(244,246,245,.13); --hair: rgba(244,246,245,.08); background: var(--bg); color: var(--white); }
.theme-light { --fg: var(--ink);   --fg-soft: rgba(12,18,12,.5);     --fg-faint: rgba(12,18,12,.14);  --hair: rgba(12,18,12,.12);  background: var(--white); color: var(--ink); }
.theme-sand  { --fg: var(--ink);   --fg-soft: rgba(12,18,12,.62);    --fg-faint: rgba(12,18,12,.18);  --hair: rgba(12,18,12,.16);  background: var(--sand); color: var(--ink); }

section { position: relative; }

/* ─── Progress Bar ─── */
#progress-bar {
  position: fixed; top: 0; left: 0; z-index: 200;
  height: 2px; width: 0%;
  background: var(--sand);
  transition: width .1s linear;
  pointer-events: none;
}

/* ─── Marcas de registro (blueprint) ─── */
.registry {
  position: fixed; z-index: 95;
  font-family: var(--mono);
  font-size: .58rem; letter-spacing: .14em;
  color: var(--sage); opacity: .42;
  pointer-events: none;
  mix-blend-mode: difference;
}
.registry-tl { top: 1.5rem; left: 1.5rem; }
.registry-tr { top: 1.5rem; right: 1.5rem; }
.registry-bl { bottom: 1.5rem; left: 1.5rem; }
.registry-br { bottom: 1.5rem; right: 1.5rem; }
@media (max-width: 900px) { .registry { display: none; } }

/* ─── Container ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }

/* ════════════════════════════════════
   NAV
════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.3rem var(--pad-x);
  transition: background .5s, border-color .5s, padding .4s;
  border-bottom: 1px solid transparent;
}
#nav.scrolled {
  background: rgba(18, 22, 20, .82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-color: rgba(244, 246, 245, .07);
  padding-top: .95rem; padding-bottom: .95rem;
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.nav-logo {
  font-size: .95rem; font-weight: 900; letter-spacing: -.06em;
  color: var(--ink); text-decoration: none; transition: color .4s;
  display: inline-flex; align-items: flex-start;
}
.logo-reg { font-size: .5em; font-weight: 500; margin-left: 2px; opacity: .5; }
#nav.scrolled .nav-logo { color: var(--white); }

.nav-links { display: flex; align-items: center; gap: 2.2rem; }
.nav-link {
  font-size: .76rem; font-weight: 500; letter-spacing: .01em;
  color: rgba(12, 18, 12, .5); text-decoration: none;
  position: relative; padding-bottom: 3px;
  transition: color .3s;
}
#nav.scrolled .nav-link { color: rgba(244, 246, 245, .42); }
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--sand); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-link:hover, .nav-link.active { color: rgba(12, 18, 12, .9); }
#nav.scrolled .nav-link:hover, #nav.scrolled .nav-link.active { color: var(--white); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.btn-short { display: none; }

/* ─── Acciones nav + toggle de idioma ─── */
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-toggle {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; cursor: pointer;
  background: transparent; border: 1px solid rgba(12, 18, 12, .22);
  color: rgba(12, 18, 12, .65);
  width: 38px; height: 32px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .3s, border-color .3s, background .3s;
}
.lang-toggle:hover { color: var(--ink); border-color: rgba(12, 18, 12, .5); background: rgba(12,18,12,.04); }
#nav.scrolled .lang-toggle { color: rgba(244, 246, 245, .55); border-color: rgba(244, 246, 245, .18); }
#nav.scrolled .lang-toggle:hover { color: var(--white); border-color: rgba(201, 181, 154, .5); background: rgba(201,181,154,.06); }

/* ════════════════════════════════════
   BOTONES
════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; font-family: inherit;
  font-size: .76rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--sand);
  border: 1px solid rgba(201, 181, 154, .32);
  padding: 13px 26px; background: transparent;
  position: relative; overflow: hidden; white-space: nowrap;
  transition: color .35s, border-color .35s, background .35s;
  cursor: pointer;
}
.btn:hover { color: var(--white); border-color: rgba(201, 181, 154, .7); background: rgba(201, 181, 154, .06); }

/* Botón sobre nav clara */
#nav:not(.scrolled) .btn { color: rgba(12, 18, 12, .72); border-color: rgba(12, 18, 12, .24); }
#nav:not(.scrolled) .btn:hover { color: var(--ink); border-color: rgba(12, 18, 12, .55); background: rgba(12, 18, 12, .04); }

/* Botón en hero claro */
.theme-light .btn { color: var(--ink); border-color: rgba(12, 18, 12, .28); }
.theme-light .btn:hover { color: var(--ink); border-color: rgba(12, 18, 12, .6); background: rgba(12, 18, 12, .04); }

/* Botón oscuro sobre fondo arena */
.btn-dark { color: var(--ink); border-color: rgba(12, 18, 12, .5); }
.btn-dark:hover { color: var(--sand); background: var(--ink); border-color: var(--ink); }

.btn-sm { font-size: .68rem; padding: 9px 18px; }
.btn-lg { font-size: .8rem; padding: 16px 34px; }

.btn-text {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-soft); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; transition: color .3s;
}
.btn-text:hover { color: var(--sage); }

.arrow { display: inline-block; transition: transform .35s var(--ease); }
.btn:hover .arrow, .btn-text:hover .arrow { transform: translateX(4px); }
.btn-text:hover .arrow { transform: translateY(3px); }

/* ════════════════════════════════════
   TIPOGRAFÍA DE SECCIÓN
════════════════════════════════════ */
.section-tag {
  display: block; font-family: var(--mono);
  font-size: .66rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.6rem;
}
.theme-sand .section-tag { color: rgba(12,18,12,.55); }

.h2 {
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.04;
  color: var(--fg); margin-bottom: 2.6rem;
}

/* ════════════════════════════════════
   LAYOUT EDITORIAL ASIMÉTRICO
════════════════════════════════════ */
.editorial {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 3.1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  position: relative; z-index: 1;
}
.editorial-aside {
  display: flex; flex-direction: column; gap: 1rem;
  padding-top: .5rem;
  border-top: 1px solid var(--hair);
}
.aside-coord {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  color: var(--fg-faint); text-transform: uppercase; line-height: 1.6;
}
.editorial-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  max-width: 920px;
}
.lede {
  font-size: clamp(1rem, 1.7vw, 1.3rem); font-weight: 400;
  color: var(--fg); line-height: 1.55; letter-spacing: -.01em;
}
.body {
  font-size: clamp(.9rem, 1.4vw, 1.02rem); font-weight: 300;
  color: var(--fg-soft); line-height: 1.85;
}

/* ════════════════════════════════════
   00 · HERO
════════════════════════════════════ */
#hero {
  min-height: 100vh; overflow: hidden;
  display: flex; align-items: center;
  padding: clamp(8rem, 15vw, 11rem) var(--pad-x) clamp(5rem, 9vw, 7rem);
}
.blueprint {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(12, 18, 12, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 18, 12, .055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 120% 90% at 70% 40%, black 30%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 70% 40%, black 30%, transparent 92%);
}
.hero-grid {
  position: relative; z-index: 2;
  max-width: var(--max-w); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1.15fr .85fr;
  align-items: center; gap: clamp(2rem, 5vw, 4rem);
}
.meta-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: .7rem;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .12em;
  color: rgba(12,18,12,.55); text-transform: uppercase;
  margin-bottom: 2rem;
}
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); animation: pulse 2.4s ease-in-out infinite; }
.meta-sep { color: rgba(12,18,12,.25); }

.hero-h1 {
  font-size: clamp(2.5rem, 6.4vw, 6rem);
  font-weight: 900; letter-spacing: -.05em; line-height: 1.0;
  color: var(--ink); margin-bottom: 2.2rem;
}
.hero-h1 .line { display: block; overflow: hidden; }
.hero-h1 .line--muted { color: var(--sage); }
.hero-h1 .w {
  display: inline-block;
  transform: translateY(110%) rotate(4deg);
  opacity: 0;
}
.hero-h1.assembled .w {
  animation: wordIn .9s var(--ease) forwards;
  animation-delay: calc(var(--wi, 0) * .055s + .15s);
}

.hero-sub {
  font-size: clamp(.92rem, 1.5vw, 1.08rem); font-weight: 300;
  color: rgba(12,18,12,.55); line-height: 1.75; letter-spacing: .005em;
  max-width: 540px; margin-bottom: 2.6rem;
}
.hero-actions { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }

.hero-visual { position: relative; }
.visual-label {
  position: absolute; top: -1.4rem; left: 0; z-index: 3;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .16em;
  color: var(--sage); text-transform: uppercase;
}
#node-net {
  width: 100%; height: clamp(320px, 42vw, 480px);
  display: block;
}

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: .7rem;
}
.scroll-hint span {
  font-family: var(--mono); font-size: .55rem; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(12,18,12,.3);
}
.scroll-line {
  width: 1px; height: 42px; background: rgba(12,18,12,.2); position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 40%;
  background: var(--ink); animation: scrollDown 2.1s ease-in-out infinite;
}


/* ════════════════════════════════════
   01 · RETO / 04 / 05 (editorial) spacing
════════════════════════════════════ */
#reto, #proceso, #enfoque, #conocimiento, #confianza { padding: var(--section-y) 0; border-top: 1px solid var(--hair); }

/* ════════════════════════════════════
   02 · PROCESO — ACORDEÓN
════════════════════════════════════ */
.accordion { border-top: 1px solid var(--hair); margin-top: .5rem; }
.acc-item { border-bottom: 1px solid var(--hair); }
.acc-head {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3vw, 2.2rem) 0;
}
.acc-title {
  font-size: clamp(1.1rem, 2.6vw, 1.9rem); font-weight: 600;
  letter-spacing: -.025em; color: var(--fg-soft);
  transition: color .35s var(--ease); line-height: 1.15;
}
.acc-head:hover .acc-title { color: var(--fg); }
.acc-sign {
  position: relative; width: 16px; height: 16px; flex-shrink: 0;
}
.acc-sign::before, .acc-sign::after {
  content: ''; position: absolute; background: var(--sand);
  transition: transform .4s var(--ease), opacity .3s;
}
.acc-sign::before { top: 50%; left: 0; width: 100%; height: 1.5px; transform: translateY(-50%); }
.acc-sign::after  { left: 50%; top: 0; height: 100%; width: 1.5px; transform: translateX(-50%); }
.acc-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .5s var(--ease), opacity .4s;
  opacity: 0;
}
.acc-body > * { overflow: hidden; }
.acc-body p {
  font-size: clamp(.92rem, 1.5vw, 1.05rem); font-weight: 300;
  color: var(--fg-soft); line-height: 1.8;
  max-width: 640px;
}
.acc-tags {
  display: inline-block; margin-top: 1.1rem;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .08em;
  color: var(--sage); opacity: .7;
}
.acc-item.is-open .acc-body { grid-template-rows: 1fr; opacity: 1; padding-bottom: 1.8rem; }
.acc-item.is-open .acc-title { color: var(--fg); }
.acc-item.is-open .acc-sign::after { transform: translateX(-50%) scaleY(0); opacity: 0; }

/* ════════════════════════════════════
   03 · SOLUCIONES — PIN HORIZONTAL
════════════════════════════════════ */
#soluciones { border-top: 1px solid var(--hair); }
.pin-wrap { position: relative; height: 360vh; }
.pin-stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; align-items: center;
  --pin-intro-w: clamp(var(--pad-x), 34vw, 460px);
}
.pin-intro {
  position: absolute; top: clamp(5rem, 12vh, 9rem); left: var(--pad-x);
  z-index: 3; max-width: 360px; pointer-events: none;
}
/* Las tarjetas pasan por detrás del texto fijo al deslizar; este degradado las
   "desvanece" antes de llegar a esa zona en vez de que se corten de golpe contra
   el texto. Ancho ligado a --pin-intro-w para no desincronizarse del padding del track. */
.pin-fade {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: var(--pin-intro-w);
  background: linear-gradient(to right, var(--bg) 70%, transparent 100%);
  z-index: 2; pointer-events: none;
}
.pin-hint {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sage); margin-top: 1rem;
}
.pin-track {
  display: flex; gap: clamp(1.2rem, 2.5vw, 2rem);
  padding: 0 var(--pad-x);
  padding-left: var(--pin-intro-w);
  will-change: transform;
}
.case {
  flex: 0 0 clamp(280px, 32vw, 420px);
  background: var(--surface); border: 1px solid var(--hair);
  padding: clamp(2rem, 3.5vw, 3rem);
  display: flex; flex-direction: column;
  min-height: clamp(360px, 52vh, 460px);
  transition: border-color .4s, transform .4s var(--ease);
}
.case:hover { border-color: rgba(201,181,154,.28); transform: translateY(-4px); }
.case-cat {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sage); margin-bottom: 1rem;
  margin-top: auto;
}
.case h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem); font-weight: 600;
  letter-spacing: -.025em; line-height: 1.2; color: var(--white);
  margin-bottom: 1.1rem;
}
.case p {
  font-size: .9rem; font-weight: 300; color: rgba(244,246,245,.42);
  line-height: 1.75; margin-bottom: 1.6rem;
}
.case-ref {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sage); opacity: .55;
}
.case--cta {
  background: transparent; border-style: dashed;
  align-items: flex-start; justify-content: center; gap: 1.8rem;
}
.case--cta h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 0; }
.case-new {
  display: inline-block; align-self: flex-start;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bg); background: var(--sand);
  padding: .22rem .6rem; margin-bottom: .85rem;
}

/* ════════════════════════════════════
   03b · GIROS — FILTRO POR INDUSTRIA
════════════════════════════════════ */
#giros { padding: var(--section-y) 0; border-top: 1px solid var(--hair); }
.giros-header { margin-bottom: clamp(2rem, 4vw, 3rem); }
.giros-q {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.18; color: var(--white);
  margin-bottom: 1.8rem;
}
.giros-pills { display: flex; flex-wrap: wrap; gap: .55rem; }
.giro-pill {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(244,246,245,.38);
  border: 1px solid rgba(244,246,245,.11); background: transparent;
  padding: .6rem 1.25rem; cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
  text-decoration: none; display: inline-flex; align-items: center;
}
.giro-pill:hover { color: var(--white); border-color: rgba(244,246,245,.3); }
.giro-pill.is-active { color: var(--white); border-color: var(--sand); background: rgba(201,181,154,.08); }
.giro-pill--other { color: var(--sand); border-color: rgba(201,181,154,.28); }
.giro-pill--other:hover { border-color: var(--sand); background: rgba(201,181,154,.06); color: var(--sand); }

.giro-panels { overflow: hidden; }
.giro-panel { display: none; }
.giro-panel.is-visible { display: block; animation: giroIn .42s var(--ease) both; }
.giro-panel-head { margin-bottom: 1.4rem; }
.giro-panel-title {
  font-size: clamp(1.05rem, 1.9vw, 1.35rem); font-weight: 600;
  letter-spacing: -.02em; color: var(--white); margin-bottom: .4rem;
}
.giro-panel-sub {
  font-size: clamp(.84rem, 1.3vw, .95rem); font-weight: 300;
  color: rgba(244,246,245,.42); line-height: 1.6;
}
.giro-examples {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--hair); border: 1px solid var(--hair);
}
.giro-ex {
  background: var(--surface); padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex; flex-direction: column; gap: .7rem;
}
.giro-ex-cat {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--sage);
}
.giro-ex-title {
  display: block; font-size: clamp(.92rem, 1.5vw, 1.06rem); font-weight: 600;
  letter-spacing: -.02em; color: var(--white); line-height: 1.3;
}
.giro-ex p {
  font-size: clamp(.84rem, 1.3vw, .95rem); font-weight: 300;
  color: rgba(244,246,245,.48); line-height: 1.75; margin: 0;
}
@keyframes giroIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ════════════════════════════════════
   04 · ENFOQUE
════════════════════════════════════ */
.enfoque-list { display: flex; flex-direction: column; }
.enfoque-item {
  padding: clamp(1.8rem, 3.5vw, 2.6rem) 0;
  border-top: 1px solid var(--hair);
}
.enfoque-item:last-child { border-bottom: 1px solid var(--hair); }
.enfoque-text h3 {
  font-size: clamp(1.1rem, 2.1vw, 1.5rem); font-weight: 600;
  letter-spacing: -.025em; color: var(--fg); margin-bottom: .7rem;
}
.enfoque-text p {
  font-size: clamp(.9rem, 1.4vw, 1rem); font-weight: 300;
  color: var(--fg-soft); line-height: 1.8; max-width: 640px;
}

/* ════════════════════════════════════
   05 · CONFIANZA / COMPROMISOS
════════════════════════════════════ */
.trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-top: 2.6rem; }
.trust-card {
  background: var(--surface); border: 1px solid var(--hair);
  padding: clamp(2rem, 3.5vw, 3rem);
  position: relative; transition: border-color .4s;
}
.trust-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 36px; height: 2px;
  background: var(--sand);
}
.trust-card:hover { border-color: rgba(201,181,154,.24); }
.trust-card p {
  font-size: clamp(.96rem, 1.5vw, 1.12rem); font-weight: 400;
  color: rgba(244,246,245,.7); line-height: 1.65; letter-spacing: -.005em;
  margin-bottom: 2rem;
}
.trust-card footer { display: flex; flex-direction: column; gap: .3rem; }
.trust-title { font-size: .85rem; font-weight: 600; color: var(--white); }

/* ════════════════════════════════════
   CONOCIMIENTO / INSIGHTS
════════════════════════════════════ */
.insights-lede { margin-bottom: 2.6rem; max-width: 640px; }
.insights-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
}
.insight-card {
  background: var(--bg); padding: clamp(1.8rem, 3.2vw, 2.6rem);
  text-decoration: none; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: background .4s var(--ease);
}
.insight-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--sand) 40%, var(--sage) 80%, transparent 100%);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.insight-card:hover { background: var(--surface); }
.insight-card:hover::before { transform: scaleX(1); }
.insight-cat {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage); opacity: .65; margin-bottom: 1.4rem;
}
.insight-card h3 {
  font-size: clamp(1.05rem, 1.9vw, 1.4rem); font-weight: 600;
  letter-spacing: -.025em; line-height: 1.25; color: var(--white); margin-bottom: .9rem;
}
.insight-card p {
  font-size: .88rem; font-weight: 300; color: rgba(244,246,245,.4);
  line-height: 1.75; margin-bottom: 1.8rem;
}
.insight-go {
  margin-top: auto; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  color: var(--sand); opacity: .7; transition: opacity .3s, transform .3s var(--ease);
}
.insight-card:hover .insight-go { opacity: 1; transform: translateX(4px); }

/* ════════════════════════════════════
   06 · CIERRE
════════════════════════════════════ */
#cierre { padding: var(--section-y) 0; }
.cierre-h2 {
  font-size: clamp(2.4rem, 5.6vw, 5.4rem); font-weight: 900;
  letter-spacing: -.05em; line-height: 1.02; color: var(--ink);
  margin-bottom: 1.8rem; max-width: 820px;
}
.cierre-body {
  font-size: clamp(.92rem, 1.5vw, 1.08rem); font-weight: 400;
  color: rgba(12,18,12,.6); line-height: 1.75; max-width: 580px; margin-bottom: 3rem;
}

/* ════════════════════════════════════
   FOOTER
════════════════════════════════════ */
#footer { padding: 2.8rem 0; border-top: 1px solid var(--hair); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-size: .85rem; font-weight: 900; letter-spacing: -.06em; color: var(--white); }
.footer-mail {
  font-family: var(--mono); font-size: .78rem; color: rgba(244,246,245,.35);
  text-decoration: none; transition: color .3s; letter-spacing: .02em;
}
.footer-mail:hover { color: var(--sand); }
.footer-copy { font-family: var(--mono); font-size: .62rem; color: rgba(244,246,245,.2); letter-spacing: .08em; }

/* ════════════════════════════════════
   BACK TO TOP
════════════════════════════════════ */
#back-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 90;
  width: 44px; height: 44px; background: rgba(18,22,20,.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(244, 246, 245, .14);
  color: rgba(244, 246, 245, .4); font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; cursor: pointer; font-family: inherit;
  transition: opacity .4s, color .3s, border-color .3s, transform .3s;
}
#back-top.visible { opacity: 1; pointer-events: all; }
#back-top:hover { color: var(--white); border-color: rgba(201, 181, 154, .35); transform: translateY(-2px); }

/* ════════════════════════════════════
   REVEAL / FADE
════════════════════════════════════ */
[data-reveal], [data-fade] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .85s var(--ease), transform .85s var(--ease);
}
[data-fade] { transform: translateY(16px); }
[data-reveal].visible, [data-fade].visible { opacity: 1; transform: none; }
[data-stagger="1"] { transition-delay: .1s; }
[data-stagger="2"] { transition-delay: .2s; }
[data-stagger="3"] { transition-delay: .3s; }
.hero-visual[data-fade] { transition-delay: .5s; }

/* ════════════════════════════════════
   KEYFRAMES
════════════════════════════════════ */
@keyframes wordIn { to { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .4; } }
@keyframes scrollDown { 0% { transform: translateY(-100%); } 100% { transform: translateY(250%); } }

/* ════════════════════════════════════
   SUBPÁGINAS — ARTÍCULOS (INSIGHTS)
════════════════════════════════════ */
.art-hero {
  position: relative; overflow: hidden;
  padding: clamp(8.5rem, 16vw, 12rem) 0 clamp(3rem, 6vw, 5rem);
}
.art-hero .container { position: relative; z-index: 2; }
.art-back {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-soft); text-decoration: none;
  margin-bottom: 2.2rem; transition: color .3s;
}
.art-back:hover { color: var(--sage); }
.art-eyebrow {
  display: block; font-family: var(--mono); font-size: .66rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--sage); margin-bottom: 1.4rem;
}
.art-title {
  font-size: clamp(2.1rem, 5.4vw, 4.4rem); font-weight: 800;
  letter-spacing: -.04em; line-height: 1.04; color: var(--fg);
  max-width: 16ch; margin-bottom: 1.8rem;
}
.art-lede {
  font-size: clamp(1.05rem, 1.9vw, 1.45rem); font-weight: 400;
  color: var(--fg-soft); line-height: 1.5; letter-spacing: -.01em; max-width: 680px;
}
.art-meta {
  display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2.4rem;
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--fg-faint);
}
.art-meta .meta-sep { color: var(--fg-faint); }

.art-body { padding: var(--section-y) 0; border-top: 1px solid var(--hair); }
.prose { max-width: 720px; margin: 0 auto; }
.prose h2 {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.03em;
  line-height: 1.15; color: var(--fg); margin: 3.2rem 0 1.2rem;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  font-size: clamp(.96rem, 1.5vw, 1.08rem); font-weight: 300;
  color: var(--fg-soft); line-height: 1.85; margin-bottom: 1.3rem;
}
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--sage); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--sand); }
.prose ul { list-style: none; margin: 0 0 1.6rem; }
.prose li {
  position: relative; padding-left: 1.6rem; margin-bottom: .9rem;
  font-size: clamp(.94rem, 1.5vw, 1.04rem); font-weight: 300;
  color: var(--fg-soft); line-height: 1.7;
}
.prose li::before {
  content: ''; position: absolute; left: 0; top: .65em;
  width: 7px; height: 1px; background: var(--sand);
}

.stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
  margin: 2.6rem 0 3rem;
}
.stat { background: var(--bg); padding: 1.8rem 1.4rem; }
.theme-light .stat { background: var(--white); }
.stat-num {
  display: block; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800;
  letter-spacing: -.04em; color: var(--sand); line-height: 1; margin-bottom: .6rem;
}
.theme-light .stat-num { color: #8a7a5e; }
.stat-cap { display: block; font-size: .74rem; font-weight: 300; color: var(--fg-soft); line-height: 1.5; }

.callout {
  border-left: 2px solid var(--sand); padding: .3rem 0 .3rem 1.6rem;
  margin: 2.4rem 0; font-size: clamp(1.05rem, 1.8vw, 1.3rem); font-weight: 400;
  color: var(--fg); line-height: 1.5; letter-spacing: -.01em;
}

.sources {
  margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--hair);
}
.sources h3 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sage); margin-bottom: 1.2rem;
}
.sources ol { list-style: none; counter-reset: src; }
.sources li {
  counter-increment: src; position: relative; padding-left: 2.4rem;
  margin-bottom: .9rem; font-size: .82rem; font-weight: 300;
  color: var(--fg-soft); line-height: 1.6;
}
.sources li::before {
  content: counter(src, decimal-leading-zero); position: absolute; left: 0; top: .1em;
  font-family: var(--mono); font-size: .72rem; color: var(--sand); opacity: .7;
}
.sources a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sources a:hover { color: var(--sage); }
.src-disc {
  margin-top: 1.6rem; font-family: var(--mono); font-size: .64rem;
  letter-spacing: .03em; color: var(--fg-faint); line-height: 1.6;
}

.art-cta { padding: var(--section-y) 0; text-align: center; }
.art-cta h2 {
  font-size: clamp(1.8rem, 4.5vw, 3.4rem); font-weight: 800; letter-spacing: -.04em;
  line-height: 1.08; color: var(--ink); margin-bottom: 2rem; max-width: 18ch;
  margin-left: auto; margin-right: auto;
}

.art-more {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
  max-width: 720px; margin: 3.5rem auto 0;
}
.art-more a {
  background: var(--bg); padding: 1.6rem; text-decoration: none;
  transition: background .3s; display: block;
}
.art-more a:hover { background: var(--surface); }
.art-more span { display: block; font-family: var(--mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); opacity: .6; margin-bottom: .5rem; }
.art-more strong { font-size: .95rem; font-weight: 600; color: var(--white); letter-spacing: -.02em; }

/* ════════════════════════════════════
   RESPONSIVE
════════════════════════════════════ */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { order: 2; max-width: 520px; }
  .editorial { grid-template-columns: 1fr; gap: 2rem; }
  .editorial-aside { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .pin-track { padding-left: var(--pad-x); }
  .pin-intro { position: static; max-width: none; padding: 0 var(--pad-x); margin-bottom: 2rem; pointer-events: auto; }
  .pin-fade { display: none; }
}
@media (max-width: 768px) {
  .editorial-cols { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
  .giro-examples { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .art-more { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .7rem; }

  /* Pin → scroll horizontal nativo en móvil (sin pin) */
  .pin-wrap { height: auto; }
  .pin-stage { position: static; height: auto; display: block; padding: var(--section-y) 0; }
  .pin-track {
    transform: none !important; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; padding-bottom: 1.5rem;
  }
  .case { scroll-snap-align: start; flex-basis: 78vw; min-height: 380px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .btn-full  { display: none; }
  .btn-short { display: inline; }
  .meta-row { font-size: .58rem; }
  .scroll-hint { display: none; }
}
@media (max-width: 520px) {
  .acc-head { grid-template-columns: auto 1fr; }
  .acc-sign { display: none; }
  .acc-body p, .acc-tags { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero-h1 .w { transform: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ════════════════════════════════════
   DIAGNÓSTICO — FORMULARIO DE FILTRADO
════════════════════════════════════ */
#diagnostico {
  min-height: 100vh; overflow: hidden;
  display: flex; align-items: center;
  padding: clamp(7.5rem, 14vw, 9.5rem) var(--pad-x) clamp(3.5rem, 7vw, 5.5rem);
}
.quiz-glow {
  position: absolute; z-index: 0; pointer-events: none;
  width: 560px; height: 560px; border-radius: 50%;
  top: -140px; right: -180px; filter: blur(50px);
  background: radial-gradient(circle, rgba(118,144,131,.22), transparent 70%);
  animation: glowFloat 9s ease-in-out infinite;
}
.quiz-shell { position: relative; z-index: 2; max-width: 700px; margin: 0 auto; width: 100%; }

.quiz-progress { display: flex; align-items: center; gap: 1.2rem; margin-bottom: clamp(2.6rem, 7vw, 4rem); }
.quiz-progress-track { flex: 1; height: 3px; background: var(--fg-faint); position: relative; overflow: hidden; }
.quiz-progress-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: var(--sage); transition: width .5s var(--ease);
}
.quiz-progress-label {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
  color: var(--fg-soft); white-space: nowrap; font-variant-numeric: tabular-nums;
}

.quiz-stage { position: relative; min-height: clamp(280px, 38vh, 360px); }

.q-step { display: none; }
.q-step.is-active { display: block; }
.q-step.is-animating { animation: stepIn .55s var(--ease) both; }

.q-phase {
  display: block; font-family: var(--mono); font-size: .66rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--sage);
  margin-bottom: 1.2rem;
}
.q-title {
  font-size: clamp(1.5rem, 3.6vw, 2.5rem); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.18; color: var(--fg);
  margin-bottom: 1rem; max-width: 600px;
}
.q-hint { font-size: .92rem; color: var(--fg-soft); line-height: 1.6; max-width: 520px; }

.q-field { margin-top: 1.8rem; }
.q-input, .q-textarea {
  display: block; width: 100%; background: transparent; border: none;
  border-bottom: 2px solid var(--fg-faint);
  font-family: inherit; font-size: clamp(1.1rem, 2.2vw, 1.4rem); font-weight: 400;
  color: var(--fg); padding: .6rem 0; transition: border-color .3s;
}
.q-textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.q-input::placeholder, .q-textarea::placeholder { color: var(--fg-faint); }
.q-input:focus, .q-textarea:focus { outline: none; border-color: var(--sage); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 1.8rem; }
.choice-option {
  display: flex; align-items: center; gap: .9rem; text-align: left;
  border: 1px solid var(--fg-faint); background: transparent; cursor: pointer;
  padding: 1rem 1.2rem; font-family: inherit; font-size: .94rem; color: var(--fg);
  transition: border-color .3s, background .3s, transform .15s;
}
.choice-option:hover { border-color: rgba(118,144,131,.55); transform: translateY(-1px); }
.choice-option:active { transform: translateY(0); }
.choice-option:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
.choice-option.is-selected { border-color: var(--sage); background: rgba(118,144,131,.08); }
.choice-key {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .66rem; color: var(--fg-soft);
  border: 1px solid var(--fg-faint);
  transition: border-color .3s, color .3s, background .3s;
}
.choice-option.is-selected .choice-key { background: var(--sage); border-color: var(--sage); color: var(--white); }

.review-list { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.6rem; max-height: 44vh; overflow-y: auto; padding-right: .5rem; }
.review-item { border-bottom: 1px solid var(--fg-faint); padding-bottom: .8rem; }
.review-q { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-soft); margin-bottom: .3rem; }
.review-a { font-size: .95rem; color: var(--fg); font-weight: 500; line-height: 1.5; }

.quiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: clamp(2.2rem, 5vw, 3.2rem); }
.quiz-error { font-family: var(--mono); font-size: .72rem; color: #b25640; flex: 1; text-align: center; }
.quiz-kbd-hint { margin-top: 1rem; font-family: var(--mono); font-size: .64rem; letter-spacing: .05em; color: var(--fg-faint); }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

#quiz-back { opacity: 0; pointer-events: none; transition: opacity .3s; }
#quiz-back.is-visible { opacity: 1; pointer-events: all; }
#quiz-next:disabled { opacity: .35; cursor: not-allowed; }
#quiz-next.is-loading { opacity: .6; cursor: wait; }

.quiz-result { text-align: center; padding: 1.5rem 0; }
.quiz-result-icon { margin: 0 auto 1.6rem; width: 76px; }
.check-circle, .check-mark { fill: none; stroke: var(--sage); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.check-circle { stroke-dasharray: 208; stroke-dashoffset: 208; animation: circleDraw .7s var(--ease) forwards; }
.check-mark { stroke-dasharray: 40; stroke-dashoffset: 40; animation: checkDraw .45s var(--ease) .55s forwards; }
.quiz-tag {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .5rem 1rem; border: 1px solid var(--fg-faint); margin-bottom: 1.6rem; color: var(--sage);
}
.quiz-result h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 1rem; color: var(--fg); }
.quiz-result p { font-size: 1rem; color: var(--fg-soft); max-width: 460px; margin: 0 auto 1.8rem; line-height: 1.7; }

@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glowFloat { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-24px, 26px); } }
@keyframes circleDraw { to { stroke-dashoffset: 0; } }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }

@media (max-width: 640px) {
  .choice-grid { grid-template-columns: 1fr; }
  .quiz-foot { flex-wrap: wrap; }
  .quiz-error { order: 3; width: 100%; text-align: left; }
  .quiz-glow { width: 360px; height: 360px; top: -80px; right: -120px; }
}
