:root {
  color-scheme: dark;
  --bg: #000000;
  --text: #F5F5F5;
  --muted: #8A8A8A;
  --line: rgba(255, 255, 255, 0.14);
  --up: #22FF88;
  --down: #FF2D4A;
  --neon: #39FF14;
  --neon-glow: rgba(57, 255, 20, 0.55);
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
}

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

html, body {
  background: #000;
  color: var(--text);
  font-family: var(--sans);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-poster,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.hero-poster { z-index: 0; }
.hero-video { z-index: 1; }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.12) 24%, rgba(0,0,0,0.08) 52%, rgba(0,0,0,0.78) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.4) 0%, transparent 22%, transparent 78%, rgba(0,0,0,0.4) 100%);
}

body.is-static .hero-video { display: none; }

.top {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 40px 16px;
  border-bottom: 1px solid transparent;
}

.top::after {
  content: "";
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 0;
  height: 1px;
  background: rgba(255,255,255,0.16);
}

.wordmark {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.feed-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: #555;
}
.feed-status[data-state="live"] .feed-dot {
  background: var(--up);
  box-shadow: 0 0 8px rgba(46, 229, 107, 0.7);
}
.feed-status[data-state="live"] .feed-label {
  color: var(--up);
  -webkit-text-fill-color: var(--up);
}
.feed-status[data-state="delayed"] .feed-dot { background: #C8A24A; }
.feed-status[data-state="delayed"] .feed-label { color: #C8A24A; -webkit-text-fill-color: #C8A24A; }
.feed-status[data-state="offline"] .feed-dot { background: var(--down); }
.feed-status[data-state="offline"] .feed-label { color: var(--down); -webkit-text-fill-color: var(--down); }

.price-panel {
  position: absolute;
  z-index: 3;
  left: 40px;
  bottom: 80px;
  max-width: min(820px, calc(100% - 80px));
}

.pair-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--neon);
  -webkit-text-fill-color: var(--neon);
  margin-bottom: 14px;
}

.price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px 28px;
}

.price {
  font-family: var(--mono);
  font-size: clamp(2.6rem, 6.6vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--neon);
  -webkit-text-fill-color: var(--neon);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 8px var(--neon-glow),
    0 0 22px var(--neon-glow),
    0 6px 20px rgba(0, 0, 0, 0.65);
  min-height: 1em;
}

.price.is-up { animation: flashUp 0.55s ease; }
.price.is-down { animation: flashDown 0.55s ease; }

@keyframes flashUp {
  0% { color: #FFFFFF; -webkit-text-fill-color: #FFFFFF; }
  100% { color: var(--neon); -webkit-text-fill-color: var(--neon); }
}
@keyframes flashDown {
  0% { color: #FF8A9A; -webkit-text-fill-color: #FF8A9A; }
  100% { color: var(--neon); -webkit-text-fill-color: var(--neon); }
}

.price-skel {
  display: inline-block;
  width: 9.5ch;
  height: 0.8em;
  background: rgba(255,255,255,0.08);
}

.change-move {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 16px rgba(0,0,0,0.8);
}
.change-arrow { font-size: 0.8em; }
.change-move.is-up,
.change-move.is-up .change-arrow,
.change-move.is-up #change-pct {
  color: var(--up);
  -webkit-text-fill-color: var(--up);
}
.change-move.is-down,
.change-move.is-down .change-arrow,
.change-move.is-down #change-pct {
  color: var(--down);
  -webkit-text-fill-color: var(--down);
}

.scroll-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-hint::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.below {
  background: #000;
  position: relative;
  z-index: 4;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.stats-section,
.chart-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.stat {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  background: #000;
}
.stat:nth-child(4n) { border-right: 0; }
.stat-wide { grid-column: span 2; }

.stat h3 {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.stat-value {
  font-family: var(--mono);
  font-size: 1.12rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.01em;
  color: #fff;
  -webkit-text-fill-color: #fff;
  word-break: break-word;
}
.stat-value.is-up { color: var(--up); -webkit-text-fill-color: var(--up); }
.stat-value.is-down { color: var(--down); -webkit-text-fill-color: var(--down); }
.stat-value.is-empty { color: var(--muted); -webkit-text-fill-color: var(--muted); font-size: 0.95rem; }
.stat-note {
  margin-top: 8px;
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chart-section { padding-top: 36px; padding-bottom: 8px; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chart-head h2 {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.ranges {
  display: inline-flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.range-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 14px 10px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}
.range-btn.is-active {
  color: var(--neon);
  -webkit-text-fill-color: var(--neon);
  border-bottom-color: var(--neon);
}
.range-btn:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

.chart-frame {
  position: relative;
  height: 380px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #000;
}
#chart { position: absolute; inset: 0; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}
.chart-empty.is-hidden { display: none; }
#chart a, #chart a img { display: none !important; }

.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 40px 48px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.foot-disclaimer {
  color: #666;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--sans);
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .top, .stats-section, .chart-section, .foot { padding-left: 20px; padding-right: 20px; }
  .top { padding-top: 18px; padding-bottom: 14px; }
  .top::after { left: 20px; right: 20px; }
  .top-meta { gap: 14px; }
  .price-panel {
    left: 0;
    right: 0;
    bottom: 68px;
    text-align: center;
    max-width: 100%;
    padding: 0 20px;
  }
  .price-row { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; border-left: 0; border-right: 0; }
  .stat { border-right: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat-wide { grid-column: span 2; }
  .chart-frame { height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .price.is-up, .price.is-down { animation: none !important; }
}

/* Phone and tall screens: always cover, never letterbox the warp. */
.hero-poster,
.hero-video {
  object-fit: cover;
  object-position: center center;
}
