@font-face {
  font-family: 'IBM Plex Sans';
  src: url('/assets/fonts/IBMPlexSans-var.woff2') format('woff2-variations'),
       url('/assets/fonts/IBMPlexSans-var.woff2') format('woff2');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #141414;
  --paper: #ffffff;
  --surface: #f5f5f3;
  --rule: #e3e3e3;
  --rule-strong: #c9c9c9;
  --muted: #6b6b6b;
  --accent: #e0421c;
  --accent-text: #c7361a;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1060px;
  --read: 660px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ===== header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
}
.site-header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo .monogram {
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  font-size: 13px;
  font-weight: 500;
  color: #cfcfcf;
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.info-strip {
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.info-strip-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px 28px;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.info-strip-inner::-webkit-scrollbar { display: none; }
.info-strip h1 { all: unset; white-space: nowrap; }

/* ===== shared bits ===== */
.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-text);
}
.meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--ink);
  margin: 0 0 6px;
}
.thumb {
  width: 34px;
  height: 34px;
  font-family: var(--mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.figs { display: flex; flex-wrap: wrap; gap: 22px; }
.fig-value { font-family: var(--mono); font-size: 19px; font-weight: 500; line-height: 1.2; }
.fig-label { font-size: 11.5px; line-height: 1.35; color: var(--muted); max-width: 190px; }
.fig-source { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--rule-strong); }
.fig-source a { color: inherit; }

/* ===== homepage ===== */
.front { display: grid; grid-template-columns: 1.55fr 1fr; gap: 0; padding: 26px 0 22px; }
.front-lead { padding-right: 30px; border-right: 1px solid var(--rule); }
.front-lead a { text-decoration: none; }
.front-lead h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.7px;
  margin: 9px 0 10px;
}
.front-lead .dek { font-size: 16px; line-height: 1.55; color: #3b3b3b; margin: 0; }
.front-lead .figs { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.front-latest { padding-left: 26px; }
.front-list a, .cat-list a, .related-list a { text-decoration: none; color: inherit; display: block; }
.front-list .row { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.front-list .row:last-child { border-bottom: 0; }
.front-list .row h3 { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0 0 3px; }
.sections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; padding: 6px 0 40px; border-top: 1px solid var(--rule); }
.sections .more { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--accent-text); text-decoration: none; }

/* ===== category pages ===== */
.cat-header { padding: 30px 0 22px; border-bottom: 1px solid var(--rule); }
.cat-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.7px; line-height: 1.1; margin: 8px 0 12px; }
.cat-header p { max-width: var(--read); margin: 0; color: #3b3b3b; }
.cat-start { background: var(--surface); padding: 20px 24px; margin: 24px 0 8px; }
.cat-start h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 8px 0 8px; }
.cat-start a { text-decoration: none; }
.cat-list { padding: 8px 0 44px; }
.cat-list .row { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.cat-list .row h2 { font-size: 18px; font-weight: 600; line-height: 1.28; margin: 0 0 4px; }
.cat-list .row p { margin: 0 0 5px; font-size: 14.5px; color: #4a4a4a; }

/* ===== article ===== */
.article-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 38px;
  padding: 26px 0 48px;
  align-items: start;
}
.breadcrumb { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); }
.breadcrumb a { color: var(--accent-text); text-decoration: none; }
.article-head h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.12;
  margin: 10px 0 12px;
}
.article-dek { font-size: 17.5px; line-height: 1.55; color: #3b3b3b; margin: 0 0 16px; max-width: var(--read); }
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.byline a { color: var(--accent-text); text-decoration: none; }
.figbox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 22px 0 26px; }
.figbox > div { background: var(--paper); padding: 12px 14px; }
.toc { position: sticky; top: 72px; }
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list a {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
  color: #555;
  text-decoration: none;
  padding: 5px 0;
  border-left: 0;
}
.toc-list a:hover { color: var(--ink); }
.toc-list a.is-current { color: var(--ink); font-weight: 600; }
.toc-mobile { display: none; margin: 18px 0 4px; border: 1px solid var(--rule); }
.toc-mobile summary { cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.toc-mobile .toc-list { padding: 0 14px 10px; }

.article-body { font-size: 17px; line-height: 1.68; max-width: var(--read); }
.article-body h2 { font-size: 23px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; margin: 38px 0 10px; scroll-margin-top: 72px; }
.article-body h3 { font-size: 17.5px; font-weight: 600; margin: 26px 0 6px; }
.article-body p { margin: 14px 0; }
.article-body ul, .article-body ol { margin: 14px 0; padding-left: 22px; }
.article-body li { margin: 7px 0; }
.article-body dl { margin: 20px 0; }
.article-body dt { font-weight: 700; margin-top: 16px; }
.article-body dd { margin: 4px 0 0; }
.article-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.table-scroll { overflow-x: auto; margin: 24px 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th { text-align: left; font-weight: 600; padding: 9px 14px 9px 0; border-bottom: 2px solid var(--ink); }
.data-table td { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { color: var(--muted); }
.data-table .num { font-family: var(--mono); white-space: nowrap; }
.callout { background: var(--surface); padding: 18px 22px; margin: 24px 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.related { border-top: 2px solid var(--ink); margin-top: 44px; padding-top: 6px; max-width: var(--read); }
.related-list .row { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.related-list .row h3 { font-size: 16px; font-weight: 600; line-height: 1.3; margin: 0 0 3px; }

/* ===== footer ===== */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.site-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 24px 28px 40px; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.site-footer a { color: var(--muted); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ===== cookie banner ===== */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--ink);
  color: #f3f3f1;
  box-shadow: 0 -6px 24px rgba(20, 20, 20, 0.2);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 40px;
}
.cookie-banner-text { flex: 1 1 420px; max-width: 680px; font-size: 14.5px; line-height: 1.5; }
.cookie-banner-title { margin: 0 0 5px; font-size: 15px; font-weight: 700; }
.cookie-banner-text p { margin: 0; }
.cookie-banner a { color: inherit; }
.cookie-banner-actions { display: flex; gap: 12px; flex: 0 0 auto; }
.cookie-banner button {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: #f3f3f1;
  color: var(--ink);
  border: 1px solid #f3f3f1;
  padding: 11px 24px;
  cursor: pointer;
}
.cookie-banner button:hover { background: transparent; color: #f3f3f1; }
.cookie-banner button:focus-visible { outline: 2px solid #f3f3f1; outline-offset: 3px; }

/* ===== responsive ===== */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .front { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .front-lead { padding-right: 0; border-right: 0; padding-bottom: 22px; border-bottom: 1px solid var(--rule); }
  .front-latest { padding-left: 0; }
  .sections { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .wrap, .site-header-inner, .info-strip-inner, .site-footer-inner, .cookie-banner-inner { padding-left: 18px; padding-right: 18px; }
  .front-lead h2 { font-size: 26px; }
  .article-head h1 { font-size: 27px; }
  .cat-header h1 { font-size: 27px; }
  .figbox { grid-template-columns: minmax(0, 1fr); }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner button { flex: 1; }
}

/* ===== article cover ===== */
.article-cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 22px 0 26px;
  background: var(--ink);
}
@media (max-width: 620px) {
  .article-cover { margin: 16px 0 20px; }
}
