/* ═══════════════════════════════════════════════════════════
   TRES PUERTAS — BBLAST
   Papel #EDE9DD · Tinta #1B1D1D · Dorado #BAA57F (solo el dato)
   ═══════════════════════════════════════════════════════════ */

/* ── fuentes autoalojadas (en tu servidor, no Google): latin woff2 ── */
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-tight-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/inter-tight-800.woff2') format('woff2'); }

:root {
  --paper: #EDE9DD;
  --ink: #1B1D1D;
  --gold: #BAA57F;      /* trazos, pulsos y rellenos grandes */
  --gold-text: #756337; /* misma familia, ≈4.8:1 sobre papel: para texto pequeño */
  --sand: #D8C9AD;
  --grey: #535A5A;
  --font-display: "Inter Tight", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }
html, body { overscroll-behavior-y: contain; overflow-x: clip; }
.nowrap { white-space: nowrap; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* grano de papel — turbulencia ESTÁTICA, nunca animada */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold); color: var(--ink); }

.mono { font-family: var(--font-mono); }

a { color: inherit; }

/* ── tipografía base ─────────────────────────────── */
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--grey);
  text-transform: uppercase;
}
.kicker--gold { color: var(--gold-text); }

.h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0.5em 0 0.4em;
}

.lead { color: var(--grey); max-width: 34em; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.badge {
  display: inline-block;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--gold-text);
  border: 1.5px solid var(--gold-text);
  padding: 6px 14px;
  border-radius: 2px;
  margin: 14px 0;
}

.exit-line {
  font-size: 14px;
  color: var(--grey);
  letter-spacing: 0.06em;
}

.footnote { font-size: 12.5px; color: var(--grey); max-width: 46em; margin-top: 22px; }

/* enlaces contextuales de la portada a las páginas de servicio */
.inline-link { color: var(--gold-text); text-decoration: underline; text-underline-offset: 2px; }
.inline-link:hover { color: var(--ink); }
.panel__title a { color: inherit; text-decoration: none; }
.panel__title a:hover { color: var(--gold-text); }
.panel__link, .proof__link {
  display: inline-block; margin-top: 12px;
  font-family: var(--font-mono); font-size: 13px; color: var(--gold-text);
  text-decoration: none; border-bottom: 1.5px solid transparent;
}
.proof__link { border-bottom-color: var(--gold); }
.panel__link:hover, .proof__link:hover { border-bottom-color: var(--gold); color: var(--ink); }

/* ── botones: tinta dibujada, el hover vierte oro ── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 14px 26px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.btn__fill {
  position: absolute;
  inset: 0;
  background: var(--gold);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.btn:hover .btn__fill, .btn:focus-visible .btn__fill { clip-path: inset(0 0 0 0); }
.btn__label { position: relative; z-index: 1; }
.btn--nav { padding: 9px 16px; font-size: 13px; border-width: 1.5px; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ── nav ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.nav__wordmark, .footer__wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav__dots { display: flex; gap: 14px; }
.nav__right { display: flex; align-items: center; gap: 18px; }
.nav__plan {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
}
.nav__plan:hover, .nav__plan:focus-visible { color: var(--ink); border-bottom-color: var(--gold); }
.nav__left { display: flex; align-items: baseline; gap: 22px; }
.nav__links { display: flex; gap: 20px; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
}
.nav__links a:hover, .nav__links a:focus-visible { color: var(--ink); border-bottom-color: var(--gold); }

/* hamburguesa + drawer móvil (compartido con .inav de páginas internas) */
.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 4px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-burger:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* saltar al contenido (accesibilidad, oculto salvo al foco) */
.skip { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 13px; padding: 10px 16px; }
.skip:focus { left: 0; }

/* select de formulario (extraído del inline, con foco visible) */
.form__select { width: 100%; padding: 10px 2px; border: none; border-bottom: 1.5px solid var(--ink); background: transparent; font-family: var(--font-body); font-size: 16px; color: var(--ink); }
.form__select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 680px) {
  .nav-burger { display: inline-flex; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    padding: 6px 22px 16px; display: none;
    box-shadow: 0 8px 16px -12px rgba(0, 0, 0, 0.3);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 11px 0; font-size: 14.5px; }
}
section[id], .cierre__final { scroll-margin-top: calc(var(--nav-h) + 12px); }
.nav__dot {
  width: 9px; height: 9px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  display: block;
  transition: background 0.25s, border-color 0.25s;
}
.nav__dot.is-active { background: var(--gold); border-color: var(--gold); }

