/* Clarity — clean editorial theme. Warm off-white paper background, serif
   display type for headlines, sans body, and a single spot of color: the
   blue-red left-right bias scale on every card. Dark mode swaps to a near-
   black paper while keeping the same blue/red bias hues (contrast-checked
   against the dark card background). */

:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --line: #e4e1d8;
  --ink: #1a1a18;
  --dim: #5b584f;
  --faint: #8a877c;
  --left: #3b6fd1;
  --right: #d1483b;
  --center: #8a877c;
  --accent: #0f6e5c;
  --accent-bg: #eaf4f1;
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14140f;
    --card: #1c1c16;
    --line: #33322a;
    --ink: #f2f1ea;
    --dim: #b3b0a3;
    --faint: #7d7a6f;
    --left: #6d97e6;
    --right: #e6786d;
    --center: #8a877c;
    --accent: #3fcf9c;
    --accent-bg: #1c2b26;
  }
}
:root[data-theme="dark"] {
  --bg: #14140f;
  --card: #1c1c16;
  --line: #33322a;
  --ink: #f2f1ea;
  --dim: #b3b0a3;
  --faint: #7d7a6f;
  --left: #6d97e6;
  --right: #e6786d;
  --center: #8a877c;
  --accent: #3fcf9c;
  --accent-bg: #1c2b26;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= TOP NAV ================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--left), var(--right));
}
.topnav { display: flex; gap: 2px; flex-wrap: wrap; }
.topnav a {
  font: 600 13px/1 var(--body);
  color: var(--dim);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { color: var(--ink); background: var(--card); }

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 600 11px/1 var(--body);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ================= HERO ================= */

.hero { padding: 40px 0 24px; border-bottom: 1px solid var(--line); }
.hero-kicker {
  margin: 0 0 8px;
  font: 700 12px/1 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 18ch;
}
.hero-sub { margin: 0 0 22px; max-width: 68ch; color: var(--dim); font-size: 15px; }

.legend { max-width: 420px; }
.legend-row { display: flex; align-items: center; gap: 10px; }
.legend-label { font: 700 12px/1 var(--body); text-transform: uppercase; letter-spacing: 0.05em; }
.legend-label.left { color: var(--left); }
.legend-label.right { color: var(--right); }
.legend-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--left), var(--center), var(--right));
}
.legend-caption { margin: 10px 0 0; font-size: 12px; color: var(--faint); max-width: 48ch; }

/* ================= SECTION HEAD ================= */

.section-head { padding: 32px 0 16px; }
.section-head h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
}
.section-sub { margin: 0; color: var(--dim); font-size: 13px; }
.section-sub:empty { display: none; }

/* ================= THE BRIEF ================= */

.briefsec { border-bottom: 1px solid var(--line); }
.brief-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 32px;
}
.brief-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.count-pill {
  font: 700 11px/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 6px 10px;
  border-radius: 999px;
}
.brief-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; }
.brief-body p:last-child { margin-bottom: 0; }
.brief-loading { color: var(--faint); }

.brief-jumps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.bj-label { font: 700 11px/1 var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.bj-btn {
  font: 600 12px/1 var(--body);
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 7px 12px;
  border-radius: 999px;
  transition: opacity 0.15s;
}
.bj-btn:hover { opacity: 0.75; }

/* ================= TABS + PANELS ================= */

.tabbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  font: 600 13px/1 var(--body);
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }

.panel { padding-bottom: 56px; }

.status {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--dim);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 18px 20px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-category {
  font: 700 11px/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.card-time { font-size: 12px; color: var(--faint); }
.card-title { margin: 0 0 6px; font-family: var(--display); font-size: 18px; line-height: 1.3; font-weight: 700; }
.card-link { text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-summary { margin: 0 0 14px; color: var(--dim); font-size: 13px; line-height: 1.55; }
.card-summary:empty { display: none; }

.card-bottom { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-source { font: 600 13px/1 var(--body); flex: 0 0 auto; min-width: 0; }

.bias-meter {
  position: relative;
  flex: 1 1 100px;
  min-width: 70px;
  max-width: 160px;
  height: 6px;
}
.bias-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--left), var(--center), var(--right));
}
.bias-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  transform: translate(-50%, -50%);
}
.bias-marker.unrated { display: none; }
.bias-label { font-size: 12px; color: var(--faint); white-space: nowrap; }

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--faint);
}

.show-more {
  display: block;
  margin: 24px auto 0;
  font: 600 13px/1 var(--body);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.show-more:hover { border-color: var(--faint); }

/* ================= MARKET CHARTS ================= */

.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.chart-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px 16px;
}
.chart-title {
  margin: 0 0 10px;
  font: 700 12px/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
}
.chart-embed { height: 180px; }
.chart-fine { margin: 10px 0 28px; font-size: 11px; color: var(--faint); }

/* ================= FOOTER ================= */

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; }
.footer-inner p { margin: 0; font-size: 12px; color: var(--faint); }
.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar-inner { height: auto; padding: 12px 0; }
  .card-bottom { align-items: flex-start; }
  .bias-meter { max-width: none; }
  .brief-card { padding: 18px; }
}
