/* ==========================================================================
   Apex Consulting · v3 "Amanecer en el Ávila" — estilos de la página
   Convenciones:
   · El CSS describe el ESTADO FINAL de cada demo (sin JS todo se ve resuelto);
     site.js pone el estado "antes" y lo conduce con el scroll.
   · Escritorio coreografiado = (min-width: 64rem) and (min-height: 37.5rem):
     capítulos con escenario sticky. Debajo, flujo normal y los demos se
     resuelven mientras cruzan la pantalla.
   · Las pantallas de ejemplo (software "real") viven en apps.css.
   ========================================================================== */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--sky-top);
  color-scheme: dark;
}
html, body { overflow-x: clip; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-style: normal; overflow-wrap: anywhere; min-width: 0; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--red-btn); color: oklch(100% 0 0); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.nowrap { white-space: nowrap; }
.skip {
  position: fixed; left: 1rem; top: -5rem; z-index: 100;
  padding: 0.7rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--day-ink); font-weight: 600;
}
.skip:focus { top: 1rem; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

main, .foot { position: relative; z-index: var(--z-main); }

/* mientras site.js prepara la intro, el hero no se pinta (la cabecera del
   documento pone .intro y un seguro de 2,5 s la quita si algo falla) */
.intro .hero__copy, .intro .nav, .intro .hero__cue { opacity: 0; }

/* ==========================================================================
   EL CIELO
   ========================================================================== */
.sky {
  position: fixed; inset: 0 0 auto 0; height: 100lvh;
  z-index: var(--z-sky); pointer-events: none; overflow: hidden;
}
.sky__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 52%, var(--sky-low) 100%);
}
.sky__sun {
  position: absolute; left: 0; top: 0;
  width: 38vmax; height: 38vmax; margin: -19vmax 0 0 -19vmax;
  opacity: 0; will-change: transform, opacity;
}
.sky__sun::before {
  content: ""; position: absolute; inset: -55%; border-radius: 50%;
  background: radial-gradient(closest-side, oklch(82% 0.15 60 / 0.55), oklch(70% 0.17 40 / 0.2) 55%, transparent);
}
.sky__sun i {
  position: absolute; inset: 36%; border-radius: 50%;
  background: radial-gradient(circle, var(--sun-core) 0 40%, var(--sun-mid) 72%, var(--sun-edge));
  box-shadow: 0 0 5vmax 1vmax oklch(88% 0.14 70 / 0.5);
}
.sky__ridges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sky__ridge--far   { fill: var(--ridge-far); }
.sky__ridge--mid   { fill: var(--ridge-mid); }
.sky__ridge--front { fill: var(--ridge-front); }
.sky__ridge-line {
  fill: none; stroke: var(--ink-2); stroke-width: 1.6;
  stroke-linejoin: round; stroke-linecap: round; opacity: 0;
}
.no-webgl .sky__ridge-line { opacity: 0.75; }
.sky__gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.sky__grain {
  position: absolute; inset: 0; opacity: 0.045;
  background-image: 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='0.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 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ficha del pico — anotación cartográfica, sky.js la mueve sobre el vértice */
.peak {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  opacity: 0; will-change: transform, opacity;
}
.peak__ring {
  position: absolute; left: -15px; top: -15px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--red-hi); opacity: 0;
  animation: peak-ring 3s var(--ease-out) infinite;
}
.peak__ring + .peak__ring { animation-delay: 1.5s; }
@keyframes peak-ring {
  0%   { transform: scale(0.35); opacity: 0.9; }
  100% { transform: scale(3.4);  opacity: 0; }
}
.peak__label {
  position: absolute; left: 1.4rem; bottom: 0.9rem;
  padding: 0.05rem 0 0.05rem 0.7rem;
  border-left: 1px solid var(--red-hi);
  font-size: var(--fs-xs); line-height: 1.45; white-space: nowrap;
  color: var(--ink-3);
}
.peak__label b { display: block; color: var(--ink); font-weight: 600; font-size: var(--fs-sm); }

