/* Mirage — analysis deep-dive (frost house UI) */
:root {
  --canvas: #000;
  --glass: rgba(18, 18, 20, 0.58);
  --line: rgba(255, 255, 255, 0.15);
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.58);
  --text-faint: rgba(255, 255, 255, 0.38);
  --accent: #f39444;
  --danger: #e85d5d;
  --rescue: #5dbf8a;
  --radius: 22px;
  --radius-sm: 14px;
  --gap: 12px;
  --pad: 18px;
  --font-ui: "Geist Variable", "Geist", system-ui, sans-serif;
  --font-num: "Doto Variable", "Doto", sans-serif;
  --font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  background: var(--canvas);
  color: var(--text);
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

.app {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  overflow-x: hidden;
}
.ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 18% 22%, rgba(243, 148, 68, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 45% at 82% 18%, rgba(90, 120, 180, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 50% at 70% 78%, rgba(243, 148, 68, 0.06), transparent 55%),
    radial-gradient(ellipse 50% 40% at 12% 85%, rgba(60, 80, 120, 0.08), transparent 50%),
    #000;
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.app > *:not(.ambient) { position: relative; z-index: 1; }

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 22px 0 20px;
}
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.mark { width: 28px; height: 16px; color: #fff; flex: none; }
.wordmark {
  font-size: 17px; font-weight: 550; letter-spacing: -0.03em; color: #fff; white-space: nowrap;
}
.subtitle {
  color: var(--text-dim); font-size: 12.5px; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav-link:hover {
  color: var(--accent);
  border-color: rgba(243, 148, 68, 0.35);
  background: rgba(243, 148, 68, 0.08);
}
.as-of {
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.toolbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 var(--pad) 12px;
}
.toolbar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: 4px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18, 18, 20, 0.45);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.chip:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.chip[aria-pressed="true"] {
  border-color: rgba(243, 148, 68, 0.55);
  background: rgba(243, 148, 68, 0.1);
  color: var(--accent);
}

.stage {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  padding: 2px var(--pad) 14px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  min-height: 0;
}
@media (min-width: 900px) {
  .stage { grid-template-columns: 1fr 1fr; }
  .wide { grid-column: 1 / -1; }
}

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 14px 16px 10px;
  min-width: 0;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.012em;
}
.card-note {
  margin: 6px 0 4px;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: -0.006em;
  line-height: 1.35;
}
.chart {
  width: 100%;
  min-height: 280px;
}
.chart.tall { min-height: 320px; }
.load-err {
  color: var(--danger);
  font-size: 13px;
  padding: 8px 0;
}

.legal {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 22px 12px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.disclaimer {
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.006em;
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}
.repo {
  color: rgba(255, 255, 255, 0.35);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}
.repo:hover { color: rgba(255, 255, 255, 0.65); }

/* Plotly modebar on dark */
.js-plotly-plot .plotly .modebar-btn path { fill: rgba(255,255,255,0.45) !important; }
.js-plotly-plot .plotly .modebar-btn:hover path { fill: var(--accent) !important; }

@media (width <= 860px) {
  .topbar { height: auto; padding: 12px 16px 8px; flex-wrap: wrap; gap: 8px; }
  .brand { flex-direction: column; align-items: flex-start; gap: 2px; }
  .subtitle { white-space: normal; }
  .toolbar { padding: 0 12px 10px; }
  .stage { padding: 4px 12px 12px; }
  .legal { flex-direction: column; align-items: flex-start; padding: 4px 16px 12px; }
  .disclaimer { white-space: normal; }
}
