/**
 * Design Fix - schumannresonancelive.com
 * Created: 2026-06-04
 * Fixes: spectrogram marker visibility, empty bottom space
 */

/* 1. SPECTROGRAM MARKER BADGE FIX */
body.sr-site .sr-dash-pro .spectro-marker {
  left: auto !important;
  right: auto !important;
  width: auto !important;
  justify-content: flex-end;
}

body.sr-site .sr-dash-pro .spectro-marker-line {
  display: none !important;
}

body.sr-site .sr-dash-pro .spectro-marker-badge {
  margin-right: 0 !important;
  margin-left: auto !important;
  z-index: 10 !important;
  position: relative !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* 2. SPECTRO OVERLAY FIX */
body.sr-site .spectro-overlay {
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
}

/* 3. EMPTY BOTTOM SPACE FIX */
body.sr-site .sr-site main,
body.sr-site main {
  padding-bottom: 0 !important;
}

body.sr-site section:last-of-type,
body.sr-site .sr-flow-section:last-of-type {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* 4. SPECTROGRAM HUD Z-INDEX */
body.sr-site .sr-ultra-spectro-hud {
  z-index: 20 !important;
}

body.sr-site .sr-ultra-spectro-scale {
  z-index: 20 !important;
}

/* 5. PRISM SPECTROGRAM OVERFLOW */
body.sr-site .sr-prism-spectro-viewport {
  overflow: hidden !important;
}

body.sr-site .spectro-container {
  overflow: hidden !important;
}

/* ============================================================
   6. HERO LIVE CARD — compact, tighter, prettier
   Fixes: min-height too tall, excessive margins, plain status.
   ============================================================ */

/* Drop the forced 18rem min-height so the card hugs its content. */
body.sr-site .sr-hero-pro__readout {
  min-height: 0 !important;
  padding: clamp(0.9rem, 2.4vw, 1.25rem) !important;
  gap: 0.55rem !important;
  border-radius: 1.1rem !important;
}

/* Header (label + LIVE pill) — keep on one line, slight breathing room */
body.sr-site .sr-hero-pro__readout-head {
  margin-bottom: 0 !important;
}

/* Big Hz number — tighten vertical rhythm so 7.83 + Hz sit closer */
body.sr-site .sr-hero-pro__hz {
  margin: 0.05rem 0 0.15rem !important;
  gap: 0.5rem !important;
}

body.sr-site .sr-hero-pro__hz .hero-freq-value,
body.sr-site .sr-hero-pro__hz #hero-freq {
  font-size: clamp(2.8rem, 9.5vw, 4.4rem) !important;
  line-height: 0.9 !important;
}

body.sr-site .sr-hero-pro__hz .hero-freq-unit {
  font-size: clamp(0.9rem, 2.4vw, 1.15rem) !important;
  padding-bottom: 0.2rem !important;
}

/* Status pill — make it a soft chip with accent border instead of plain text */
body.sr-site .sr-hero-pro__status {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  align-self: flex-start !important;
  margin: 0.1rem 0 0 !important;
  padding: 0.28rem 0.6rem !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  color: var(--hp-muted) !important;
  background: rgba(94, 234, 212, 0.06) !important;
  border: 1px solid rgba(94, 234, 212, 0.18) !important;
  border-radius: 999px !important;
}

body.sr-site .sr-hero-pro__status strong {
  color: var(--hp-text) !important;
  font-weight: 600 !important;
  font-family: "Roboto Mono", ui-monospace, monospace !important;
  font-size: 0.78rem !important;
}

body.sr-site .sr-hero-pro__status .hero-readout-status-dot {
  width: 0.45rem !important;
  height: 0.45rem !important;
  margin-right: 0 !important;
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.8) !important;
}

/* Trace canvas — softer, closer to status */
body.sr-site .sr-hero-pro__trace {
  margin-top: 0.5rem !important;
  height: 2.6rem !important;
}

/* Harmonics grid — keep 5 columns, tighten cells, add subtle gradient bg */
body.sr-site .sr-hero-pro__harmonics {
  margin-top: 0.55rem !important;
  gap: 0.35rem !important;
}

