/* =============================================================================
   PORTADA "CIUDAD CINEMATOGRÁFICA" — en producción desde el 13-nov-2026
   -----------------------------------------------------------------------------
   Solo la carga index.php ($pageStyles). Reutiliza la foto de Santiago y los velos de
   legibilidad MEDIDOS de hero.css (no se tocaron sus valores: el contraste del
   titular, 8,72:1 mínimo, depende de ellos).

   Capas de la escena, de atrás hacia adelante:
     cámara (mouse + scroll) > toma (retroceso inicial) > deriva (Ken Burns)
       > foto + luces (canvas) + reflejo
     bruma > sombra (scroll) > velo > grano > telón (fundido de entrada)
   Todo lo que se mueve lo hace con transform u opacity: lo resuelve el compositor.
   ========================================================================== */

/* =============================================================================
   1. HERO
   ========================================================================== */
.hc {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--carbon);
  color: var(--papel);
  min-height: min(100svh, 980px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-h) + clamp(28px, 4vw, 64px));
  padding-bottom: calc(clamp(40px, 6vw, 84px) + 52px);   /* + alto de la cinta */
}

/* ---------- Escena ---------- */
.hc__escena {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;                 /* no se come los clics del formulario */
}

.hc__camara,
.hc__toma,
.hc__deriva {
  position: absolute;
  inset: 0;
}
.hc__camara { will-change: transform; }

/* Retroceso de cámara al cargar: de un acercamiento al encuadre final. CSS puro. */
.hc__toma {
  animation: hc-retroceso 3.2s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes hc-retroceso {
  from { transform: scale(1.16); }
  to   { transform: scale(1); }
}

/* Deriva lenta (Ken Burns): la escala mínima 1,04 deja margen para el parallax del mouse */
.hc__deriva {
  transform-origin: 62% 58%;
  animation: hc-deriva 28s ease-in-out infinite alternate;
}
@keyframes hc-deriva {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.11) translate3d(-1.4%, -.8%, 0); }
}

.hc__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  display: block;
}

.hc__luces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
}

/* Reflejo de atardecer que recorre los vidrios. overlay aclara lo claro (las torres)
   mucho más que lo oscuro (cerros, árboles): se lee como un brillo sobre el vidrio. */
.hc__reflejo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 30%, #000 80%, transparent 96%);
          mask-image: linear-gradient(180deg, transparent 4%, #000 30%, #000 80%, transparent 96%);
}
.hc__reflejo::before {
  content: '';
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 46%;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255, 196, 160, .0) 25%,
    rgba(255, 196, 160, .55) 48%,
    rgba(255, 232, 214, .75) 50%,
    rgba(255, 196, 160, .55) 52%,
    transparent 78%);
  mix-blend-mode: overlay;
  transform: translate3d(-120%, 0, 0) skewX(-12deg);
  animation: hc-reflejo 11s cubic-bezier(.45, 0, .2, 1) 2.2s infinite;
}
@keyframes hc-reflejo {
  0%   { transform: translate3d(-120%, 0, 0) skewX(-12deg); }
  38%  { transform: translate3d(330%, 0, 0) skewX(-12deg); }
  100% { transform: translate3d(330%, 0, 0) skewX(-12deg); }
}

/* Bruma rosada entre la cordillera y la ciudad */
.hc__bruma {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 46%;
  height: 26%;
  mix-blend-mode: screen;
  opacity: .5;
}
.hc__bruma span {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 50% at 30% 50%, rgba(232, 160, 190, .28), transparent 70%),
    radial-gradient(ellipse 26% 42% at 72% 46%, rgba(200, 150, 210, .22), transparent 70%);
  animation: hc-bruma 46s linear infinite alternate;
}
.hc__bruma span + span {
  background:
    radial-gradient(ellipse 34% 46% at 58% 56%, rgba(255, 170, 160, .18), transparent 70%);
  animation-duration: 63s;
  animation-direction: alternate-reverse;
}
@keyframes hc-bruma {
  from { transform: translate3d(-6%, 0, 0); }
  to   { transform: translate3d(6%, 0, 0); }
}

