/* ============================================================
   PoliMetrics — Global Styles
   ============================================================ */

:root {
  --bg-base: #07090f;
  --bg-card: #0e1118;
  --bg-card-hover: #141720;
  --bg-section: #0a0d14;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f0f2f7;
  --text-secondary: #8892a4;
  --text-muted: #4e5a6d;
  --text-note: #5e6e85;
  --text-donation: #a78bfa;

  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-yellow: #eab308;
  --accent-green: #22c55e;
  --accent-purple: #a855f7;
  --accent-gray: #6b7280;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 12px;
  --radius-sm: 8px;

  --transition: 200ms ease;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: clip;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Header
   ============================================================ */

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   Recent Updates Strip
   ============================================================ */

.recent-section {
  min-width: 0;
  overflow: visible;
}

.recent-section.landing-page {
  overflow: hidden;
}

.recent-section:not(.landing-page) {
  width: calc(100vw - 24px);
  overflow: visible;
  margin-left: -24px;
}

.recent-section-title:not(.landing-page) {
  padding-left: 24px;
}

.recent-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1.5rem 0 0.4rem 0;
}

.recent-strip-wrap {
  display: flex;
  gap: 0.75rem;
  padding: 0 0 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100vw;
  min-width: 0;
}

/* Tracker: full-bleed strip, first card aligns with stat-section */
.recent-strip-wrap:not(.landing-page) {
  /* margin-left: calc(-50vw + 50%); */
  margin-left: 0px;
}

.recent-strip-wrap:not(.landing-page) .recent-card:first-child {
  margin-left: 24px;
}

.recent-strip-wrap.landing-page:not(.is-aligned) .recent-card:first-child {
  margin-left: 1.5rem;
}

.recent-strip-wrap:not(.is-aligned) .recent-card:last-child {
  margin-right: 1.5rem;
}


.recent-strip-wrap.landing-page {
  width: 100%;
}

.recent-section.landing-page .recent-section-title {
  padding-left: 1.5rem;
}

.recent-strip-wrap.landing-page.is-aligned {
  justify-content: center;
}

.recent-section.landing-page.is-aligned .recent-section-title {
  padding-left: 0;
}

.recent-strip-wrap::-webkit-scrollbar {
  display: none;
}

.recent-strip {
  display: contents;
}

.recent-card {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-width: 3px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
  cursor: pointer;
}

.recent-card>svg {
  margin-top: 0.5rem !important;
  margin-left: -1rem !important;
  margin-right: -1rem !important;
  margin-bottom: -0.85rem !important;
  width: calc(100% + 2rem) !important;
  height: 54px !important;
}

.recent-card.accent-red {
  border-top-color: #ef4444;
}

.recent-card.accent-orange {
  border-top-color: #f97316;
}

.recent-card.accent-yellow {
  border-top-color: #eab308;
}

.recent-card.accent-green {
  border-top-color: #22c55e;
}

.recent-card.accent-purple {
  border-top-color: #a855f7;
}

.recent-card.accent-gray {
  border-top-color: #6b7280;
}

.recent-tracker {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-right: .5rem;
}

.recent-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.recent-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: auto;
}

.recent-date {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.55;
  white-space: nowrap;
}

.recent-card:hover {
  opacity: 0.8;
}


.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  user-select: none;
}

.logo-t {
  color: var(--text-primary);
  font-size: 1.3rem;
}

.logo-s {
  color: var(--accent-orange);
  opacity: 1;
  font-size: 1rem;
  text-transform: uppercase;
}