/* ── escenas ─────────────────────────────────────── */
.scene { position: relative; }
.pinstage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 12px) 24px 24px;
  max-width: 1240px;
  margin: 0 auto;
}
.scene-head { display: flex; gap: 26px; align-items: baseline; flex-wrap: wrap; position: relative; }
.scene-head .kicker { position: relative; }
#ordenKicker2 { position: absolute; left: 0; top: 0; }

/* ── hero ────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 20px) 24px 40px;
  max-width: 1240px;
  margin: 0 auto;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 18em;
  margin: 20px 0 26px;
}
.hero__sub { color: var(--grey); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 30em; }
.hero__cta { margin: 34px 0 0; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.hero__quick {
  font-size: 13px;
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1.5px solid color-mix(in srgb, var(--grey) 40%, transparent);
}
.hero__quick:hover, .hero__quick:focus-visible { color: var(--ink); border-bottom-color: var(--gold); }
.hero__cue {
  position: absolute;
  bottom: 26px; left: 24px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--grey);
}
/* pantallas bajas (portátil): el hero entero por encima del pliegue */
@media (min-width: 800px) and (max-height: 700px) {
  .hero { padding-top: calc(var(--nav-h) + 8px); }
  .hero__title { font-size: clamp(1.65rem, 3.9vw, 3.1rem); margin: 12px 0 16px; }
  .hero__sub { font-size: 1rem; }
  .hero__cta { margin-top: 18px; }
  .hero__reaseguro { margin-top: 12px; }
  .hero__cue { bottom: 16px; }
}
.hero__thread {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.hero__thread path { stroke: var(--ink); stroke-width: 1.5; }

/* ── diagramas ───────────────────────────────────── */
.diagram { width: 100%; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagram--order { max-width: 1140px; margin: 0 auto; }
.diagram--proof { max-width: 1020px; margin: 18px auto 6px; padding: 0 24px; }
.diagram--mini { width: 210px; margin: 0 auto 8px; opacity: 0.9; }

/* lenguaje del plano (clases usadas por diagram.js) */
.d-stroke { stroke: var(--ink); stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-edge { stroke: var(--ink); stroke-width: 1.4; fill: none; opacity: 0.8; }
.d-edge--new { stroke-width: 1.6; opacity: 0.9; }
.d-fill-paper { fill: var(--paper); }
.d-shadow { fill: var(--sand); opacity: 0.5; }
.d-label {
  font-family: var(--font-mono);
  font-weight: 500;
  fill: var(--ink);
}
.d-sublabel { font-family: var(--font-mono); fill: var(--grey); }
.d-gold { fill: var(--gold); }
.d-gold-stroke { stroke: var(--gold); fill: none; stroke-linecap: round; }
.d-gold-label { font-family: var(--font-mono); font-weight: 500; fill: var(--gold-text); }
.d-hub-title { font-family: var(--font-display); font-weight: 700; fill: var(--ink); }
.d-pulse { fill: var(--gold); }

/* el dato respira: pulso sutil SOLO en el trazo dorado */
@keyframes chipBreathe { 50% { opacity: 0.68; } }
.d-chip .d-gold-stroke { animation: chipBreathe 2.6s ease-in-out infinite; }

.btn--final.is-filled .btn__fill { clip-path: inset(0 0 0 0); }
.btn--final.is-filled small { color: var(--ink); }

/* ── caos ────────────────────────────────────────── */
.chaos__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.1;
  margin: 10px 0 4px;
  max-width: 22em;
}
#caos .diagram { max-width: 1140px; margin: 0 auto; flex: 1; display: flex; align-items: center; min-height: 0; }
#caos .diagram svg { height: min(66svh, 54vw); width: 100%; }

.truths {
  position: absolute;
  left: 50%; bottom: 9svh;
  transform: translateX(-50%);
  width: min(92vw, 620px);
  text-align: center;
  pointer-events: none;
}
.truth { position: absolute; inset: auto 0 0 0; }
.truth__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.2vw, 2.2rem);
  line-height: 1.12;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  display: inline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.2em;
}
.truth__foot { font-size: 13.5px; color: var(--grey); margin-top: 12px; }

