/* Hero live stats dashboard — animated meters from site-data.json */

/* Download universe frame */
.hero-universe {
  position: relative;
  width: 100%;
  border-radius: calc(var(--radius-lg) + 8px);
  border: 1px solid rgba(124, 92, 255, 0.22);
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(77, 159, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(124, 92, 255, 0.1), transparent 50%),
    linear-gradient(165deg, rgba(12, 16, 26, 0.96), rgba(8, 10, 18, 0.92));
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.38),
    0 0 80px rgba(124, 92, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  isolation: isolate;
}

.hero-universe-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 78% 22%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 44% 8%, rgba(124, 92, 255, 0.5), transparent),
    radial-gradient(1px 1px at 88% 62%, rgba(77, 159, 255, 0.45), transparent),
    radial-gradient(1px 1px at 24% 72%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 62% 88%, rgba(255, 255, 255, 0.3), transparent);
  animation: hero-universe-twinkle 8s ease-in-out infinite alternate;
}

.hero-universe-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 0;
  position: relative;
  z-index: 2;
}

.hero-universe-head-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-universe-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c4d4f0;
}

.hero-universe-sub {
  font-size: 0.72rem;
  color: var(--muted, #9aa3b2);
}

.hero-visual-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 14px 16px;
}

@media (min-width: 900px) {
  .hero-visual-stage {
    padding: 0 18px 18px;
  }
}

/* Orbit zone — separate from stats card (no overlap) */
.hero-orbit-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(168px, 22vw, 200px);
  margin: 0 auto;
  flex-shrink: 0;
  overflow: visible;
}

.hero-orbit-track {
  position: absolute;
  inset: 0;
  animation: hero-orbit-spin 56s linear infinite;
}

.hero-star {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  transform: rotate(var(--planet-angle, 0deg)) translateX(118px) rotate(calc(-1 * var(--planet-angle, 0deg)));
  box-shadow: 0 0 12px 2px currentColor;
  opacity: 0.92;
}

.hero-star::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, currentColor 0%, transparent 70%);
  opacity: 0.35;
  animation: hero-star-pulse 3.5s ease-in-out infinite;
}

