/* =================================================================
   NTL RIGGER  —  black/red climber on a swinging rope, with fatigue.
   Follows the cursor; the rope bows/whips with the pendulum swing;
   the climber tires (sweat, frantic limbs, heavy breathing) the
   deeper you scroll. Desktop + fine-pointer + motion-OK only.
   DISABLE: remove the crawler.css / crawler.js lines in index.html.
   ================================================================= */
:root { --rig-size: 64px; }

/* the swinging rope (curved SVG path) */
.ntl-rope {
  position: fixed; inset: 0; z-index: 8000; pointer-events: none;
  opacity: 0; transition: opacity 0.35s ease;
}
.ntl-rope.is-on { opacity: 0.9; }
.ntl-rope svg { display: block; overflow: visible; }
.ntl-rope__path {
  fill: none; stroke: var(--crimson-2); stroke-width: 2; stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(47,143,208, 0.55));
}

.ntl-rig {
  position: fixed; top: 0; left: 0;
  width: var(--rig-size); height: calc(var(--rig-size) * 1.25);
  z-index: 8001; pointer-events: none; opacity: 0;
  transform: translate(-160px, -160px); will-change: transform;
  transform-origin: 50% 7px;
}
.ntl-rig.is-on { opacity: 1; }
.ntl-rig.is-anim { transition: transform 0.72s cubic-bezier(0.5, 0.05, 0.2, 1); }

.ntl-rig__svg {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
  transition: transform 0.25s ease;
}
.rig-fill  { fill: #08080a; }
.rig-steel { fill: #1b1c20; }
.rig-red   { fill: var(--crimson); }
.rig-light { fill: var(--crimson-2); }

.ntl-rig__frame { position: absolute; inset: -9px; pointer-events: none; }
.ntl-rig__frame i {
  position: absolute; width: 11px; height: 11px;
  border: 2px solid var(--crimson-2); opacity: 0.9;
}
.ntl-rig__frame .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.ntl-rig__frame .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.ntl-rig__frame .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.ntl-rig__frame .br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.ntl-rig__tag {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace; font-size: 8px; letter-spacing: 2px;
  color: var(--crimson-2); white-space: nowrap; text-shadow: 0 0 8px rgba(47,143,208, 0.6);
}

.rig-arm-l, .rig-arm-r, .rig-leg-l, .rig-leg-r, .rig-body { transform-box: fill-box; }
.rig-body  { transform-origin: 50% 50%; animation: rigBob 1s ease-in-out infinite; }
.rig-arm-l { transform-origin: 50% 86%; animation: armA 1s ease-in-out infinite; }
.rig-arm-r { transform-origin: 50% 86%; animation: armB 1s ease-in-out infinite; }
.rig-leg-l { transform-origin: 50% 14%; animation: legB 1s ease-in-out infinite; }
.rig-leg-r { transform-origin: 50% 14%; animation: legA 1s ease-in-out infinite; }

.ntl-rig.is-scramble .rig-arm-l,
.ntl-rig.is-scramble .rig-arm-r,
.ntl-rig.is-scramble .rig-leg-l,
.ntl-rig.is-scramble .rig-leg-r,
.ntl-rig.is-scramble .rig-body { animation-duration: 0.34s; }

/* FATIGUE — limbs work harder + breathing quickens the deeper you scroll */
.ntl-rig.is-tired .rig-arm-l,
.ntl-rig.is-tired .rig-arm-r,
.ntl-rig.is-tired .rig-leg-l,
.ntl-rig.is-tired .rig-leg-r { animation-duration: 0.6s; }
.ntl-rig.is-tired .rig-body  { animation-duration: 0.55s; }

.ntl-rig.is-exhausted .rig-arm-l,
.ntl-rig.is-exhausted .rig-arm-r,
.ntl-rig.is-exhausted .rig-leg-l,
.ntl-rig.is-exhausted .rig-leg-r { animation-duration: 0.4s; }
.ntl-rig.is-exhausted .rig-body  { animation-name: rigGasp; animation-duration: 0.34s; }
.ntl-rig.is-exhausted .rig-light { animation: rigHeat 0.5s ease-in-out infinite; }

@keyframes armA   { 0%,100% { transform: rotate(-9deg); }  50% { transform: rotate(7deg); } }
@keyframes armB   { 0%,100% { transform: rotate(9deg); }   50% { transform: rotate(-7deg); } }
@keyframes legA   { 0%,100% { transform: rotate(7deg); }   50% { transform: rotate(-9deg); } }
@keyframes legB   { 0%,100% { transform: rotate(-7deg); }  50% { transform: rotate(9deg); } }
@keyframes rigBob  { 0%,100% { transform: translateY(0); }      50% { transform: translateY(-1.6px); } }
@keyframes rigGasp { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-3px) scaleY(1.05); } }
@keyframes rigHeat { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* sweat droplets (spawned by JS; rate rises with fatigue) */
.ntl-sweat {
  position: fixed; top: 0; left: 0; width: 4px; height: 5px; z-index: 8000; pointer-events: none;
  background: radial-gradient(circle at 40% 30%, #eaf6ff, #84c4ec);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  opacity: 0.92; transform: translateY(0) scale(1);
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.7, 1), opacity 0.85s ease-in;
}
.ntl-sweat.go { transform: translateY(32px) scale(0.7); opacity: 0; }

/* ---- film-cut wipe overlay ---- */
.ntl-cut { position: fixed; inset: 0; z-index: 9000; pointer-events: none; }
.ntl-cut__bar {
  position: absolute; left: 0; width: 100%; height: 52%;
  background: #050506; transform: scaleY(0);
  transition: transform 0.46s cubic-bezier(0.7, 0, 0.3, 1);
}
.ntl-cut__bar--top    { top: 0;    transform-origin: top; }
.ntl-cut__bar--bottom { bottom: 0; transform-origin: bottom; }
.ntl-cut.is-closing .ntl-cut__bar { transform: scaleY(1); }
.ntl-cut__edge {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--crimson-2); box-shadow: 0 0 16px 3px var(--crimson); opacity: 0;
}
.ntl-cut__edge--top { top: 52%; }
.ntl-cut__edge--bottom { bottom: 52%; }
.ntl-cut.is-closing .ntl-cut__edge { opacity: 1; transition: opacity 0.2s 0.34s; }
.ntl-cut__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace; letter-spacing: 0.5em;
  color: #fff; font-size: 0.78rem; text-indent: 0.5em; opacity: 0; transform: scale(0.92);
}
.ntl-cut.is-peak .ntl-cut__label { opacity: 1; transform: scale(1); transition: opacity 0.12s, transform 0.12s; }
.ntl-cut__flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.ntl-cut.is-peak .ntl-cut__flash { animation: cutFlash 0.18s ease-out; }
@keyframes cutFlash { 0% { opacity: 0; } 30% { opacity: 0.5; } 100% { opacity: 0; } }
