/* ==========================================================================
   AI Signal, design system
   A modern technology-publication layout. Categorical colours are the
   validated data-viz reference set: slots 1-4 pass CVD, chroma, lightness
   and normal-vision gates against both the light and dark surfaces.
   ========================================================================== */

:root {
  color-scheme: light;

  --surface-1:   #fcfcfb;   /* card surface */
  --surface-0:   #f9f9f7;   /* page plane */
  --surface-2:   #f1f1ed;   /* inset / hover wash */
  --surface-3:   #e8e8e3;   /* image placeholder ground */
  --ink-invert:  #fcfcfb;

  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;

  --grid:   #e1e0d9;
  --axis:   #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.16);
  --rule:   rgba(11, 11, 11, 0.86);

  --series-1: #2a78d6;  /* Model Releases        */
  --series-2: #eb6834;  /* Capability & Research */
  --series-3: #1baf7a;  /* Industry & Money      */
  --series-4: #eda100;  /* Policy & Adoption     */

  --accent:   #2a78d6;
  --good:     #0ca30c;
  --critical: #d03b3b;

  --shadow-sm: 0 1px 2px rgba(11,11,11,.05);
  --shadow:    0 1px 3px rgba(11,11,11,.06), 0 8px 24px rgba(11,11,11,.05);
  --shadow-lg: 0 2px 6px rgba(11,11,11,.07), 0 18px 44px rgba(11,11,11,.08);

  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1240px;
  --gutter: 26px;
  --radius: 4px;
  --radius-lg: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --surface-0: #0d0d0d;
    --surface-2: #232322;
    --surface-3: #2b2b29;
    --ink-invert: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #928f87;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255,255,255,0.11);
    --border-strong: rgba(255,255,255,0.20);
    --rule: rgba(255,255,255,0.88);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --accent: #3987e5;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 3px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --surface-0: #0d0d0d;
  --surface-2: #232322;
  --surface-3: #2b2b29;
  --ink-invert: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #928f87;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255,255,255,0.11);
  --border-strong: rgba(255,255,255,0.20);
  --rule: rgba(255,255,255,0.88);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --accent: #3987e5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.45);
}

/* Category accent, set per element via data-cat. */
[data-cat="releases"] { --cat: var(--series-1); }
[data-cat="research"] { --cat: var(--series-2); }
[data-cat="industry"] { --cat: var(--series-3); }
[data-cat="policy"]   { --cat: var(--series-4); }

/* -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--surface-0);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.021em; line-height: 1.16; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* Shared eyebrow / kicker treatment. */
.kicker {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface-0) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.masthead-inner {
  display: flex; align-items: center; gap: 26px;
  height: 62px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800; letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%; background: var(--series-1);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--series-1) 20%, transparent);
  flex: none;
}
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav a {
  padding: 7px 12px; border-radius: 6px; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text-primary); }
.nav a[aria-current="page"] { color: var(--text-primary); background: var(--surface-2); font-weight: 650; }

.theme-toggle {
  margin-left: 8px; width: 33px; height: 33px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 7px;
  background: transparent; color: var(--text-secondary); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text-primary); }
.theme-toggle svg { width: 15px; height: 15px; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon { display: none; }
  :root:not([data-theme="light"]) .icon-sun { display: block; }
}

/* ==========================================================================
   Ticker, the liveness signal directly under the masthead
   ========================================================================== */

.ticker { border-bottom: 1px solid var(--border); background: var(--surface-1); overflow: hidden; }
.ticker-inner {
  display: flex; align-items: stretch;
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding-right: 16px; margin-right: 16px;
  border-right: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-primary);
}
.ticker-label .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--critical);
  animation: blip 2.4s ease-in-out infinite;
}
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.ticker-track { overflow: hidden; flex: 1; min-width: 0; padding: 9px 0; }
.ticker-rail { display: flex; width: max-content; animation: marquee 80s linear infinite; }
.ticker:hover .ticker-rail, .ticker:focus-within .ticker-rail { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.ticker-item {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 0 20px; font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; border-right: 1px solid var(--border);
}
.ticker-item:hover { color: var(--text-primary); }
.ticker-item .tk-org { font-weight: 650; color: var(--text-primary); }
.ticker-item .tk-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--cat, var(--text-muted)); flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .ticker-rail { animation: none; }
  .ticker-track { overflow-x: auto; scrollbar-width: none; }
  .ticker-track::-webkit-scrollbar { display: none; }
  .ticker-label .live-dot { animation: none; }
}

/* ==========================================================================
   Edition bar
   ========================================================================== */

