/* ========================================================================
   FireXCore Sentinel V4 — 2026 Professional
   Layered 2.5D rig / Spring physics / Behavioral states / Articulated neck
   Namespace: .fxs4-*
   ======================================================================== */

.fxs4-stage,
.fxs4-stage *,
.fxs4-stage *::before,
.fxs4-stage *::after { box-sizing: border-box; }

.fxs4-stage {
  --fxs4-cyan: #59ecff;
  --fxs4-blue: #208cff;
  --fxs4-alert: #ff6b2b;
  --fxs4-navy: #08111f;
  --fxs4-state: idle;
  position: relative;
  width: min(100%, 900px);
  aspect-ratio: 1 / 1.15;
  height: auto;
  min-height: 0;
  margin-inline: auto;
  display: grid;
  place-items: center;
  perspective: 1700px;
  perspective-origin: 50% 46%;
  isolation: isolate;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: crosshair;
}

.fxs4-stage img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Ambient */
.fxs4-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.fxs4-ambient__glow {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 46%, rgba(29, 135, 244, .19), rgba(18, 77, 163, .08) 40%, transparent 72%);
  filter: blur(42px);
  opacity: .82;
  transition: opacity .6s ease, background .8s ease;
}

.fxs4-stage.is-alert .fxs4-ambient__glow {
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 90, 30, .22), rgba(180, 40, 10, .09) 40%, transparent 72%);
  opacity: 1;
}

.fxs4-stage.is-focus .fxs4-ambient__glow { opacity: .95; }
.fxs4-stage.is-powersave .fxs4-ambient__glow { opacity: .45; }

.fxs4-ambient__pointer-light {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 190, 255, .14), transparent 68%);
  filter: blur(28px);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .35s ease;
  will-change: left, top, opacity;
  pointer-events: none;
}
.fxs4-stage.is-engaged .fxs4-ambient__pointer-light { opacity: 1; }
.fxs4-stage.is-alert .fxs4-ambient__pointer-light {
  background: radial-gradient(circle, rgba(255, 110, 40, .18), transparent 68%);
}

.fxs4-ambient__particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(91, 230, 255, .82);
  box-shadow: 0 0 16px rgba(62, 203, 255, .64);
  opacity: .25;
}
.fxs4-ambient__particle--1 { left: 10%; top: 35%; }
.fxs4-ambient__particle--2 { right: 8%; top: 48%; width: 2px; height: 2px; }
.fxs4-ambient__particle--3 { left: 27%; bottom: 16%; width: 2px; height: 2px; opacity: .18; }

/* Sentinel root */
.fxs4-sentinel {
  position: relative;
  z-index: 2;
  width: min(96%, 820px);
  aspect-ratio: 1 / 1.12;
  height: auto;
  min-height: 0;
  transform-style: preserve-3d;
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(.978);
  transition: filter .7s ease;
}

.fxs4-stage.is-ready .fxs4-sentinel {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity .7s ease, transform .9s cubic-bezier(.16, 1, .3, 1), filter .7s ease;
}

.fxs4-stage.is-powersave .fxs4-sentinel {
  filter: brightness(.72) saturate(.75);
}

.fxs4-stage.is-alert .fxs4-sentinel {
  filter: brightness(1.06) saturate(1.15);
}

/* Rig */
.fxs4-rig-pointer,
.fxs4-rig-idle {
  position: absolute;
  inset: 0 0 2%;
  transform-style: preserve-3d;
  transform-origin: 50% 42%;
  will-change: transform;
}

.fxs4-head-shell,
.fxs4-neck-shell,
.fxs4-torso-shell,
.fxs4-arm-shell {
  position: absolute;
  transform-style: preserve-3d;
}

/* Head */
.fxs4-head-shell {
  z-index: 9;
  top: 0%;
  left: 50%;
  width: 46%;
  transform: translateX(-50%) translateZ(54px);
}

