:root {
  --bg: #0b0d14;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #eef1f8;
  --muted: #8b93a7;
  --accent: #7c5cff;
  --accent2: #29d3c2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      50% 50% at 15% 10%,
      rgba(124, 92, 255, 0.22),
      transparent 60%
    ),
    radial-gradient(
      45% 45% at 90% 20%,
      rgba(41, 211, 194, 0.16),
      transparent 60%
    ),
    radial-gradient(
      60% 60% at 50% 100%,
      rgba(124, 92, 255, 0.1),
      transparent 70%
    );
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 40px) 56px;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 0 0 rgba(41, 211, 194, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(41, 211, 194, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(41, 211, 194, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(41, 211, 194, 0);
  }
}

h1 {
  font-size: clamp(34px, 7vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  color: var(--muted);
  font-size: clamp(15px, 2.4vw, 18px);
  margin-top: 16px;
}

/* ---- Grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  backdrop-filter: blur(12px);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
  /* "backwards" fills the hidden start state only during the entrance delay.
     The resting state stays visible, so adding the .flash class (which overrides
     the animation shorthand) can no longer revert a card to opacity 0. */
  animation: rise 0.5s backwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.card.featured {
  grid-column: span 2;
  background: linear-gradient(
    135deg,
    rgba(124, 92, 255, 0.16),
    rgba(41, 211, 194, 0.08)
  );
  border-color: rgba(124, 92, 255, 0.3);
}

.card .icon {
  display: flex;
  margin-bottom: 14px;
  color: var(--accent2);
}

.card .icon svg {
  width: 24px;
  height: 24px;
}

/* Accent gradient shared by all icon strokes (matches the title highlight). */
#icon-gradient stop:first-child {
  stop-color: var(--accent);
}
#icon-gradient stop:last-child {
  stop-color: var(--accent2);
}

.card .label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card .value {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  word-break: break-word;
}

/* Gentle one-shot highlight when a card's value changes after the initial
   render. Animates only the border and a soft glow, so it works for both
   regular and featured cards without disturbing their background. */
.card.flash {
  animation: card-flash 0.6s ease;
}

@keyframes card-flash {
  0% {
    border-color: var(--accent);
    box-shadow:
      0 0 0 1px var(--accent),
      0 8px 22px rgba(124, 92, 255, 0.28);
  }
  100% {
    border-color: var(--card-border);
    box-shadow: 0 0 0 0 transparent;
  }
}

.card .hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 40px;
}

@media (max-width: 520px) {
  .card.featured {
    grid-column: span 1;
  }
  .grid {
    grid-template-columns: 1fr 1fr;
  }
  .card {
    padding: 16px;
  }
}