body.sr-site .sr-hero-pro__harm {
  padding: 0.38rem 0.2rem !important;
  gap: 0.1rem !important;
  border-radius: 0.5rem !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  transition: border-color 0.2s ease, background 0.2s ease;
}

body.sr-site .sr-hero-pro__harm:hover {
  border-color: rgba(94, 234, 212, 0.35) !important;
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(94, 234, 212, 0.02)) !important;
}

body.sr-site .sr-hero-pro__harm span {
  font-size: 0.56rem !important;
}

body.sr-site .sr-hero-pro__harm strong {
  font-size: 0.78rem !important;
}

/* When the readout is in a 2-col grid with the spectrogram, make them
   share equal height (no awkward tall-but-empty card). */
body.sr-site .sr-hero-pro__stage {
  align-items: stretch !important;
}

body.sr-site .sr-hero-pro__readout,
body.sr-site .sr-hero-pro__spectro {
  height: 100% !important;
}
/* ============================================================
   7. HERO LIVE PULSE — make the value feel truly alive
   The Hz number and harmonic values should look like they are
   breathing/heartbeating in real-time, with a quick flash when
   the API value updates. We also add subtle background activity
   on the readout card so the user perceives "data is live".
   ============================================================ */

/* ── 7a. The big Hz value: glowing gold that breathes ── */
body.sr-site .sr-hero-pro__readout .sr-hero-pro__hz .hero-freq-value,
body.sr-site .sr-hero-pro__readout .sr-hero-pro__hz #hero-freq {
  color: #fde68a !important;
  text-shadow:
    0 0 14px rgba(253, 230, 138, 0.65),
    0 0 36px rgba(253, 230, 138, 0.28),
    0 0 72px rgba(34, 211, 238, 0.18);
  animation: srLiveFreqBreath 2.6s ease-in-out infinite !important;
}

body.sr-site .sr-hero-pro__readout .sr-hero-pro__hz .hero-freq-unit {
  color: rgba(253, 230, 138, 0.78) !important;
  animation: srLiveUnitBreath 2.6s ease-in-out infinite !important;
}

@keyframes srLiveFreqBreath {
  0%, 100% {
    transform: scale(1);
    text-shadow:
      0 0 14px rgba(253, 230, 138, 0.55),
      0 0 32px rgba(253, 230, 138, 0.24),
      0 0 64px rgba(34, 211, 238, 0.14);
  }
  50% {
    transform: scale(1.05);
    text-shadow:
      0 0 28px rgba(253, 230, 138, 0.95),
      0 0 64px rgba(253, 230, 138, 0.6),
      0 0 120px rgba(34, 211, 238, 0.45);
  }
}

@keyframes srLiveUnitBreath {
  0%, 100% { opacity: 0.72; }
  50%      { opacity: 1; }
}

/* ── 7b. The Hz unit: tiny vertical "tick" on each breath ── */
body.sr-site .sr-hero-pro__readout .sr-hero-pro__hz .hero-freq-unit::before {
  content: '';
  display: inline-block;
  width: 0.3rem;
  height: 0.3rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: #5eead4;
  box-shadow: 0 0 8px rgba(94, 234, 212, 0.9);
  animation: srLiveTick 1.3s ease-in-out infinite;
  vertical-align: middle;
  position: relative;
  top: -0.15rem;
}