.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-text);
  border: 2px solid var(--gold-text);
  border-radius: 3px;
  padding: 5px 12px;
  transform: rotate(-5deg);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}
.stamp--inline { margin-top: 16px; }

#chaosExit { position: absolute; right: 26px; bottom: 22px; }

/* ── giro ────────────────────────────────────────── */
.giro__stage { position: relative; align-items: center; text-align: center; }
.giro__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.18;
  pointer-events: none;
}
/* fundido en el pin del caos: capa centrada sobre los restos del diagrama */
.giro__phrases {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0 24px;
  pointer-events: none;
  z-index: 4;
}
.giro__phrase {
  grid-area: 1 / 1;
  width: min(92vw, 780px);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.u-underline { position: relative; white-space: nowrap; }
.u-underline__svg {
  position: absolute;
  left: -2%; bottom: -0.18em;
  width: 104%; height: 0.28em;
  overflow: visible;
}
.u-underline__svg path { stroke: var(--gold); stroke-width: 5; stroke-linecap: round; }

/* ── orden ───────────────────────────────────────── */
.diagram--order svg { height: min(74svh, 60vw); width: 100%; }
.orden__copy { position: absolute; left: 26px; bottom: 64px; max-width: 30em; pointer-events: none; }
.orden__text { position: absolute; inset: auto auto 0 0; color: var(--grey); font-size: clamp(0.95rem, 1.4vw, 1.15rem); width: max-content; max-width: 30em; }
#ordenExit { position: absolute; right: 26px; bottom: 22px; }
#ordenBadge { position: absolute; left: 26px; bottom: 18px; margin: 0; }

/* ── prueba ──────────────────────────────────────── */
.proof { padding: 15svh 0 12svh; }
.flows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.card {
  border: 1.75px solid var(--ink);
  border-radius: 3px;
  padding: 20px 20px 18px;
  background: color-mix(in srgb, var(--paper) 55%, #fff 20%);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--sand) 80%, transparent);
}
.flow__label { font-size: 12px; letter-spacing: 0.14em; color: var(--gold-text); margin-bottom: 10px; }
.flow p { font-size: 14.5px; line-height: 1.55; }

/* ── LA PRUEBA: El Expediente Abierto ─────────────── */
.expediente { position: relative; max-width: 1000px; margin: 26px auto 8px; padding: 0 24px 0 56px; }
.exp__thread { position: absolute; left: 22px; top: 14px; width: 10px; height: calc(100% - 28px); overflow: visible; }
.exp__thread path { stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; opacity: 0.72; }

.evidence { display: grid; grid-template-columns: 1fr 1.15fr; gap: 34px; align-items: center; padding: 36px 0; }
.evidence + .evidence { border-top: 1px dashed color-mix(in srgb, var(--gold-text) 42%, transparent); }
.evidence--rev .evidence__text { order: 2; }
.evidence--rev .evidence__art { order: 1; }

.evidence__label { font-size: 12px; letter-spacing: 0.13em; color: var(--gold-text); display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.evidence__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border: 2px solid var(--gold-text); border-radius: 50%;
  font-weight: 500; font-size: 13px; color: var(--gold-text); flex: none;
}
.evidence__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 1.62rem); line-height: 1.16; margin-bottom: 13px; }
.evidence__body { font-size: 15px; line-height: 1.62; color: var(--grey); margin-bottom: 16px; }
.evidence__anchor {
  position: relative; display: inline-block;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.32rem); line-height: 1.28; margin-bottom: 20px;
}
.evidence__anchor-rule { position: absolute; left: 0; bottom: -3px; width: 100%; height: 3px; background: var(--gold); border-radius: 2px; transform-origin: left center; }
.verify-link {
  display: inline-block; font-size: 13px; letter-spacing: 0.02em; color: var(--gold-text);
  border-bottom: 1.5px solid var(--gold); padding-bottom: 2px; transition: color 0.2s;
}
.verify-link:hover { color: var(--ink); }

