/* ATS-1 Dashboard — editorial brief
   Light: warm cream / deep ink. Dark: charcoal / parchment.
   One accent (graphite blue). Green/red reserved for P&L only. */

:root {
  color-scheme: light dark;
  --bg: #f6f1e7;
  --paper: #fbf7ee;
  --ink: #1c1c1c;
  --ink-soft: #3a3a3a;
  --muted: #6b6357;
  --rule: #d6cdb9;
  --rule-soft: #e6dfcd;
  --accent: #3a4a6b;
  --gain: #2e6b3f;
  --loss: #a23b3b;
  --panic: #6b2630;
  --euphoria: #8a4a1a;
  --squeeze: #574083;
  --trend: #2a4a78;
  --range: #4a4a3a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161413;
    --paper: #1d1a18;
    --ink: #f0ead8;
    --ink-soft: #c8c0ad;
    --muted: #948a78;
    --rule: #2e2a26;
    --rule-soft: #25221f;
    --accent: #7fa1d6;
    --gain: #6fbf85;
    --loss: #e07a7a;
    --panic: #c25862;
    --euphoria: #d39458;
    --squeeze: #9c87d4;
    --trend: #6a90c8;
    --range: #b5b39a;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 48px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
}

section { width: 100%; }

/* Hero row: Performance on the left, Equity on the right, side by side on wide screens. */
.hero-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: start;
}

.serif {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-feature-settings: "tnum" 1, "cv11" 1;
  font-weight: 400;
}

.muted { color: var(--muted); }
.gain  { color: var(--gain); }
.loss  { color: var(--loss); }
.neutral { color: var(--ink-soft); }

/* ── Masthead ───────────────────────────────────────────────────── */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.masthead .brand {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.masthead .meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.masthead .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted); margin-right: 6px; vertical-align: 1px;
}
.masthead .dot.live {
  background: var(--gain);
  box-shadow: 0 0 0 0 currentColor;
  animation: heartbeat 2s ease-out infinite;
  color: var(--gain);
}
@keyframes heartbeat {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gain) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--gain) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gain) 0%, transparent); }
}

.cadence {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  white-space: nowrap;
  margin-left: 8px;
}
.section-head .right { display: inline-flex; align-items: baseline; gap: 8px; }

/* ── Regime pill ────────────────────────────────────────────────── */
.regime {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.regime::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
}
.regime-panic::before    { background: var(--panic); }
.regime-euphoria::before { background: var(--euphoria); }
.regime-squeeze::before  { background: var(--squeeze); }
.regime-trend::before    { background: var(--trend); }
.regime-range::before    { background: var(--range); }

/* ── Section headers ────────────────────────────────────────────── */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.section-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  margin: 0;
  letter-spacing: 0.005em;
}
.section-head .caption {
  font-size: 13px;
  color: var(--muted);
}

/* ── Performance brief ──────────────────────────────────────────── */
.brief-prose {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 22px 0;
  max-width: 65ch;
}
.brief-prose strong { font-weight: 500; color: var(--ink); }

.compare {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 6px;
  column-gap: 28px;
  padding: 4px 0 10px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 14px;
}
.compare .label { color: var(--muted); font-size: 14px; padding-top: 8px; }
.compare .value {
  text-align: right;
  font-size: 22px;
  padding-top: 6px;
}
.compare .delta { padding-top: 6px; }
.compare .divider {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--rule-soft);
  margin: 2px 0;
}

.substats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.substats > div {
  padding: 12px 18px 12px 0;
  border-right: 1px solid var(--rule-soft);
}
.substats > div:last-child { border-right: 0; padding-right: 0; }
.substats .k { font-size: 12px; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.03em; }
.substats .v { font-size: 18px; }
.substats .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Equity curve ───────────────────────────────────────────────── */
.chart-wrap { width: 100%; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.equity-line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.baseline-line { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; opacity: 0.7; }
.axis-line { stroke: var(--rule); stroke-width: 1; }
.axis-tick { fill: var(--muted); font-size: 10px; font-family: "JetBrains Mono", monospace; }
.chart-caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  max-width: 65ch;
}
.legend {
  display: flex; gap: 18px; margin-top: 8px;
  font-size: 12px; color: var(--muted);
}
.legend .swatch {
  display: inline-block; width: 18px; height: 2px; vertical-align: 3px; margin-right: 6px;
  background: var(--accent);
}
.legend .swatch.dashed {
  background: transparent;
  border-top: 1px dashed var(--muted);
  height: 0;
}

/* ── Strategy cards ─────────────────────────────────────────────── */
.strat-list { display: flex; flex-direction: column; gap: 0; }
.strat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.strat:last-child { border-bottom: 0; }
.strat .name {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  margin-bottom: 4px;
}
.strat .stats { font-size: 13px; color: var(--ink-soft); }
.strat .stats .sep { color: var(--muted); margin: 0 6px; }
.strat .alloc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.strat .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: var(--muted);
  border: 1px solid var(--rule);
}
.pill.active { color: var(--gain); border-color: var(--gain); }
.pill.blocked-by-regime { color: var(--loss); border-color: var(--loss); opacity: 0.85; }

.probing { color: var(--muted); font-style: italic; font-family: "Fraunces", Georgia, serif; }

/* ── Bottom row ─────────────────────────────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
}

.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
}
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.feed .body { color: var(--ink-soft); }
.feed .signal_dropped .body {
  border-left: 2px solid var(--loss);
  padding-left: 10px;
  margin-left: -12px;
}
.feed .trade_exit .body {
  border-left: 2px solid var(--gain);
  padding-left: 10px;
  margin-left: -12px;
}

.muta { margin: 0 0 18px 0; }
.muta:last-child { margin-bottom: 0; }
.muta h3 {
  font-family: "Inter Tight", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px 0;
}
.muta ul { list-style: none; padding: 0; margin: 0; }
.muta li { padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--rule-soft); }
.muta li:last-child { border-bottom: 0; }

.empty { color: var(--muted); font-style: italic; font-family: "Fraunces", Georgia, serif; margin: 0; font-size: 14px; }

/* ── Glossary ───────────────────────────────────────────────────── */
.glossary {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  font-size: 13px;
  color: var(--ink-soft);
}
.glossary > summary {
  cursor: pointer;
  list-style: none;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 10px;
}
.glossary > summary::-webkit-details-marker { display: none; }
.glossary > summary::before {
  content: "+ ";
  color: var(--muted);
  margin-right: 4px;
}
.glossary[open] > summary::before { content: "− "; }
.glossary dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 18px; margin: 0; }
.glossary dt {
  font-family: "Inter Tight", sans-serif;
  font-weight: 500;
  color: var(--ink);
}
.glossary dd { margin: 0; color: var(--muted); }

abbr[title] {
  text-decoration: underline dotted var(--rule);
  text-underline-offset: 3px;
  cursor: help;
  border: 0;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  main { padding: 48px 32px 72px; gap: 40px; }
  .hero-row { grid-template-columns: 1fr; gap: 40px; }
  .bottom-row { gap: 40px; }
}
@media (max-width: 760px) {
  main { padding: 36px 20px 60px; gap: 32px; }
  .substats { grid-template-columns: 1fr 1fr; }
  .substats > div { border-right: 0; border-bottom: 1px solid var(--rule-soft); padding-bottom: 10px; margin-bottom: 6px; }
  .hero-row, .bottom-row { grid-template-columns: 1fr; gap: 28px; }
  .glossary dl { grid-template-columns: 1fr; gap: 2px 0; }
  .glossary dt { margin-top: 8px; }
}