.edition {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 26px 0 18px; border-bottom: 2px solid var(--rule); margin-bottom: 26px;
}
.edition h1 { font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.04em; font-weight: 800; }
.edition .lede { margin: 10px 0 0; color: var(--text-secondary); font-size: 15.5px; max-width: 62ch; }
.edition-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.edition-meta .kicker { font-size: 11px; }

/* ==========================================================================
   Thumbnails, feed artwork with a generated fallback tile
   ========================================================================== */

.thumb {
  position: relative; display: block; overflow: hidden;
  background: var(--surface-3); border-radius: var(--radius);
  aspect-ratio: 16 / 9; container-type: inline-size;
}
.thumb img {
  /* Positioned so it paints ABOVE the fallback tile. A statically positioned
     image loses the paint order to the absolutely positioned tile beneath it,
     which hides the artwork completely. */
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}
.thumb::after {   /* hairline ring, keeps pale artwork from bleeding into the page */
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px var(--border);
  border-radius: inherit; pointer-events: none;
}
a:hover .thumb img { transform: scale(1.035); }

/* Generated tile, used when a feed ships no artwork (most lab blogs do not). */
.thumb-tile {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px 16px;
  background:
    radial-gradient(120% 100% at 88% 6%, color-mix(in srgb, var(--cat, var(--accent)) 34%, transparent) 0%, transparent 62%),
    linear-gradient(150deg, color-mix(in srgb, var(--cat, var(--accent)) 13%, var(--surface-2)) 0%, var(--surface-2) 74%);
}
.thumb-tile::before {   /* faint rule pattern so flat colour does not read as empty */
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg, transparent 0 13px, color-mix(in srgb, var(--cat, var(--accent)) 11%, transparent) 13px 14px);
  opacity: .55;
}
.thumb-tile .tile-org {
  position: relative; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text-primary); line-height: 1.08;
  font-size: clamp(13px, 9cqw, 34px);
  overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; line-clamp: 2;
}
.thumb-tile .tile-cat {
  position: relative; margin-top: 5px;
  font-family: var(--mono); font-size: clamp(8px, 2.6cqw, 10px); font-weight: 500;
  letter-spacing: .11em; text-transform: uppercase; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* In a narrow thumb there is no room for a wordmark; the pattern alone reads
   as artwork, and the org name is already in the meta line beside it. */
@container (max-width: 150px) {
  .thumb-tile { padding: 9px 10px; }
  .thumb-tile .tile-cat { display: none; }
  .thumb-tile .tile-org { font-size: 12px; -webkit-line-clamp: 2; line-clamp: 2; }
}
@container (max-width: 105px) {
  .thumb-tile .tile-org { display: none; }
}

/* ==========================================================================
   Story meta, chips and badges
   ========================================================================== */

.meta-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-muted);
}
.meta-row .sep { opacity: .5; }
.meta-row .src { color: var(--text-secondary); }

/* Category label. The dot is a secondary cue; the word carries the meaning. */
.cat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--cat, var(--text-secondary));
}
.cat-tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px;
  background: var(--cat, var(--text-muted)); flex: none;
}

.badge-new {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-invert); background: var(--critical);
  padding: 2px 6px; border-radius: 3px;
}
.badge-points {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-muted);
}

/* ==========================================================================
   Lead story + rail
   ========================================================================== */

.lead-grid {
  display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 34px; align-items: start; margin-bottom: 38px;
}
@media (max-width: 980px) { .lead-grid { grid-template-columns: 1fr; gap: 30px; } }

.lead { display: block; }
.lead .thumb { aspect-ratio: 16 / 8.4; border-radius: var(--radius-lg); }
.lead-body { padding-top: 17px; }
.lead h2 {
  font-size: clamp(27px, 3.5vw, 42px); letter-spacing: -0.038em;
  font-weight: 800; margin: 11px 0 0; text-wrap: balance;
}
.lead:hover h2 { color: var(--accent); }
.lead .dek { margin: 12px 0 0; font-size: 16.5px; line-height: 1.55; color: var(--text-secondary); max-width: 60ch; }
.lead .meta-row { margin-top: 14px; }

.rail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding-bottom: 11px; margin-bottom: 2px;
  border-bottom: 2px solid var(--rule);
}
.rail-head h3 { font-size: 14.5px; font-weight: 750; letter-spacing: -0.015em; }