.evidence__art { position: relative; }
.evidence__svg { max-width: 460px; margin: 0 auto; }
.evidence__stamp { position: absolute; top: 2px; right: 6px; z-index: 2; }
.evidence--rev .evidence__stamp { right: auto; left: 6px; }
.evidence__note { font-size: 11px; color: var(--grey); margin-top: 10px; text-align: center; opacity: 0.85; }

.d-redact { fill: var(--ink); opacity: 0.9; }

.proof__close { text-align: center; margin-top: 26px; }
.stamp--big { font-size: clamp(14px, 2.3vw, 19px); padding: 10px 20px; border-width: 2.5px; transform: rotate(-4deg); margin-bottom: 16px; }
.proof__closeline { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.1rem, 2.3vw, 1.5rem); max-width: 26em; margin: 4px auto 0; }
.proof__close .footnote { margin: 22px auto 0; text-align: left; }

@media (max-width: 799.98px) {
  .expediente { padding: 0 4px 0 34px; }
  .exp__thread { left: 12px; }
  .evidence { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .evidence__text { order: 0 !important; }
  .evidence__art { order: 1 !important; }
  .evidence__svg { max-width: 360px; }
  .evidence__stamp { top: 0; right: 0; }
  .evidence--rev .evidence__stamp { left: auto; right: 0; }
}

/* ── plan (horizontal) ───────────────────────────── */
.plan { padding-top: 14svh; }
.plan__intro { padding-bottom: 4svh; }
#planIntroLine { display: block; margin-bottom: 26px; }
.hwrap { position: relative; overflow: hidden; }
.htrack { display: flex; position: relative; }
.panel {
  flex: 0 0 100vw;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 20px) max(6vw, 24px) 60px;
  position: relative;
}
.panel__stamp { position: absolute; top: calc(var(--nav-h) + 26px); right: max(6vw, 24px); }
.panel__phase { color: var(--gold-text); font-size: 13px; letter-spacing: 0.16em; }
.panel__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin: 8px 0 6px;
}
.panel__price { font-size: clamp(1.1rem, 2vw, 1.45rem); color: var(--grey); font-variant-numeric: tabular-nums; margin-bottom: 20px; }
.panel__price strong { color: var(--ink); font-weight: 600; }
.panel__list { list-style: none; max-width: 34em; display: grid; gap: 10px; }
.panel__list li { padding-left: 26px; position: relative; }
.panel__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 16px; height: 1.75px;
  background: var(--ink);
}
.panel__note { font-size: 13px; color: var(--grey); margin-top: 18px; }
.panel__guarantee { max-width: 34em; margin-top: 14px; font-size: 14.5px; border-left: 2.5px solid var(--gold); padding-left: 14px; }
.panel .btn { margin-top: 26px; align-self: flex-start; }
.plan__thread {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}
.plan__thread path { stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* pantallas bajas (portátil): el panel entra entero en el alto del pin
   y deja papel libre abajo para el hilo */
@media (min-width: 800px) and (max-height: 700px) {
  .panel { justify-content: flex-start; padding-top: calc(var(--nav-h) + 14px); padding-bottom: 46px; }
  .panel__title { font-size: clamp(1.55rem, 3.4vw, 2.3rem); margin: 6px 0 4px; }
  .panel__price { font-size: clamp(1rem, 1.7vw, 1.25rem); margin-bottom: 12px; }
  .panel__list { gap: 7px; font-size: 14px; }
  .panel__note { margin-top: 12px; font-size: 12.5px; }
  .panel__guarantee { margin-top: 10px; font-size: 13.5px; }
  .panel .btn, .panel__cta { margin-top: 16px; }
  .panel__stamp { top: calc(var(--nav-h) + 14px); }
}

/* ── filtro ──────────────────────────────────────── */
.filtro { padding: 14svh 0; }
.filtro__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 40px;
  margin-top: 26px;
}
.filtro__head { font-size: 14px; letter-spacing: 0.18em; color: var(--gold-text); margin-bottom: 18px; }
.filtro__head--no { color: var(--grey); }
.filtro__list { list-style: none; display: grid; gap: 14px; }
.fitem { display: flex; gap: 12px; align-items: baseline; font-size: 15.5px; }
.fitem__svg { flex: 0 0 44px; height: 16px; overflow: visible; transform: translateY(2px); }
.fitem__line { stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.filtro__list--no .fitem__line { stroke: var(--grey); }
.fitem__node { fill: var(--gold); }
.fitem__cut { stroke: var(--ink); stroke-width: 2.25; stroke-linecap: round; }
.filtro__remate {
  margin-top: 44px;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
  max-width: 30em;
}
.filtro__promise {
  margin-top: 14px;
  color: var(--gold-text);
  font-weight: 500;
}
.filtro__autor {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--grey);
}

