/* 01-home-constellation.css
   SNA Today — Edge-to-Edge Dark Emerald Glass Sculptural Signal Constellation
   All selectors, tokens, and keyframes scoped strictly under the snhm prefix. */

.snhm-root {
  --snhm-bg: #0A2E1A;
  --snhm-forest: #0F3B22;
  --snhm-emerald: #0B9444;
  --snhm-deep: #066632;
  --snhm-sage: #4FB878;
  --snhm-mint: #9CD9B3;
  --snhm-gold: #E8A423;
  --snhm-alabaster: #F8FAF7;
  --snhm-white: #FFFFFF;
  --snhm-font-display: 'Lexend', system-ui, -apple-system, sans-serif;
  --snhm-font-label: 'DM Sans', system-ui, -apple-system, sans-serif;

  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 11;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--snhm-bg);
  border: 1px solid rgba(232, 164, 35, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(232, 164, 35, 0.14),
    0 24px 56px -24px rgba(5, 24, 13, 0.72),
    0 8px 20px -10px rgba(10, 46, 26, 0.55);
  color: var(--snhm-alabaster);
  font-family: var(--snhm-font-label);
  isolation: isolate;
}

.snhm-root *,
.snhm-root *::before,
.snhm-root *::after {
  box-sizing: border-box;
}

.snhm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Edge-to-edge interactive constellation stage */
.snhm-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.snhm-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Depth orbital planes */
.snhm-plane {
  will-change: transform;
  transition: opacity 0.35s ease;
}

.snhm-orbit-num {
  font-family: var(--snhm-font-display);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  fill: rgba(232, 164, 35, 0.62);
  pointer-events: none;
  user-select: none;
}

/* Signal filaments & living audience nodes */
.snhm-filament {
  opacity: 0.52;
  transition: opacity 0.28s ease, stroke-width 0.28s ease;
}

.snhm-filament.snhm-lit {
  opacity: 0.96;
  stroke-width: 2.1;
}

.snhm-node {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.25s ease;
}

.snhm-node-halo {
  opacity: 0.58;
  transition: opacity 0.25s ease;
}

.snhm-node.snhm-lit .snhm-node-halo {
  opacity: 1;
}

.snhm-plane.snhm-plane-active .snhm-filament {
  opacity: 0.94;
}

.snhm-plane.snhm-plane-active .snhm-node-halo {
  opacity: 1;
}

/* Subtle ambient CSS choreography (all paused cleanly under snam-paused & reduced motion) */
.snhm-beacon-aura {
  transform-box: fill-box;
  transform-origin: center;
  animation: snhm-breathe 5.8s ease-in-out infinite;
}

.snhm-beacon-filigree {
  transform-box: fill-box;
  transform-origin: center;
  animation: snhm-orbit-spin 42s linear infinite;
}

.snhm-beacon-star {
  transform-box: fill-box;
  transform-origin: center;
  animation: snhm-star-pulse 4.6s ease-in-out infinite;
}

.snhm-echo-a {
  transform-box: fill-box;
  transform-origin: center;
  animation: snhm-echo-breathe 6.2s ease-in-out infinite;
}

.snhm-echo-b {
  transform-box: fill-box;
  transform-origin: center;
  animation: snhm-echo-breathe 7.4s ease-in-out infinite 1.4s;
}

.snhm-stars circle:nth-child(odd) {
  animation: snhm-twinkle 5.4s ease-in-out infinite alternate;
}

.snhm-stars circle:nth-child(even) {
  animation: snhm-twinkle 6.8s ease-in-out infinite alternate 1.8s;
}

@keyframes snhm-breathe {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.78;
  }
  50% {
    transform: scale(1.09);
    opacity: 1;
  }
}

@keyframes snhm-orbit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes snhm-star-pulse {
  0%, 100% {
    transform: scale(0.96);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes snhm-echo-breathe {
  0%, 100% {
    transform: scale(0.98);
    opacity: 0.24;
  }
  50% {
    transform: scale(1.045);
    opacity: 0.44;
  }
}

@keyframes snhm-twinkle {
  0% {
    opacity: 0.28;
  }
  100% {
    opacity: 0.72;
  }
}

/* Ultra-minimal floating dark glass bottom bar */
.snhm-bar {
  position: absolute;
  z-index: 4;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(10, 46, 26, 0.82);
  border: 1px solid rgba(232, 164, 35, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 28px -12px rgba(4, 18, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.snhm-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--snhm-alabaster);
  font-family: var(--snhm-font-label);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  white-space: nowrap;
}

.snhm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--snhm-gold);
  box-shadow: 0 0 10px rgba(232, 164, 35, 0.85);
}

.snhm-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
}

.snhm-orbit-group {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* Floating minimal orbital pulse triggers (>=44x44px WCAG 2.5.8 target) */
.snhm-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(79, 184, 120, 0.48);
  background: rgba(15, 59, 34, 0.86);
  color: var(--snhm-alabaster);
  cursor: pointer;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.snhm-chip:hover {
  background: rgba(6, 102, 50, 0.94);
  border-color: var(--snhm-gold);
  color: var(--snhm-white);
  box-shadow: 0 0 14px rgba(232, 164, 35, 0.28);
}

.snhm-chip:active {
  transform: scale(0.95);
}

.snhm-chip[aria-pressed="true"],
.snhm-chip.snhm-chip-active {
  background: rgba(6, 102, 50, 0.96);
  border-color: var(--snhm-gold);
  color: var(--snhm-gold);
  box-shadow: 0 0 16px rgba(232, 164, 35, 0.36);
}

.snhm-chip:focus {
  outline: none;
}

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

.snhm-chip-icon {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Inline slot for sna-motion.js 44x44px dark pause button */
.snhm-pause-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
}

/* Responsive mobile layout down to 320px with zero horizontal overflow */
@media (max-width: 639px) {
  .snhm-root {
    aspect-ratio: 4 / 3;
    min-height: 295px;
  }

  .snhm-bar {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    border-radius: 1.125rem;
    padding: 0.4rem 0.5rem 0.4rem 0.7rem;
    gap: 0.35rem 0.5rem;
  }

  .snhm-caption {
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }
}

@media (max-width: 420px) {
  .snhm-bar {
    justify-content: center;
    padding: 0.4rem 0.45rem;
  }

  .snhm-caption {
    width: 100%;
    justify-content: center;
  }

  .snhm-controls {
    margin-left: 0;
    justify-content: center;
    gap: 0.3rem;
  }

  .snhm-orbit-group {
    gap: 0.3rem;
  }
}

/* Pause & Reduced Motion WCAG 2.2 AA Contract */
html.snam-paused .snhm-root *,
html.snam-paused .snhm-root *::before,
html.snam-paused .snhm-root *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .snhm-root *,
  .snhm-root *::before,
  .snhm-root *::after {
    animation: none !important;
    transition: none !important;
  }

  .snhm-beacon-aura,
  .snhm-beacon-star,
  .snhm-echo-rest,
  .snhm-stars circle,
  .snhm-node,
  .snhm-packet {
    opacity: 1;
  }

  .snhm-echo-a {
    opacity: 0.34;
  }

  .snhm-echo-b {
    opacity: 0.22;
  }

  .snhm-echo-c {
    opacity: 0.18;
  }
}

@media (forced-colors: active) {
  .snhm-root,
  .snhm-bar,
  .snhm-chip {
    border-color: ButtonText;
  }

  .snhm-chip:focus-visible {
    outline-color: Highlight;
  }
}
