:root {
  color-scheme: light dark;
  --background: #ffffff;
  --surface: #f5f5f3;
  --text: #20201f;
  --muted: #686863;
  --accent: #5b3f8c;
  --border: #deded9;
  /* Fraunces (display serif) for headings and the wordmark; IBM Plex Sans for
     body and UI. Both self-hosted in fonts.css and linked site-wide. */
  --font-display: "Fraunces", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    /* Plum-tinted, matching the homepage dark palette (home.css) so the
       chrome, blog and projects pages read as one theme. */
    --background: #1a1526;
    --surface: #241d33;
    --text: #e7e3f2;
    --muted: #a7a0bd;
    --accent: #c3a9ee;
    --border: #332b46;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text);
  font-size: 100%;
  line-height: 1.6;
}

body {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

img,
iframe,
video {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

.skip-link {
  left: 1rem;
  padding: 0.5rem 0.75rem;
  position: absolute;
  top: -5rem;
  z-index: 10;
}

.skip-link:focus {
  background: var(--background);
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner,
.page-shell,
.site-footer {
  margin-inline: auto;
  max-width: 46rem;
  padding-inline: 1.25rem;
}

.site-header__inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 4.5rem;
}

.site-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 1.5rem;
}

/* Match the homepage nav (.home__links): uppercase Plex Sans, bold, tracked. */
.site-header nav a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
}

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

.page-shell {
  min-height: calc(100vh - 10rem);
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.page-header,
.post__header {
  margin-bottom: 2.5rem;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 4rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.45rem;
}

time,
.site-footer {
  color: var(--muted);
}

.post-stream {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.post--stream + .post--stream {
  border-top: 1px solid var(--border);
  padding-top: 3.5rem;
}

.post--stream .post__header {
  margin-bottom: 1.5rem;
}

.post--stream h2 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

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

.post--stream h2 a:hover,
.post--stream h2 a:focus-visible {
  text-decoration: underline;
}

.post-stream__more {
  border-top: 1px solid var(--border);
  margin-top: 3.5rem;
  padding-top: 1.5rem;
}

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

.post-list li {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
}

.post-list h2 {
  margin: 0 0 0.25rem;
}

.post-list p {
  margin-bottom: 0;
}

.post__body {
  font-family: var(--font-sans);
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
}

.post__body > * + * {
  margin-top: 1.4em;
}

.post__body blockquote {
  border-left: 0.2rem solid var(--border);
  color: var(--muted);
  margin-inline: 0;
  padding-left: 1.25rem;
}

.post__body code {
  background: var(--surface);
  border-radius: 0.2rem;
  font-size: 0.9em;
  padding: 0.1em 0.25em;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
}

.site-footer p {
  margin: 0;
}