/* ── FAQ + cierre ────────────────────────────────── */
.cierre { padding: 12svh 0 0; }
.faq { margin-top: 18px; display: grid; gap: 10px; max-width: 760px; }
.faq__item {
  border: 1.75px solid var(--ink);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 55%, #fff 15%);
}
.faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 44px 16px 18px;
  font-weight: 600;
  font-size: 15.5px;
  position: relative;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--gold);
  transition: transform 0.25s;
}
.faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq__body { padding: 0 18px 16px; color: var(--grey); font-size: 15px; }
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq__item::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
  }
  .faq__item[open]::details-content { block-size: auto; }
}

.cierre__final { padding: 12svh 24px 10svh; text-align: center; }
.cierre__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  letter-spacing: -0.015em;
  margin: 18px 0 34px;
}
.form { max-width: 620px; margin: 0 auto; text-align: left; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: block; margin-bottom: 16px; }
.form__label { display: block; font-size: 11.5px; letter-spacing: 0.14em; color: var(--grey); margin-bottom: 6px; text-transform: uppercase; }
.form input, .form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1.75px solid var(--ink);
  padding: 8px 2px;
  border-radius: 0;
}
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--gold); }
.form input:focus-visible, .form textarea:focus-visible, .form select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.form textarea { resize: vertical; }

.draw-btn { position: relative; margin-top: 30px; }
.draw-btn__svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
#btnPerimeter { stroke: var(--ink); stroke-width: 2.5; }
.btn--final {
  width: 100%;
  border: none;
  padding: 20px 26px;
  font-size: 17px;
}
.btn--final .btn__label { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.btn--final small { font-family: var(--font-mono); font-weight: 400; font-size: 12px; color: var(--grey); }
.btn--final:hover small, .btn--final:focus-visible small { color: var(--ink); }
.form__note { text-align: center; font-size: 12px; color: var(--grey); margin-top: 16px; }

.footer {
  margin-top: 10svh;
  border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  padding: 34px 24px 46px;
  text-align: center;
  display: grid;
  gap: 8px;
}
.footer__tag { font-size: 14px; color: var(--grey); }
.footer__meta, .footer__legal { font-size: 12px; color: var(--grey); }
.footer__meta a { color: inherit; }

/* ── CTA sticky móvil ────────────────────────────── */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.06em;
  padding: 15px 16px calc(15px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--gold);
  transform: translateY(110%);
  visibility: hidden; /* fuera del tab-order mientras está oculto */
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s 0.4s;
  display: none;
}
.sticky-cta.is-visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), visibility 0s;
}

/* ── responsive ──────────────────────────────────── */
@media (max-width: 799px) {
  body { font-size: 16px; }
  .nav__dots { display: none; }
  .nav__right { gap: 12px; }
  .sticky-cta { display: block; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
  .hero__cta .btn { width: 100%; min-height: 56px; }
  .panel { flex-basis: auto; min-height: 0; padding: 60px 24px; }
  .htrack { flex-direction: column; }
  .hwrap { overflow: visible; }
  .panel__stamp { position: static; align-self: flex-start; margin-bottom: 14px; }
  .truths { bottom: 6svh; }
  #chaosExit, #ordenExit { right: 18px; bottom: 14px; font-size: 12px; }
  #ordenBadge { left: 18px; bottom: 10px; font-size: 11px; }
  .btn--final { min-height: 64px; }
  .proof, .filtro { padding-top: 10svh; }
  #caos .diagram svg { height: min(54svh, 150vw); }
  .diagram--order svg { height: min(50svh, 160vw); }
  #orden .pinstage { justify-content: flex-start; }
  #orden .scene-head { margin-bottom: 8px; }
  .orden__copy { left: 18px; right: 18px; bottom: 118px; max-width: none; }
  .orden__text { max-width: 100%; width: auto; font-size: 0.95rem; }
  #ordenExit { left: 18px; right: 18px; bottom: 58px; text-align: right; }
  #ordenBadge { bottom: 12px; }
  .scene-head { gap: 10px; }
}

/* ── reduced motion: todo visible, nada se mueve ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  /* las frases del giro y las verdades pasan a flujo normal, apiladas */
  .giro__phrases { position: static; inset: auto; min-height: 0; display: grid; gap: 28px; place-items: center; margin: 24px auto 0; }
  .giro__phrase { grid-area: auto; }
  .truths { position: static; transform: none; width: auto; max-width: 640px; margin: 24px auto 0; }
  .truth { position: static; margin-bottom: 22px; }
  .pinstage { min-height: 0; padding-bottom: 60px; }
  /* el botón final no depende del trazo animado */
  .draw-btn__svg { display: none; }
  .btn--final { border: 2.5px solid var(--ink); }
  .sticky-cta { transition: none; }
}

