/* CapitolAlpha — equity-research-note aesthetic
   Light: cool near-white paper, deep navy ink, finance-green for positive numbers, Bloomberg-blue chrome.
   Dark:  Bloomberg-terminal navy-black, with the same green/red P&L coloring. */

:root {
  --paper: #fafbfc;
  --paper-deep: #f1f5f9;
  --panel: #ffffff;
  --ink: #0c1626;
  --ink-soft: #2d3a4f;
  --rule: #dde3eb;
  --rule-strong: #cbd5e1;
  --mute: #475569;
  --pos: #15803d;
  --pos-soft: #16a34a;
  --pos-tint: rgba(21, 128, 61, 0.08);
  --neg: #b91c1c;
  --neg-soft: #dc2626;
  --neg-tint: rgba(185, 28, 28, 0.08);
  --brand: #1d4ed8;
  --brand-soft: #2563eb;
  --gold: #b45309;
  --link: var(--brand);
  --link-hover: #1e3a8a;
  --selection: rgba(29, 78, 216, 0.18);
  --inverse-bg: #0c1626;
  --inverse-paper: #e2e8f0;
  --inverse-mute: #94a3b8;
  --inverse-rule: rgba(226, 232, 240, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1019;
    --paper-deep: #131c2b;
    --panel: #131c2b;
    --ink: #e2e8f0;
    --ink-soft: #cbd5e1;
    --rule: rgba(226, 232, 240, 0.12);
    --rule-strong: rgba(226, 232, 240, 0.28);
    --mute: #94a3b8;
    --pos: #22c55e;
    --pos-soft: #4ade80;
    --pos-tint: rgba(34, 197, 94, 0.12);
    --neg: #ef4444;
    --neg-soft: #f87171;
    --neg-tint: rgba(239, 68, 68, 0.12);
    --brand: #60a5fa;
    --brand-soft: #93c5fd;
    --gold: #fbbf24;
    --link: var(--brand);
    --link-hover: #bfdbfe;
    --selection: rgba(96, 165, 250, 0.24);
    --inverse-bg: #050a13;
    --inverse-paper: #e2e8f0;
    --inverse-mute: #94a3b8;
    --inverse-rule: rgba(226, 232, 240, 0.12);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Serif', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern', 'liga';
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 32px;
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--link) 35%, transparent);
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: var(--link-hover);
}

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* ─── Brand strip + report header ───────────────────────── */

.brand-strip {
  height: 4px;
  background: linear-gradient(to right, var(--brand) 0%, var(--brand) 33%, var(--pos) 33%, var(--pos) 66%, var(--gold) 66%, var(--gold) 100%);
}

.report-header {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--rule);
}

.report-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 36px;
  flex-wrap: wrap;
  gap: 12px;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meta-sep {
  color: var(--rule-strong);
}
.report-tag {
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
  letter-spacing: 0.14em;
  font-weight: 600;
}
.report-meta em {
  text-transform: none;
  letter-spacing: 0;
  font-style: italic;
}

.title {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(48px, 8vw, 76px);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 12px;
  color: var(--ink);
}

.subtitle {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(16px, 1.9vw, 19px);
  font-style: italic;
  color: var(--mute);
  margin: 0 0 36px;
  max-width: 640px;
}

.report-spec {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin: 0 0 8px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.spec-item {
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--rule);
}
.spec-item:nth-child(3n) {
  border-right: 0;
}
.spec-item:last-child {
  border-right: 0;
}
.report-spec dt {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 4px;
}
.report-spec dd {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

@media (max-width: 880px) {
  .report-spec { grid-template-columns: repeat(3, 1fr); }
  .spec-item { padding-left: 16px; }
  .spec-item:nth-child(3n) { border-right: 0; }
  .spec-item:nth-child(3n+1) { padding-left: 0; }
}
@media (max-width: 540px) {
  .report-spec { grid-template-columns: repeat(2, 1fr); }
  .spec-item { padding-left: 16px; }
  .spec-item:nth-child(odd) { padding-left: 0; }
  .spec-item:nth-child(2n) { border-right: 0; }
  .spec-item:nth-child(3n) { border-right: 1px solid var(--rule); }
  .spec-item:nth-child(2n) { border-right: 0; }
}

/* ─── Verdict panel ─────────────────────────────────────── */

.verdict {
  padding: 56px 0 40px;
}
.verdict-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: stretch;
  padding: 36px;
  background: var(--panel);
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--pos);
  border-radius: 2px;
  position: relative;
}