/* rótulos de la ciudad (capítulo 02): anotaciones de mapa con su guía */
.city-labels { position: absolute; inset: 0; }
.city-label, .city-zone {
  position: absolute; left: 0; top: 0;
  opacity: 0; visibility: hidden; will-change: transform, opacity;
  font-size: var(--fs-xs); line-height: 1.3; white-space: nowrap;
  color: var(--ink-2);
  text-shadow: 0 1px 8px oklch(8% 0.03 262), 0 0 2px oklch(8% 0.03 262);
}
.city-label { padding-bottom: 2.1rem; }
.city-label::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 1px; height: 1.8rem;
  background: linear-gradient(var(--ink-3), transparent);
}
.city-label b { display: block; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.city-label.is-queue b { color: var(--warn); }
.city-label.is-sent b { color: var(--ok); }
.city-zone { color: var(--warn); font-weight: 600; letter-spacing: 0.02em; }

/* ==========================================================================
   NAVEGACIÓN
   ========================================================================== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
  padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: transform 0.55s var(--ease-out), background-color 0.4s, border-color 0.4s, opacity 0.4s;
}
.nav.is-solid {
  background-color: oklch(9% 0.03 262 / 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-105%); }
.nav.is-day { background-color: oklch(96.5% 0.013 78 / 0.8); border-bottom-color: var(--day-line); color: var(--day-ink); }
.nav.is-day .brand__ridge { stroke: var(--day-ink); }
.nav.is-day .brand__word small, .nav.is-day .nav__alt, .nav.is-day .nav__links a { color: var(--day-ink-2); }
.nav.is-day .btn--glass { background: var(--day-ink); color: var(--day-paper); border-color: transparent; }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 44px; }
.brand__mark { width: 3.6rem; height: auto; overflow: visible; flex: none; }
.brand__ridge {
  fill: none; stroke: var(--ink); stroke-width: 1.7px;
  vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
}
.brand__apex { fill: var(--red); }
.brand__climber { fill: var(--red); }
.brand__word {
  display: grid; line-height: 1;
  font-weight: 850; font-stretch: 125%; font-size: 1.02rem; letter-spacing: 0.01em;
}
.brand__word small {
  margin-top: 0.34em;
  font-weight: 500; font-stretch: 100%; font-size: 0.52rem; letter-spacing: 0.44em;
  color: var(--ink-3);
}
.nav__links { display: none; }
.nav__links a {
  position: relative; padding: 0.6rem 0;
  font-size: var(--fs-sm); color: var(--ink-2);
  transition: color var(--dur-fast);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.3rem; height: 1px;
  background: var(--red); transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__end { display: flex; align-items: center; gap: var(--sp-4); }
.nav__alt {
  display: none;
  font-size: var(--fs-xs); color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.nav__alt i { font-style: normal; display: inline-block; min-width: 4.4ch; text-align: right; color: var(--ink-2); }
@media (min-width: 64rem) {
  .nav__links { display: flex; gap: clamp(1.25rem, 2.4vw, 2.5rem); }
  .nav__alt { display: inline; }
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 3.25rem; padding: 0 1.65rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-md); font-stretch: 106%; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background-color 0.25s var(--ease-out), border-color 0.25s, color 0.25s, box-shadow 0.4s var(--ease-out);
}
.btn__arrow { display: inline-block; transition: transform 0.4s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--primary {
  background: var(--red-btn); color: oklch(100% 0 0);
  box-shadow: 0 0.8rem 2rem -0.8rem var(--red-glow), inset 0 1px 0 oklch(100% 0 0 / 0.22);
}
.btn--primary:hover {
  background: var(--red-btn-hover);
  box-shadow: 0 1.1rem 2.8rem -0.7rem var(--red-glow), inset 0 1px 0 oklch(100% 0 0 / 0.28);
}
.btn--ghost { color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--glass); }
.btn--glass { color: var(--ink); background: var(--glass-2); border-color: var(--line); }
.btn--glass:hover { background: oklch(100% 0 0 / 0.14); }
.btn--sm { min-height: 2.6rem; padding: 0 1.15rem; font-size: var(--fs-sm); }
.btn--lg { min-height: 3.9rem; padding: 0 2.3rem; font-size: var(--fs-lg); }
.btn:not(.btn--magnetic):active { transform: translateY(1px); }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--nav-h) + var(--sp-6)) var(--gutter) max(36svh, 13rem);
}
.hero__copy { position: relative; max-width: 64rem; }
.hero__title {
  font-size: var(--fs-h1); font-weight: 850; font-stretch: 125%;
  line-height: 0.97; letter-spacing: -0.035em;
  max-width: 11.5ch; text-wrap: balance;
}
/* el punto final del titular es el marcador rojo del logo: la frase termina
   en la cumbre. El "." real queda para lectores de pantalla. */
.hero__title .dot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.apex-dot {
  display: inline-block; width: 0.3em; height: 0.26em; margin-left: 0.07em;
  background: var(--red);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.hero__lede {
  margin-top: var(--sp-5); max-width: 35rem;
  font-size: var(--fs-lg); line-height: 1.55; color: var(--ink-2);
}
.hero__actions { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); }
.hero__cue {
  position: absolute; left: var(--gutter); bottom: var(--sp-5);
  display: inline-flex; align-items: center; gap: 0.9rem; min-height: 44px;
  font-size: var(--fs-sm); color: var(--ink-3);
}
.hero__cue i { position: relative; width: 1px; height: 2.6rem; overflow: hidden; background: var(--line-strong); }
.hero__cue i::after {
  content: ""; position: absolute; left: 0; top: -45%; width: 1px; height: 45%;
  background: var(--red-hi);
  animation: cue-drop 2.4s var(--ease-in-out) infinite;
}
@keyframes cue-drop { to { top: 110%; } }

/* texto partido: cada palabra es un bloque en línea para poder animar letras
   sin que una palabra se corte entre dos líneas */
.split .w { display: inline-block; white-space: nowrap; }
.split .c { display: inline-block; }
/* recorte por palabra: las letras suben desde debajo de su propio renglón.
   El padding da aire a tildes y descendentes; el margen negativo lo anula. */
.hero__title .split .w {
  padding: 0.12em 0.04em 0.15em; margin: -0.12em -0.04em -0.15em;
  clip-path: inset(-0.04em -0.1em 0 -0.1em);
}
.split--mask .w {
  padding: 0.1em 0.04em 0.17em; margin: -0.1em -0.04em -0.17em;
  clip-path: inset(-0.04em -0.1em 0 -0.1em);
}
.split--mask .wi { display: inline-block; }
.split--words .w { display: inline; white-space: normal; }
/* mientras ScrollTrigger mide, los sticky vuelven al flujo */
.st-measure .svc, .st-measure .ch__sticky, .st-measure .manifesto__sticky,
.st-measure .cases__sticky, .st-measure .summit__sticky { position: relative !important; top: auto !important; }

/* ==========================================================================
   MANIFIESTO
   ========================================================================== */
.manifesto { position: relative; padding: var(--sp-9) var(--gutter); }
.manifesto__text {
  max-width: 22ch;
  font-size: clamp(1.8rem, 0.9rem + 3.2vw, 4.2rem);
  font-weight: 750; font-stretch: 112%;
  line-height: 1.1; letter-spacing: -0.022em;
  text-wrap: pretty;
}
.manifesto mark {
  background: none; color: inherit;
  text-decoration-line: underline; text-decoration-style: wavy;
  text-decoration-color: color-mix(in oklch, var(--warn) calc(var(--lit, 1) * 100%), transparent);
  text-decoration-thickness: 0.055em; text-underline-offset: 0.16em;
  text-decoration-skip-ink: none;
}
.manifesto strong { font-weight: 850; color: var(--red-hi); }

/* ==========================================================================
   CAPÍTULOS (beneficios)
   ========================================================================== */
.ch { position: relative; }
.ch__sticky { position: relative; padding: var(--sp-9) var(--gutter) var(--sp-8); }
.ch__copy { position: relative; z-index: 3; max-width: 34rem; }
.ch__label { margin-bottom: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-3); }
.dim { color: var(--ink-3); }
.ch__title .dim, .services__title .dim, .cases__title .dim { display: block; }
.ch__title {
  font-size: var(--fs-h2); font-weight: 800; font-stretch: 116%;
  line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance;
}
.ch__text { margin-top: var(--sp-5); max-width: 31rem; color: var(--ink-2); font-size: var(--fs-md); }
.ch__stage { position: relative; margin-top: var(--sp-7); }