/* ── las tres puertas ────────────────────────────── */
/* banda inferior reservada: las tarjetas nunca llegan donde vive la frase de salida */
#puertas .pinstage { justify-content: flex-start; padding-top: calc(var(--nav-h) + 20px); padding-bottom: 56px; }
#puertasTitle { margin-bottom: 6px; }
.doors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  max-width: 1150px;
  width: 100%;
  margin: 14px auto 0;
  flex: 1;
  align-content: center;
  min-height: 0;
}
.door {
  border: 1.75px solid var(--ink);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 55%, #fff 18%);
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--sand) 75%, transparent);
  padding: 16px 20px 14px;
  display: flex;
  flex-direction: column;
}
.door__num { font-size: 11.5px; letter-spacing: 0.16em; color: var(--gold-text); }
.door__diagram { margin: 6px 0 2px; }
.door__diagram svg { width: 100%; height: auto; max-height: 24svh; display: block; overflow: visible; }
.door__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.12;
  margin: 4px 0 6px;
}
.door__desc { font-size: 13.5px; color: var(--grey); margin-bottom: 10px; }
.door__list { list-style: none; display: grid; gap: 6px; font-size: 12px; margin-bottom: 12px; }
.door__list li { padding-left: 16px; position: relative; }
.door__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 9px; height: 1.5px;
  background: var(--gold);
}
.door__note {
  margin-top: auto;
  font-size: 12.5px;
  color: var(--gold-text);
  border-top: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent);
  padding-top: 8px;
}
#puertasExit {
  position: absolute; right: 26px; bottom: 18px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  padding: 2px 8px;
}

/* pantallas bajas (portátil): tarjetas comprimidas para que la escena
   entera (título + 3 puertas + frase de salida) quepa en el alto del pin */
@media (min-width: 800px) and (max-height: 800px) {
  #puertas .pinstage { padding-top: calc(var(--nav-h) + 10px); }
  #puertas .h2 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
  .doors { gap: 18px; margin-top: 8px; }
  .door { padding: 10px 14px 10px; }
  .door__diagram svg { max-height: 17svh; }
  .door__title { font-size: 1.05rem; margin: 2px 0 4px; }
  .door__desc { font-size: 12.5px; margin-bottom: 6px; }
  .door__list { font-size: 11.5px; gap: 4px; margin-bottom: 8px; }
  .door__note { font-size: 11.5px; padding-top: 6px; }
}

/* ventana estrecha Y baja: las 3 columnas apretadas hacen crecer las tarjetas,
   así que un punto más de compresión */
@media (min-width: 800px) and (max-width: 1080px) and (max-height: 800px) {
  .door__diagram svg { max-height: 13svh; }
  .door__title { font-size: 0.98rem; }
  .door__desc { font-size: 12px; }
  .door__list { font-size: 11px; }
}

/* ── el criterio ─────────────────────────────────── */
.criterio { padding: 13svh 0; }
.criterio__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 22px;
  max-width: 1020px;
}
.criterio__cols p { font-size: 15.5px; }
.criterio .badge { margin-top: 30px; }

