:root {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1f2630;
  --text: #f2f4f7;
  --muted: #b5bdc9;
  --line: #303844;
  --link: #8ec5ff;
  --accent: #d5e7ff;
  --good: #a8e6b0;
  --warn: #f4d06f;
  --bad: #ff9f9f;
  --max: 920px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #17202a;
  --muted: #56616f;
  --line: #d8dde5;
  --link: #005ecb;
  --accent: #143f66;
  --good: #2d7a37;
  --warn: #7a5a00;
  --bad: #9f2d2d;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.65;
}

a { color: var(--link); text-underline-offset: .17em; }

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: .01em;
}

.theme-button,
button,
select,
input {
  font: inherit;
}

.theme-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

main { padding: 42px 0 72px; }

h1, h2, h3 {
  line-height: 1.18;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); margin: 0 0 18px; }
h2 { font-size: 1.6rem; margin-top: 2.2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; }

.intro {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 760px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 10px;
  margin: 34px 0;
}

.toolbar input,
.toolbar select,
.toolbar button {
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
}

.toolbar button {
  cursor: pointer;
  font-weight: 700;
}

.article-list {
  display: grid;
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.card h2 {
  margin: 8px 0 10px;
  font-size: 1.45rem;
}

.card h2 a {
  color: var(--text);
  text-decoration: none;
}

.card h2 a:hover { text-decoration: underline; }

.meta {
  color: var(--muted);
  font-size: .92rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .8rem;
  font-weight: 700;
}

.badge.status-confirmed { color: var(--good); }
.badge.status-developing { color: var(--warn); }
.badge.status-speculative,
.badge.status-superseded { color: var(--bad); }

.article-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.standfirst {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 800px;
}

.article-body {
  margin-top: 32px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sources ol,
.revisions ol {
  padding-left: 1.4em;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 0 44px;
  font-size: .9rem;
}

.empty {
  color: var(--muted);
  padding: 24px 0;
}

@media (max-width: 760px) {
  body { font-size: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .header-inner { min-height: 68px; }
}