.logo-io {
  color: var(--text-primary);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.updated-label {
  color: var(--text-muted);
}

.updated-date {
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  background: linear-gradient(180deg,
      #0d1526 0%,
      #080b14 60%,
      var(--bg-base) 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 24px 56px;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-title sup {
  font-size: 0.55em;
  vertical-align: super;
  color: var(--text-secondary);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
}

.hero-subtitle em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 0.9em;
}

.hero-counter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  transition: border-color var(--transition);
}

.hero-card:hover {
  border-color: var(--border-hover);
}

.hero-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.hero-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ============================================================
   Tracker Nav
   ============================================================ */

.tracker-nav {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tracker-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 0.25rem;
  white-space: nowrap;
}

.tracker-nav-link {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tracker-nav-link:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.tracker-nav-link.accent-orange:hover {
  color: #f97316;
  border-color: #f97316;
}

.tracker-nav-link.accent-yellow:hover {
  color: #eab308;
  border-color: #eab308;
}

.tracker-nav-link.accent-purple:hover {
  color: #a855f7;
  border-color: #a855f7;
}

.tracker-nav-link.accent-red:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* ============================================================
   Main layout
   ============================================================ */

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ============================================================
   Section headers
   ============================================================ */

.stat-section {
  /* nothing — just spacing via gap in main */
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}

.section-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

/* ============================================================
   Stat grid + cards
   ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}

.stat-card {
  scroll-margin-top: 72px;
  /* header (56px) + breathing room */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* Accent colors — top bar */
.accent-red::before {
  background: var(--accent-red);
}

.accent-orange::before {
  background: var(--accent-orange);
}

.accent-yellow::before {
  background: var(--accent-yellow);
}

.accent-green::before {
  background: var(--accent-green);
}

.accent-purple::before {
  background: var(--accent-purple);
}

.accent-gray::before {
  background: var(--accent-gray);
}

/* Accent glow on hover */
.accent-red:hover {
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15), 0 8px 32px rgba(239, 68, 68, 0.06);
}

.accent-orange:hover {
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15), 0 8px 32px rgba(249, 115, 22, 0.06);
}

.accent-yellow:hover {
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.15), 0 8px 32px rgba(234, 179, 8, 0.06);
}

.accent-green:hover {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 8px 32px rgba(34, 197, 94, 0.06);
}

.accent-purple:hover {
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15), 0 8px 32px rgba(168, 85, 247, 0.06);
}

/* Number */
.stat-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 0.6em;
  color: var(--text-secondary);
  vertical-align: baseline;
  font-weight: 500;
  margin-left: 2px;
}

/* Accent number colors */
.accent-red .stat-number {
  color: #fca5a5;
}

.accent-orange .stat-number {
  color: #fdba74;
}

.accent-yellow .stat-number {
  color: #fde047;
}

.accent-green .stat-number {
  color: #86efac;
}

.accent-purple .stat-number {
  color: #d8b4fe;
}

.accent-gray .stat-number {
  color: #d1d5db;
}

/* Label */
.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Note */
.stat-note {
  font-size: 0.72rem;
  color: var(--text-note);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

/* ============================================================
   Footer
   ============================================================ */

footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 36px 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 720px;
}

.footer-disclaimer strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.footer-links {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 50px;
}

.separator {
  color: var(--border-hover);
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card {
  animation: fadeUp 0.4s ease backwards;
}

/* Stagger via JS-added delay */

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
  .hero {
    padding: 40px 16px 40px;
  }

  .hero-counter-row {
    grid-template-columns: 1fr 1fr;
  }

  main {
    padding: 32px 16px 60px;
    gap: 40px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    padding: 0 16px;
  }
}

@media (max-width: 400px) {
  .hero-counter-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Source chips inside cards
   ============================================================ */

.card-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.sources-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 2px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.source-chip::before {
  content: '↗';
  font-size: 0.6rem;
  opacity: 0.6;
}

.source-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ============================================================
   Source modal
   ============================================================ */

/* Source modal always above detail modal */
#source-modal {
  z-index: 1100;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 150ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  animation: slideUp 200ms ease;
}

.btn-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

/* Source info card */
.source-card {
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

.source-favicon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 6px;
  object-fit: contain;
}

.source-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.source-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.source-domain {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

.source-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
  margin-bottom: 20px;
}

.source-open-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.source-open-btn svg {
  flex-shrink: 0;
}

.source-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  width: 100%;
}

/* Responsive */
@media (max-width: 540px) {
  .modal {
    padding: 12px;
  }

  .source-card {
    padding: 32px 20px 24px;
  }
}

/* ============================================================
   Detail modal (card click → rich info panel)
   ============================================================ */