/* Oscurecimiento al hacer scroll (lo maneja el JS: opacity) */
.hc__sombra {
  position: absolute;
  inset: 0;
  background: #0C0A09;
  opacity: 0;
}

/* Velos de legibilidad: COPIA EXACTA de .heroimg__velo (hero.css), valores medidos */
.hc__velo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(96deg,
      rgba(12, 10, 9, .90) 0%,
      rgba(12, 10, 9, .84) 34%,
      rgba(12, 10, 9, .62) 46%,
      rgba(12, 10, 9, .26) 56%,
      rgba(12, 10, 9, .06) 68%,
      rgba(12, 10, 9, .02) 100%),
    linear-gradient(180deg,
      rgba(12, 10, 9, .42) 0%,
      rgba(12, 10, 9, .14) 14%,
      rgba(12, 10, 9, 0) 34%,
      rgba(12, 10, 9, 0) 90%,
      rgba(12, 10, 9, .34) 100%);
}

/* Grano de película, fijo (se rasteriza una vez). Ruido SVG en línea, sin pedir archivos. */
.hc__grano {
  position: absolute;
  inset: 0;
  opacity: .09;
  mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Telón de entrada: la foto se pinta desde el primer cuadro (cuenta para el LCP) y lo
   que se anima es esta capa negra encima, de .62 a 0. */
.hc__telon {
  position: absolute;
  inset: 0;
  background: #0C0A09;
  opacity: 0;
  animation: hc-telon 2.6s cubic-bezier(.3, 0, .2, 1) both;
}
@keyframes hc-telon {
  from { opacity: .62; }
  to   { opacity: 0; }
}

/* ---------- Contenido ---------- */
.hc__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  width: 100%;
}
.hc__texto { min-width: 0; }

/* El eyebrow es un <p> y base.css limita los párrafos a 68ch (~449 px en mono 12 px):
   con "Sitios web y apps Android · Servidor propio en Chile" dejaba "EN CHILE" solo en
   una segunda línea. En escritorio cabe entero en la columna. */
.hc__eyebrow { max-width: none; }

.hc__titulo {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-bold);
  color: var(--papel);
  line-height: var(--lh-tight);
  letter-spacing: var(--tk-display);
  margin: var(--gap-md) 0 var(--gap-lg);
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(8, 6, 5, .55);
}

/* "a medida": un destello de luz cálida la recorre una vez. El texto nunca se oculta:
   el degradado empieza y termina en el mismo #FF8A93 (7,97:1 sobre carbón). */
