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

:root {
  /* Backgrounds — blue-undertone darks for depth and somber feel */
  --bg:          #0a0a0f;
  --surface:     #13131a;
  --surface-alt: #1a1a24;
  --border:      #2a2a35;

  /* Text hierarchy */
  --text:        #e8e8f0;
  --text-mid:    #a0a0b8;
  --text-dim:    #7a7a94;

  /* Red — the emotional core */
  --red:         #dc3545;
  --red-bright:  #ef4444;
  --red-dim:     #991b1b;
  --red-glow:    rgba(220, 53, 69, 0.25);
  --red-surface: rgba(220, 53, 69, 0.08);

  /* Focus */
  --focus-ring:  rgba(220, 53, 69, 0.5);

  /* Spacing — 8px grid */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-8:  48px;
  --space-10: 64px;
  --space-12: 80px;
}

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

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

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

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Tabular numbers everywhere */
.ticker, #since-open-ticker, .card-count span, .card-price {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ============================================
   Falling items
   ============================================ */
#falling-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.falling-item {
  position: absolute;
  top: -120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: rgba(19, 19, 26, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: fall cubic-bezier(0.55, 0, 1, 0.45) forwards;
  will-change: transform, opacity;
}

.falling-item img {
  width: 40px;
  height: 40px;
}

.falling-item .falling-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg) scale(0.7);
    opacity: 0;
  }
  8% {
    transform: translateY(20px) rotate(1deg) scale(1);
    opacity: 0.85;
  }
  75% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(calc(100vh + 150px)) rotate(var(--rotation, 12deg)) scale(0.85);
    opacity: 0;
  }
}

/* ============================================
   Main content
   ============================================ */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-5);
}

/* ============================================
   Header
   ============================================ */
header {
  text-align: center;
  margin-bottom: var(--space-6);
}

h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: var(--space-2);
}

.subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-dim);
  font-weight: 400;
}

/* ============================================
   Hero ticker — the focal point
   ============================================ */
.ticker-section {
  text-align: center;
  padding: var(--space-12) 0;
  margin-bottom: var(--space-6);
}

.ticker-wrapper {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.dollar-sign {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 700;
  color: var(--red);
}

.ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  color: var(--text);
  transition: color 0.1s ease-out, text-shadow 0.3s ease-out;
  letter-spacing: -0.03em;
}

.ticker.pulse {
  color: var(--red-bright);
  text-shadow: 0 0 40px var(--red-glow);
}

.rate {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--text-dim);
  line-height: 1.8;
}

.rate-highlight {
  color: var(--red);
  font-weight: 700;
}

/* ============================================
   Since you opened this page
   ============================================ */
.since-open {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.since-open h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: var(--space-3);
}

.since-open-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 0.05em;
  margin-bottom: var(--space-3);
}

.dollar-sign-small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
}

#since-open-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
}

.since-open-items {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.8;
}

.since-open-items strong {
  color: var(--text);
}

/* ============================================
   Comparisons
   ============================================ */
.comparisons {
  margin-bottom: var(--space-8);
}

.comparisons h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: var(--space-5);
  text-align: center;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.comparison-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: var(--space-5);
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto auto;
  gap: 0 var(--space-4);
  align-items: center;
  transition: border-color 0.15s ease-out, box-shadow 0.5s ease-out;
}

.comparison-card.flash {
  border-color: var(--red);
  box-shadow: 0 0 24px var(--red-glow);
}

.card-icon {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon img {
  width: 48px;
  height: 48px;
}

.card-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--red-bright);
  font-weight: 600;
}

.card-rate {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.card-progress {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--border);
  border-radius: 4px;
  margin-top: var(--space-3);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--red);
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
}

.card-count {
  grid-column: 1 / -1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: var(--space-2);
}

.card-count span {
  color: var(--text);
  font-weight: 700;
}

/* ============================================
   Footer
   ============================================ */
footer {
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: var(--space-2);
}

.disclaimer {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  main {
    padding: var(--space-5) var(--space-4);
  }

  .ticker-section {
    padding: var(--space-8) 0;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .falling-item {
    padding: var(--space-1) var(--space-2);
    backdrop-filter: none;
    background: rgba(19, 19, 26, 0.95);
    border-radius: 8px;
  }

  .falling-item img {
    width: 28px;
    height: 28px;
  }

  .falling-item .falling-label {
    font-size: 0.55rem;
  }
}

@media (max-width: 380px) {
  .ticker {
    font-size: 2rem;
    word-break: break-all;
  }
}

/* ============================================
   Reduced motion — accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .falling-item {
    animation: none;
    display: none;
  }

  .ticker {
    transition: none;
  }

  .comparison-card {
    transition: none;
  }

  .progress-bar {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}