.detail-modal-box {
  max-width: 560px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

/* Banner */
.detail-banner {
  position: relative;
  height: 210px;
  background: #1a1f2e;
  flex-shrink: 0;
  overflow: hidden;
}

.detail-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0;
  transition: opacity 500ms ease;
}

.detail-banner-img.is-loaded {
  opacity: 1;
}

.detail-banner-credit {
  position: absolute;
  bottom: 0.4rem;
  right: 0.5rem;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  z-index: 3;
}
.detail-banner-credit:hover {
  color: rgba(255,255,255,0.75);
}

.detail-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.3) 0%,
      rgba(17, 24, 39, 0.88) 70%,
      #111827 100%);
  z-index: 1;
}

.detail-banner-content {
  position: absolute;
  bottom: 20px;
  left: 28px;
  right: 52px;
  z-index: 2;
}

.detail-stat-number {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
}

.detail-stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* Body */
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.detail-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0;
  text-align: justify;
}

/* Facts list */
.detail-facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.detail-facts li {
  font-size: 0.81rem;
  color: var(--text-secondary);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}

.detail-facts li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  top: 1px;
}

/* Sources */
.detail-sources-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.detail-sources-heading {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Detail modal close button must sit above the banner */
.detail-modal-box .btn-close {
  z-index: 10;
}

@keyframes card-highlight {
  0% {
    box-shadow: none;
    transform: scale(1);
  }

  12% {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 0 32px rgba(255, 255, 255, 0.25);
    transform: scale(1.04);
  }

  25% {
    box-shadow: none;
    transform: scale(1);
  }

  45% {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45), 0 0 24px rgba(255, 255, 255, 0.18);
    transform: scale(1.03);
  }

  100% {
    box-shadow: none;
    transform: scale(1);
  }
}

.stat-card.is-highlighted {
  animation: card-highlight 1.2s ease-in-out;
}

.stat-card.is-dimmed {
  opacity: 0.25;
  transition: opacity 0.4s ease;
}

/* Make cards feel clickable */
.stat-card {
  cursor: pointer;
}

.stat-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 540px) {
  .detail-modal-box {
    max-height: 82vh;
    margin-top: 6vh;
    margin-bottom: 6vh;
    border-radius: 16px;
  }

  .detail-banner {
    height: 170px;
  }

  .detail-banner-content {
    left: 20px;
  }

  .detail-body {
    padding: 16px 20px 24px;
  }
}

/* ============================================================
   Share — card button + popover + detail modal row
   ============================================================ */

/* Share button on each card */
.card-share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.card-share-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Share button in detail modal banner */
.detail-share-btn {
  position: absolute;
  top: 12px;
  right: 48px;
  /* leaves room for close button */
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.detail-share-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Share popover (fixed, global) */
#share-popover {
  position: fixed;
  z-index: 5000;
  background: #151c2b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 8px 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#share-popover[hidden] {
  display: none;
}

.share-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 6px 10px;
}

.share-popover-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.share-popover-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}

.share-popover-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Individual share item (link or button) */
.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}

.share-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.share-item-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.share-x .share-item-icon {
  background: #000;
  color: #fff;
  font-family: sans-serif;
}

.share-fb .share-item-icon {
  background: #1877f2;
  color: #fff;
}

.share-wa .share-item-icon {
  background: #25d366;
  color: #fff;
}

.share-copy .share-item-icon,
.share-embed .share-item-icon {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.share-copy.copied .share-item-icon,
.share-embed.copied .share-item-icon {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.share-copy.copied span:last-child,
.share-embed.copied span:last-child {
  color: #86efac;
}

/* Share row inside detail modal */
.detail-share-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.detail-share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Share chips in detail modal (reuse .source-chip look with colors) */
.detail-share-btns a,
.detail-share-btns button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity var(--transition), transform var(--transition);
}

.detail-share-btns a {
  width: 41px;
  justify-content: center;
}

.detail-share-btns a:hover,
.detail-share-btns button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.detail-share-x {
  background: #000;
  color: #fff;
}

.detail-share-fb {
  background: #1877f2;
  color: #fff;
}

.detail-share-wa {
  background: #25d366;
  color: #fff;
}

.detail-share-copy,
.detail-share-embed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border-color: var(--border);
}