.hc__acento { color: var(--brand-lift); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hc__acento {
    background: linear-gradient(100deg,
      #FF8A93 0%, #FF8A93 40%, #FFE6DA 50%, #FF8A93 60%, #FF8A93 100%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* Sin sombra: con el texto transparente, la sombra del h1 se pintaría ENCIMA del
       degradado y lo apagaría. Va sobre la parte más oscura del velo (.84–.90). */
    text-shadow: none;
    animation: hc-destello 1.8s cubic-bezier(.45, 0, .2, 1) 1.1s both;
  }
}
@keyframes hc-destello {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

.hc__sub {
  font-size: var(--fs-lg);
  color: #E8E3DC;
  max-width: 52ch;
  margin-bottom: var(--gap-lg);
  line-height: 1.58;
  text-shadow: 0 1px 12px rgba(8, 6, 5, .6);
}

.hc__hechos {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--gap-xl);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.hc__hechos li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: #E8E3DC;
  text-shadow: 0 1px 10px rgba(8, 6, 5, .6);
}
.hc__hechos svg { color: var(--brand-lift); flex: none; }

.hc__acciones {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  flex-wrap: wrap;
}
.hc__enlace {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  font-weight: var(--fw-semibold);
  color: var(--papel);
  border-bottom: 1.5px solid rgba(251, 250, 248, .45);
  padding-bottom: 2px;
  transition: border-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.hc__enlace:hover { color: var(--brand-lift); border-color: var(--brand-lift); }
.hc__enlace svg { transition: transform var(--duration-base) var(--ease-out); }
.hc__enlace:hover svg { transform: translateX(4px); }

/* ---------- Formulario con borde de luz que gira (el de la demo 1) ----------
   Un cuadrado con degradado cónico FIJO rota detrás del panel con transform (lo mueve
   el compositor, sin repintar) y el marco recorta con overflow: hidden. El panel es
   OPACO (misma razón que en hero.css: que la foto no se transparente sobre los campos),
   así que solo asoma 1,5 px de borde. */
.hc__form { min-width: 0; position: relative; }

.hc__marco {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.5px;
  border-radius: calc(var(--radius-2xl) + 1.5px);
  background: rgba(251, 250, 248, .12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.hc__marco::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 260%;                     /* cubre la diagonal del panel aunque sea alto y angosto */
  aspect-ratio: 1;
  background: conic-gradient(
    transparent 0deg 220deg,
    rgba(230, 57, 70, .25) 255deg,
    #E63946 300deg,
    #FF8A93 330deg,
    rgba(251, 250, 248, .6) 342deg,
    transparent 360deg);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: hc-giro 7s linear infinite;
}
@keyframes hc-giro { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Resplandor rojo bajo el panel (fijo: se rasteriza una vez) */
.hc__form::before {
  content: '';
  position: absolute;
  inset: 12% 8% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(230, 57, 70, .26), transparent);
  filter: blur(34px);
  pointer-events: none;
}

.hc__marco .leadform--oscuro {
  background: #171412;
  border-color: transparent;
  box-shadow: none;
}

/* Cinco opciones en "¿Qué necesitas?" (se sumó App Android): 3 arriba y 2 más anchas
   abajo, en vez de 4 + "Otro" solo en la segunda fila. */
.hc__marco .segmentado { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hc__marco .segmentado__opt { grid-column: span 2; }
.hc__marco .segmentado__opt:nth-last-child(-n + 2) { grid-column: span 3; }
@media (max-width: 560px) {
  /* En móvil van de a 2 (lead-form.css): "Otro" ocupa la última fila completa */
  .hc__marco .segmentado { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hc__marco .segmentado__opt,
  .hc__marco .segmentado__opt:nth-last-child(-n + 2) { grid-column: auto; }
  .hc__marco .segmentado__opt:last-child { grid-column: 1 / -1; }
}

/* ---------- Cinta de lo que incluye ---------- */
.hc__cinta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 52px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: rgba(12, 10, 9, .72);
  border-top: 1px solid rgba(251, 250, 248, .12);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.hc__cinta-pista {
  display: flex;
  flex: none;
  animation: hc-cinta 48s linear infinite;
}
.hc__cinta:hover .hc__cinta-pista { animation-play-state: paused; }
@keyframes hc-cinta {
  to { transform: translate3d(-50%, 0, 0); }
}
.hc__cinta-lista {
  display: flex;
  flex: none;
  list-style: none;
  margin: 0;
  padding: 0;
}
.hc__cinta-lista li {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding-right: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--fw-medium);
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #E8E3DC;                       /* 13,5:1 sobre el fondo de la cinta */
}
.hc__cinta-lista li::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}
/* El precio, destacado */
.hc__cinta-lista li:last-child { color: var(--brand-lift); font-weight: var(--fw-bold); }

/* ---------- Estado inicial de la entrada ----------
   html.hc-intro la pone el <script> en línea de hero-ciudad.php. Nunca incluye el h1. */
html.hc-intro .hc__eyebrow,
html.hc-intro .hc-entra { opacity: 0; }
html:not(.hc-gsap) .hc__eyebrow,
html:not(.hc-gsap) .hc-entra { transition: opacity .6s var(--ease-out); }

/* El JS pone .hc--fuera cuando el hero sale de pantalla: se pausa todo lo que se mueve */
.hc--fuera .hc__deriva,
.hc--fuera .hc__marco::before,
.hc--fuera .hc__reflejo::before,
.hc--fuera .hc__bruma span,
.hc--fuera .hc__cinta-pista { animation-play-state: paused; }

/* =============================================================================
   2. BARRA DE PROGRESO Y RESTO DE LA PÁGINA
   ========================================================================== */
.pc-progreso {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: calc(var(--z-nav) + 1);
  pointer-events: none;
}
.pc-progreso span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-cta), var(--brand), var(--brand-lift));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@media (min-width: 768px) and (hover: hover) {
  html.js-animations body.portada-ciudad [data-animate] {
    filter: blur(10px);
    transition:
      opacity .9s var(--ease-out),
      transform .9s var(--ease-out),
      filter .9s var(--ease-out);
  }
  html.js-animations body.portada-ciudad [data-animate].is-visible { filter: none; }
}

.portada-ciudad .process__step { position: relative; overflow: hidden; }
.portada-ciudad .process__step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-lift));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.1s var(--ease-out);
}
.portada-ciudad .process__step.pc-activo::before { transform: scaleX(1); }
.portada-ciudad .process__step.pc-activo .process__step-number { opacity: 1; }

