:root {
  --bg: #101012;
  --surface: #16161a;
  --ink: #ececea;
  --muted: #a4a5a7;
  --line: rgba(236, 236, 234, 0.14);
  --accent: #ef5348;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, monospace;
  --pad: 48px;
  --measure: 720px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

img { display: block; max-width: 100%; height: auto; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  text-decoration: none;
}

.wordmark .accent { color: var(--accent); }

.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
}

.site-header nav a {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding: 12px 14px;
}

main {
  max-width: calc(var(--measure) + 2 * var(--pad));
  margin: 0 auto;
  padding: 0 var(--pad) 96px var(--pad);
}

/* ---------- index ---------- */

.blog-hero {
  padding: 72px 0 40px 0;
}

.blog-hero .eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 18px 0;
}

.blog-hero h1 {
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 18px 0;
  text-wrap: pretty;
}

.blog-hero p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
  margin: 0;
}

.post-list { margin-top: 24px; }

.post-list a.row {
  display: flex;
  align-items: baseline;
  gap: 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.post-list a.row:last-child { border-bottom: 1px solid var(--line); }

.post-list time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  flex: 0 0 130px;
}

.post-list .post-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.post-list a.row:hover .post-title { color: var(--accent); }

/* ---------- post ---------- */

.post-header { padding: 72px 0 12px 0; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.post-meta .tag { color: var(--accent); }

.post-header h1 {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.12;
  margin: 16px 0 0 0;
  text-wrap: pretty;
}

.post-hero {
  margin: 48px 0 0 0;
}

.post-hero img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.post-hero + .post-header { padding-top: 44px; }

.post-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: var(--muted);
  max-width: var(--measure);
  margin: 16px 0 0 0;
}

.post-body {
  font-size: 17px;
  line-height: 1.75;
  max-width: var(--measure);
}

.post-body h2, .post-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.25;
  margin: 44px 0 12px 0;
}

.post-body h2 { font-size: 32px; }
.post-body h3 { font-size: 24px; }

.post-body p { margin: 0 0 20px 0; }

.post-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 19px;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
}

.post-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px;
  overflow-x: auto;
  margin: 28px 0;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.post-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 28px 0;
  font-size: 15px;
}

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

.post-body th { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }

.post-body hr { border: none; border-top: 1px solid var(--line); margin: 44px 0; }

.post-body figure { margin: 32px 0; }
.post-body figcaption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.post-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
}

.post-footer a { text-decoration: none; padding: 12px 0; display: inline-block; }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px var(--pad) 36px var(--pad);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  :root { --pad: 20px; }
  .blog-hero h1 { font-size: 38px; }
  .post-header h1 { font-size: 34px; }
  .post-list a.row { flex-direction: column; gap: 6px; }
  .post-list time { flex: none; }
}