@keyframes srLiveTick {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ── 7c. Quick "value updated" flash (JS adds .sr-live-flash briefly) ── */
body.sr-site .sr-hero-pro__readout .sr-live-num.sr-live-flash {
  animation: srLiveFlash 0.7s ease-out !important;
}

@keyframes srLiveFlash {
  0%   { color: #ffffff !important; transform: scale(1.18); filter: brightness(2.2) drop-shadow(0 0 12px rgba(253,230,138,0.9)); }
  25%  { color: #fef3c7 !important; transform: scale(1.10); filter: brightness(1.7) drop-shadow(0 0 8px rgba(253,230,138,0.7)); }
  60%  { color: #fde68a !important; transform: scale(1.02); filter: brightness(1.2); }
  100% { color: #fde68a !important; transform: scale(1);    filter: brightness(1); }
}

/* ── 7d. Status dot: stronger heartbeat (was barely visible) ── */
body.sr-site .sr-hero-pro__readout .hero-readout-status-dot {
  background: #fde047 !important;
  box-shadow:
    0 0 6px rgba(253, 224, 71, 0.95),
    0 0 16px rgba(253, 224, 71, 0.55) !important;
  animation: srLiveDotBeat 1.05s ease-in-out infinite !important;
}

@keyframes srLiveDotBeat {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 6px rgba(253, 224, 71, 0.95), 0 0 14px rgba(253, 224, 71, 0.5); }
  20%      { transform: scale(1.45); box-shadow: 0 0 8px rgba(253, 224, 71, 1), 0 0 24px rgba(253, 224, 71, 0.85); }
  40%      { transform: scale(1);    box-shadow: 0 0 6px rgba(253, 224, 71, 0.95), 0 0 14px rgba(253, 224, 71, 0.5); }
}

/* ── 7e. Status pill border breathing ── */
body.sr-site .sr-hero-pro__readout .sr-hero-pro__status {
  animation: srLiveStatusBreath 2.6s ease-in-out infinite !important;
}

@keyframes srLiveStatusBreath {
  0%, 100% { border-color: rgba(94, 234, 212, 0.18); }
  50%      { border-color: rgba(94, 234, 212, 0.42); }
}

/* ── 7f. Harmonic cells: subtle staggered pulse so they feel "in sync" ── */
body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm strong {
  animation: srLiveHarmBreath 2.6s ease-in-out infinite;
}

body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm:nth-child(1) strong { animation-delay: 0s; }
body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm:nth-child(2) strong { animation-delay: 0.12s; }
body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm:nth-child(3) strong { animation-delay: 0.24s; }
body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm:nth-child(4) strong { animation-delay: 0.36s; }
body.sr-site .sr-hero-pro__readout .sr-hero-pro__harm:nth-child(5) strong { animation-delay: 0.48s; }

@keyframes srLiveHarmBreath {
  0%, 100% { opacity: 0.78; text-shadow: none; }
  50%      { opacity: 1;    text-shadow: 0 0 8px rgba(253, 230, 138, 0.45); }
}

/* ── 7g. Background "data flow" sweep behind the readout ── */
body.sr-site .sr-hero-pro__readout {
  position: relative !important;
  overflow: hidden !important;
}

body.sr-site .sr-hero-pro__readout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 30%,
    rgba(94, 234, 212, 0.16) 50%,
    transparent 70%,
    transparent 100%
  );
  animation: srLiveSweep 4s linear infinite;
  pointer-events: none;
  z-index: 0;
}

body.sr-site .sr-hero-pro__readout > * {
  position: relative;
  z-index: 1;
}

@keyframes srLiveSweep {
  0%   { left: -50%; }
  100% { left: 110%; }
}

/* ── 7h. Readout-live (the CANLI pill) — make it pop ── */
body.sr-site .sr-hero-pro__readout .sr-hero-pro__readout-live {
  background: rgba(94, 234, 212, 0.14) !important;
  border-color: rgba(94, 234, 212, 0.5) !important;
  color: #5eead4 !important;
  animation: srLiveBadgePulse 1.6s ease-in-out infinite !important;
}

body.sr-site .sr-hero-pro__readout .sr-hero-pro__readout-live i {
  box-shadow: 0 0 10px rgba(94, 234, 212, 1) !important;
  animation: srLiveBadgeDot 1.05s ease-in-out infinite !important;
}

@keyframes srLiveBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.45); }
  50%      { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0); }
}

@keyframes srLiveBadgeDot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.6; }
}

/* ── 7i. Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  body.sr-site .sr-hero-pro__readout *,
  body.sr-site .sr-hero-pro__readout::before {
    animation: none !important;
  }
}