/* =============================================================================
   3. RESPONSIVE — igual que hero.css: en pantallas angostas la foto va como franja abajo
   ========================================================================== */
@media (max-width: 1023px) {
  .hc { min-height: 0; padding-bottom: 52px; }
  .hc__inner {
    grid-template-columns: 1fr;
    gap: clamp(28px, 5vw, 40px);
    padding-bottom: clamp(230px, 32vh, 340px);
  }
  .hc__sub { max-width: 62ch; }
  .hc__escena {
    top: auto;
    bottom: 0;
    height: calc(clamp(230px, 32vh, 340px) + 52px);
  }
  .hc__img { object-position: 55% 55%; }
  .hc__velo {
    background: linear-gradient(180deg,
      var(--carbon) 0%,
      rgba(26, 22, 19, .72) 16%,
      rgba(26, 22, 19, .26) 40%,
      rgba(26, 22, 19, .22) 72%,
      rgba(26, 22, 19, .58) 100%);
  }
  .hc__bruma { top: 30%; height: 34%; }
  .hc__titulo, .hc__sub, .hc__hechos li { text-shadow: none; }
}

@media (max-width: 767px) {
  .hc { padding-top: calc(var(--nav-h) + 20px); }
  .hc__titulo { font-size: clamp(1.9rem, 8vw, 2.6rem); margin: 12px 0 14px; }
  .hc__sub { font-size: var(--fs-base); margin-bottom: 18px; }
  /* Igual que hero.css: los hechos y el botón vuelven más abajo (franja de confianza y
     botón flotante). */
  .hc__hechos, .hc__acciones { display: none; }
  .hc__inner { padding-bottom: clamp(210px, 27vh, 280px); }
  .hc__escena { height: calc(clamp(210px, 27vh, 280px) + 52px); }
  .hc__cinta-lista li { font-size: 11px; }
}

/* =============================================================================
   4. MOVIMIENTO REDUCIDO: escena quieta, cinta sin desplazamiento (se puede deslizar)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hc__toma,
  .hc__deriva,
  .hc__marco::before,
  .hc__reflejo::before,
  .hc__bruma span,
  .hc__telon,
  .hc__acento { animation: none; }
  .hc__deriva { transform: scale(1.04); }
  .hc__reflejo { display: none; }
  .hc__cinta { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .hc__cinta-pista { animation: none; }
  .hc__cinta-lista[aria-hidden="true"] { display: none; }
  html.js-animations body.portada-ciudad [data-animate] { filter: none; }
  .portada-ciudad .process__step::before { transition: none; }
}

/* =============================================================================
   5. REJILLA DE SERVICIOS CON ÍCONOS (13-nov-2026)
   -----------------------------------------------------------------------------
   Cada ítem de "Qué desarrollamos" lleva un ícono de trazo en una baldosa roja
   tenue, con el número a la derecha. Sin sombras: la rejilla sigue separada por
   reglas de 1 px (ver layout.css).
   Movimiento: los trazos se "dibujan" cuando la sección aparece (escalonados) y
   otra vez al pasar el mouse. pathLength="1" en cada trazo (index.php) hace que
   stroke-dasharray: 1 cubra el trazo completo. Sin JS o con movimiento reducido,
   los íconos se ven completos y quietos.
   ========================================================================== */