.fxs4-head-pointer,
.fxs4-head-idle,
.fxs4-neck-pointer,
.fxs4-neck-idle,
.fxs4-torso-pointer,
.fxs4-torso-idle,
.fxs4-arm-pointer,
.fxs4-arm-idle {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.fxs4-head-pointer { transform-origin: 50% 78%; }
.fxs4-neck-pointer { transform-origin: 50% 10%; }
.fxs4-torso-pointer { transform-origin: 50% 22%; }
.fxs4-arm-shell--left .fxs4-arm-pointer { transform-origin: 88% 14%; }
.fxs4-arm-shell--right .fxs4-arm-pointer { transform-origin: 12% 14%; }

.fxs4-head-idle,
.fxs4-torso-idle,
.fxs4-arm-idle {
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, .17));
}

/* Visor & eyes */
.fxs4-visor {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 26.2%;
  width: 72.2%;
  height: 50%;
  transform: translateX(-50%) translateZ(14px);
  border-radius: 36% / 43%;
  overflow: hidden;
  pointer-events: none;
}

.fxs4-visor__shade {
  position: absolute;
  inset: 20% 7% 13%;
  z-index: 1;
  border-radius: 48%;
  background: radial-gradient(ellipse at 50% 60%, rgba(2, 8, 15, .18), rgba(2, 8, 15, .09) 54%, transparent 80%);
  filter: blur(3px);
}

.fxs4-visor__sheen {
  position: absolute;
  z-index: 2;
  left: -8%;
  top: -30%;
  width: 76%;
  height: 83%;
  border-radius: 50%;
  transform: rotate(-14deg);
  background: radial-gradient(ellipse, rgba(255, 255, 255, .08), rgba(255, 255, 255, .018) 46%, transparent 72%);
  opacity: .82;
  will-change: transform;
}

.fxs4-visor__reflect {
  position: absolute;
  z-index: 3;
  left: 18%;
  top: 12%;
  width: 38%;
  height: 28%;
  border-radius: 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .02) 55%, transparent);
  opacity: .55;
  will-change: transform, opacity;
  pointer-events: none;
}

.fxs4-visor__scan {
  position: absolute;
  z-index: 4;
  left: 14%;
  right: 14%;
  top: 37%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(86, 233, 255, .48), transparent);
  box-shadow: 0 0 12px rgba(45, 186, 255, .34);
  opacity: 0;
}
.fxs4-stage.is-alert .fxs4-visor__scan {
  background: linear-gradient(90deg, transparent, rgba(255, 120, 40, .65), transparent);
  box-shadow: 0 0 14px rgba(255, 90, 30, .45);
}

.fxs4-eyes {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 48%;
  width: 72%;
  height: auto;
  transform: translate(-50%, -50%);
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(54, 216, 255, .52));
  transition: filter .45s ease, opacity .45s ease;
}
.fxs4-stage.is-alert .fxs4-eyes {
  filter: drop-shadow(0 0 12px rgba(255, 100, 30, .7));
}
.fxs4-stage.is-powersave .fxs4-eyes {
  filter: drop-shadow(0 0 6px rgba(54, 216, 255, .28));
  opacity: .7;
}