.hero-star--ovsx { color: #a78bfa; animation-delay: 0s; }
.hero-star--vscode { color: #5eb8ff; }
.hero-star--github { color: #34d399; }
.hero-star--canonical { color: #9ec5ff; }
.hero-star--visits { color: #67e8f9; }

.hero-star--ovsx::after { animation-delay: 0s; }
.hero-star--vscode::after { animation-delay: 0.7s; }
.hero-star--github::after { animation-delay: 1.4s; }
.hero-star--canonical::after { animation-delay: 2.1s; }
.hero-star--visits::after { animation-delay: 2.8s; }

@keyframes hero-star-pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.35); }
}

.hero-orbit-zone .hero-orbit {
  position: relative;
  width: min(100%, 280px);
  height: min(100%, 280px);
  aspect-ratio: 1;
  margin: 0;
  flex-shrink: 0;
}

.hero-orbit-zone .hero-orbit-mascot {
  width: clamp(64px, 12vw, 80px);
  height: clamp(64px, 12vw, 80px);
}

.hero-stats-dashboard {
  margin-top: 4px;
  flex: 1;
}

@keyframes hero-universe-twinkle {
  0% { opacity: 0.35; }
  100% { opacity: 0.55; }
}

.hero-universe.is-live .hero-orbit-glow {
  animation: hero-orbit-pulse 4s ease-in-out infinite;
}

.hero-stats-dashboard {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: calc(var(--radius-lg) + 2px);
  padding: 14px 16px 16px;
  background: linear-gradient(165deg, rgba(14, 18, 28, 0.94), rgba(10, 14, 22, 0.9));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.hero-stats-dashboard.is-loaded {
  opacity: 1;
}

.hero-stats-dashboard .panel-head {
  margin-bottom: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.hero-total-block {
  text-align: center;
  padding: 14px 14px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(124, 92, 255, 0.38);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.16), rgba(77, 159, 255, 0.1));
  box-shadow:
    0 0 32px rgba(124, 92, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero-total-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a5b4c8;
  margin-bottom: 8px;
  font-weight: 700;
}

.hero-total-value {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1.55rem, 3.2vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-total-value.is-counting {
  opacity: 0.85;
  transform: scale(0.98);
}

.stat-count.is-counting {
  opacity: 0.7;
}

.stat-count {
  font-variant-numeric: tabular-nums;
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.stat-count--total {
  color: #eef2ff;
  text-shadow: 0 0 28px rgba(124, 92, 255, 0.35);
}

.stat-count--ovsx {
  color: #a78bfa;
}

.stat-count--vscode {
  color: #5eb8ff;
}

.stat-count--github {
  color: #34d399;
}

.stat-count--canonical {
  color: #9ec5ff;
}

.stat-count--duplicate {
  color: #fbbf24;
}

.stat-count--visits {
  color: #67e8f9;
}

.stat-count--engagement {
  color: #f472b6;
}

.install-card .stat-count {
  font-family: var(--mono);
  font-weight: 600;
}

.hero-total-meter {
  height: 8px;
  margin: 0 auto;
  max-width: 280px;
}

.hero-channel-breakdown {
  padding: 8px 0 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 10px;
}

.hero-breakdown-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.hero-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.hero-stats-dashboard .hero-channel-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 10px;
}

.hero-stats-dashboard .hero-channel-item:last-child {
  grid-column: auto;
}

.hero-stats-dashboard .hero-channel-item strong {
  font-size: 1rem;
}

.hero-stats-dashboard .hero-channel-item {
  font-size: 0.74rem;
}

.hero-channel-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.hero-channel-item strong {
  font-family: var(--mono);
  font-size: 0.95rem;
}

.stats-grid-secondary {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-tile {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.stat-tile-label {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8fa0ba;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-tile-value {
  display: block;
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.stat-tile .meter {
  height: 6px;
  margin: 0;
}

.stat-tile .meter-fill.stat-meter {
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-total-meter .meter-fill,
.stat-tile .meter-fill.stat-meter {
  border-radius: 999px;
}

.stat-meter--total {
  background: linear-gradient(90deg, #7c5cff, #4d9fff);
}

.stat-meter--ovsx,
.stat-meter--canonical,
.hero-ovsx-split-bar .meter-fill.canonical {
  background: linear-gradient(90deg, #4d9fff, #7c5cff);
}

.stat-meter--duplicate,
.hero-ovsx-split-bar .meter-fill.legacy,
.hero-ovsx-split-bar .meter-fill.duplicate {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-meter--vscode {
  background: linear-gradient(90deg, #007acc, #5eb8ff);
}

.stat-meter--github {
  background: linear-gradient(90deg, #059669, #34d399);
}

.stat-meter--visits {
  background: linear-gradient(90deg, #0891b2, #67e8f9);
}

.stat-meter--engagement {
  background: linear-gradient(90deg, #db2777, #f472b6);
}

.hero-total-meter .meter-fill {
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-ovsx-block {
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-ovsx-block h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.hero-ovsx-combined {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.hero-ovsx-combined strong {
  font-family: var(--mono);
  font-size: 1.15rem;
}

.hero-ovsx-split-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
  margin-bottom: 10px;
}

.hero-ovsx-split-bar .meter-fill {
  height: 100%;
  border-radius: 0;
  transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-ovsx-split-bar .meter-fill.canonical {
  background: linear-gradient(90deg, #4d9fff, #7c5cff);
}

.hero-ovsx-split-bar .meter-fill.legacy,
.hero-ovsx-split-bar .meter-fill.duplicate {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.hero-ovsx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.78rem;
  color: var(--muted);
}

.hero-ovsx-legend strong {
  font-family: var(--mono);
}

.feature-svg-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 24px;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.9), rgba(12, 16, 24, 0.85));
  border-bottom: 1px solid var(--border);
}

.feature-svg-visual img {
  width: min(72%, 140px);
  height: auto;
  opacity: 0.92;
  filter: drop-shadow(0 12px 28px rgba(77, 159, 255, 0.25));
  animation: feature-svg-float 4s ease-in-out infinite;
}

@keyframes feature-svg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-stats-dashboard .stats-grid-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.hero-stats-dashboard .stats-grid-secondary .stat-tile {
  padding: 10px 10px;
}

.hero-stats-dashboard .stats-grid-secondary .stat-tile-label {
  font-size: 0.66rem;
}

.hero-stats-dashboard .stats-grid-secondary .stat-tile-value {
  font-size: 1.1rem;
  margin-bottom: 0;
}

.hero-stats-dashboard .stats-grid-secondary .meter {
  display: none;
}

.hero-stats-dashboard .hero-channel-breakdown {
  padding: 10px 0 12px;
  margin-bottom: 10px;
}

.hero-stats-dashboard .hero-ovsx-legend {
  font-size: 0.74rem;
  gap: 10px 16px;
}

.hero-stats-dashboard .hero-total-block {
  padding: 14px 14px 16px;
  margin-bottom: 10px;
}

.hero-stats-dashboard .hero-total-label {
  margin-bottom: 8px;
  font-size: 0.72rem;
}

.hero-stats-dashboard .hero-ovsx-split-bar {
  height: 7px;
  margin-bottom: 8px;
}

.hero-stats-dashboard .hero-breakdown-title {
  margin-bottom: 10px;
  font-size: 0.72rem;
}

@media (min-width: 900px) {
  .hero-visual-stage .hero-stats-dashboard {
    flex: 1;
    padding: 16px 18px 18px;
  }

  .hero-visual-stage .hero-stats-dashboard .stats-grid-secondary {
    margin-top: auto;
    padding-top: 4px;
  }
}

@media (max-width: 899px) {
  .hero-visual-stage .hero-stats-dashboard {
    margin-top: 8px;
    padding-top: 0;
  }

  .hero-orbit-zone {
    height: 160px;
  }

  .hero-star {
    transform: rotate(var(--planet-angle, 0deg)) translateX(96px) rotate(calc(-1 * var(--planet-angle, 0deg)));
  }
}

.hero-visual-stage .hero-stats-dashboard {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

@media (prefers-reduced-motion: reduce) {
  .feature-svg-visual img { animation: none; }
  .hero-stats-dashboard { transition: none; }
  .stat-count { transition: none; }
  .stat-tile .meter-fill.stat-meter,
  .hero-ovsx-split-bar .meter-fill,
  .hero-total-meter .meter-fill { transition: none; }
  .hero-universe-stars,
  .hero-orbit-track,
  .hero-orbit-ring,
  .hero-star::after { animation: none !important; }
}

@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-channel-grid,
  .hero-stats-dashboard .hero-channel-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