.rejilla__cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rejilla__ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--brand-cta);               /* gráfico sobre --brand-wash: > 3:1 */
  background: var(--brand-wash);
  box-shadow: inset 0 0 0 1px rgba(193, 18, 31, .16);
  transition:
    background-color .35s var(--ease-out),
    color .35s var(--ease-out),
    box-shadow .35s var(--ease-out),
    transform .5s var(--ease-out);
}
.rejilla__ico svg { width: 24px; height: 24px; display: block; }
.rejilla__ico svg > * { stroke-dasharray: 1; stroke-dashoffset: 0; }

.rejilla__item:hover .rejilla__ico,
.rejilla__item:focus-visible .rejilla__ico {
  background: var(--brand-cta);
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1px var(--brand-cta);
}

@media (prefers-reduced-motion: no-preference) {
  /* Al aparecer la sección (animations.js pone .is-visible en .rejilla) */
  html.js-animations .rejilla:not(.is-visible) .rejilla__ico svg > * { stroke-dashoffset: 1; }
  .rejilla__ico svg > * { transition: stroke-dashoffset 1.2s var(--ease-out) .2s; }
  .rejilla__item:nth-child(2) .rejilla__ico svg > * { transition-delay: .32s; }
  .rejilla__item:nth-child(3) .rejilla__ico svg > * { transition-delay: .44s; }
  .rejilla__item:nth-child(4) .rejilla__ico svg > * { transition-delay: .56s; }
  .rejilla__item:nth-child(5) .rejilla__ico svg > * { transition-delay: .68s; }
  .rejilla__item:nth-child(6) .rejilla__ico svg > * { transition-delay: .80s; }

  /* Al pasar el mouse: la baldosa se levanta un poco y el ícono se vuelve a dibujar */
  .rejilla__item:hover .rejilla__ico { transform: translateY(-3px) rotate(-6deg); }
  .rejilla__item:hover .rejilla__ico svg > * { animation: rejilla-trazo .8s var(--ease-out) both; }
}
@keyframes rejilla-trazo {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

/* Íconos de marca (Google en SEO, Android en apps): son de RELLENO, no de trazo, así que
   no se "dibujan". Aparecen con un pequeño giro y escala, y al pasar el mouse dan un salto. */
.rejilla__ico--marca svg { width: 22px; height: 22px; }
.rejilla__ico--marca svg > * { stroke: none; }

@media (prefers-reduced-motion: no-preference) {
  .rejilla__ico--marca svg {
    transition: transform .9s var(--ease-out) .5s, opacity .6s var(--ease-out) .5s;
  }
  html.js-animations .rejilla:not(.is-visible) .rejilla__ico--marca svg {
    opacity: 0;
    transform: scale(.4) rotate(-25deg);
  }
  .rejilla__item:hover .rejilla__ico--marca svg { animation: rejilla-marca .7s var(--ease-out); }
}
@keyframes rejilla-marca {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(1.18) rotate(-10deg); }
  70%  { transform: scale(.95) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Atribución de las marcas, en letra chica bajo la rejilla (tinta-3 sobre papel-2: 5,03:1) */
.rejilla-marcas {
  margin: 10px auto 0;
  max-width: 100ch;
  text-align: center;
  text-wrap: balance;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--tinta-3);
}

/* La nota de la automatización bajo la rejilla, centrada como el encabezado de la sección
   (13-nov-2026, pedido del usuario). base.css le pone margen izquierdo 0 para alinearla a la
   izquierda; esta hoja va después del bundle y, con la misma especificidad, gana. */
.section__subtitle.rejilla-nota {
  margin: var(--gap-lg) auto 0;
  text-align: center;
}

/* =============================================================================
   6. VELOCÍMETRO DE LIGHTHOUSE + COHETE, versión 2 (13-nov-2026) — includes/trust.php
   -----------------------------------------------------------------------------
   Sobre el fondo claro de la sección, sin franja oscura. Tres columnas: velocímetro rojo a
   la izquierda, texto al centro, cohete de líneas rojas a la derecha.
   Estado POR DEFECTO = final (aguja en el puntaje, arco lleno): así se ve sin JS y con
   movimiento reducido. El JS pone .vel--espera (todo en cero) y la quita al entrar en
   pantalla; cuenta el número, enciende y lanza el cohete (Web Animations API) y genera las
   bocanadas de humo.
   Contraste sobre papel: --brand-cta 5,97:1 (texto rojo) · --brand 4,00:1 (gráfico, > 3:1)
   · tinta 18,04:1 · tinta-2 8,40:1 · tinta-3 5,58:1.
   ========================================================================== */
.vel {
  margin-top: clamp(30px, 3.6vw, 46px);
  padding: clamp(22px, 2.6vw, 34px) 0;
  border-top: 1px solid var(--regla);
  border-bottom: 1px solid var(--regla);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 300px);
  grid-template-areas: "medidor texto escena";
  column-gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

/* ---------- Velocímetro ---------- */
.vel__medidor { grid-area: medidor; width: 240px; }
.vel__svg { display: block; width: 240px; height: auto; overflow: visible; }

.vel__pista,
.vel__arco {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
}
.vel__pista { stroke: var(--brand-wash); }
.vel__arco {
  stroke: var(--brand);
  stroke-dasharray: 100;
  stroke-dashoffset: var(--vel-resto, 1);
}

.vel__raya { stroke: rgba(193, 18, 31, .35); stroke-width: 2; stroke-linecap: round; }
.vel__raya--mayor { stroke: var(--brand-cta); stroke-width: 2.5; }
.vel__etiquetas text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  fill: var(--tinta-3);
  text-anchor: middle;
}

