:root {
  color-scheme: dark;
  --ink: #0b0d10;
  --panel: #15191f;
  --panel-raised: #1a2028;
  --line: #303844;
  --muted: #8e98a5;
  --paper: #f4f1ea;
  --orange: #f7931a;
  --teal: #2dd4a8;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }

html { background: var(--ink); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(244, 241, 234, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 241, 234, 0.025) 1px, transparent 1px),
    var(--ink);
  background-size: 44px 44px;
  color: var(--paper);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  opacity: 0.12;
}

.ambient-one { right: -180px; top: 80px; background: var(--orange); }
.ambient-two { left: -260px; top: 620px; background: var(--teal); opacity: 0.07; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 46px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-mark {
  display: block;
  width: 43px;
  height: 43px;
  flex: none;
  object-fit: contain;
}

.brand strong { display: block; font-size: 15px; letter-spacing: 0.02em; }
.brand small, .eyebrow, .metric-label, .instrument span, th, footer {
  font-family: "IBM Plex Mono", "Noto Sans Mono", monospace;
  letter-spacing: 0.13em;
}
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }

.live-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: "IBM Plex Mono", "Noto Sans Mono", monospace;
  font-size: 10px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(45, 212, 168, 0.1), 0 0 18px rgba(45, 212, 168, 0.55);
}

.hero {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  min-height: 360px;
  align-items: end;
  gap: 70px;
  padding: 76px 0 64px;
}

.eyebrow { margin: 0 0 16px; color: var(--orange); font-size: 10px; }
.hero h1 { margin: 0; font-size: clamp(52px, 7vw, 92px); line-height: 0.92; letter-spacing: -0.065em; }
.lede { max-width: 440px; margin: 28px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }

.price-block {
  position: relative;
  padding: 38px 0 6px 42px;
  border-left: 1px solid var(--line);
}

.price-block::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 40px;
  width: 3px;
  height: 72px;
  background: var(--orange);
  box-shadow: 0 0 24px rgba(247, 147, 26, 0.45);
}

.metric-label { color: var(--muted); font-size: 10px; }
.latest-price { display: block; margin: 14px 0 20px; font-size: clamp(48px, 7.2vw, 96px); line-height: 1; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.price-meta { display: flex; flex-wrap: wrap; gap: 12px 26px; color: var(--muted); font-size: 12px; }
.delta { font-weight: 600; }
.delta.positive { color: var(--teal); }
.delta.negative { color: var(--red); }
.delta.neutral { color: var(--muted); }

.instrument-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  border: 1px solid var(--line);
  background: rgba(21, 25, 31, 0.86);
}

.instrument { min-width: 0; padding: 22px; border-right: 1px solid var(--line); }
.instrument:last-child { border-right: 0; }
.instrument.accented { background: linear-gradient(135deg, rgba(247, 147, 26, 0.12), transparent); }
.instrument span { display: block; color: var(--muted); font-size: 9px; }
.instrument strong { display: block; overflow: hidden; margin-top: 13px; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.instrument small { display: block; overflow: hidden; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }

.chart-panel, .runs-panel { margin-top: 20px; border: 1px solid var(--line); background: rgba(21, 25, 31, 0.9); }
.chart-panel { padding: 28px 28px 20px; }
.runs-panel { padding: 28px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.legend span { width: 22px; height: 2px; background: var(--orange); }

.chart-wrap { position: relative; min-height: 360px; margin-top: 24px; }
#price-chart { display: block; width: 100%; height: auto; min-height: 320px; overflow: visible; }
.grid-line { stroke: rgba(142, 152, 165, 0.16); stroke-width: 1; }
.axis-label { fill: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.price-area { fill: url(#area-gradient); }
.price-line { fill: none; stroke: var(--orange); stroke-width: 3; stroke-linecap: square; stroke-linejoin: bevel; filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.2)); }
.point { fill: var(--ink); stroke: var(--orange); stroke-width: 3; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 13px; }
.chart-empty[hidden] { display: none; }

.source-link { color: var(--orange); font-family: "IBM Plex Mono", monospace; font-size: 10px; text-decoration: none; }
.source-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.table-scroll { overflow-x: auto; margin-top: 22px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 500; text-align: left; }
td { padding: 17px 14px; border-bottom: 1px solid rgba(48, 56, 68, 0.6); color: #cdd1d5; font-size: 12px; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.status-pill.failed { color: var(--red); }
.status-pill.failed::before { background: var(--red); }
.empty-cell { height: 100px; color: var(--muted); text-align: center; }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 22px 2px 0; color: var(--muted); font-size: 8px; line-height: 1.6; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 38px; padding: 58px 0 46px; }
  .price-block { padding-left: 28px; }
  .instrument-grid { grid-template-columns: repeat(2, 1fr); }
  .instrument:nth-child(2) { border-right: 0; }
  .instrument:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 28px, 1220px); padding-top: 20px; }
  .brand small { display: none; }
  .live-state { max-width: 160px; text-align: right; }
  .hero { min-height: 0; padding-top: 46px; }
  .hero h1 { font-size: 54px; }
  .lede { font-size: 13px; }
  .latest-price { font-size: 48px; }
  .instrument-grid { grid-template-columns: 1fr; }
  .instrument { border-right: 0; border-bottom: 1px solid var(--line); }
  .instrument:last-child { border-bottom: 0; }
  .chart-panel, .runs-panel { padding: 22px 16px; }
  .panel-heading { align-items: start; }
  .chart-wrap { min-height: 280px; }
  #price-chart { min-height: 260px; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero, .instrument-grid, .chart-panel, .runs-panel { animation: reveal 0.5s ease both; }
  .instrument-grid { animation-delay: 0.06s; }
  .chart-panel { animation-delay: 0.11s; }
  .runs-panel { animation-delay: 0.16s; }
  @keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
}

.brand .brand-wordmark { --wordmark-width: 116px; margin-bottom: 5px; }