.fxs4-eyes__motion {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.fxs4-eye {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

.fxs4-eye path {
  fill: none;
  stroke: url(#fxs4EyeGradient);
  stroke-width: 3.1;
  stroke-linecap: round;
  filter: url(#fxs4EyeGlow);
  transition: stroke .4s ease;
}
.fxs4-stage.is-alert .fxs4-eye path {
  stroke: url(#fxs4EyeAlert);
}

.fxs4-stage.is-focus .fxs4-eye {
  transform: scaleY(0.92);
}
.fxs4-stage.is-alert .fxs4-eye {
  transform: scaleY(0.88);
}

/* Neck */
.fxs4-neck-shell {
  z-index: 7;
  top: 30.5%;
  left: 50%;
  width: 11%;
  height: 2.5%;
  transform: translateX(-50%) translateZ(32px);
  pointer-events: none;
  opacity: 0.85;
}

.fxs4-neck-idle {
  height: 100%;
  min-height: 0;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .38));
  position: relative;
}

.fxs4-neck__cap,
.fxs4-neck__rib {
  position: absolute;
  left: 50%;
  border: 1px solid rgba(105, 142, 196, .16);
  background:
    linear-gradient(180deg,
      #1c2a3d 0%,
      #0d141f 42%,
      #121b28 70%,
      #0a1018 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    inset 0 -1px 0 rgba(0, 0, 0, .35),
    0 4px 10px rgba(0, 0, 0, .28);
  transform: translateX(-50%);
}

.fxs4-neck__cap {
  top: 0;
  width: 88%;
  height: 22%;
  border-radius: 3px 3px 5px 5px;
  background:
    linear-gradient(180deg, #243448 0%, #121a27 55%, #0c121c 100%);
  box-shadow:
    inset 0 1px 0 rgba(160, 200, 255, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .4),
    0 3px 8px rgba(0, 0, 0, .3);
}

.fxs4-neck__rib { height: 16%; border-radius: 3px; }
.fxs4-neck__rib--1 { top: 24%; width: 78%; }
.fxs4-neck__rib--2 { top: 42%; width: 68%; }
.fxs4-neck__rib--3 { top: 60%; width: 58%; }
.fxs4-neck__rib--4 { top: 76%; width: 48%; height: 14%; }

.fxs4-neck__glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 70%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(33, 137, 255, .28), rgba(23, 83, 176, .08) 48%, transparent 74%);
  filter: blur(8px);
  transform: translateX(-50%);
  transition: background .5s ease, opacity .5s ease;
}
.fxs4-stage.is-alert .fxs4-neck__glow {
  background: radial-gradient(ellipse, rgba(255, 100, 30, .32), rgba(180, 40, 10, .1) 48%, transparent 74%);
}
.fxs4-stage.is-powersave .fxs4-neck__glow { opacity: .35; }

.fxs4-neck__cable {
  position: absolute;
  top: 10%;
  width: 2px;
  height: 80%;
  border-radius: 2px;
  background: linear-gradient(180deg,
    rgba(70, 110, 160, .35),
    rgba(30, 50, 80, .5) 40%,
    rgba(20, 35, 55, .45));
  box-shadow: 0 0 4px rgba(40, 90, 160, .15);
}
.fxs4-neck__cable--l { left: 6%; transform: rotate(3deg); }
.fxs4-neck__cable--r { right: 6%; transform: rotate(-3deg); }

/* Torso */
.fxs4-torso-shell {
  z-index: 5;
  top: 29.5%;
  left: 50%;
  width: 52%;
  transform: translateX(-50%) translateZ(12px);
}

.fxs4-core-glow {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 42%;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(65, 214, 255, .18), rgba(14, 100, 225, .08) 43%, transparent 72%);
  filter: blur(16px);
  mix-blend-mode: screen;
  pointer-events: none;
  will-change: transform, opacity;
  transform-origin: center center;
  transition: background .5s ease;
}
.fxs4-stage.is-alert .fxs4-core-glow {
  background: radial-gradient(circle, rgba(255, 120, 40, .22), rgba(200, 50, 10, .1) 43%, transparent 72%);
}
.fxs4-stage.is-powersave .fxs4-core-glow { opacity: .35 !important; }

.fxs4-thruster {
  position: absolute;
  left: 50%;
  bottom: -2.3%;
  width: 22%;
  height: 10.5%;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgb(0, 149, 255), rgb(41, 54, 255) 42%, transparent 72%);
  filter: blur(7px);
  mix-blend-mode: screen;
  will-change: transform, opacity;
  transform-origin: center bottom;
  transition: background .45s ease;
}
.fxs4-stage.is-alert .fxs4-thruster {
  background: radial-gradient(ellipse, rgb(255, 110, 30), rgb(200, 40, 10) 42%, transparent 72%);
}
.fxs4-stage.is-powersave .fxs4-thruster { opacity: .25 !important; }

/* Particles */
.fxs4-particles {
  position: absolute;
  left: 50%;
  bottom: -4%;
  width: 30%;
  height: 80px;
  transform: translateX(-50%);
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.fxs4-particle {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: rgba(90, 210, 255, .85);
  box-shadow: 0 0 8px rgba(60, 180, 255, .7);
  opacity: 0;
  will-change: transform, opacity;
  pointer-events: none;
}
.fxs4-stage.is-alert .fxs4-particle {
  background: rgba(255, 140, 50, .9);
  box-shadow: 0 0 10px rgba(255, 100, 30, .75);
}

/* Arms */
.fxs4-arm-shell {
  z-index: 4;
  top: 43%;
  width: 29%;
}
.fxs4-arm-shell--left {
  left: 4%;
  transform: translateZ(-10px);
}
.fxs4-arm-shell--right {
  right: 4%;
  transform: translateZ(-10px);
}

.fxs4-shoulder-glow {
  position: absolute;
  z-index: -1;
  top: 14%;
  width: 22%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 151, 255, .23), transparent 68%);
  filter: blur(11px);
  transition: background .5s ease;
}
.fxs4-shoulder-glow--left { right: -6%; }
.fxs4-shoulder-glow--right { left: -6%; }
.fxs4-stage.is-alert .fxs4-shoulder-glow {
  background: radial-gradient(circle, rgba(255, 100, 30, .28), transparent 68%);
}

