/* 06-svc-analysis.css — Interactive Split-Lens Optical Prism (Noise vs. Signal)
   Scoped strictly to .snan-* / --snan-* / @keyframes snan-*.
   Palette: Botanical Forest #0A2E1A, Deep Emerald #066632, Emerald #0B9444,
   Sage Glow #4FB878, Brushed Gold #E8A423, Alabaster #F8FAF7. */

.snan-section {
  --snan-bg-deep: #072213;
  --snan-bg: #0A2E1A;
  --snan-bg-elev: #0F3B22;
  --snan-emerald: #0B9444;
  --snan-sage: #4FB878;
  --snan-mint: #9CD9B3;
  --snan-gold: #E8A423;
  --snan-gold-hi: #F7D47C;
  --snan-gold-lo: #B5760D;
  --snan-alabaster: #F8FAF7;
  --snan-noise-ink: #A8BEB2; /* 7.2:1 on #0A2E1A (WCAG AAA) */
  --snan-pos: 56%;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: clamp(1.75rem, 3.6vw, 3.25rem) clamp(0.85rem, 3vw, 2.25rem);
  background:
    radial-gradient(ellipse 70% 80% at 82% 24%, rgba(11, 148, 68, 0.22), transparent 64%),
    radial-gradient(ellipse 55% 65% at 18% 72%, rgba(74, 99, 85, 0.16), transparent 62%),
    linear-gradient(180deg, #072213 0%, #0A2E1A 18%, #0C341E 82%, #072213 100%);
  border-top: 1px solid rgba(248, 250, 247, 0.12);
  border-bottom: 1px solid rgba(232, 164, 35, 0.24);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}

.snan-section *,
.snan-section *::before,
.snan-section *::after {
  box-sizing: border-box;
}

.snan-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.snan-root {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: var(--snan-bg);
  border: 1px solid rgba(248, 250, 247, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(248, 250, 247, 0.1),
    0 24px 60px -28px rgba(3, 14, 8, 0.85);
}

/* Top optical HUD rail */
.snan-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem clamp(0.85rem, 2.4vw, 1.5rem);
  background: linear-gradient(180deg, rgba(7, 34, 19, 0.92), rgba(10, 46, 26, 0.76));
  border-bottom: 1px solid rgba(248, 250, 247, 0.1);
}

.snan-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.snan-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: clamp(0.75rem, 1.15vw, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}

.snan-tag-noise {
  color: var(--snan-noise-ink);
}

.snan-tag-signal {
  color: var(--snan-gold);
}

.snan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.snan-dot-noise {
  background: #6E8A7A;
  box-shadow: 0 0 0 2px rgba(110, 138, 122, 0.25);
}

.snan-dot-signal {
  background: var(--snan-sage);
  box-shadow: 0 0 10px rgba(79, 184, 120, 0.85), 0 0 0 2px rgba(232, 164, 35, 0.45);
}

.snan-pause-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
}

/* Precision optical viewport */
.snan-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.snan-viewport.snan-dragging {
  cursor: grabbing;
}

.snan-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 430;
  pointer-events: none;
}

/* Sculptural 44x44px brushed-gold optical lens handle */
.snan-handle {
  position: absolute;
  top: 50%;
  left: var(--snan-pos, 56%);
  z-index: 4;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--snan-alabaster);
  background: radial-gradient(circle at 32% 28%, var(--snan-gold-hi) 0%, var(--snan-gold) 56%, var(--snan-gold-lo) 100%);
  color: var(--snan-bg);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 0 0 3px rgba(10, 46, 26, 0.72),
    0 0 24px rgba(232, 164, 35, 0.52),
    0 8px 20px rgba(3, 14, 8, 0.55);
  transition: transform 0.2s ease, box-shadow 0.22s ease, border-color 0.2s ease;
}

.snan-handle-rim {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(232, 164, 35, 0.48);
  pointer-events: none;
  transition: transform 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}

.snan-handle-icon {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.snan-handle:hover {
  transform: translate(-50%, -50%) scale(1.07);
  border-color: #FFFFFF;
  box-shadow:
    0 0 0 3px rgba(10, 46, 26, 0.8),
    0 0 32px rgba(232, 164, 35, 0.78),
    0 0 46px rgba(79, 184, 120, 0.36),
    0 10px 24px rgba(3, 14, 8, 0.65);
}

.snan-handle:hover .snan-handle-rim {
  transform: scale(1.12);
  border-color: rgba(248, 223, 156, 0.85);
}

.snan-viewport.snan-dragging .snan-handle {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.1);
  border-color: #FFFFFF;
  box-shadow:
    0 0 0 4px rgba(79, 184, 120, 0.45),
    0 0 38px rgba(232, 164, 35, 0.9),
    0 12px 28px rgba(3, 14, 8, 0.72);
}