.verdict-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.verdict-eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 14px;
}
.verdict-rating {
  margin: 0 0 18px;
}
.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid var(--pos);
  background: var(--pos-tint);
  color: var(--pos);
}
.rating-arrow {
  font-size: 11px;
  line-height: 1;
}

.verdict-thesis {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
}
.verdict-thesis strong {
  color: var(--pos);
  font-weight: 700;
}

.verdict-caveat {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  color: var(--mute);
  margin: 0;
  letter-spacing: 0.02em;
}
.verdict-caveat a {
  color: var(--mute);
  border-bottom-color: var(--rule-strong);
}
.verdict-caveat a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.verdict-number-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 36px;
  border-left: 1px solid var(--rule);
}

.verdict-number {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: clamp(56px, 9vw, 92px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--pos);
  margin: 0 0 16px;
  font-feature-settings: 'tnum' on, 'zero' on;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.verdict-number .delta {
  font-size: 0.42em;
  color: var(--pos);
  vertical-align: 0.3em;
  margin-right: 0.04em;
  line-height: 1;
}
.verdict-number .unit {
  font-size: 0.45em;
  color: color-mix(in srgb, var(--pos) 75%, var(--ink) 25%);
  vertical-align: 0.55em;
  margin-left: 0.04em;
}

.verdict-label {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  letter-spacing: 0.005em;
}

.verdict-stats {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--mute);
  font-feature-settings: 'tnum' on;
}
.verdict-stats .sep {
  margin: 0 10px;
  opacity: 0.5;
}

@media (max-width: 760px) {
  .verdict-panel {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 32px;
  }
  .verdict-number-block {
    padding-left: 0;
    padding-top: 24px;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
}

/* ─── Ticker tape ───────────────────────────────────────── */

.ticker {
  background: var(--ink);
  color: var(--inverse-paper);
  overflow: hidden;
  padding: 14px 0;
  margin: 8px 0 56px;
  position: relative;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.ticker::before,
.ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(to right, var(--ink), transparent); }
.ticker::after  { right: 0; background: linear-gradient(to left, var(--ink), transparent); }

.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  width: max-content;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 24px;
  border-right: 1px solid rgba(226, 232, 240, 0.14);
  color: rgba(226, 232, 240, 0.6);
}
.ticker-item.up { color: var(--pos-soft); }
.ticker-item.down { color: var(--neg-soft); }
.ticker-item .tick {
  font-size: 9px;
  opacity: 0.85;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ─── Section headings (▎ vertical-bar prefix) ──────────── */

section { margin: 0 0 56px; }

.section-h {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 24px;
  padding: 4px 0 10px 16px;
  border-bottom: 1px solid var(--rule-strong);
  border-left: 3px solid var(--brand);
  display: flex;
  align-items: center;
}

/* ─── Executive summary ─────────────────────────────────── */

.exec-summary {
  margin-top: 0;
}
.exec-summary p {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.exec-summary p strong { color: var(--ink); }
.exec-summary .byline {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--mute);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-style: normal;
}
.exec-summary .byline strong { color: var(--ink); font-weight: 600; }

/* ─── KPI strip ─────────────────────────────────────────── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--panel);
}

.kpi-item {
  padding: 24px 22px 22px;
  border-right: 1px solid var(--rule);
  position: relative;
}
.kpi-item:last-child { border-right: 0; }

.kpi-item--pos .kpi-value {
  color: var(--pos);
}
.kpi-item--pos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--pos);
}
.kpi-item--neg .kpi-value {
  color: var(--neg);
}
.kpi-item--neg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neg);
}

.kpi-value {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  font-feature-settings: 'tnum' on;
  display: flex;
  align-items: baseline;
}
.kpi-arrow {
  font-size: 18px;
  margin-right: 4px;
  color: inherit;
}
.kpi-value small {
  font-size: 0.55em;
  font-weight: 700;
  margin-left: 0.04em;
  color: color-mix(in srgb, currentColor 70%, transparent);
}

.kpi-label {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 14px 0 6px;
}

.kpi-sub {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 12px;
  font-style: italic;
  color: var(--mute);
  line-height: 1.45;
}

/* ─── Essay prose ───────────────────────────────────────── */

.essay p {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.essay p strong { color: var(--ink); }

/* ─── Exhibits ──────────────────────────────────────────── */

.fig {
  margin: 56px 0;
}

.fig-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.fig-num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--brand);
  padding: 5px 10px;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1;
}
.fig-title {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.fig figure {
  margin: 0 0 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.fig figure img {
  display: block;
  width: 100%;
  height: auto;
}

.fig-caption {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 14px;
  font-style: italic;
  line-height: 1.55;
  color: var(--mute);
  margin: 0 0 6px;
  max-width: 760px;
}

.fig-source {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--mute);
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.fig-source span {
  color: var(--ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-right: 6px;
}

/* ─── Important disclosures ─────────────────────────────── */

.disclosures {
  background: var(--inverse-bg);
  color: var(--inverse-paper);
  padding: 40px 36px 30px;
  margin: 72px 0;
  border-radius: 2px;
  border-top: 4px solid var(--neg);
  position: relative;
}
.disclosures::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--gold);
}

.section-h--inverse {
  color: var(--inverse-paper);
  border-bottom-color: var(--inverse-rule);
  border-left-color: var(--neg);
}

.footnotes {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: footnote;
}
.footnotes li {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--inverse-paper) 80%, transparent);
  margin: 0 0 16px;
  padding-left: 44px;
  position: relative;
  counter-increment: footnote;
}
.footnotes li::before {
  content: counter(footnote, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--neg-soft);
  letter-spacing: 0.06em;
  padding-right: 10px;
  border-right: 1px solid var(--inverse-rule);
  width: 32px;
  text-align: right;
  line-height: 1.7;
}
.footnotes li strong { color: var(--inverse-paper); }
.footnotes li em { color: color-mix(in srgb, var(--inverse-paper) 90%, transparent); }