.vel__aguja {
  transform-box: view-box;
  transform-origin: 120px 126px;
  transform: rotate(var(--vel-ang, 88deg));
}
.vel__aguja path { fill: var(--brand-cta); }
.vel__eje { fill: var(--brand-cta); stroke: var(--papel); stroke-width: 3; }

.vel__cifra {
  margin: 2px 0 0;
  max-width: none;
  text-align: center;
  line-height: 1;
}
.vel__num {
  font-size: clamp(2.5rem, 3vw + 1rem, 3.2rem);
  font-weight: var(--fw-bold);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--brand-cta);
}
.vel__de {
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--tinta-3);
}

/* ---------- Texto ---------- */
.vel__texto { grid-area: texto; min-width: 0; }
.vel__k {
  margin: 0 0 10px;
  font-size: 11.5px;
  font-weight: var(--fw-semibold);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-cta);
}
.vel__titulo {
  margin: 0 0 10px;
  max-width: none;
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tk-title);
  line-height: 1.1;
  color: var(--tinta);
}
.vel__desc {
  margin: 0 0 12px;
  max-width: 54ch;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--tinta-2);
}
.vel__nota {
  margin: 0;
  max-width: none;
  font-size: 11px;
  letter-spacing: .03em;
  color: var(--tinta-3);
}

/* ---------- Escena del cohete (versión 3: vuelo con efecto 3D) ----------
   El JS mueve el cohete por una curva (entra por la izquierda, gira sobre su eje, da la
   vuelta, regresa acercándose y se va alejándose) con translate + rotate + rotateY + scale.
   La perspectiva de la escena hace que el giro sobre su eje se vea en 3D. Sin JS o con
   movimiento reducido, el cohete queda quieto al centro, inclinado como despegando. */
