/* ============================================================
   RECORRIDO NÚCLEO · tramo de scroll de la Home
   El hero comercial no cambia. El tramo solo existe al activarse desde
   el cerebro: una escena fija (sticky) que el scroll recorre y que
   termina DENTRO del bloque siguiente (#ruta), sin tarjeta ni corte.
   ============================================================ */

/* ---------- la puerta: el cerebro + un botón discreto ---------- */
.rocalde-home .rh-hero__emblem { flex-direction: column; align-items: center; gap: 18px; }
.rocalde-home .rh-emblem[data-nh-open] { cursor: pointer; }
.rocalde-home .nh-open {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 14px; min-height: 44px; border-radius: 999px; cursor: pointer;
  font: 600 13px/1 var(--rh-font); letter-spacing: 0.04em; color: rgba(244, 247, 250, 0.9);
  background: rgba(8, 14, 24, 0.55); border: 1px solid rgba(214, 222, 227, 0.18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .2s ease, color .2s ease, transform .16s ease-out;
}
.rocalde-home .nh-open:active { transform: scale(0.97); }
.rocalde-home .nh-open i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #F26A1B; box-shadow: 0 0 10px rgba(242, 106, 27, 0.9); }
.rocalde-home .nh-open i::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(242, 106, 27, 0.6); animation: nh-ping 2.4s ease-out infinite; }
@keyframes nh-ping { 0% { transform: scale(0.6); opacity: 1; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@media (hover: hover) and (pointer: fine) {
  .rocalde-home .rh-emblem[data-nh-open]:hover .rh-emblem__img { filter: drop-shadow(0 0 26px rgba(242, 106, 27, 0.45)); }
  .rocalde-home .nh-open:hover { color: #fff; border-color: rgba(242, 106, 27, 0.6); }
  .rocalde-home .nh-close:hover { border-color: rgba(242, 106, 27, 0.7); }
}
.rocalde-home:not(.rh-js) .nh-open { display: none; }

/* ---------- el tramo: alto de scroll + escena fija ---------- */
.rocalde-home .nh-journey { position: relative; height: 720svh; background: #05080d; }
.rocalde-home .nh-journey[hidden] { display: none; }
.rocalde-home .nh-journey.is-2d { height: 460svh; }
.rocalde-home .nh-stage {
  position: sticky; top: var(--rh-nav-h, 88px); z-index: 1;
  height: calc(100svh - var(--rh-nav-h, 88px)); min-height: 480px; overflow: hidden;
  color: #eef2f6; background: #05080d;
}
.rocalde-home .nh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s ease; }
.rocalde-home .nh-stage.is-3d .nh-canvas { opacity: 1; }
.rocalde-home .nh-hints { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.rocalde-home .nh-hint {
  position: absolute; left: 0; top: 0; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  font: 500 12px/1 ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.08em; color: rgba(214, 232, 244, 0.9);
}
.rocalde-home .nh-hint--w { color: #ffb38a; }
.rocalde-home .nh-veil { position: absolute; inset: 0; pointer-events: none; opacity: 0; will-change: opacity; background: radial-gradient(60% 60% at 50% 50%, rgba(255, 190, 140, 0.55), rgba(242, 106, 27, 0.25) 45%, rgba(5, 8, 13, 0) 80%); }

.rocalde-home .nh-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(20px, 5vw, 48px); }
.rocalde-home .nh-kicker { font: 600 11px/1 ui-monospace, 'SF Mono', Consolas, monospace; letter-spacing: 0.22em; text-transform: uppercase; color: #7fd0ea; transition: color .4s ease; }
.rocalde-home .nh-stage[data-step] .nh-kicker { color: #ffb38a; }
.rocalde-home .nh-close { width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 22px; line-height: 1; color: #eef2f6; background: rgba(8, 14, 24, 0.6); border: 1px solid rgba(214, 222, 227, 0.2); transition: border-color .2s ease, transform .16s ease-out; }
.rocalde-home .nh-close:active { transform: scale(0.95); }

/* rótulo del capítulo: su opacidad la gobierna el scroll (nucleo-hero.js), no un temporizador */
.rocalde-home .nh-cap { position: absolute; left: clamp(20px, 5vw, 48px); bottom: clamp(40px, 8vh, 72px); max-width: min(560px, 80vw); pointer-events: none; }
.rocalde-home .nh-cap__n { display: none; }
.rocalde-home .nh-cap__t { margin: 0; font-size: clamp(20px, 2.2vw, 28px); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; color: rgba(238, 242, 246, 0.92); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); opacity: 0; }

/* invitación a avanzar: desaparece apenas empieza el viaje */
.rocalde-home .nh-cue { position: absolute; left: 50%; bottom: clamp(40px, 8vh, 72px); transform: translateX(-50%); margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font: 600 10.5px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(198, 214, 226, 0.7); pointer-events: none; }
.rocalde-home .nh-cue i { width: 1px; height: 34px; background: linear-gradient(#F26A1B, transparent); transform-origin: top; animation: nh-cue 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
@keyframes nh-cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.rocalde-home .nh-rail { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(214, 222, 227, 0.08); }
.rocalde-home .nh-rail i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #1E9BC4, #F26A1B); }

.rocalde-home .nh-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; font: 600 11px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.2em; text-transform: uppercase; color: #7fd0ea; opacity: 0; transition: opacity .3s ease; }
.rocalde-home .nh-stage.is-loading .nh-loading { opacity: 1; animation: nh-blink 1.2s ease-in-out infinite; }
.rocalde-home .nh-stage.is-loading .nh-cue { opacity: 0 !important; }
@keyframes nh-blink { 50% { opacity: 0.35; } }

/* consulta → conversación → agenda → relación (lo arma la escena) */
.rocalde-home .nh-seq { position: absolute; left: 0; right: 0; top: 50%; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 10px 14px; margin: 0; padding: 0 20px; pointer-events: none; font-size: clamp(20px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.02em; color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8); }
.rocalde-home .nh-seq span, .rocalde-home .nh-seq i { opacity: 0; }
.rocalde-home .nh-seq i { font-style: normal; color: #F26A1B; }
.rocalde-home .nh-seq span:last-of-type { color: #ffb38a; }

/* ---------- 2D por scroll: misma narrativa, sin WebGL / reduced-motion ---------- */
.rocalde-home .nh-2d { display: none; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(300px, 56vw); }
.rocalde-home .nh-stage.is-2d .nh-2d { display: block; }
.rocalde-home .nh-2d img { width: 100%; height: auto; transition: filter .6s ease, transform .6s cubic-bezier(0.22, 1, 0.36, 1), opacity .6s ease; }
.rocalde-home .nh-stage.is-2d[data-step="0"] .nh-2d img { opacity: 0.55; filter: grayscale(0.7); transform: scale(0.92); }
.rocalde-home .nh-stage.is-2d[data-step="1"] .nh-2d img { filter: drop-shadow(0 0 22px rgba(242, 106, 27, 0.5)); }
.rocalde-home .nh-stage.is-2d[data-step="2"] .nh-2d img { filter: drop-shadow(0 0 30px rgba(127, 208, 234, 0.5)); }
.rocalde-home .nh-stage.is-2d[data-step="3"] .nh-2d img { transform: scale(0.8); filter: drop-shadow(0 0 40px rgba(127, 208, 234, 0.4)); }
.rocalde-home .nh-stage.is-2d[data-step="4"] .nh-2d img { transform: scale(0.7); filter: drop-shadow(0 0 60px rgba(242, 106, 27, 0.7)); }

/* ---------- LA MANO: el bloque siguiente sube sobre la luz del encuentro ----------
   Mientras el tramo está abierto, #ruta se superpone al último 70% de la
   escena fija: su borde superior es transparente (se ve la luz 3D) y se
   vuelve grafito; una línea baja desde el encuentro hasta el título. */
.rocalde-home.nh-on .rh-fork {
  --nh-ov: calc((100svh - var(--rh-nav-h, 88px)) * 0.7);
  position: relative; z-index: 3;
  margin-top: calc(var(--nh-ov) * -1);
  padding-top: calc(var(--nh-ov) * 0.42 + clamp(40px, 6vh, 64px));
  background: linear-gradient(180deg, rgba(8, 14, 24, 0) 0, rgba(8, 14, 24, 0.55) calc(var(--nh-ov) * 0.22), var(--rh-bg-dark, #080e18) calc(var(--nh-ov) * 0.4));
}
.rocalde-home.nh-on .rh-fork::before { display: none; }
.rocalde-home .nh-thread { display: none; }
.rocalde-home.nh-on .nh-thread { display: block; position: absolute; left: 0; right: 0; z-index: 0; pointer-events: none; }
.rocalde-home .nh-thread svg { position: absolute; left: 0; top: 0; overflow: visible; }
.rocalde-home .nh-thread path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rocalde-home .nh-thread circle { opacity: 0; }
.rocalde-home .nh-thread i {                                  /* lo que queda del resplandor cuando la escena se va */
  position: absolute; left: var(--nh-cx, 50%); top: 0; width: min(760px, 110vw); height: 60svh; transform: translate(-50%, -48%);
  background: radial-gradient(closest-side, rgba(255, 178, 122, 0.22), rgba(242, 106, 27, 0.08) 50%, transparent);
  opacity: 0; will-change: opacity;
}

@media (max-width: 900px) {
  .rocalde-home .nh-journey { height: 640svh; }
  .rocalde-home .nh-journey.is-2d { height: 420svh; }
  .rocalde-home .nh-cap { bottom: 48px; }
  .rocalde-home .nh-cap__t { font-size: 20px; }
  .rocalde-home .nh-hint { font-size: 10px; }
  .rocalde-home .nh-seq { top: 56%; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .rocalde-home .nh-open i::after, .rocalde-home .nh-cue i, .rocalde-home .nh-stage.is-loading .nh-loading { animation: none; }
  .rocalde-home .nh-canvas, .rocalde-home .nh-2d img { transition: opacity .3s ease; }
  .rocalde-home .nh-stage.is-2d[data-step] .nh-2d img { transform: none; }
}
