/* Palette and type follow Basis Point Weekly: newsprint grey with brass, Red Hat Display and Text, flat tinted blocks. */
:root {
  --bg: #e8e8e3; --surface: #dcdcd6; --surface-2: #d2d2cb; --ink: #181715; --muted: #5c5b56; --hair: #c9c9c2;
  --accent: #bfb21a; --accent-ink: #181715;
  --inv-bg: #181715; --inv-ink: #e8e8e3; --inv-muted: #a3a29e;
  --up: #2c6e44; --down: #a8352b;
  --font-display: "Red Hat Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --area: .28;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141412; --surface: #1f1e1c; --surface-2: #292826; --ink: #e8e8e3; --muted: #9d9c97; --hair: #33322f;
  --accent: #cfc23a; --inv-bg: #e8e8e3; --inv-ink: #181715; --inv-muted: #5c5b56;
  --up: #6fc790; --down: #f08a7e; --area: .14; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141412; --surface: #1f1e1c; --surface-2: #292826; --ink: #e8e8e3; --muted: #9d9c97; --hair: #33322f;
  --accent: #cfc23a; --inv-bg: #e8e8e3; --inv-ink: #181715; --inv-muted: #5c5b56;
  --up: #6fc790; --down: #f08a7e; --area: .14; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--font-text); }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.08; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.025em; }
h3 { font-size: 1.15rem; letter-spacing: -.01em; font-weight: 500; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.meta { font-size: .88rem; color: var(--muted); }
.link { color: inherit; text-decoration: none; background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 1px no-repeat, linear-gradient(var(--hair), var(--hair)) 0 100% / 100% 1px no-repeat; transition: background-size 150ms var(--ease); padding-bottom: 1px; }
.link:hover { background-size: 100% 1px, 100% 1px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* Header */
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 20px; }
header.site { position: sticky; top: 0; z-index: 9; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--hair); }
.bar { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo .mark { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font: 600 .7rem var(--font-text); color: var(--accent-ink); }
.logo b { font: 500 1.1rem var(--font-display); letter-spacing: -.02em; }
nav.main { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; align-self: stretch; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { position: relative; display: flex; align-items: center; white-space: nowrap; text-decoration: none; color: var(--muted); font-size: .95rem; transition: color 150ms var(--ease); }
nav.main a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 150ms var(--ease); }
nav.main a:hover { color: var(--ink); }
nav.main a:hover::after { transform: scaleX(1); }
nav.main a[aria-current="page"] { color: var(--ink); }
nav.main a[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.updated { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.theme-btn { flex: none; border: 0; background: var(--surface); color: var(--ink); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: background 150ms var(--ease); }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn svg { width: 18px; height: 18px; }

.banner { background: color-mix(in srgb, var(--accent) 30%, var(--bg)); color: var(--ink); font-size: .92rem; padding: 9px 0; }

main { padding-block: 44px 88px; }

/* Global strip */
.global { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 44px; }
.gcard { background: var(--surface); border-radius: var(--r); padding: 18px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; }
.gcard small { display: block; font-size: .85rem; color: var(--muted); }
.gcard .g-label { font: 500 1.05rem var(--font-display); }
.gcard .g-value { font: 400 1.6rem/1.1 var(--font-display); text-align: right; letter-spacing: -.02em; }
.gcard .g-chg { text-align: right; font-size: .9rem; }
.gcard .g-spark { grid-column: 1 / -1; height: 34px; margin-top: 8px; }

/* Region head and sub-tabs */
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; padding-bottom: 32px; border-bottom: 1px solid var(--hair); }
.page-head .lede { font-size: 1.1rem; color: var(--muted); margin-top: 14px; max-width: 54ch; }
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; transition: background 150ms var(--ease); white-space: nowrap; }
.pill:hover { background: var(--surface-2); }
.pill[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* Desk: featured chart + instrument list */
.desk { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; margin-top: 32px; }
.panel { background: var(--surface); border-radius: var(--r); padding: 24px 26px; min-width: 0; }
.feature-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.feature-label { font: 400 1.55rem/1.1 var(--font-display); letter-spacing: -.02em; }
.feature-meta { font-size: .86rem; color: var(--muted); margin-top: 6px; }
.feature-value { font: 400 2.2rem/1 var(--font-display); letter-spacing: -.03em; text-align: right; }
.feature-change { font-size: .9rem; text-align: right; margin-top: 6px; color: var(--muted); }
.ranges { display: flex; gap: 6px; margin: 18px 0 6px; }
.range { appearance: none; font: 500 .82rem var(--font-text); color: var(--ink); background: var(--bg); border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: background 150ms var(--ease); }
.range:hover { background: var(--surface-2); }
.range[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chart { position: relative; height: 260px; margin-top: 6px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis { font: 11px var(--font-text); fill: var(--muted); }
.chart .grid { stroke: var(--hair); stroke-width: 1; }
.tooltip { position: absolute; pointer-events: none; background: var(--inv-bg); color: var(--inv-ink); font-size: .8rem; padding: 5px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -125%); display: none; }

.list { padding: 8px 0; }
.list h3 { padding: 14px 24px 10px; font-size: .85rem; font-weight: 500; color: var(--muted); font-family: var(--font-text); letter-spacing: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--hair); cursor: pointer; transition: background 150ms var(--ease); }
.row:hover { background: var(--surface-2); }
.row[aria-selected="true"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.row-label { font-weight: 500; line-height: 1.3; }
.row-sub { font-size: .82rem; color: var(--muted); }
.row-right { text-align: right; line-height: 1.3; }
.row-value { font-weight: 500; }
.row-chg { font-size: .85rem; }
.spark { width: 72px; height: 26px; display: block; }

.tag { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--hair); border-radius: 999px; padding: 0 7px; margin-left: 8px; vertical-align: 2px; }
.tag.stale { color: var(--down); border-color: currentColor; }
.empty { color: var(--muted); padding: 24px 0; }

.note-strip { margin-top: 14px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.note-strip p { color: var(--muted); font-size: .92rem; max-width: 70ch; }
.go { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .95rem; color: var(--ink); text-decoration: none; }
.go svg { width: 16px; height: 16px; transition: transform 150ms var(--ease); }
.go:hover svg { transform: translateX(3px); }

/* Weekly summary page */
.issue-line { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: .95rem; }
.issue-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lead-view { background: var(--inv-bg); color: var(--inv-ink); border-radius: var(--r); padding: 38px 42px; margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 44px; }
.lead-view .who { display: flex; align-items: center; gap: 12px; color: var(--inv-muted); font-size: .92rem; margin-bottom: 16px; }
.lead-view .who i { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 .78rem var(--font-text); font-style: normal; }
.lead-view h2 { color: var(--inv-ink); }
.lead-view p { font-size: 1.05rem; line-height: 1.65; }
.sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.sum-card { background: var(--surface); border-radius: var(--r); padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; }
.sum-card .card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-card h3 { font: 400 1.45rem var(--font-display); letter-spacing: -.02em; }
.sum-card h4 { margin: 0 0 4px; font: 500 .8rem var(--font-text); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sum-card .part + .part { padding-top: 14px; border-top: 1px solid var(--hair); }
.placeholder { color: var(--muted); font-style: italic; }
.archive { margin-top: 64px; }
.archive h2 { margin-bottom: 18px; }
.archive details { border-top: 1px solid var(--hair); padding: 16px 0; }
.archive details:last-child { border-bottom: 1px solid var(--hair); }
.archive summary { cursor: pointer; font: 500 1.05rem var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.archive summary::-webkit-details-marker { display: none; }
.archive summary::after { content: "+"; color: var(--muted); }
.archive details[open] summary::after { content: "−"; }

/* Footer */
footer { border-top: 1px solid var(--hair); }
footer .wrap { padding-block: 40px; display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 40px; font-size: .92rem; color: var(--muted); }
footer h4 { font: 500 1rem var(--font-display); color: var(--ink); margin: 0 0 8px; }

@media (max-width: 900px) {
  .desk, .page-head, .lead-view { grid-template-columns: 1fr; }
  .lead-view { gap: 18px; padding: 30px 26px; }
  .updated { display: none; }
  footer .wrap { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 620px) {
  main { padding-block: 32px 64px; }
  .sum-grid { grid-template-columns: 1fr; }
  .panel, .sum-card { padding: 20px; }
  .row { padding: 12px 20px; grid-template-columns: minmax(0, 1fr) auto; }
  .row .spark-cell { display: none; }
  .list h3 { padding-left: 20px; }
  .logo b { display: none; }
  .bar { gap: 16px; }
  .feature-value, .feature-change { text-align: left; }
  .chart { height: 220px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
