:root {
  --bg-primary: #06060c;

  --text-primary: #e8e8ec;
  --text-secondary: #6b6b7b;
  --text-muted: #3a3a4a;
  --text-readable: #9a9aad;

  --accent-red: #e02020;
  --accent-red-glow: rgba(224, 32, 32, 0.35);
  --accent-red-dim: #8b1a1a;

  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-body: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Warning bar (top edge) --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red-glow), 0 0 40px rgba(224, 32, 32, 0.1);
  z-index: 1001;
}

/* --- Vignette overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.5) 100%);
}

/* --- Grain overlay --- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Scanlines --- */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
}

/* --- Main layout --- */
#app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top bar --- */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--text-muted);
  opacity: 0;
  animation: fadeSlideUp 0.6s var(--ease-out-expo) 0.1s forwards;
}

.top-bar__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
}

.top-bar__status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--accent-red-glow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.status-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-red);
  text-transform: uppercase;
}

/* ========================================
   MAP UNDERLAY
   ======================================== */
.map-underlay {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 85vw;
  max-width: 1080px;
  pointer-events: none;
  z-index: -1;
}

.map-underlay object {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.15;
}

@media (max-width: 480px) {
  .map-underlay {
    width: 120vw;
    top: 40px;
  }
}

/* ========================================
   HERO
   ======================================== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0 0;
  text-align: center;
}

@media (min-width: 768px) {
  .hero {
    padding: 64px 0 0;
  }
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 0;
  opacity: 0;
  animation: fadeSlideUp 1s var(--ease-out-expo) 0.2s forwards;
}

.hero__headline em {
  font-style: normal;
  color: var(--accent-red);
  text-shadow: 0 0 30px var(--accent-red-glow);
  animation: headlineGlow 6s ease-in-out infinite;
}

@keyframes headlineGlow {
  0%, 100% { text-shadow: 0 0 30px var(--accent-red-glow); }
  50% { text-shadow: 0 0 50px var(--accent-red-glow), 0 0 80px rgba(224, 32, 32, 0.2); }
}

/* --- Body text (below clock) --- */
.hero-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 24px;
}

.hero-body mark {
  color: var(--text-readable);
  padding: 2px 6px 4px;
  border-radius: 2px;
  font-style: normal;
  background-color: transparent;
  background-image: linear-gradient(rgba(202, 168, 0, 0.25), rgba(202, 168, 0, 0.25));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-position: left;
  animation: highlightSweep 0.8s var(--ease-out-expo) 2.4s forwards;
}

.hero__body--strong mark {
  animation-delay: 2.8s;
}

@keyframes highlightSweep {
  to { background-size: 100% 100%; color: #f0d830; }
}

.hero__body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.7;
  color: var(--text-readable);
  letter-spacing: 0.015em;
  margin-bottom: 12px;
  max-width: 640px;
  opacity: 0;
  animation: fadeSlideUp 0.9s var(--ease-out-expo) 1.2s forwards;
}

.hero__body--strong {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.35rem;
  animation-delay: 1.6s;
  border-left: 2px solid var(--accent-red-dim);
  padding-left: 16px;
  margin-top: 16px;
}

/* ========================================
   CLOCK — RESTORED LARGE SIZE
   ======================================== */
.clock-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0 40px;
  text-align: center;
  position: relative;
}

.clock-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 140%;
  background: radial-gradient(ellipse, rgba(224, 32, 32, 0.04) 0%, transparent 65%);
  pointer-events: none;
}

/* Shared label style for section eyebrows */
.stat-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--text-primary);
}

.clock-prefix {
  letter-spacing: 0.35em;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out-expo) 0.4s forwards;
}

.clock-container {
  display: flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
  opacity: 0;
  animation: fadeSlideUp 1s var(--ease-out-expo) 0.6s forwards;
}

.clock-dollar {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--accent-red-dim);
  margin-right: 4px;
  position: relative;
  top: -0.02em;
}

.clock-value {
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 14vw, 10rem);
  font-weight: 700;
  color: var(--accent-red);
  text-shadow:
    0 0 40px var(--accent-red-glow),
    0 0 80px rgba(224, 32, 32, 0.15);
  letter-spacing: -0.02em;
  min-width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.clock-unit {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 3rem);
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  min-width: 7ch;
  margin-left: 12px;
  position: relative;
  top: -0.1em;
}

/* ========================================
   INTEREST TICKER CARDS
   ======================================== */
.interest-section {
  padding: 0 0 40px;
  opacity: 0;
  animation: fadeSlideUp 0.9s var(--ease-out-expo) 2s forwards;
}

.interest-statement {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  color: var(--text-readable);
  text-align: center;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.interest-statement em {
  font-style: normal;
  color: var(--accent-red);
  text-shadow: 0 0 20px var(--accent-red-glow);
}

.interest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .interest-grid { grid-template-columns: 1fr; }
}

.interest-card {
  background: rgba(224, 32, 32, 0.03);
  border: 1px solid rgba(224, 32, 32, 0.2);
  border-radius: 3px;
  padding: 2rem 2rem 1.75rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.interest-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.interest-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(224, 32, 32, 0.06), transparent 60%);
  pointer-events: none;
}

.interest-card__label {
  letter-spacing: 0.2em;
  margin-bottom: 0.9rem;
}

.interest-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(224, 32, 32, 0.08);
  border: 1px solid rgba(224, 32, 32, 0.15);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: 0.05em;
}

.interest-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-red-glow);
}

.interest-card__amount {
  display: flex;
  align-items: baseline;
  margin-bottom: 1rem;
}

.interest-card__dollar {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.6rem);
  color: var(--accent-red-dim);
  margin-right: 3px;
  line-height: 1;
}

.interest-card__value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--accent-red);
  text-shadow: 0 0 30px var(--accent-red-glow);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.interest-card__note {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  line-height: 1.5;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}

/* ========================================
   FOOTER / SOURCE BAR
   ======================================== */
.source-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--text-muted);
  margin-top: auto;
  opacity: 0;
  animation: fadeSlideUp 0.8s var(--ease-out-expo) 2.6s forwards;
}

@media (min-width: 768px) {
  .source-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.source-bar__left,
.source-bar__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-label,
.updated-label {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
}

.source-sep {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.source-link {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--text-primary);
  border-bottom-color: var(--text-secondary);
}

.source-link:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 2px;
}

.updated-value {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* --- Authorisation line --- */
.authorised {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.1em;
  padding: 12px 0 20px;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
  .top-bar__label {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
  }

  .hero {
    padding: 40px 0 12px;
  }

  .hero__body--strong {
    padding-left: 12px;
  }

  .clock-section {
    padding: 32px 0 24px;
  }

  .clock-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .clock-unit {
    margin-left: 8px;
  }

}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .top-bar,
  .hero__headline,
  .hero__body,
  .clock-prefix,
  .clock-container,
  .source-bar,
  .map-underlay object,
  .interest-section {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-body mark {
    background-size: 100% 100% !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #bbbbbb;
    --text-muted: #888888;
    --text-readable: #cccccc;
    --accent-red: #ff3333;
  }
}
