/* Shared public-site atmosphere. The QR entry gateways intentionally use their own visual language. */
body.jsh-ambient {
  --jsh-ambient-primary: rgba(39, 101, 244, 0.22);
  --jsh-ambient-secondary: rgba(218, 100, 42, 0.14);
  --jsh-ambient-line: rgba(113, 159, 255, 0.22);
  --jsh-ambient-network: rgba(123, 174, 255, 0.42);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(39, 101, 244, 0.23), transparent 30rem),
    radial-gradient(circle at 88% 82%, rgba(218, 100, 42, 0.12), transparent 28rem),
    linear-gradient(155deg, #071225 0%, #050e1b 48%, #030912 100%) !important;
}

body.jsh-ambient::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(145, 159, 179, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 159, 179, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

body.jsh-ambient > :not(.ambient-field) { position: relative; z-index: 1; }

.jsh-ambient .ambient-field {
  position: fixed;
  inset: -12%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.jsh-ambient .ambient-orb,
.jsh-ambient .ambient-sweep,
.jsh-ambient .ambient-ring { position: absolute; }

.jsh-ambient .ambient-coordinate-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.38;
  background-image:
    linear-gradient(var(--jsh-ambient-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--jsh-ambient-line) 1px, transparent 1px),
    radial-gradient(circle, var(--jsh-ambient-line) 0 1px, transparent 1.6px);
  background-position: 0 0, 0 0, 19px 23px;
  background-size: 96px 96px, 96px 96px, 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 6%, transparent 76%);
  will-change: background-position;
  animation: jsh-ambient-grid-drift 72s linear infinite;
}

.jsh-ambient .ambient-network {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--jsh-ambient-network);
  opacity: 0.72;
  filter: drop-shadow(0 0 7px var(--jsh-ambient-primary));
}

.jsh-ambient .ambient-network path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-dasharray: 8 18 2 12;
  vector-effect: non-scaling-stroke;
  will-change: stroke-dashoffset;
  animation: jsh-ambient-network-flow 30s linear infinite;
}

.jsh-ambient .ambient-network path:nth-of-type(2) { opacity: 0.72; animation-duration: 42s; animation-direction: reverse; }
.jsh-ambient .ambient-network path:nth-of-type(3) { opacity: 0.52; animation-duration: 56s; }

.jsh-ambient .ambient-network circle {
  fill: currentColor;
  transform-box: fill-box;
  transform-origin: center;
  animation: jsh-ambient-node-pulse 4.8s ease-in-out infinite;
}

.jsh-ambient .ambient-network circle:nth-of-type(2n) { animation-delay: -1.7s; }
.jsh-ambient .ambient-network circle:nth-of-type(3n) { animation-delay: -3.1s; }

.jsh-ambient .ambient-orb { z-index: 0; border-radius: 50%; filter: blur(18px); will-change: transform, opacity; }
.jsh-ambient .ambient-orb--blue {
  top: 3%; left: -8%; width: clamp(22rem, 46vw, 48rem); aspect-ratio: 1;
  background: radial-gradient(circle, var(--jsh-ambient-primary), transparent 68%);
  animation: jsh-ambient-drift-blue 24s ease-in-out infinite alternate;
}
.jsh-ambient .ambient-orb--orange {
  right: -12%; bottom: -8%; width: clamp(20rem, 42vw, 44rem); aspect-ratio: 1;
  background: radial-gradient(circle, var(--jsh-ambient-secondary), transparent 70%);
  animation: jsh-ambient-drift-orange 31s ease-in-out infinite alternate;
}
.jsh-ambient .ambient-sweep {
  z-index: 3; top: -18%; bottom: -18%; left: -36%; width: 28%; transform: skewX(-12deg);
  background: linear-gradient(90deg, transparent, var(--jsh-ambient-line), transparent);
  filter: blur(10px); opacity: 0; mix-blend-mode: screen; animation: jsh-ambient-signal-pass 19s linear infinite;
}
.jsh-ambient .ambient-ring {
  z-index: 1; top: 19%; right: 12%; width: clamp(12rem, 27vw, 28rem); aspect-ratio: 1;
  border: 1px solid var(--jsh-ambient-line); border-radius: 50%; opacity: 0;
  animation: jsh-ambient-ring-pulse 15s ease-out 2s infinite;
}