.disclosures a {
  color: var(--gold);
  border-bottom-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
.disclosures a:hover {
  color: color-mix(in srgb, var(--gold) 80%, var(--inverse-paper) 20%);
}

.disclosure-foot {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: color-mix(in srgb, var(--inverse-paper) 65%, transparent);
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--inverse-rule);
}

/* ─── Further reading ───────────────────────────────────── */

.docs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs li {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-size: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.docs li:last-child { border-bottom: 0; }

.doc-tag {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--brand);
  padding: 4px 10px;
  border-radius: 2px;
  flex-shrink: 0;
  min-width: 60px;
  text-align: center;
  line-height: 1.2;
}
.doc-tag--repo {
  background: var(--gold);
  color: var(--inverse-bg);
}

.docs a {
  font-weight: 600;
}

.doc-desc {
  color: var(--mute);
  font-style: italic;
  font-size: 14px;
}

/* ─── Colophon ──────────────────────────────────────────── */

.colophon {
  padding: 36px 0 56px;
  margin-top: 72px;
  border-top: 1px solid var(--rule-strong);
}
.colophon p {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  color: var(--mute);
  line-height: 1.6;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}
.colophon-line {
  font-size: 13px !important;
  color: var(--ink) !important;
}
.colophon-line strong {
  font-weight: 600;
}
.colophon .disclaimer {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-style: italic;
  font-size: 11px;
  color: var(--mute);
  padding: 14px 16px;
  background: var(--paper-deep);
  border-left: 3px solid var(--neg);
  margin: 16px 0;
  max-width: 720px;
  line-height: 1.55;
}
.colophon .set-in {
  font-family: 'IBM Plex Serif', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  margin-top: 8px;
  color: var(--mute);
}

/* ─── Mobile tuning ─────────────────────────────────────── */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 22px; }

  .report-header { padding-top: 24px; }
  .report-meta { font-size: 10px; }

  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-item:nth-child(1),
  .kpi-item:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .kpi-item:nth-child(2) { border-right: 0; }
  .kpi-value { font-size: 26px; }

  .fig-head { gap: 12px; }
  .fig figure { padding: 12px; }

  .disclosures { padding: 28px 22px 22px; }
  .footnotes li { padding-left: 36px; font-size: 14px; }
}

@media (max-width: 420px) {
  .title { font-size: 44px; }
  .verdict-number { font-size: 56px; }
  .ticker-track { font-size: 12px; }
}

/* ─── Print ─────────────────────────────────────────────── */

@media print {
  body { background: white; color: black; font-size: 11pt; }
  .brand-strip, .ticker, .colophon { display: none; }
  a { color: black; border-bottom: 0; }
  a::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #555; }
  .verdict-panel { border-left-width: 2px; }
  .disclosures { background: #f5f5f5; color: black; }
  .disclosures .footnotes li { color: black; }
  .disclosures .footnotes li::before { color: #b91c1c; border-right-color: #ccc; }
}