/* 02 · la ciudad: el teléfono en primer plano */
.city-stage { display: grid; justify-items: center; }
.city-stage .iph { --w: min(16rem, 66vw); }

/* 04 · fiscal */
.fiscal {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: end; gap: clamp(1.2rem, 3vw, 3rem);
}

/* 05 · la obra */
.obra-stage { display: grid; justify-items: start; }

/* ==========================================================================
   SERVICIOS — cartas que se apilan
   ========================================================================== */
.services { position: relative; padding: var(--sp-9) var(--gutter) var(--sp-8); }
.services__head { max-width: 60rem; margin-bottom: var(--sp-8); }
.services__title, .cases__title {
  font-size: var(--fs-h2); font-weight: 800; font-stretch: 116%;
  line-height: 1.02; letter-spacing: -0.03em; text-wrap: balance;
}
.stack { display: grid; gap: 7vh; }
.svc {
  position: sticky; top: calc(var(--nav-h) + 1rem + var(--i) * 1.15rem);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-items: center;
  min-height: min(74vh, 46rem);
  padding: clamp(1.5rem, 3.6vw, 3.4rem);
  border-radius: var(--radius-xl); border: 1px solid var(--line);
  background: var(--svc-bg);
  box-shadow: 0 -1.5rem 3rem -1.5rem oklch(0% 0 0 / 0.5), inset 0 1px 0 oklch(100% 0 0 / 0.06);
  overflow: hidden; transform-origin: 50% 0;
}
.svc::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: oklch(5% 0.02 262); opacity: var(--dim, 0);
}
.svc--web  { --svc-bg: linear-gradient(155deg, oklch(22% 0.05 262), oklch(15% 0.04 262) 70%); }
.svc--mob  { --svc-bg: linear-gradient(155deg, oklch(24% 0.06 283), oklch(16% 0.05 278) 70%); }
.svc--desk { --svc-bg: linear-gradient(155deg, oklch(26% 0.065 310), oklch(17% 0.05 302) 70%); }
.svc--erp  { --svc-bg: linear-gradient(155deg, oklch(55% 0.19 33), oklch(43% 0.165 29) 75%); }
.svc__kind { font-size: var(--fs-sm); color: var(--ink-3); }
.svc h3 {
  margin-top: var(--sp-3);
  font-size: clamp(2rem, 1.1rem + 2.7vw, 3.7rem); font-weight: 800; font-stretch: 118%;
  line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
}
.svc__body > p:not(.svc__kind) { margin-top: var(--sp-4); max-width: 30rem; color: var(--ink-2); }
.svc--erp .svc__kind { color: oklch(94% 0.03 40); }
.svc--erp .svc__body > p:not(.svc__kind) { color: oklch(97% 0.02 40); }
.svc__art { position: relative; display: grid; place-items: center; min-height: 16rem; }