.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { border-bottom: 1px solid var(--border); }
.ranked li:last-child { border-bottom: 0; }
.ranked a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 13px; padding: 14px 0; align-items: start; }
.ranked a:hover .rk-title { color: var(--accent); }
.ranked .rk-num {
  counter-increment: rank;
  font-family: var(--mono); font-size: 19px; font-weight: 700;
  color: var(--text-muted); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.ranked .rk-num::before { content: counter(rank, decimal-leading-zero); }
.ranked .rk-title { font-size: 14.5px; font-weight: 650; line-height: 1.34; letter-spacing: -0.012em; margin-bottom: 5px; }
.ranked .meta-row { font-size: 10px; }

/* ==========================================================================
   Briefing
   ========================================================================== */

.briefing {
  background: var(--surface-1); border: 1px solid var(--border);
  border-top: 3px solid var(--series-1);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 26px 30px 28px; margin-bottom: 42px;
}
.briefing .kicker { display: block; margin-bottom: 12px; }
.briefing p {
  margin: 0; font-size: 18px; line-height: 1.6; max-width: 84ch;
  letter-spacing: -0.011em; color: var(--text-primary);
}
.briefing .byline { margin-top: 15px; }

/* ==========================================================================
   Section fronts
   ========================================================================== */

.section-front { margin-bottom: 44px; }
.section-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 11px; margin-bottom: 22px;
  border-bottom: 2px solid var(--cat, var(--rule));
}
.section-bar h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.028em; display: flex; align-items: center; gap: 10px; }
.section-bar h2::before {
  content: ""; width: 10px; height: 10px; border-radius: 2px;
  background: var(--cat, var(--accent)); flex: none;
}
.section-bar .count { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.section-bar .more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.section-bar .more:hover { color: var(--accent); }

.section-body {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px; align-items: start;
}
.section-body.solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
@media (max-width: 860px) { .section-body { grid-template-columns: 1fr; gap: 24px; } }

.sec-lead .thumb { aspect-ratio: 16 / 8.6; }
.sec-lead h3 { font-size: 21px; font-weight: 750; letter-spacing: -0.026em; margin: 12px 0 0; text-wrap: balance; }
.sec-lead:hover h3 { color: var(--accent); }
.sec-lead .dek { margin: 9px 0 0; font-size: 14.5px; line-height: 1.52; color: var(--text-secondary); }
.sec-lead .meta-row { margin-top: 11px; }

.compact-list { display: flex; flex-direction: column; }
.compact {
  display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 15px;
  padding: 15px 0; border-bottom: 1px solid var(--border); align-items: start;
}
.compact:first-child { padding-top: 0; }
.compact:last-child { border-bottom: 0; }
.compact h4 { font-size: 15px; font-weight: 650; line-height: 1.36; letter-spacing: -0.015em; margin-bottom: 6px; }
.compact:hover h4 { color: var(--accent); }
.compact .thumb { aspect-ratio: 16/10; border-radius: 3px; }
.compact.no-art { grid-template-columns: minmax(0, 1fr); }
.compact .meta-row { font-size: 10px; }

/* ==========================================================================
   Card grid
   ========================================================================== */

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1040px) { .card-grid, .card-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .card-grid, .card-grid.cols-3 { grid-template-columns: 1fr; gap: 22px; } }

.card-story { display: block; }
.card-story h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.021em; margin: 11px 0 0; line-height: 1.32; text-wrap: balance; }
.card-story:hover h3 { color: var(--accent); }
.card-story .dek { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.card-story .meta-row { margin-top: 10px; }

/* ==========================================================================
   Feed page rows
   ========================================================================== */

.feed-list { display: flex; flex-direction: column; }
.feed-row {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 22px;
  padding: 22px 0; border-bottom: 1px solid var(--border); align-items: start;
}
.feed-row h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.024em; margin: 9px 0 0; line-height: 1.3; }
.feed-row:hover h3 { color: var(--accent); }
.feed-row .dek { margin: 8px 0 0; font-size: 14.5px; line-height: 1.52; color: var(--text-secondary); max-width: 82ch; }
.feed-row .also { margin-top: 9px; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 680px) { .feed-row { grid-template-columns: 1fr; gap: 13px; } }

/* ==========================================================================
   Release timeline
   ========================================================================== */

.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 2px; background: var(--grid); border-radius: 2px;
}
.release { position: relative; padding-bottom: 26px; }
.release:last-child { padding-bottom: 0; }
.release::before {
  content: ""; position: absolute; left: -27px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--series-1); box-shadow: 0 0 0 4px var(--surface-0);
}
.release h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.023em; margin: 7px 0 0; }
.release a:hover h3 { color: var(--accent); }
.release .dek { margin: 7px 0 0; font-size: 14px; color: var(--text-secondary); max-width: 76ch; }
.release .org-line { font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }

/* ==========================================================================
   Stats strip
   ========================================================================== */

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-1); overflow: hidden; box-shadow: var(--shadow-sm);
}
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat { padding: 19px 22px 21px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
@media (max-width: 760px) {
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
.stat .label { margin-bottom: 9px; }
.stat .value { font-size: 36px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.stat .value.text { font-size: 25px; }
.stat .sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; }

/* ==========================================================================
   Panels, bands, charts
   ========================================================================== */

.panel {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.panel-head { padding: 17px 21px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.panel-head h3 { font-size: 14.5px; font-weight: 700; }
.panel-head .hint { font-size: 12.5px; color: var(--text-muted); }
.panel-body { padding: 16px 21px 20px; }

.band { margin-bottom: 42px; }
.band-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 11px; margin-bottom: 22px; border-bottom: 2px solid var(--rule);
}
.band-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.028em; }
.band-head .hint { font-size: 13px; color: var(--text-muted); }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 940px) { .chart-grid { grid-template-columns: 1fr; } }

.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--sans); }
.axis-label { fill: var(--text-muted); font-size: 11px; }
.value-label { fill: var(--text-secondary); font-size: 11px; font-weight: 700; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.axis-line { stroke: var(--axis); stroke-width: 1; }

.legend { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 0 0 16px; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-secondary); }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0;
  transition: opacity .1s; transform: translate(-50%, -100%);
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 10px 13px; font-size: 12.5px; line-height: 1.5;
  max-width: 270px; white-space: nowrap;
}
.tooltip strong { display: block; margin-bottom: 5px; }
.tooltip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .row .k { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); }
.tooltip .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tooltip .v { font-variant-numeric: tabular-nums; font-weight: 700; }

.table-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.table-toggle:hover { color: var(--text-primary); }
.data-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.data-table th, .data-table td {
  text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.data-table th:first-child, .data-table td:first-child { text-align: left; font-variant-numeric: normal; }
.data-table th { color: var(--text-muted); font-weight: 650; font-size: 11.5px; }

.split-bar { display: flex; gap: 2px; margin-bottom: 15px; }
.split-bar > div { height: 10px; border-radius: 2px; }

/* ==========================================================================
   Filters
   ========================================================================== */

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.filter-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 30px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-1);
  color: var(--text-secondary); transition: all .12s;
  display: inline-flex; align-items: center; gap: 8px;
}
.filter-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.filter-btn[aria-pressed="true"] { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.filter-btn .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.filter-btn .n { font-variant-numeric: tabular-nums; opacity: .62; font-size: 12px; }
.search {
  flex: 1; min-width: 190px; max-width: 300px;
  font-family: var(--sans); font-size: 13px;
  padding: 8px 15px; border-radius: 30px;
  border: 1px solid var(--border-strong);
  background: var(--surface-1); color: var(--text-primary);
}
.search::placeholder { color: var(--text-muted); }

/* ==========================================================================
   Archive
   ========================================================================== */

.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .archive-grid { grid-template-columns: 1fr; } }
.week-card {
  padding: 20px 22px; display: block; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s;
}
.week-card:hover { border-color: var(--text-muted); transform: translateY(-2px); }
.week-card h3 { font-size: 17px; margin: 8px 0 13px; letter-spacing: -0.024em; }
.week-card .counts { display: flex; gap: 20px; font-size: 13px; color: var(--text-secondary); }
.week-card .counts b { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ==========================================================================
   States
   ========================================================================== */

.empty {
  padding: 56px 30px; text-align: center; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.empty h3 { font-size: 18px; margin-bottom: 9px; }
.empty p { margin: 0 auto; max-width: 48ch; color: var(--text-secondary); font-size: 14.5px; }
.empty code {
  font-family: var(--mono); font-size: 12.5px; background: var(--surface-2);
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* ==========================================================================
   Footer
   ========================================================================== */

.foot { border-top: 2px solid var(--rule); margin-top: 46px; padding: 28px 0 46px; }
.foot-inner {
  display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 13px;
}
.foot a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
.sources-note { max-width: 66ch; line-height: 1.6; }

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 640px) {
  :root { --gutter: 17px; }
  .masthead-inner { height: auto; flex-wrap: wrap; padding: 11px var(--gutter) 0; row-gap: 4px; }
  .brand { flex: 1 1 auto; font-size: 18px; }
  .theme-toggle { order: 2; margin-left: 0; }
  .nav {
    order: 3; flex: 1 0 100%; margin-left: 0; gap: 2px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 9px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .ticker-label { padding-right: 12px; margin-right: 12px; }
  .edition { padding: 22px 0 15px; margin-bottom: 22px; }
  .briefing { padding: 22px 20px 24px; }
  .briefing p { font-size: 16.5px; }
  .compact { grid-template-columns: minmax(0, 1fr) 76px; gap: 13px; }
}