.vel__escena {
  grid-area: escena;
  position: relative;
  height: 240px;
  overflow: hidden;
  perspective: 700px;
  /* bordes difuminados: el humo no se corta en seco y el cohete se esfuma al salir */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 86%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 86%, transparent 100%);
}
.vel__humo { position: absolute; inset: 0; pointer-events: none; }
.vel__bocanada {
  position: absolute;
  pointer-events: none;
  /* bocanadas de humo volumétrico renderizadas en Blender (13-nov-2026): una tira de 4
     variantes con fondo transparente; el JS elige una al azar (--h1, --h2, --h3). Ya vienen
     difuminadas, así que no llevan filter: blur (más barato de pintar). */
  background: url("/assets/images/cohete/cohete-humo.webp") 0 0 / 400% 100% no-repeat;
  will-change: transform, opacity;
}
.vel__bocanada--h1 { background-position: 33.333% 0; }
.vel__bocanada--h2 { background-position: 66.667% 0; }
.vel__bocanada--h3 { background-position: 100% 0; }
/* bocanada tibia, cerca de la llama */
.vel__bocanada--rosa {
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 186, 128, .5) 0%,
    rgba(255, 186, 128, .28) 38%,
    rgba(255, 186, 128, .08) 58%,
    rgba(255, 186, 128, 0) 71%);
  filter: blur(2px);
}

/* Cohete 3D: 96x120 px. .vel__nave recorta la tira de 24 cuadros y muestra el cuadro
   --vel-cuadro (lo pone el JS según el giro). La llama va detrás, saliendo de la tobera. */
.vel__cohete {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 120px;
  z-index: 1;
  transform: translate(-50%, -50%) rotate(40deg);   /* estado quieto (sin JS) */
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.vel__nave {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 120px;
  overflow: hidden;
}
.vel__nave img {
  display: block;
  width: 2304px;
  max-width: none;
  height: 120px;
  transform: translateX(calc(var(--vel-cuadro, 0) * -96px));
}
.vel__fuego {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 108px;
  width: 18px;
  height: 34px;
  margin-left: -9px;
  overflow: visible;
}
.vel__llama { transform-box: fill-box; transform-origin: 50% 0; }

/* Con JS, el cohete arranca fuera de escena: lo ubica y lo muestra el propio JS */
.vel--js .vel__cohete { left: 0; top: 0; opacity: 0; transform: none; }

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  .vel__arco { transition: stroke-dashoffset 1.9s cubic-bezier(.2, .8, .2, 1); }
  /* la aguja se pasa un poco y vuelve, como un velocímetro de verdad */
  .vel__aguja { transition: transform 1.9s cubic-bezier(.25, 1.35, .45, 1); }
  .vel--sin-transicion .vel__arco,
  .vel--sin-transicion .vel__aguja { transition: none; }
  .vel--espera .vel__arco { stroke-dashoffset: 100; }
  .vel--espera .vel__aguja { transform: rotate(-90deg); }

  /* la llama titila siempre */
  .vel__llama { animation: vel-llama .12s ease-in-out infinite alternate; }
  .vel--fuera .vel__llama { animation-play-state: paused; }
}
@keyframes vel-llama {
  from { transform: scaleY(.75) scaleX(.9); }
  to   { transform: scaleY(1.25) scaleX(1.05); }
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .vel {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "medidor texto"
      "escena  escena";
    row-gap: 10px;
  }
  .vel__escena { height: 220px; }
}
@media (max-width: 767px) {
  .vel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "medidor"
      "texto"
      "escena";
    row-gap: 16px;
    text-align: center;
  }
  .vel__medidor { justify-self: center; }
  .vel__desc { margin-left: auto; margin-right: auto; }
  .vel__titulo { font-size: var(--fs-2xl); }
}
