:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --surface: #f5f5f4;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --border: #e7e5e4;
  --border-soft: #f0efee;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 680px;
  --shell-width: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #1c1b1a;
    --text: #f0eeec;
    --muted: #a8a29e;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --border: #2c2a28;
    --border-soft: #242220;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: "kern", "liga", "calt";
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

main,
header.site,
footer.site {
  width: 100%;
  max-width: var(--shell-width);
  margin-inline: auto;
  padding-inline: 2rem;
}

main {
  flex: 1;
  max-width: var(--max-width);
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

header.site {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

header.site a {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

footer.site {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8125rem;
}

footer.site p {
  margin: 0;
}

footer.site nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 650;
}

h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 1.3125rem;
  font-weight: 650;
}

h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

p {
  margin: 1.5rem 0 0;
}

ul,
ol {
  margin: 1.5rem 0 0;
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.35rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 3px;
}

pre {
  margin: 1.5rem 0 0;
  padding: 1.375rem 1.5rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
}

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

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

table {
  width: 100%;
  margin: 1.5rem 0 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

hr {
  margin-block: 3rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.home {
  max-width: var(--shell-width);
}

.home-intro {
  max-width: var(--max-width);
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.home-deck,
.subtitle,
.post-meta {
  color: var(--muted);
}

.home-deck {
  max-width: 52ch;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.home-section h2 {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.post-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 1.5rem;
  padding: 1.625rem 0;
  border-bottom: 1px solid var(--border);
}

.post-card.compact {
  grid-template-columns: 1fr;
}

.post-card time,
.post-meta time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.post-card h3 {
  margin: 0 0 0.4rem;
}

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

.post-card h3 a:hover {
  color: var(--accent);
}

.post-card p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.subtitle {
  margin: 1rem 0 0;
  max-width: 52ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.post-meta {
  margin: 0.75rem 0 2.75rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.callout {
  margin: 1.5rem 0 0;
  padding: 1rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.snapshot-banner {
  margin: 0 0 2.25rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.snapshot-banner strong {
  color: var(--text);
  font-weight: 650;
  margin-right: 0.25rem;
}

.post-meta a {
  color: var(--muted);
}

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

.versions-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.versions-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.versions-list li:last-child {
  border-bottom: 0;
}

.versions-list time {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-right: 0.75rem;
}

.versions-list .version-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.versions-list p {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  main,
  header.site,
  footer.site {
    padding-inline: 1.25rem;
  }

  main {
    padding-top: 2.5rem;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  footer.site {
    flex-direction: column;
    align-items: flex-start;
  }
}