/* ==========================================================================
   CASOS
   ========================================================================== */
.cases { position: relative; padding: var(--sp-9) var(--gutter); }
.cases__head { max-width: 40rem; }
.cases__note { margin-top: var(--sp-4); color: var(--ink-2); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px;
  margin-top: var(--sp-3);
  font-weight: 650; color: var(--ink);
  background: linear-gradient(var(--red), var(--red)) 0 calc(100% - 0.55rem) / 100% 1px no-repeat;
}
.link-arrow span { transition: transform 0.4s var(--ease-out); }
.link-arrow:hover span { transform: translateX(4px); }
.drum { display: none; }
.cases__list { margin-top: var(--sp-7); display: grid; gap: var(--sp-4); }
.case {
  padding: var(--sp-5); border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--line);
}
.case__tag { font-size: var(--fs-sm); color: var(--red-hi); }
.case h3 {
  margin-top: var(--sp-2);
  font-size: var(--fs-h3); font-weight: 750; font-stretch: 110%;
  line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance;
}
.case p:not([class]) { margin-top: var(--sp-3); color: var(--ink-2); }
.case__meta { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-3); }
.cases__count { display: none; }

/* ==========================================================================
   POR QUÉ
   ========================================================================== */
.why { position: relative; padding: var(--sp-9) 0; overflow: clip; }
.why__title {
  padding: 0 var(--gutter); margin-bottom: var(--sp-6);
  font-size: var(--fs-lg); font-weight: 600; color: var(--ink-3);
}
.why__item + .why__item { margin-top: var(--sp-8); }
.why__line {
  display: flex; align-items: center; gap: 0.32em; width: max-content;
  font-size: var(--fs-mega); font-weight: 900; font-stretch: 125%;
  line-height: 1.02; letter-spacing: -0.045em; text-transform: uppercase; white-space: nowrap;
  will-change: transform;
}
.why__line i { font-style: normal; font-size: 0.28em; color: var(--red); }
.why__line .o { color: oklch(100% 0 0 / 0.13); }
.why__text { margin: var(--sp-5) var(--gutter) 0; max-width: 34rem; font-size: var(--fs-lg); color: var(--ink-2); }
@media (min-width: 48rem) {
  .why__item:nth-of-type(odd) .why__text { margin-left: auto; }
}