.snan-handle:focus {
  outline: none;
}

.snan-handle:focus-visible {
  outline: 3px solid var(--snan-sage);
  outline-offset: 4px;
  box-shadow:
    0 0 0 4px var(--snan-bg),
    0 0 30px rgba(79, 184, 120, 0.7);
}

/* Bottom quick-snap vernier bar */
.snan-rail-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.6vw, 0.85rem);
  padding: 0.7rem clamp(0.75rem, 2.4vw, 1.5rem);
  background: linear-gradient(0deg, rgba(7, 34, 19, 0.94), rgba(10, 46, 26, 0.78));
  border-top: 1px solid rgba(248, 250, 247, 0.1);
}

.snan-snap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 44px;
  margin: 0;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(156, 217, 179, 0.28);
  background: rgba(15, 59, 34, 0.62);
  color: var(--snan-alabaster);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.snan-snap:hover {
  border-color: var(--snan-sage);
  background: rgba(11, 148, 68, 0.28);
  color: #FFFFFF;
}

.snan-snap:active {
  transform: scale(0.97);
}

.snan-snap[aria-pressed="true"] {
  background: var(--snan-gold);
  border-color: var(--snan-gold-hi);
  color: var(--snan-bg);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(232, 164, 35, 0.34);
}

.snan-snap[aria-pressed="true"]:hover {
  background: var(--snan-gold-hi);
  border-color: #FFFFFF;
  color: var(--snan-bg);
}

.snan-snap:focus {
  outline: none;
}

.snan-snap:focus-visible {
  outline: 3px solid var(--snan-sage);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--snan-bg);
}

/* Subtle ambient SVG CSS animations (all paused via .snam-paused and reduced-motion) */
.snan-halo-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: snan-halo-breathe 4.4s ease-in-out infinite;
}

.snan-delay-1 {
  animation-delay: -1.45s;
}

.snan-delay-2 {
  animation-delay: -2.9s;
}

.snan-reticle {
  transform-box: fill-box;
  transform-origin: center;
  animation: snan-reticle-spin 22s linear infinite;
}

.snan-prism-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: snan-reticle-spin 28s linear infinite reverse;
}

.snan-momentum-pulse {
  animation: snan-ribbon-flow 5.6s linear infinite;
}

@keyframes snan-halo-breathe {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.16);
    opacity: 1;
  }
}

@keyframes snan-reticle-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes snan-ribbon-flow {
  0% { stroke-dashoffset: 1168; }
  100% { stroke-dashoffset: 0; }
}

/* Mobile polish down to 320px — zero overflow, spacious 44px touch targets */
@media (max-width: 480px) {
  .snan-section {
    padding: 1.25rem 0.65rem;
  }
  .snan-root {
    border-radius: 14px;
  }
  .snan-rail-top {
    padding: 0.55rem 0.75rem;
  }
  .snan-top-right {
    gap: 0.5rem;
  }
  .snan-tag {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }
  .snan-rail-bottom {
    gap: 0.4rem;
    padding: 0.6rem 0.55rem;
  }
  .snan-snap {
    min-width: 72px;
    padding: 0.5rem 0.72rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    flex: 1 1 0;
    max-width: 112px;
  }
  .snan-handle {
    width: 44px;
    height: 44px;
  }
}

/* Pause contract (sna-motion.js) */
html.snam-paused .snan-root *,
html.snam-paused .snan-root *::before,
html.snam-paused .snan-root *::after {
  animation-play-state: paused !important;
}

/* Reduced motion contract (WCAG 2.3.3 — everything remains at opacity: 1) */
@media (prefers-reduced-motion: reduce) {
  .snan-root *,
  .snan-root *::before,
  .snan-root *::after {
    animation: none !important;
    transition: none !important;
  }
  .snan-halo-pulse,
  .snan-reticle,
  .snan-prism-ring,
  .snan-momentum-pulse {
    opacity: 1;
  }
}

@media (forced-colors: active) {
  .snan-root,
  .snan-snap,
  .snan-handle {
    border-color: ButtonText;
  }
  .snan-snap[aria-pressed="true"] {
    background: Highlight;
    color: HighlightText;
  }
  .snan-handle:focus-visible,
  .snan-snap:focus-visible {
    outline-color: Highlight;
  }
}
