/* Solvendi v3: "La pila que viaja". Ver web/DESIGN.md y docs/plan/REDISENO-V3.md. */

@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/mona-sans-var.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #F4F4F1;
  --card: #EAEAE5;
  --paper: #E2E2DC;
  --ink: #000;
  --ink-2: #55554F;
  --tone: #8C8C86;
  --line: #D9D9D3;
  --night: #000;
  --on-night: #EDEDEA;
  --on-night-2: #9A9A94;
  --dim-night: #7A7A74;
  --ring: #2E2E2E;
  --green: #163A2B;
  --green-ink: #2C6A4D;
  --mint: #C4E2CF;
  --glow: #5FD39A;
  --err: #B42318;

  --sans: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --max: 1240px;
  --gut: clamp(20px, 4vw, 48px);
  --frame: 12px;
  --radius: 16px;
  --top: 64px;

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  interpolate-size: allow-keywords;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 430; font-stretch: 112%; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(32px, 3.9vw, 56px); }
h3 { font-size: 17px; font-weight: 520; letter-spacing: -0.01em; line-height: 1.3; font-stretch: 104%; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img, svg, video, canvas { display: block; }
.display { font-size: clamp(42px, 5.4vw, 78px); line-height: .98; letter-spacing: -0.04em; }
.mono { font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: 0; color: var(--ink-2); }
.tone { color: var(--tone); }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.offscreen { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

.wrap { width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
[data-theme="dark"] :focus-visible, .frame--night :focus-visible, .frame--green :focus-visible, .frame--band :focus-visible, .top.is-dark :focus-visible { outline-color: var(--mint); }

.skip {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: #fff; text-decoration: none; font-size: 14px;
}
.skip:focus { top: 12px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  font: 500 14.5px/1 var(--sans); font-stretch: 104%; letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s, box-shadow .18s, color .18s, transform .12s var(--ease);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn--light { background: var(--on-night); color: #000; }
.btn--light:hover { background: #fff; }
.btn--dark { background: rgba(0, 0, 0, .25); color: var(--on-night); box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn--dark:hover { box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .5); background: rgba(237, 237, 234, .08); }
.btn--ink { background: #000; color: #fff; }
.btn--ink:hover { background: #2A2A27; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn--block { width: 100%; height: 46px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: progress; }

/* Cabecera */
.top {
  position: sticky; top: 0; z-index: 50;
  transition: background-color .25s, box-shadow .25s, color .25s;
}
.top--over { position: fixed; left: 0; right: 0; }
.top.is-scrolled {
  background: rgba(244, 244, 241, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.top.is-dark { color: var(--on-night); }
.top.is-dark.is-scrolled { background: rgba(0, 0, 0, .5); box-shadow: 0 1px 0 rgba(237, 237, 234, .08); }
.top__in { height: var(--top); display: flex; align-items: center; gap: 32px; transition: height .25s var(--ease); }
.top.is-scrolled .top__in { height: calc(var(--top) - 8px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 560; font-size: 17px; font-stretch: 112%; letter-spacing: -0.025em; }
.brand__mark { width: 22px; height: 22px; }
.nav { display: flex; gap: 28px; margin-inline: auto; font-size: 14px; }
.nav a { color: var(--ink-2); text-decoration: none; transition: color .15s; }
.nav a:hover { color: var(--ink); }
.top.is-dark .nav a { color: var(--on-night-2); }
.top.is-dark .nav a:hover { color: var(--on-night); }
.top.is-dark .btn--ink { background: var(--on-night); color: #000; }
.top.is-dark .btn--ink:hover { background: #fff; }
.top__cta { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.nav + .top__cta { margin-left: 0; }
.link-call { font-size: 14px; text-decoration: none; color: var(--ink-2); }
.link-call:hover { color: var(--ink); }
.top.is-dark .link-call { color: var(--on-night-2); }

/* Paneles enmarcados. overflow: clip (no hidden) para que funcione position: sticky dentro. */
.frame {
  position: relative; isolation: isolate; overflow: clip;
  margin-inline: var(--frame); border-radius: var(--radius);
}
.frame--night { background: var(--night); color: var(--on-night); }
.frame--green { background: var(--green); color: var(--on-night); }
.frame--paper { background: var(--paper); }
.grain {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background-image: var(--noise); background-size: 180px 180px; opacity: .06;
}

/* Etiquetas y pastillas */
.pill {
  display: inline-flex; align-items: center; width: fit-content; height: 24px; padding: 0 10px;
  border-radius: 999px; background: rgba(0, 0, 0, .06);
  font: 11.5px/1 var(--mono); color: var(--ink-2); white-space: nowrap;
}
.card__pill {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: #DDDDD7; color: var(--ink);
}
.card__pill .i { width: 18px; height: 18px; }

/* ============================================================================================
   La noche: hero + capítulos comparten un único lienzo WebGL (sticky dentro del panel).
   ============================================================================================ */
/* Al cargar, la cabecera va en su propia franja sobre el papel y el vídeo empieza debajo (principio de scale.com). */
.night { margin-top: var(--top); }
.gl {
  position: sticky; top: 0; z-index: 0;
  width: 100%; height: 100vh; margin-bottom: -100vh;
  pointer-events: none; opacity: 0; transition: opacity .8s;
}
html.has-gl .gl { opacity: 1; }

/* Hero */
.hero { position: relative; min-height: max(620px, calc(100svh - var(--top) - var(--frame))); display: grid; }
.hero__media { position: absolute; inset: 0; z-index: 1; overflow: clip; }
.hero__video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .55) 34%, rgba(0, 0, 0, .12) 62%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(to right, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, 0) 55%);
}
.hero__in {
  position: relative; z-index: 3; align-self: end;
  width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px;
  padding-block: 48px 104px;
}
.hero h1 { font-size: clamp(40px, 5vw, 76px); color: #F4F4F1; max-width: 15ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.ask { display: flex; align-items: center; gap: 10px; max-width: 520px; margin-top: 30px; padding: 7px 7px 7px 20px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(20, 22, 21, .42); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: border-color .2s ease, background-color .2s ease; }
.ask:focus-within { border-color: rgba(255, 255, 255, .55); background: rgba(20, 22, 21, .6); }
.ask__in { flex: 1; min-width: 0; height: 40px; border: 0; background: none; outline: none; font: inherit; font-size: 16px; color: #F4F4F1; }
.ask__in::placeholder { color: rgba(237, 237, 234, .62); }
.ask__go { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #F4F4F1; color: #111311; cursor: pointer; transition: transform .2s ease, background-color .2s ease; }
.ask__go .i { width: 18px; height: 18px; rotate: -90deg; }
.ask__go:hover { background: #fff; }
.ask__go:active { transform: scale(.94); }
.ask__go:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.cue {
  position: absolute; left: 50%; bottom: 26px; z-index: 3; translate: -50% 0;
  display: inline-flex; align-items: center; gap: 12px;
  font: 12px/1 var(--mono); color: var(--on-night-2); text-decoration: none; transition: color .2s;
}
.cue:hover { color: var(--on-night); }
.cue__box { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .25); }
.cue .i { width: 14px; height: 14px; }

.hero__pause {
  position: absolute; right: max(var(--gut), calc((100% - var(--max)) / 2)); bottom: 20px; z-index: 3;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, .3); color: var(--on-night-2); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .22); transition: color .2s, box-shadow .2s;
}
.hero__pause:hover { color: var(--on-night); box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .5); }
.hero__pause .i { width: 14px; height: 14px; }
.hero__pause[aria-pressed="true"] .i { fill: currentColor; }

@media (prefers-reduced-motion: no-preference) {
  .js .hero__in { opacity: calc(1 - var(--h, 0) * 1.8); translate: 0 calc(var(--h, 0) * -48px); }
  .js .cue, .js .hero__pause { opacity: calc(1 - var(--h, 0) * 5); }
  .js .hero__shade { opacity: calc(1 - var(--h, 0) * 1.4); }
}

/* Capítulos de la pila. Sin JS o con movimiento reducido: lista estática con un póster. */
.chapters { position: relative; z-index: 1; padding-block: 64px 96px; }
.chapters__poster { width: min(560px, 90%); height: auto; margin: 0 auto 24px; }
html.has-gl .chapters__poster { opacity: 0; }
.chapters__in { width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto; }
.chapters__copy { max-width: 560px; }
.chapters__list { display: grid; gap: 56px; margin-top: 32px; }
.chap__label { display: flex; align-items: center; gap: 8px; font: 12px/1 var(--mono); color: var(--mint); }
.chap__label .i { width: 16px; height: 16px; }
.chap__t { margin-top: 18px; font-size: clamp(34px, 4.1vw, 62px); line-height: 1; color: #F4F4F1; }
.chap__t span { display: block; color: #75756F; }
.chap__p { margin-top: 22px; max-width: 38ch; font-size: 18px; line-height: 1.5; color: var(--on-night-2); }

@media (prefers-reduced-motion: no-preference) {
  .js .chapters { height: 440vh; padding: 0; }
  .js .chapters__stage { position: sticky; top: 0; height: 100vh; display: grid; }
  .js .chapters__poster {
    position: absolute; right: 4%; top: 50%; translate: 0 -50%; width: min(52vw, 760px); margin: 0;
    transition: opacity .8s;
  }
  .js .chapters__in { display: grid; align-items: center; }
  .js .chapters__copy { position: relative; z-index: 1; }
  .js .chapters__list { gap: 0; margin-top: 0; }
  .js .chap { grid-area: 1 / 1; opacity: 0; translate: 0 18px; transition: opacity .5s var(--ease), translate .7s var(--ease); }
  .js .chap.is-on { opacity: 1; translate: 0 0; }
  .js .chap__p .w { color: var(--dim-night); transition: color .3s; }
  .js .chap__p .w.is-on { color: var(--on-night); }
}

/* ============================================================================================
   Inventario (verde)
   ============================================================================================ */
.inv { margin-top: var(--frame); }
.inv__in {
  width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto;
  padding-block: clamp(80px, 10vw, 136px);
}
.inv__head { display: grid; justify-items: center; text-align: center; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.inv__h { font-size: clamp(36px, 5vw, 72px); max-width: 16ch; letter-spacing: -0.045em; }
.inv__lede { max-width: 44ch; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; color: var(--ink-2); }
.inv .note { margin-inline: auto; justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
  .js .inv [data-reveal] .w { color: rgba(0, 0, 0, .46); }
  .js .inv [data-reveal] .w.is-on { color: var(--ink); }
}

/* Bento 2x2 (principio de Replit): color suave, texto arriba a la izquierda y un visual sencillo a la derecha. */
.bento { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bc {
  position: relative; overflow: clip; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px;
  min-height: 330px; padding: clamp(26px, 3vw, 40px); border-radius: 24px; color: var(--ink);
}
.bc__t { display: grid; align-content: start; gap: 10px; }
.bc__k { font: 12.5px/1 var(--mono); letter-spacing: .04em; opacity: .7; }
.bc h3 { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.08; letter-spacing: -0.03em; margin: 4px 0 2px; }
.bc__t > p:last-child { font-size: 15px; line-height: 1.5; opacity: .78; max-width: 30ch; }
.bc--mint  { background: #CFE6D7; }
.bc--night { background: #12201A; color: #EDEDEA; }
.bc--stone { background: #E9E9E4; }
.bc--green {
  color: #06140D;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, .22) 56%, transparent 66%, rgba(255, 255, 255, .16) 82%, transparent 92%),
    radial-gradient(120% 90% at 85% 50%, #9BEBC1 0%, #5FD39A 45%, #3BAA74 100%);
}

/* Formatos: la barra recorre la lista */
.fmt { list-style: none; margin: 0 calc(-1 * clamp(26px, 3vw, 40px)) 0 0; padding: 0; position: relative; align-self: center; display: grid; }
.fmt li { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; height: 64px; padding-left: 20px; font-size: clamp(28px, 3vw, 42px); letter-spacing: -0.03em; }
.fmt::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 64px; border-radius: 12px 0 0 12px; background: #5FD39A; }
.fmt__d { width: 14px; height: 14px; background: radial-gradient(circle, currentColor 1.3px, transparent 1.6px) 0 0 / 5px 5px; opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .fmt::before { animation: fmt-step 6s var(--ease) infinite; }
  @keyframes fmt-step { 0%, 28% { translate: 0 0; } 33%, 61% { translate: 0 64px; } 66%, 94% { translate: 0 128px; } 100% { translate: 0 0; } }
}

/* Burbujas de registros */
.bub { align-self: center; display: grid; gap: 10px; }
.bub__m { width: fit-content; max-width: 100%; padding: 10px 14px; border-radius: 12px; background: rgba(237, 237, 234, .1); font-size: 13.5px; color: rgba(237, 237, 234, .9); }
.bub__m--r { justify-self: end; background: rgba(95, 211, 154, .22); }

/* Histórico de órdenes de trabajo: barras por año y dos filas tipo ficha (ilustrativo). */
.ot { align-self: center; display: grid; gap: 10px; }
.ot__chart { padding: 16px 16px 12px; border-radius: 14px; background: #fff; }
.ot__bars { display: flex; align-items: flex-end; gap: 5px; height: 96px; }
.ot__bars i { flex: 1; height: 40%; border-radius: 3px 3px 1px 1px; background: #C9D8CF; transform-origin: 50% 100%; }
.ot__bars i:nth-child(2) { height: 52%; } .ot__bars i:nth-child(3) { height: 46%; } .ot__bars i:nth-child(4) { height: 64%; }
.ot__bars i:nth-child(5) { height: 58%; } .ot__bars i:nth-child(6) { height: 72%; } .ot__bars i:nth-child(7) { height: 66%; }
.ot__bars i:nth-child(8) { height: 80%; } .ot__bars i:nth-child(9) { height: 74%; } .ot__bars i:nth-child(10) { height: 88%; }
.ot__bars i:nth-child(11) { height: 82%; } .ot__bars i:nth-child(12) { height: 94%; background: var(--green-ink); }
.ot__bars i:nth-child(13) { height: 100%; background: #5FD39A; }
.ot__yrs { display: flex; justify-content: space-between; margin-top: 8px; font: 11.5px/1 var(--mono); color: var(--ink-2); }
.ot__row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #fff; font-size: 13.5px; }
.ot__row span { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--green-ink); }
.ot__row em { margin-left: auto; font: normal 11.5px/1 var(--mono); color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .js .ot__bars i { scale: 1 calc(.15 + .85 * var(--e, 1)); transition: scale .2s linear; }
}

/* Líneas de sistemas */
.code { align-self: end; display: grid; gap: 8px; font: 13px/1.3 var(--mono); }
.code p { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .5); }
.code span { color: rgba(6, 20, 13, .66); }

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] .w { color: rgba(237, 237, 234, .46); transition: color .3s; }
  .js [data-reveal] .w.is-on { color: #F4F4F1; }
}

/* ============================================================================================
   Categorías (gris claro): "Datos de [palabra]" con miniaturas flotantes
   ============================================================================================ */
.cats {
  margin-top: var(--frame); min-height: max(720px, 92vh);
  display: grid; place-items: center; padding: 120px 0;
}
.cats { position: relative; overflow: clip; }
/* Dos columnas de imágenes y vídeos en los lados que se mueven en sentidos opuestos con el scroll */
.cats__col {
  --cw: clamp(140px, 14vw, 210px);
  position: absolute; top: -12%; z-index: 0; width: var(--cw);
  display: grid; gap: 16px; pointer-events: none;
}
.cats__col--l { left: var(--gut); translate: 0 calc(var(--py, 0) * 140px); }
.cats__col--r { right: var(--gut); top: -4%; translate: 0 calc(var(--py, 0) * -140px); }
.cm { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; background: #cfcfc8; }
.cats__in { position: relative; z-index: 1; text-align: center; padding-inline: var(--gut); max-width: calc(100% - 2 * (clamp(140px, 14vw, 210px) + var(--gut))); }
.cats__h { font-size: clamp(38px, 5.5vw, 92px); letter-spacing: -0.045em; line-height: 1; }
.rot { display: grid; justify-items: center; color: var(--green-ink); margin-top: .08em; }
.rot > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: .2em; opacity: 0; translate: 0 .35em; transition: opacity .45s var(--ease), translate .6s var(--ease); }
.rot > span.is-on { opacity: 1; translate: 0 0; }
.rot > span.is-off { opacity: 0; translate: 0 -.35em; }
html:not(.js) .rot > span:first-child { opacity: 1; translate: 0 0; }
/* El icono amable de cada palabra: un cuadradito menta que entra un poco antes que la palabra */
.rot__i { flex: none; display: grid; place-items: center; width: .78em; height: .78em; border-radius: .2em; background: var(--mint); }
.rot__i .i { width: .46em; height: .46em; stroke-width: 1.6; }
.rot > span.is-on .rot__i { animation: rot-pop .6s var(--ease) both; }
@keyframes rot-pop { from { scale: .6; rotate: -12deg; } to { scale: 1; rotate: 0deg; } }
.cats__p { margin: 26px auto 32px; max-width: 38ch; font-size: 18px; color: var(--ink-2); }

/* ============================================================================================
   Secciones claras: garantías y preguntas
   ============================================================================================ */
.sec { padding: 128px 0 96px; }
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.split__head { grid-column: 1 / span 5; padding-right: 32px; }
.split > :last-child { grid-column: 6 / span 7; }
.split__head--sticky { position: sticky; top: calc(var(--top) + 40px); }
.note { display: flex; gap: 10px; margin-top: 28px; max-width: 46ch; font-size: 14.5px; color: var(--ink-2); }
.note .i { width: 18px; height: 18px; margin-top: 2px; }
.aside { margin-top: 24px; max-width: 34ch; font-size: 14.5px; color: var(--ink-2); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; padding: 20px 22px 22px; border-radius: 8px; background: var(--card); color: var(--ink);
  transition: box-shadow .25s var(--ease);
}
.card h3 { margin-bottom: 6px; }
.card p { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.card--row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 18px; align-items: start; padding: 20px 22px; }
.card--row h3 { margin: 6px 0 4px; }
.card--row .pill { margin-top: 5px; }
.card:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 14px 30px -22px rgba(0, 0, 0, .45); }
.card__pill { transition: background-color .2s var(--ease), color .2s var(--ease); }
.card:hover .card__pill { background: var(--green-ink); color: #F4F4F1; }

@media (prefers-reduced-motion: no-preference) {
  .js [data-enter] { opacity: calc(.2 + var(--e, 1) * .8); translate: 0 calc((1 - var(--e, 1)) * 28px); }
}

/* Guías y aviso (v4): un carrusel de guías sobre papel. Al seguir bajando, las piezas de sus maquetas se recogen
   en un rombo (la lámina de arriba del logo), el fondo sigue blanco, aparece el logo en 3D y de él se abre
   el círculo verde que es la sección del aviso. */
.exp { position: relative; }
.exp__stage { position: relative; overflow: clip; min-height: 100vh; min-height: 100dvh; background: var(--canvas); }
.exp__night { position: relative; height: 60vh; min-height: 320px; background: var(--canvas); }

.gd { position: relative; z-index: 1; padding-block: 112px 72px; }
.gd__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.gd__head h2 { max-width: 20ch; }
.gd__head p { margin-top: 16px; max-width: 52ch; color: var(--ink-2); font-size: 16px; }
.gd__nav { display: flex; gap: 8px; flex: none; }
.gd__btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--card); color: var(--ink); cursor: pointer; touch-action: manipulation;
  transition: background-color .18s, opacity .18s, transform .12s var(--ease);
}
.gd__btn .i { rotate: 90deg; }
.gd__btn--next .i { rotate: -90deg; }
.gd__btn:hover:not(:disabled) { background: var(--paper); }
.gd__btn:active:not(:disabled) { transform: scale(.94); }
.gd__btn:disabled { opacity: .4; cursor: default; }
.gd__track {
  --pad: max(var(--gut), calc((100% - var(--max)) / 2));
  list-style: none; margin: 40px 0 0; padding: 0 var(--pad) 8px; display: flex; gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gd__track::-webkit-scrollbar { display: none; }
.gcard { flex: 0 0 clamp(270px, 28vw, 380px); scroll-snap-align: start; }
.gcard > a { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; border-radius: 20px; }
.gcard h3 { margin-top: 18px; font-size: 18px; line-height: 1.25; }
.gcard__pts { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.gcard__pts li { position: relative; padding-left: 14px; }
.gcard__pts li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--tone); }
.gcard__more { margin-top: auto; padding-top: 14px; font-size: 14px; font-weight: 520; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: text-decoration-color .18s; }
.gcard > a:hover .gcard__more { text-decoration-color: currentColor; }
.ga {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  height: clamp(190px, 26vh, 260px); padding: 22px; border-radius: 18px; background: var(--card); overflow: hidden;
  transition: background-color .25s var(--ease);
}
.gcard > a:hover .ga { background: var(--paper); }
/* Piezas de las maquetas. También se copian a la capa de vuelo, así que no dependen del contenedor.
   --ct (1 → 0) apaga su texto y sus rayas mientras vuelan. */
.gbx { display: grid; gap: 8px; padding: 14px; border-radius: 10px; background: #fff; }
.gbx--doc b { font-size: 13px; font-weight: 560; color: var(--ink); opacity: var(--ct, 1); }
.gbx--sm { width: 62%; align-self: flex-end; padding: 12px; }
.gln { display: block; height: 7px; border-radius: 4px; background: #DCDCD6; opacity: var(--ct, 1); }
.gln--x { background: #1B1E24; }
.w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
.grow { display: flex; flex-wrap: wrap; gap: 8px; }
.gtag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--mint); font-size: 12.5px; font-weight: 500; white-space: nowrap;
  color: color-mix(in srgb, var(--green) calc(var(--ct, 1) * 100%), transparent);
}
.gtag--soft { background: #fff; color: color-mix(in srgb, var(--ink-2) calc(var(--ct, 1) * 100%), transparent); }
.gtag--no { background: #F6DEDA; color: color-mix(in srgb, #8A2A20 calc(var(--ct, 1) * 100%), transparent); }
.gfile {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; background: #fff;
  font-size: 13px; white-space: nowrap; color: color-mix(in srgb, var(--ink) calc(var(--ct, 1) * 100%), transparent);
}
.gfile > * { opacity: var(--ct, 1); }
.gfile i { width: 14px; height: 16px; border-radius: 3px; background: var(--mint); flex: none; }
.gfile em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--green-ink); }
.gbar { height: 10px; border-radius: 5px; background: #fff; overflow: hidden; }
.gbar span { display: block; width: 64%; height: 100%; border-radius: inherit; background: var(--glow); opacity: var(--ct, 1); }
.gd__fly, .gd__gem { display: none; }
@media (max-width: 640px) {
  .gd__head { flex-direction: column; align-items: stretch; gap: 16px; }
  .gd__head p { font-size: 15px; margin-top: 12px; }
  .gd__nav { justify-content: flex-end; margin-top: -8px; }
  .gd__track { margin-top: 16px; }
  .gcard { flex-basis: min(82vw, 330px); }
}
.exp__logo3d { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(44vmin, 380px); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; display: none; }
.exp__logo {
  position: absolute; left: 50%; top: 50%; z-index: 3; translate: -50% -50%;
  display: grid; place-items: center; width: 88px; height: 88px; border-radius: 24px;
  background: #fff; color: var(--green-ink); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
}
.exp__logo svg { width: 40px; height: 40px; }
.exp.has-logo3d .exp__logo3d { display: block; }
.exp.has-logo3d .exp__logo { display: none; }

.exp__dome {
  position: relative; z-index: 2; color: #fff;
  background: radial-gradient(120% 70% at 50% 118%, rgba(95, 211, 154, .62) 0%, rgba(95, 211, 154, .18) 45%, rgba(95, 211, 154, 0) 70%), linear-gradient(180deg, #1F523B 0%, var(--green-ink) 100%);
}
.exp__content {
  position: relative; display: grid; justify-items: center; text-align: center;
  width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto; padding-block: clamp(96px, 12vh, 140px);
}
.exp__content h2 { font-size: clamp(34px, min(5vw, 8vh), 72px); color: #fff; max-width: 13ch; letter-spacing: -0.04em; }
.exp__content > p { margin-top: 18px; max-width: 46ch; font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, .86); }
.btn--outline { margin-top: 26px; background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7); }
.btn--outline:hover { background: #fff; color: var(--green-ink); }
/* Tarjetas: lámina de color pastel con un icono grande y limpio, y el texto debajo. */
.exp__cards { list-style: none; margin: clamp(32px, 5vh, 56px) 0 0; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; text-align: left; }
.wcard { --t-bg: #DDF3E6; --t-fg: #2C8A5C; display: flex; flex-direction: column; gap: 16px; padding: 10px 10px 20px; border-radius: 22px; background: #fff; color: var(--ink); transition: translate .3s var(--ease), box-shadow .3s var(--ease); }
.wcard--sky { --t-bg: #DFF1FA; --t-fg: #2B8FC4; }
.wcard--pink { --t-bg: #F9E4EF; --t-fg: #CC4F92; }
.wcard--coral { --t-bg: #FCE4E1; --t-fg: #D9493F; }
.wcard__art { display: grid; place-items: center; height: clamp(84px, 15vh, 150px); border-radius: 14px; background: var(--t-bg); color: var(--t-fg); }
.wi { width: clamp(40px, 6vh, 60px); height: clamp(40px, 6vh, 60px); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.wcard__b { padding-inline: 10px; }
.wcard h3 { font-size: 17px; margin-bottom: 6px; }
.wcard p { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.wcard:hover { translate: 0 -4px; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .55); }
/* El icono se dibuja una vez, al aparecer la sección; al pasar el cursor solo sube y crece, sin borrarse. */
.wi { transition: translate .3s var(--ease), scale .3s var(--ease); }
.wcard:hover .wi { translate: 0 -2px; scale: 1.06; }
@media (prefers-reduced-motion: no-preference) {
  .js .exp .wi { stroke-dasharray: 200; stroke-dashoffset: calc((1 - min(1, var(--c, 1) * 1.25)) * 200); }
}

/* Sin movimiento: las guías, debajo el logo sobre papel y después la sección verde, uno tras otro. */
@media (prefers-reduced-motion: no-preference) {
  .js .exp { height: 420vh; }
  .js .exp__stage { position: sticky; top: 0; height: 100vh; height: 100dvh; }
  .js .exp__night { position: absolute; inset: 0; height: auto; min-height: 0; background: transparent; }
  .js .gd { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding-block: calc(var(--top) + 16px) 32px; opacity: calc(1 - var(--t, 0)); }
  .js .exp.is-morph .gd { pointer-events: none; }
  .js .gd__fly { display: block; position: absolute; inset: 0; z-index: 4; pointer-events: none; }
  .js .gd__box { position: absolute; transform-origin: 50% 50%; will-change: transform; overflow: hidden; contain: layout paint; }
  .js .gd__box > .ga { position: absolute; inset: 0 auto auto 0; }
  .js .gd__gem {
    display: block; position: absolute; left: 50%; top: 50%; z-index: 5; width: 120px; height: 120px; translate: -50% -50%; rotate: 45deg;
    border-radius: 9%; background: #84DAAE; box-shadow: inset 0 0 0 1px rgba(230, 246, 236, .55); opacity: 0; pointer-events: none;
  }
  .js .exp__logo, .js .exp__logo3d { top: calc(50% - var(--c, 0) * 8vh); opacity: calc(min(1, var(--l, 0) * 8) * (1 - var(--c, 0))); }
  .js .exp__logo { scale: calc(.6 + var(--l, 0) * .4); }
  .js .exp__dome { position: absolute; inset: 0; clip-path: circle(calc(var(--d, 0) * 75vmax) at 50% 50%); display: grid; align-items: center; }
  .js .exp__content { opacity: var(--c, 0); translate: 0 calc((1 - var(--c, 0)) * 24px); padding-block: 72px 24px; }
}

/* Preguntas */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px 0; list-style: none; cursor: pointer;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em; font-stretch: 104%;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { width: 18px; height: 18px; color: var(--ink-2); transition: rotate .3s var(--ease); }
.faq details[open] summary .i { rotate: 45deg; }
.faq details p { padding-bottom: 22px; max-width: 58ch; font-size: 15.5px; color: var(--ink-2); }
@supports selector(::details-content) {
  @media (prefers-reduced-motion: no-preference) {
    .faq details::details-content { block-size: 0; overflow: clip; transition: block-size .34s var(--ease), content-visibility .34s allow-discrete; }
    .faq details[open]::details-content { block-size: auto; }
  }
}

/* Cierre en banda verde */
.close { padding: 116px 0 0; }
.frame--band {
  color: var(--on-night);
  background:
    radial-gradient(90% 70% at 18% 0%, rgba(196, 226, 207, .26), transparent 62%),
    radial-gradient(70% 60% at 100% 100%, rgba(0, 0, 0, .35), transparent 70%),
    var(--green);
}
.frame--band .grain { opacity: .1; }
.close__in {
  position: relative; z-index: 3;
  width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(72px, 9vw, 120px) 0 88px;
}
.close__head { text-align: center; }
.close h2 { font-size: clamp(44px, 6vw, 88px); color: #F4F4F1; }
.close__sub { margin: 22px auto 0; max-width: 40ch; font-size: 17px; color: rgba(237, 237, 234, .76); }
.close__phone { margin-top: 14px; font-size: 17px; color: rgba(237, 237, 234, .76); }
.close__phone a { color: var(--mint); text-underline-offset: 3px; }
.close .form { width: min(620px, 100%); margin-top: 40px; }
.form__lead { margin-bottom: 18px; font-size: 16px; font-weight: 520; }

/* Chat «Contar el caso». Sin JS se ve el formulario; con JS, el chat (y el formulario entra al final). */
.chat { display: none; width: min(780px, 100%); margin-top: 44px; }
.has-chat .chat { display: block; }
.has-chat .close .form:not(.form--chat) { display: none; }
.chat__panel {
  background: #FBFBF8; color: var(--ink); border-radius: 22px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: box-shadow .25s var(--ease);
}
.chat__panel:focus-within { box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .7), 0 0 0 4px rgba(196, 226, 207, .45); }
.chat__log { display: none; flex-direction: column; gap: 18px; max-height: min(62vh, 580px); overflow-y: auto; overscroll-behavior: contain; padding: 26px 26px 14px; }
.is-open .chat__log { display: flex; }
.chat__bar { display: flex; align-items: flex-end; gap: 10px; padding: 12px 12px 12px 22px; }
.chat__bar[hidden] { display: none; }
.is-open .chat__bar { border-top: 1px solid var(--line); }
.chat__in {
  flex: 1; min-width: 0; max-height: 168px; padding: 11px 0; border: 0; resize: none; outline: none; overflow-y: hidden;
  background: transparent; color: var(--ink); font: inherit; font-size: 17px; line-height: 1.45;
}
.chat__in::placeholder { color: #85857F; }
.chat__send {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: #000; color: #fff; cursor: pointer; transition: transform .16s var(--ease), background .2s;
}
.chat__send:hover { background: #2A2A27; }
.chat__send:active { transform: scale(.92); }
.chat__send:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.chat__ico { grid-area: 1 / 1; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s, transform .28s var(--ease); }
.chat__ico--stop { fill: currentColor; stroke: none; opacity: 0; transform: scale(.4); }
.is-busy .chat__ico--send { opacity: 0; transform: translateY(-8px); }
.is-busy .chat__ico--stop { opacity: 1; transform: none; }

.chat__starts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chat__starts[hidden] { display: none; }
.chat__chip {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--on-night); background: rgba(237, 237, 234, .08);
  box-shadow: inset 0 0 0 1px rgba(237, 237, 234, .26); transition: background .18s, box-shadow .18s, transform .14s var(--ease);
}
.chat__chip:hover { background: rgba(237, 237, 234, .16); }
.chat__chip:active { transform: scale(.97); }
.chat__chip:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.chat__note { margin-top: 16px; font-size: 13px; text-align: center; color: rgba(237, 237, 234, .62); }
.chat__note a { color: var(--mint); text-underline-offset: 2px; }

.msg { display: flex; align-items: flex-start; gap: 12px; }
.msg--user { justify-content: flex-end; }
.msg__b {
  max-width: 80%; padding: 10px 15px; border-radius: 18px 18px 5px 18px;
  background: var(--green); color: #F4F4F1; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg__t { max-width: 62ch; padding-top: 3px; font-size: 16px; line-height: 1.55; }
.mk { flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: #000; color: #fff; overflow: visible; }
.mk path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; }
.mk .mk__a { fill: currentColor; stroke: none; }
.msg__think {
  padding-top: 5px; font-size: 15px; color: transparent;
  background: linear-gradient(90deg, var(--ink-2) 0 35%, #000 50%, var(--ink-2) 65% 100%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 42px; }
.chips .chat__chip { color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.chips .chat__chip:hover { box-shadow: inset 0 0 0 1px #000; }
.chips .chat__chip:focus-visible { outline-color: var(--green); }
.chips .chat__chip[aria-pressed="true"] { background: #000; color: #fff; box-shadow: none; }
.chips .chat__chip--ok { background: var(--green); color: #fff; box-shadow: none; }
.chips .chat__chip--ok:disabled { opacity: .35; cursor: default; }
.chips .chat__chip--ghost { background: transparent; box-shadow: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

.est { margin-left: 42px; padding: 22px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.est__k { font-size: 13.5px; color: var(--ink-2); }
.est__v { margin-top: 4px; font-size: clamp(30px, 4.4vw, 44px); font-weight: 620; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.est__s { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.est__list { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.est__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.est__n { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-weight: 560; }
.est__r { font-family: var(--mono); font-size: 14px; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.est__note { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }
.est__tag { padding: 2px 9px; border-radius: 6px; background: var(--card); color: var(--ink-2); font-size: 11.5px; font-weight: 500; }
.est__tag.is-ok { background: var(--mint); color: var(--green); }
.est__out, .est__legal { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.est__warn { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #F3EDD8; font-size: 13.5px; }
.est__cta { width: 100%; margin-top: 18px; height: 46px; }
.close .form--chat { width: auto; margin: 0 0 0 42px; padding: 22px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.form--chat .field--msg { display: none; }
.caret { display: none; }
.chat__tools { display: none; justify-content: center; margin-top: 12px; }
.is-open ~ .chat__tools, .chat.is-open .chat__tools { display: flex; }
.chat__reset { padding: 4px 8px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13.5px; color: rgba(237, 237, 234, .78); text-decoration: underline; text-underline-offset: 3px; }
.chat__reset:hover { color: #fff; }
.chat__reset:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.is-restoring *, .is-restoring { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: no-preference) {
  .is-open .chat__log { animation: chat-open .45s var(--ease) both; }
  .msg, .chips, .est, .form--chat { animation: msg-in .42s var(--ease) both; }
  .chips .chat__chip { animation: msg-in .36s var(--ease) both; }
  .chips .chat__chip:nth-child(2) { animation-delay: 40ms; }
  .chips .chat__chip:nth-child(3) { animation-delay: 80ms; }
  .chips .chat__chip:nth-child(4) { animation-delay: 120ms; }
  .chips .chat__chip:nth-child(5) { animation-delay: 160ms; }
  .chips .chat__chip:nth-child(n+6) { animation-delay: 200ms; }
  .est__row { animation: msg-in .4s var(--ease) both; }
  .est__row:nth-child(2) { animation-delay: 60ms; }
  .est__row:nth-child(3) { animation-delay: 120ms; }
  .est__row:nth-child(4) { animation-delay: 180ms; }
  .est__row:nth-child(5) { animation-delay: 240ms; }
  .est__row:nth-child(n+6) { animation-delay: 300ms; }
  .is-thinking .mk { animation: mk-ring 1.6s ease-out infinite; }
  .is-thinking .mk path { animation: mk-breathe 1.2s var(--ease) infinite; }
  .is-thinking .mk .mk__b { animation-delay: .14s; }
  .is-thinking .mk .mk__c { animation-delay: .28s; }
  .msg__think { animation: shimmer 1.8s linear infinite; }
  .w { display: inline-block; animation: w-in .5s var(--ease) both; }
  .caret { display: inline-block; width: .5em; height: 1.05em; margin-left: 3px; vertical-align: -.16em; border-radius: 2px; background: var(--green); animation: caret-out .35s ease both; }
  .msg--user { animation: none; }
  .msg--user .msg__b { transform-origin: 100% 100%; animation: bubble-in .32s var(--ease) both; }
}
@keyframes chat-open { from { opacity: 0; transform: translateY(10px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes bubble-in { from { opacity: 0; transform: scale(.9); } }
@keyframes w-in { from { opacity: 0; filter: blur(5px); transform: translateY(3px); } }
@keyframes caret-out { to { opacity: 0; } }
@keyframes mk-breathe { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-2.5px); opacity: .4; } }
@keyframes mk-ring { 0% { box-shadow: 0 0 0 0 rgba(44, 106, 77, .45); } 100% { box-shadow: 0 0 0 10px rgba(44, 106, 77, 0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.form { padding: 28px; border-radius: 12px; background: #FBFBF8; color: var(--ink); }
.form :focus-visible { outline-color: var(--green); }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.field--full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 520; }
.opt { font-weight: 400; color: var(--ink-2); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid #CDCDC6; border-radius: 8px;
  background: #fff; color: var(--ink); font: 16px/1.4 var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 58, 43, .16); }
.field [aria-invalid="true"] { border-color: var(--err); }
.field__err { margin-top: 6px; font-size: 13px; color: var(--err); }
.field__err:empty { display: none; }
.field__help { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.field--check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; margin: 20px 0; font-size: 13.5px; color: var(--ink-2); }
.field--check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.field--check label { margin: 0; font-weight: 400; }
.field--check label a { color: var(--ink); text-underline-offset: 2px; }
.field--check .field__err { grid-column: 2; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { margin-top: 12px; font-size: 14px; }
.form__status:empty { display: none; }
.form__status.is-ok { color: var(--green); font-size: 16px; font-weight: 500; }
.form__status.is-err { color: var(--err); }
.form.is-sent .form__grid, .form.is-sent .field--check, .form.is-sent [data-submit], .form.is-sent .form__lead { display: none; }
.form.is-sent .form__status { margin: 0; }

/* Pie (base: legal y 404 lo usan dentro de .frame--band) */
.foot {
  position: relative; z-index: 3;
  width: min(var(--max), calc(100% - 2 * var(--gut))); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px;
  padding: 32px 0 40px; border-top: 1px solid rgba(237, 237, 234, .16);
  font-size: 13.5px; color: rgba(237, 237, 234, .72);
}
.foot__brand { display: flex; gap: 12px; align-items: flex-start; }
.foot__brand .brand__mark { color: var(--on-night); margin-top: 1px; }
.foot__brand strong { color: var(--on-night); font-weight: 560; font-stretch: 112%; letter-spacing: -0.02em; font-size: 15px; }
.foot__nav { display: flex; flex-direction: column; gap: 6px; }
.foot a { color: inherit; text-underline-offset: 3px; }
.foot a:hover { color: var(--on-night); }
.foot__nav a { text-decoration: none; width: fit-content; }
.foot__legal { text-align: right; }

/* Pie negro con el titular gigante */
.foot-big { margin-block: var(--frame); padding-top: 56px; }
.foot--dark { grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.3fr); border-top: 0; padding-top: 0; }
.foot-big__h {
  position: relative; z-index: 1;
  padding: clamp(40px, 6vw, 88px) var(--gut) clamp(28px, 4vw, 48px);
  font-size: clamp(48px, 9.2vw, 164px); font-weight: 440; font-stretch: 112%; letter-spacing: -0.05em; line-height: .9;
  color: #F4F4F1; text-wrap: balance;
}
@media (prefers-reduced-motion: no-preference) {
  .js .foot-big__h { opacity: .15; transform: translateY(60px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js .foot-big.is-in .foot-big__h { opacity: 1; transform: none; }
}

/* Páginas de texto (legal, 404) */
.doc { padding: 72px 0 112px; }
.doc__in { max-width: 720px; }
.doc h1 { font-size: clamp(36px, 4.4vw, 60px); }
.doc h2 { margin: 56px 0 16px; font-size: clamp(24px, 2.4vw, 32px); }
.doc p { margin-bottom: 14px; color: #2B2B28; }
.doc .meta { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.doc a { text-underline-offset: 3px; }
.doc__cta { margin-top: 32px; }
/* Guías: listas, entradilla, fuentes y otras guías. */
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; color: #2B2B28; }
.doc li { margin-bottom: 8px; padding-left: 4px; }
.doc li::marker { color: var(--tone); }
.doc__lead { margin-top: 28px; font-size: 19px; line-height: 1.55; }
.doc__note { margin-top: 24px; padding: 16px 18px; border-radius: 12px; background: var(--card); font-size: 14.5px; }
.crumbs { display: flex; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--ink-2); }
.crumbs a { color: inherit; text-underline-offset: 3px; }
.doc__src { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--line); }
.doc__src h2 { margin-top: 32px; font-size: 20px; }
.doc__src li, .doc__src p { font-size: 14.5px; }
.doc__src a { overflow-wrap: anywhere; }
.doc__cta { padding: 24px; border-radius: 16px; background: var(--card); }
.doc__cta p { margin-bottom: 16px; }
.doc__more h2 { font-size: 20px; }
.close--slim { padding: 0 0 var(--frame); }
.close--slim .foot { border-top: 0; padding-top: 40px; }

/* ============================================================================================
   Móvil y tableta
   ============================================================================================ */
@media (max-width: 1100px) {
  .foot--dark { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot--dark .foot__legal { text-align: left; }
  .exp__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  :root { --frame: 8px; --radius: 12px; --top: 56px; }
  .nav { display: none; }
  .link-call { display: none; }

  .hero__in { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 88px; }
  .hero h1 { font-size: clamp(40px, 10.6vw, 60px); }
  .actions { flex-direction: column; align-items: stretch; max-width: 420px; }
  .actions .btn { height: 46px; }
  .hero__shade { background: linear-gradient(to top, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .7) 45%, rgba(0, 0, 0, .2) 75%, rgba(0, 0, 0, .5) 100%); }

  .chap__p { font-size: 16.5px; }
  .chap__t { font-size: clamp(32px, 8.6vw, 46px); }

  .bento { grid-template-columns: minmax(0, 1fr); }
  .bc { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .fmt { margin-right: calc(-1 * clamp(26px, 3vw, 40px)); }
  .exp__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wcard { gap: 10px; padding: 6px 6px 12px; border-radius: 16px; }
  .wcard__art { height: 56px; border-radius: 11px; }
  .wi { width: 30px; height: 30px; }
  .wcard__b { padding-inline: 6px; }
  .wcard h3 { font-size: 14.5px; margin-bottom: 3px; }
  .wcard p { font-size: 12.5px; line-height: 1.38; }
  .exp__content h2 { font-size: clamp(32px, 9vw, 44px); }
  .exp__content > p { font-size: 15px; margin-top: 14px; }
  .btn--outline { margin-top: 18px; }

  .cats { min-height: 0; padding: 64px 0; gap: 36px; grid-template-columns: minmax(0, 1fr); }
  .cats__col { position: relative; top: auto; left: auto; right: auto; display: flex; width: max-content; gap: 10px; }
  .cats__col .cm { width: 128px; border-radius: 14px; }
  .cats__col--l { order: -1; translate: calc(var(--py, 0) * 120px - 20px) 0; }
  .cats__col--r { order: 1; translate: calc(var(--py, 0) * -120px + 20px) 0; }
  .cats__in { max-width: none; }

  .sec { padding: 80px 0 64px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__head, .split > :last-child { grid-column: 1; }
  .split__head { padding: 0; margin-bottom: 36px; }
  .split__head--sticky { position: static; }

  .close { padding-top: 80px; }
  .close__in { padding: 64px 0 48px; }
  .close .form { margin-top: 32px; }
  .chat { margin-top: 32px; }
  .chat__log { max-height: 68vh; padding: 20px 16px 12px; }
  .chat__bar { padding-left: 16px; }
  .msg__b { max-width: 88%; }
  .chips, .est, .close .form--chat { margin-left: 0; }
  .est { padding: 18px 16px; }
  .est__row { grid-template-columns: minmax(0, 1fr); }
  .est__n { flex-direction: column; align-items: flex-start; }
  .est__r { text-align: left; }
  .foot, .foot--dark { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .foot__nav { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
  .foot__legal { text-align: left; }
}

@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .js .chapters { height: 400vh; }
  .js .chapters__in { align-items: end; padding-bottom: 56px; }
  .js .chapters__poster { right: auto; left: 50%; top: 12%; translate: -50% 0; width: 86vw; }
  .js .chapters__list { margin-top: 28px; }
}

/* Tableta en vertical (ancha pero alta): la pila arriba y el texto abajo, como en el móvil. */
@media (min-width: 900px) and (max-aspect-ratio: 9/10) and (prefers-reduced-motion: no-preference) {
  .js .chapters__in { align-items: end; padding-bottom: 72px; }
}
/* Móvil o tableta pequeña en horizontal (poca altura): texto a la izquierda en media columna y la pila a la derecha. */
@media (max-width: 899px) and (orientation: landscape) and (prefers-reduced-motion: no-preference) {
  .js .chapters__in { align-items: center; padding-bottom: 0; }
  .js .chapters__copy { max-width: 46%; }
  .js .chapters__poster { left: auto; right: 3%; top: 50%; translate: 0 -50%; width: 48vw; }
  .chap__t { font-size: clamp(24px, 4.4vw, 38px); }
  .chap__p { margin-top: 12px; font-size: 14px; }
}
/* Pantallas bajas (móvil en horizontal): el aviso deja de ser una escena fija y se lee de corrido. */
@media (max-height: 560px) and (prefers-reduced-motion: no-preference) {
  .js .exp { height: auto; }
  .js .exp__stage { position: relative; height: auto; min-height: 0; }
  .js .exp__night { position: relative; inset: auto; height: 50vh; min-height: 200px; background: var(--canvas); }
  .js .gd { position: relative; inset: auto; display: block; padding-block: 72px 48px; opacity: 1; }
  .js .gd__fly, .js .gd__gem { display: none; }
  .js .exp__logo { top: 50%; opacity: 1; scale: 1; }
  .js .exp__logo3d { display: none; }
  .js .exp.has-logo3d .exp__logo { display: grid; }
  .js .exp__dome { position: relative; inset: auto; clip-path: none; display: block; }
  .js .exp__content { opacity: 1; translate: none; padding-block: 56px; }
  .js .exp .wi { stroke-dashoffset: 0; }
}
@media (max-height: 560px) and (min-width: 640px) {
  .exp__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .cards--2 { grid-template-columns: minmax(0, 1fr); }
  .card--row { grid-template-columns: 34px minmax(0, 1fr); }
  .card--row .pill { grid-column: 2; margin-top: 10px; }
  .form { padding: 20px; }
  .form__grid { grid-template-columns: minmax(0, 1fr); }
  .top .btn--sm { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