.detail-share-copy.copied {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.detail-share-embed.copied {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

/* ============================================================
   Embed preview modal
   ============================================================ */

.embed-modal-box {
  max-width: 400px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.embed-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 2rem;
}

.embed-modal-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.embed-size-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.embed-size-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.embed-size-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.embed-size-btn:not(.active):hover {
  color: var(--text-secondary);
}

.embed-preview-wrap {
  background: #0a0c12;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  transition: height 0.2s ease;
}

.embed-modal-code-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.embed-modal-code {
  flex: 1;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  white-space: nowrap;
  word-break: break-all;
  line-height: 1.5;
}

.embed-modal-copy-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 0.9rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.embed-modal-copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.embed-modal-copy-btn.copied {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.embed-modal-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   Donation section
   ============================================================ */

.donate-section {
  margin: 3rem auto 0;
  max-width: 860px;
  padding: 0 1rem 4rem;
}

.donate-inner {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(14, 17, 24, 0) 60%), var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 1rem;
  padding: 2.5rem 2.75rem;
}

.donate-text {
  flex: 1;
}

.donate-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-donation);
  margin-bottom: 0.5rem;
}

.donate-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.donate-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.donate-quip {
  font-size: 0.82rem;
  color: #6d7896;
  font-style: italic;
  margin: 0;
}

.donate-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.donate-btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 0.55rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
}

.donate-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.donate-amounts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.donate-amount-btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: rgba(124, 58, 237, 0.15);
  color: var(--text-donation);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 0.55rem;
  text-decoration: none;
  border: 1px solid rgba(124, 58, 237, 0.3);
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.donate-amount-btn:hover {
  background: rgba(124, 58, 237, 0.28);
  transform: translateY(-1px);
}

.donate-amount-featured {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.35);
}


.donate-amount-featured:hover {
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  opacity: 1;
}

.donate-note {
  font-size: 0.72rem;
  color: #6d7896;
  margin: 0;
  text-align: center;
}

@media (max-width: 600px) {
  .donate-inner {
    flex-direction: column;
    padding: 1.75rem 1.5rem;
    text-align: center;
  }

  .donate-btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   Donate type modal
   ============================================================ */

.donate-modal-box {
  max-width: 360px;
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
}

.donate-modal-amount {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.donate-modal-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.donate-modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.donate-modal-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.donate-modal-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.donate-modal-option-featured {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.4);
}

.donate-modal-option-featured:hover {
  background: rgba(124, 58, 237, 0.25);
  border-color: rgba(124, 58, 237, 0.6);
}

.donate-option-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.donate-option-icon.single-donation {
  font-size: 1rem;
  margin-top: 6px;
}

.donate-option-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.donate-option-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   Floating donation nudge
   ============================================================ */

#donate-nudge[hidden] {
  display: none;
}

#donate-nudge {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 17, 24, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 2rem;
  padding: 0.6rem 1rem 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 4000;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  animation: nudge-rise 0.4s ease;
}

#donate-nudge a {
  color: var(--text-donation);
  text-decoration: none;
  font-weight: 600;
}

#donate-nudge a:hover {
  text-decoration: underline;
}

#nudge-close {
  background: none;
  border: none;
  color: #6d7896;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
}

#nudge-close:hover {
  color: var(--text-primary);
}

@keyframes nudge-rise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================================
   Sparkline tooltip
   ============================================================ */

#spark-tip {
  position: fixed;
  z-index: 9999;
  background: rgba(10, 13, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 5px 10px 6px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

#spark-tip[hidden] {
  display: none;
}

.stt-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #f0f2f7;
  line-height: 1.1;
  white-space: nowrap;
}

.stt-date {
  font-size: 0.68rem;
  color: #4e5a6d;
  line-height: 1;
  white-space: nowrap;
}

.stt-info {
  font-size: 0.62rem;
  color: #64748b;
  line-height: 1.3;
  max-width: 200px;
  white-space: normal;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 2px;
  padding-top: 3px;
}

.draft-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.recent-card .draft-badge {
  position: static;
  margin-top: 0.2rem;
}