@media (max-width: 799px) {
  .doors { grid-template-columns: 1fr; gap: 18px; margin-top: 10px; }
  .door__diagram svg { max-height: 200px; }
  #puertasExit { position: static; margin-top: 16px; text-align: right; display: block; }
  #puertas .pinstage { min-height: 0; padding-bottom: 48px; }
  .criterio { padding: 9svh 0; }
}

/* nav compacta en móvil: wordmark + enlace + botón caben a 375px */
@media (max-width: 799px) {
  .nav { padding: 0 14px; gap: 8px; }
  .nav__wordmark { font-size: 19px; }
  .nav__plan { font-size: 11px; letter-spacing: 0.04em; white-space: nowrap; }
  .btn--nav { padding: 8px 11px; font-size: 12px; white-space: nowrap; }
}

/* halo de papel bajo las etiquetas del plano: legibles entre la maraña */
.d-label, .d-sublabel, .d-gold-label, .d-hub-title {
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ── footer de producción ────────────────────────── */
.footer { text-align: left; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 980px) and (min-width: 800px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer__brand { display: grid; gap: 10px; justify-items: start; }
.footer__brand .footer__tag { max-width: 30em; }
.footer__meta a { color: inherit; text-decoration: none; }
.footer__meta a:hover { color: var(--ink); text-decoration: underline; }
.footer__col { display: grid; gap: 9px; align-content: start; }
.footer__col a {
  color: var(--grey);
  text-decoration: none;
  font-size: 14px;
  width: fit-content;
  border-bottom: 1.5px solid transparent;
}
.footer__col a:hover, .footer__col a:focus-visible { color: var(--ink); border-bottom-color: var(--gold); }
.footer__head { font-size: 11.5px; letter-spacing: 0.16em; color: var(--gold-text); margin-bottom: 4px; }
.footer__funding {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  max-width: 1080px;
  margin: 34px auto 0;
  padding-top: 26px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  width: 100%;
}
.footer__funding p { font-size: 12px; color: var(--grey); }
.footer__funding img { height: 42px; width: auto; }
.footer__legalline { text-align: center; margin-top: 22px; font-size: 12px; color: var(--grey); }
.footer__legalline a { color: inherit; }

@media (max-width: 799px) {
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .footer__funding { gap: 18px; }
  .footer__funding img { height: 36px; }
}

/* ── páginas legales ─────────────────────────────── */
.legal { max-width: 760px; margin: 0 auto; padding: 120px 24px 90px; }
.legal h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin: 10px 0 26px;
}
.legal h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--grey); font-size: 15.5px; margin-bottom: 10px; }
.legal ul { padding-left: 20px; margin-bottom: 12px; }
.legal a { color: var(--ink); }
.legal .volver { display: inline-block; margin-top: 40px; }
.legal__updated { font-family: var(--font-mono); font-size: 12.5px; color: var(--grey); letter-spacing: .04em; margin: -14px 0 22px; }
.legal__intro { border: 1px solid rgba(186,165,127,.45); background: rgba(186,165,127,.09); padding: 14px 16px; border-radius: 4px; font-size: 15px; line-height: 1.55; color: var(--ink); margin-bottom: 8px; }

/* honeypot anti-bot: fuera de pantalla, invisible para humanos y lectores; lo rellenan los bots */
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── consultoría: quick wins ─────────────────────── */
/* reaseguro de riesgo cero bajo el CTA del hero */
.hero__reaseguro {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--gold-text);
  letter-spacing: 0.02em;
}
/* CTA al cierre del panel Fase 3 */
.panel__cta { margin-top: 26px; align-self: flex-start; }
/* nav: nunca partir en dos en móviles estrechos */
.nav__plan, .btn--nav { white-space: nowrap; }
@media (max-width: 380px) {
  .btn--nav { padding: 9px 12px; }
  .nav__plan { display: none; }
}

/* ── estado del envío del formulario (producción: POST a Platform) ── */
.form__status {
  margin-top: 18px;
  border: 1.75px solid var(--ink);
  border-radius: 3px;
  background: color-mix(in srgb, var(--paper) 45%, #fff 22%);
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.form__status--ok { border-color: var(--gold-text); }
.form__status--ok strong { color: var(--gold-text); }
.form__status a { color: var(--gold-text); }
