:root {
  color-scheme: light dark;
  --paper: #f8f7f4;
  --ink: #1f211e;
  --muted: #62655e;
  --line: #e2e1db;
  --code: #efeee9;
  --accent: #66694a;
  --accent-soft: color-mix(in srgb, var(--accent) 35%, transparent);
  --mark-accent: #adb08a;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --measure: 41rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181a18;
    --ink: #e9e8e2;
    --muted: #9da199;
    --line: #2e312d;
    --code: #222522;
    --accent: #adb08a;
    --mark-accent: #66694a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.5rem 0.8rem;
  transform: translateY(-200%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.skip-link:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell {
  width: min(var(--measure), 100% - 2rem);
  margin-inline: auto;
}

/* Header and footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem 0 3.5rem;
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-title:hover {
  color: var(--ink);
}

.site-title span::after {
  content: ".";
  color: var(--accent);
}

.site-mark {
  flex: none;
  shape-rendering: crispEdges;
}

.site-mark-tile {
  fill: var(--ink);
  shape-rendering: geometricPrecision;
}

.site-mark-chevron {
  fill: var(--paper);
}

.site-mark-cursor {
  fill: var(--mark-accent);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.site-nav a:hover,
.site-nav a[aria-current],
.site-footer a:hover {
  color: var(--ink);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 5rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
}

/* Home */

.intro {
  margin: 0 0 3.5rem;
  color: var(--muted);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.45;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

.year {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.75rem 0 0.75rem;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-variant-numeric: lining-nums;
}

.year::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.posts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.posts li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
}

.posts time {
  padding-top: 0.15rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.posts a {
  text-decoration: underline;
  text-decoration-color: transparent;
}

.posts a:hover {
  text-decoration-color: var(--accent-soft);
}

/* Posts and pages */

h1 {
  margin: 0 0 0.5rem;
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.meta {
  margin: 0.75rem 0 2.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 + .prose {
  margin-top: 1.5rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose figure {
  margin: 0 0 1.25rem;
}

.prose h2,
.prose h3 {
  margin: 2.5rem 0 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.prose h3 {
  font-size: 1.15rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose a {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose hr {
  margin: 2.25rem 0;
  border: 0;
  text-align: center;
}

.prose hr::after {
  content: "· · ·";
  color: var(--muted);
  letter-spacing: 0.5em;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose figure img {
  display: block;
  width: 100%;
}

.prose .figure-title {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
}

.prose figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.5;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--code);
  font-family: var(--mono);
  font-size: 0.85em;
  font-variant-numeric: normal;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 0.85rem;
  line-height: 1.55;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.prose th,
.prose td {
  padding: 0.4rem 0.6rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

@media (max-width: 480px) {
  .site-header {
    padding: 1.75rem 0 2.5rem;
  }

  .posts li {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.55rem 0;
  }

  .posts time {
    order: 2;
  }

  h1 {
    font-size: 1.9rem;
  }

  .intro {
    font-size: 1.2rem;
  }
}
