:root {
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #111827;
  --ink-muted: #6b7280;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --rule: #e5e7eb;
  --body-font: 'IBM Plex Sans', system-ui, sans-serif;
  --display-font: 'IBM Plex Sans', system-ui, sans-serif;
  --mono-font: 'IBM Plex Mono', 'Courier New', monospace;
  --col: 760px;
  --shell: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--accent); }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: 24px; }

/* ── Masthead ─────────────────────────────────────────────── */

.masthead {
  background: var(--surface);
  padding: 18px 0;
  border-bottom: 3px solid var(--ink);
}
.masthead__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}
.wordmark__mark {
  width: 32px;
  height: 28px;
  background: var(--accent);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono-font);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.wordmark__name { font-weight: 600; letter-spacing: 0.01em; }

.site-nav {
  display: flex;
  gap: 28px;
  font-family: var(--mono-font);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.site-nav a { text-decoration: none; color: var(--ink-muted); }
.site-nav a:hover { color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────── */

.hero { background: var(--surface); padding: 64px 0 0; }
.hero__eyebrow {
  display: block;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero__h1 {
  font-family: var(--display-font);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  max-width: 22ch;
  margin-bottom: 18px;
}
.hero__dek {
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 58ch;
  line-height: 1.65;
}
.hero__img { margin-top: 40px; line-height: 0; }
.hero__img img { width: 100%; max-height: 480px; object-fit: cover; display: block; }

/* ── Post plate ───────────────────────────────────────────── */

.post-plate { overflow: hidden; line-height: 0; }
.post-plate img { width: 100%; height: 400px; object-fit: cover; display: block; }

/* ── Inline post ──────────────────────────────────────────── */

.post-inline { background: var(--surface); padding: 56px 0 0; }
.post-inline__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
}
.post-inline__num { color: var(--accent); font-weight: 600; }
.post-inline__title {
  font-family: var(--display-font);
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.post-inline__title a { text-decoration: none; color: var(--ink); }
.post-inline__title a:hover { color: var(--accent); }
.post-inline__dek { font-size: 1rem; color: var(--ink-muted); max-width: 64ch; margin-bottom: 32px; }
.post-inline__plate-wrap { margin-bottom: 40px; }
.post-separator { border: none; margin: 0; background: var(--canvas); height: 2px; }

/* ── Prose ────────────────────────────────────────────────── */

.prose { max-width: var(--col); }
.prose p { margin-bottom: 1.5em; }
.prose h2 {
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.5em 0 0.75em;
}
.prose h3 { font-family: var(--display-font); font-size: 1rem; font-weight: 600; margin: 2em 0 0.5em; }
.prose ul, .prose ol { margin: 0 0 1.5em 1.5em; }
.prose li { margin-bottom: 0.4em; }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--accent); }
.prose code {
  font-family: var(--mono-font);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 3px;
}
.prose pre { background: var(--ink); color: #e5e7eb; padding: 20px; border-radius: 4px; overflow-x: auto; margin-bottom: 1.5em; }
.prose pre code { background: none; padding: 0; font-size: 0.88rem; color: inherit; }
.prose strong { font-weight: 600; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: 0.92rem; }
.prose th { font-family: var(--mono-font); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 8px 12px; background: var(--surface-2); text-align: left; }
.prose td { padding: 8px 12px; background: var(--surface); }
.prose tr:nth-child(even) td { background: var(--canvas); }

/* ── Article page ─────────────────────────────────────────── */

.post-page { padding: 56px 0 80px; }
.post-page__h1 {
  font-family: var(--display-font);
  font-size: clamp(1.9rem, 3.8vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.post-page__dek { font-size: 1.05rem; color: var(--ink-muted); max-width: 60ch; margin-bottom: 40px; }
.post-page__plate { margin-bottom: 48px; }
.post-page__plate .post-plate img { height: 400px; border-radius: 4px; }

/* ── Articles index ───────────────────────────────────────── */

.page-head { background: var(--surface); padding: 60px 0 48px; }
.page-head__eyebrow {
  display: block;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.page-head__h1 { font-family: var(--display-font); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.page-head__dek { font-size: 1rem; color: var(--ink-muted); max-width: 56ch; }

.cards-grid { padding: 48px 0 80px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--surface); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; }
.card__plate .post-plate img { height: 180px; }
.card__body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.card__meta {
  display: flex;
  gap: 12px;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
}
.card__num { color: var(--accent); font-weight: 600; }
.card__title { font-family: var(--display-font); font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 10px; }
.card__title a { text-decoration: none; color: var(--ink); }
.card__title a:hover { color: var(--accent); }
.card__dek { font-size: 0.88rem; color: var(--ink-muted); line-height: 1.55; flex: 1; }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer { background: var(--ink); color: #fff; padding: 48px 0; margin-top: 80px; }
.site-footer__row { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: center; }
.site-footer__brand { font-family: var(--mono-font); font-weight: 600; font-size: 0.88rem; letter-spacing: 0.04em; color: #fff; text-decoration: none; }
.site-footer__nav { display: flex; gap: 24px; font-family: var(--mono-font); font-size: 0.88rem; }
.site-footer__nav a { color: rgba(255,255,255,0.5); text-decoration: none; }
.site-footer__nav a:hover { color: #fff; }

/* ── 404 ──────────────────────────────────────────────────── */

.not-found { padding: 120px 0; text-align: center; }
.not-found__code { font-family: var(--mono-font); font-size: 5rem; font-weight: 700; color: var(--rule); line-height: 1; margin-bottom: 16px; }
.not-found__msg { font-size: 1rem; color: var(--ink-muted); margin-bottom: 20px; }
.not-found a { color: var(--accent); text-decoration: underline; }

@media (max-width: 640px) {
  .masthead__row { flex-wrap: wrap; }
  .hero { padding: 48px 0 0; }
  .post-inline { padding: 40px 0 0; }
  .cards { grid-template-columns: 1fr; }
}