/* ==========================================================================
   LA CUMBRE
   ========================================================================== */
.summit { position: relative; padding: var(--sp-9) var(--gutter) 88svh; }
.summit__copy { max-width: 42rem; display: grid; justify-items: start; }
.summit__alt { display: inline-flex; align-items: center; gap: 0.6rem; font-size: var(--fs-sm); color: var(--ink-2); }
.tri-mark { width: 0.72rem; height: 0.62rem; background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.summit__title {
  margin-top: var(--sp-4);
  font-size: clamp(2.6rem, 0.9rem + 4.7vw, 6.4rem); font-weight: 850; font-stretch: 122%;
  line-height: 0.98; letter-spacing: -0.035em; text-wrap: balance;
}
.summit__text { margin-top: var(--sp-5); max-width: 34rem; font-size: var(--fs-lg); color: var(--ink); text-shadow: 0 0 1.2em oklch(15% 0.05 300 / 0.5); }
.summit .btn { margin-top: var(--sp-6); }

/* ==========================================================================
   PIE — de día
   ========================================================================== */
.foot {
  background: var(--day-paper); color: var(--day-ink);
  padding: var(--sp-9) var(--gutter) 0;
}
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 30vh;
  background: linear-gradient(to bottom, oklch(96.5% 0.013 78 / 0), var(--day-paper));
  pointer-events: none;
}
.foot ::selection { background: var(--day-ink); color: var(--day-paper); }
.foot :focus-visible { outline-color: var(--red-deep); }
.foot__line {
  max-width: 17ch;
  font-size: clamp(2.2rem, 0.9rem + 4.6vw, 5.8rem); font-weight: 850; font-stretch: 118%;
  line-height: 1; letter-spacing: -0.035em; text-wrap: balance;
}
.foot__row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-8); padding-top: var(--sp-4);
  border-top: 1px solid var(--day-line);
  font-size: var(--fs-sm); color: var(--day-ink-2);
}
.foot__nav { display: flex; flex-wrap: wrap; gap: 0 var(--sp-5); }
.foot__nav a, .foot__top { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; transition: color var(--dur-fast); }
.foot__nav a:hover, .foot__top:hover { color: var(--day-ink); }
.foot__meta { font-variant-numeric: tabular-nums; }
.foot__mark {
  display: flex; align-items: flex-end; gap: 2.5vw;
  margin-top: var(--sp-7); margin-bottom: -0.08em;
  font-size: clamp(5rem, 23vw, 23rem); font-weight: 900; font-stretch: 125%;
  line-height: 0.74; letter-spacing: -0.05em; color: var(--day-ink);
  overflow: hidden;
}
.foot__mark svg { width: 0.9em; flex: none; overflow: visible; margin-bottom: 0.08em; }
.foot__mark path { fill: none; stroke: var(--day-ink); stroke-width: 3px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.foot__mark .foot__apex { fill: var(--red); stroke: none; }

/* ==========================================================================
   ESCRITORIO COREOGRAFIADO — escenarios sticky
   ========================================================================== */
@media (min-width: 64rem) and (min-height: 37.5rem) {
  .manifesto { height: 250vh; padding: 0; }
  .manifesto__sticky {
    position: sticky; top: 0; height: 100vh;
    display: flex; align-items: center;
    padding: 0 var(--gutter);
  }

  .ch { height: var(--len, 300vh); }
  .ch--erp    { --len: 330vh; }
  .ch--city   { --len: 470vh; }
  .ch--tri    { --len: 330vh; }
  .ch--fiscal { --len: 320vh; }
  .ch--obra   { --len: 320vh; }
  .ch__sticky {
    position: sticky; top: 0; height: 100vh;
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center; gap: clamp(2rem, 4.5vw, 5.5rem);
    padding: calc(var(--nav-h) + var(--sp-3)) var(--gutter) var(--sp-5);
  }
  .ch__stage { margin-top: 0; }

  /* 01 · el ERP a tamaño de pantalla; el 0,00 se apodera del cuadro entero */
  .ch--erp .ch__stage { position: static; }
  .erp3d { --ui: clamp(10px, min(1.45vh, 0.95vw), 13.5px); }

  /* 02 · la ciudad ocupa todo el cuadro; el texto flota arriba a la izquierda */
  .ch--city .ch__sticky { display: block; padding: 0; }
  /* velo detrás del texto: la ciudad sigue viva, la lectura no sufre */
  .ch--city .ch__sticky::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(90deg, oklch(8% 0.03 260 / 0.82) 0%, oklch(8% 0.03 260 / 0.5) 30%, transparent 52%);
  }
  .ch--city .ch__copy { position: absolute; left: var(--gutter); top: calc(var(--nav-h) + 5vh); width: min(31rem, 34vw); }
  .ch--city .ch__stage { position: absolute; inset: 0; margin: 0; pointer-events: none; }
  .city-stage .iph {
    --w: min(16.5rem, 30vh, 18vw);
    position: absolute; right: clamp(2rem, 8vw, 9rem); top: 50%;
    transform: translateY(-46%);
  }

  /* 03 · tres pantallas: el texto arriba, la escena abajo a lo ancho */
  .ch--tri .ch__sticky {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    align-items: center; gap: 2vh;
    padding-top: calc(var(--nav-h) + 3vh);
  }
  .ch--tri .ch__copy {
    max-width: none; width: 100%;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 6vw, 7rem); align-items: end;
  }
  .ch--tri .ch__label { grid-column: 1; }
  .ch--tri .ch__title { grid-column: 1; }
  .ch--tri .ch__text { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0; }
  .ch--tri .tri__pane { --ui: clamp(9.5px, min(1.3vh, 0.82vw), 12px); }

  .fiscal { height: calc(100vh - var(--nav-h) - 3rem); }

  /* 05 · díptico: el tablero de la oficina a la izquierda; a la derecha la
     torre (WebGL, sky.js) sube piso a piso al ritmo del avance */
  .ch--obra .ch__sticky {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    align-items: start; gap: 3vh;
    padding-top: calc(var(--nav-h) + 3vh);
  }
  .ch--obra .ch__copy {
    max-width: none; width: 100%;
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 6vw, 7rem); align-items: end;
  }
  .ch--obra .ch__label, .ch--obra .ch__title { grid-column: 1; }
  .ch--obra .ch__title { font-size: clamp(2rem, 0.9rem + 2.5vw, 3.6rem); }
  .ch--obra .ch__text { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0; }
  .ch--obra .ch__stage { align-self: stretch; display: grid; align-items: center; justify-items: start; }
  .obra-stage .obra { width: min(47vw, 46em); --ui: clamp(9.5px, min(1.22vh, 0.8vw), 12.5px); }

  .cases { height: 470vh; padding: 0; }
  .cases__sticky {
    position: sticky; top: 0; height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: clamp(2rem, 4.5vw, 5.5rem);
    padding: calc(var(--nav-h) + var(--sp-5)) var(--gutter) var(--sp-6);
  }
  .cases__head {
    grid-column: 1 / -1; max-width: none;
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(2rem, 4.5vw, 5.5rem); align-items: end;
  }
  .cases__title { grid-column: 1; grid-row: 1 / 3; }
  .cases__note { grid-column: 2; grid-row: 1; margin-top: 0; font-size: var(--fs-sm); }
  .cases__head .link-arrow { grid-column: 2; grid-row: 2; justify-self: start; }
  .drum {
    display: block; position: relative;
    grid-column: 1; grid-row: 2;
    perspective: 1400px; perspective-origin: 0% 50%;
    margin-right: calc(-1 * clamp(2rem, 4.5vw, 5.5rem));
    -webkit-mask: linear-gradient(transparent, #000 24%, #000 76%, transparent);
    mask: linear-gradient(transparent, #000 24%, #000 76%, transparent);
  }
  .drum__wheel {
    --drum: 0deg;
    position: absolute; inset: 0;
    transform-style: preserve-3d; transform: rotateX(var(--drum));
  }
  .drum__item {
    position: absolute; left: 0; right: 0; top: 50%;
    height: 1.2em; margin-top: -0.6em;
    font-size: clamp(1.2rem, 0.5rem + 1.55vw, 2.25rem); font-weight: 800; font-stretch: 100%;
    line-height: 1.2; letter-spacing: -0.025em; white-space: nowrap;
    transform: rotateX(calc(var(--i) * -30deg)) translateZ(min(26vh, 13rem));
    backface-visibility: hidden;
    opacity: var(--o, 0.22);
  }
  .drum__item.is-active { color: var(--ink); }
  .drum__item.is-active::before {
    content: ""; position: absolute; left: -1.4rem; top: 50%; width: 0.65rem; height: 0.56rem; margin-top: -0.28rem;
    background: var(--red); clip-path: polygon(0 0, 100% 50%, 0 100%);
  }
  .cases__list {
    grid-column: 2; grid-row: 2; margin: 0;
    display: grid; align-content: center;
  }
  .case {
    grid-area: 1 / 1;
    opacity: 0; transform: translateY(1.2rem);
    transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
  }
  .case.is-active { opacity: 1; transform: none; }
  .cases__count {
    display: flex; align-items: baseline; gap: 0.4rem;
    position: absolute; right: var(--gutter); bottom: var(--sp-5);
    font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums;
  }
  .cases__count b { font-weight: 600; color: var(--ink); }
  /* sin JS no hay tambor que mueva: se ve el primer caso (y el resto por lector) */
  .no-js .case:first-child { opacity: 1; transform: none; }

  .summit { height: 230vh; padding: 0; }
  .summit__sticky {
    position: sticky; top: 0; height: 100vh;
    display: grid; align-content: start;
    padding: calc(var(--nav-h) + 12vh) var(--gutter) 0;
  }

  .svc { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

@media (min-width: 56rem) and (max-width: 63.99rem) {
  .svc { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

/* ==========================================================================
   MÓVIL / TABLETA
   ========================================================================== */
@media (max-width: 40rem) {
  .hero__title { max-width: 9.5ch; }
  .hero__lede { font-size: var(--fs-md); }
  .hero__actions .btn { flex: 1 1 auto; }
  .peak__label { display: none; }
  .brand__word small { display: none; }
  .nav .btn--sm { padding: 0 0.95rem; }
  .svc { top: calc(var(--nav-h) + 0.5rem + var(--i) * 0.7rem); }
  .ae__name { font-size: clamp(2.2rem, 12vw, 3.4rem); }
  .fiscal { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .voucher { margin-top: -1rem; }
}
/* móvil: hueco para ver la torre subir antes de que llegue el tablero */
@media (max-width: 63.99rem), (max-height: 37.49rem) {
  .obra-stage { padding-top: 68vh; }
}
@media (min-width: 64rem) and (max-height: 50rem) {
  .ot:nth-child(n+5), .obra__months { display: none; }
}

/* ==========================================================================
   MOVIMIENTO REDUCIDO — todo queda en su estado final, sin escenarios sticky
   ========================================================================== */
.reduce .manifesto, .reduce .ch, .reduce .cases, .reduce .summit { height: auto; }
.reduce .manifesto__sticky, .reduce .ch__sticky, .reduce .cases__sticky, .reduce .summit__sticky {
  position: relative; height: auto; min-height: 0;
}
.reduce .ch--city .ch__sticky { min-height: 100vh; }
.reduce .drum { display: none; }
.reduce .cases__list { grid-column: 1 / -1; }
.reduce .case { grid-area: auto; opacity: 1; transform: none; }
.reduce .svc { position: relative; top: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