.jsh-ambient .ambient-sound-host { display: inline-flex; align-items: center; }
.jsh-ambient .ambient-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 36px;
  padding: 0.48rem 0.68rem;
  border: 1px solid rgba(145, 159, 179, 0.22);
  border-radius: 999px;
  background: rgba(5, 14, 27, 0.58);
  color: #aeb8c8;
  cursor: pointer;
  font: inherit;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}
.jsh-ambient .ambient-sound-toggle:hover { border-color: rgba(145, 159, 179, 0.5); color: #f4f7fb; }
.jsh-ambient .ambient-sound-toggle[aria-pressed="true"] { border-color: var(--jsh-ambient-line); color: #f4f7fb; background: rgba(39, 101, 244, 0.09); }
.jsh-ambient .sound-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.jsh-ambient .sound-bars i { display: block; width: 2px; border-radius: 2px; background: currentColor; transform-origin: bottom; }
.jsh-ambient .sound-bars i:nth-child(1) { height: 45%; }
.jsh-ambient .sound-bars i:nth-child(2) { height: 100%; }
.jsh-ambient .sound-bars i:nth-child(3) { height: 68%; }
.jsh-ambient .ambient-sound-toggle[aria-pressed="true"] .sound-bars i { animation: jsh-ambient-sound-meter 1.1s ease-in-out infinite alternate; }
.jsh-ambient .ambient-sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(2) { animation-delay: -0.58s; }
.jsh-ambient .ambient-sound-toggle[aria-pressed="true"] .sound-bars i:nth-child(3) { animation-delay: -0.31s; }

@keyframes jsh-ambient-drift-blue {
  0% { transform: translate3d(-3%, -2%, 0) scale(0.9); opacity: 0.55; }
  55% { opacity: 0.92; }
  100% { transform: translate3d(18%, 12%, 0) scale(1.1); opacity: 0.64; }
}
@keyframes jsh-ambient-grid-drift {
  from { background-position: 0 0, 0 0, 19px 23px; }
  to { background-position: 96px 96px, 96px 96px, 67px 71px; }
}
@keyframes jsh-ambient-network-flow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -240; } }
@keyframes jsh-ambient-node-pulse {
  0%, 100% { transform: scale(0.65); opacity: 0.28; }
  48% { transform: scale(1.65); opacity: 0.95; }
  62% { transform: scale(1); opacity: 0.58; }
}
@keyframes jsh-ambient-drift-orange {
  0% { transform: translate3d(4%, 5%, 0) scale(0.92); opacity: 0.48; }
  45% { opacity: 0.78; }
  100% { transform: translate3d(-18%, -15%, 0) scale(1.08); opacity: 0.56; }
}
@keyframes jsh-ambient-signal-pass {
  0%, 8% { transform: translateX(0) skewX(-12deg); opacity: 0; }
  18% { opacity: 0.34; }
  72% { opacity: 0.18; }
  84%, 100% { transform: translateX(560%) skewX(-12deg); opacity: 0; }
}
@keyframes jsh-ambient-ring-pulse {
  0% { transform: scale(0.42); opacity: 0; }
  12% { opacity: 0.2; }
  72% { opacity: 0.06; }
  100% { transform: scale(1.7); opacity: 0; }
}
@keyframes jsh-ambient-sound-meter {
  from { transform: scaleY(0.36); opacity: 0.5; }
  to { transform: scaleY(1); opacity: 1; }
}

@media (max-width: 720px) {
  .jsh-ambient .ambient-field { opacity: 0.62; }
  .jsh-ambient .ambient-sweep,
  .jsh-ambient .ambient-ring,
  .jsh-ambient .ambient-network circle { display: none; }
  .jsh-ambient .ambient-coordinate-grid { opacity: 0.22; animation-duration: 28s; }
  .jsh-ambient .ambient-network { opacity: 0.48; filter: none; }
  .jsh-ambient .ambient-network path { animation-duration: 14s; }
  .jsh-ambient .ambient-network path:nth-of-type(2) { animation-duration: 18s; }
  .jsh-ambient .ambient-network path:nth-of-type(3) { animation-duration: 23s; }
}

@media (prefers-reduced-motion: reduce) {
  .jsh-ambient:not([data-motion="full"]) .ambient-coordinate-grid,
  .jsh-ambient:not([data-motion="full"]) .ambient-network path,
  .jsh-ambient:not([data-motion="full"]) .ambient-network circle,
  .jsh-ambient:not([data-motion="full"]) .ambient-orb,
  .jsh-ambient:not([data-motion="full"]) .ambient-sweep,
  .jsh-ambient:not([data-motion="full"]) .ambient-ring { animation: none !important; }
}