/* Status */
.fxs4-status {
  position: absolute;
  z-index: 20;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  border-radius: 20px;
  background: rgba(8, 16, 30, .72);
  border: 1px solid rgba(80, 130, 190, .18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  color: #7a9bb8;
  pointer-events: none;
  opacity: .85;
  transition: color .4s ease, border-color .4s ease, background .4s ease;
}

.fxs4-status__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3d9eff;
  box-shadow: 0 0 8px rgba(60, 160, 255, .6);
  transition: background .4s ease, box-shadow .4s ease;
}

.fxs4-stage.is-focus .fxs4-status { color: #8ec8ff; border-color: rgba(80, 160, 255, .28); }
.fxs4-stage.is-focus .fxs4-status__dot { background: #5cbcff; box-shadow: 0 0 10px rgba(80, 190, 255, .7); }

.fxs4-stage.is-alert .fxs4-status {
  color: #ffb080;
  border-color: rgba(255, 120, 50, .35);
  background: rgba(30, 12, 6, .75);
}
.fxs4-stage.is-alert .fxs4-status__dot {
  background: #ff6b2b;
  box-shadow: 0 0 10px rgba(255, 100, 30, .75);
  animation: fxs4-pulse-dot 0.9s ease-in-out infinite;
}

.fxs4-stage.is-powersave .fxs4-status { color: #4a6278; border-color: rgba(60, 90, 120, .15); opacity: .55; }
.fxs4-stage.is-powersave .fxs4-status__dot { background: #3a5a78; box-shadow: none; }

@keyframes fxs4-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(0.85); }
}

/* Utility */
.fxs4-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.fxs4-stage.is-engaged .fxs4-ambient__glow { opacity: 1; }

/* Contact stage (home page) */
.fxs4-stage--contact {
  width: min(100%, 480px);
  aspect-ratio: 1 / 1.15;
  min-height: 0;
  height: auto;
  margin: 0 auto 8px;
  cursor: crosshair;
}
.fxs4-stage--contact .fxs4-sentinel {
  width: 100%;
  aspect-ratio: 1 / 1.12;
  height: auto;
  min-height: 0;
}
.fxs4-stage--contact .fxs4-status {
  bottom: 8px;
  font-size: 10px;
  opacity: .8;
}

/* Width scaling only — vertical ratios stay locked via aspect-ratio */
@media (max-width: 767.98px) {
  .fxs4-stage {
    width: min(100%, 690px);
  }
  .fxs4-sentinel {
    width: min(100%, 690px);
  }
  .fxs4-status { bottom: 10px; font-size: 9px; }
  .fxs4-stage--contact {
    width: min(100%, 400px);
  }
}

@media (max-width: 479.98px) {
  .fxs4-stage {
    width: min(100%, 610px);
  }
  .fxs4-sentinel {
    width: min(100%, 610px);
  }
  .fxs4-stage--contact {
    width: min(100%, 340px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fxs4-sentinel { opacity: 1; transform: none; }
  .fxs4-stage.is-ready .fxs4-sentinel { transition: none; }
  .fxs4-particle { display: none !important; }
}
