:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --paper-deep: #ece8df;
  --ink: #1f1e1b;
  --muted: #6b6862;
  --rule: #e0dbd0;
  --clay: #a8502b;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 34rem;
}


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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

.site-header,
main,
.site-footer {
  width: min(var(--measure), 100% - 2.5rem);
  margin-inline: auto;
}

/* ---------- header & footer ---------- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 2.25rem;
}

.site-name {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

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

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 5rem;
  padding-top: 1.25rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

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

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

/* ---------- type ---------- */

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

::selection {
  background: var(--clay);
  color: var(--paper);
}

p {
  margin: 0 0 1em;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  font-weight: 700;
  text-wrap: balance;
  hyphens: manual;
}

h1 {
  font-size: 2rem;
  margin: 3.5rem 0 1.5rem;
}

main > section > h2 {
  font-size: 1rem;
  margin: 3.25rem 0 1rem;
}

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

/* ---------- home ---------- */

.focus {
  font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.05rem);
  line-height: 1.3;
  margin: 4.5rem 0 1.75rem;
}

.outside {
  margin-top: 3.25rem;
  color: var(--muted);
}

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

.entries li,
.post-list li {
  margin-bottom: 1.15rem;
}

.entries p,
.post-list p {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

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

.tags,
.tag-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}

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

.tags a:hover,
.tag-nav a:hover {
  color: var(--clay);
}

.tag-nav {
  margin: -0.5rem 0 2.25rem;
  font-size: 1rem;
}

.count {
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
}

.tags .category {
  color: var(--clay);
}

.category-group h3 {
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  margin: 1.6rem 0 0.6rem;
}

.category-group h3 a {
  color: var(--muted);
}

.category-group:first-of-type h3 {
  margin-top: 0;
}

main > section > h2 a {
  color: var(--ink);
  text-decoration: none;
}

.category-group h3 a:hover,
main > section > h2 a:hover {
  color: var(--clay);
}

.more {
  font-size: 0.95rem;
  margin-top: -0.3rem;
}

.current {
  color: var(--muted);
}

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

.related h2 {
  font-size: 1rem;
  margin: 0 0 1rem;
}

.related li {
  margin-bottom: 0.5rem;
}

.cv {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
}

.cv dt {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cv dd {
  margin: 0;
}

.org {
  font-weight: 700;
}

.org::after {
  content: ",";
}

.draft {
  font-size: 0.85rem;
  color: var(--clay);
  font-style: italic;
}

/* ---------- posts ---------- */

.post-header {
  margin-bottom: 2.25rem;
}

.post-header h1 {
  margin-bottom: 0.4rem;
}

article {
  hyphens: auto;
  overflow-wrap: break-word;
}

article h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 0.75rem;
}

article h3 {
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem;
}

article ul,
article ol {
  padding-left: 1.4rem;
  margin: 0 0 1em;
}

article li {
  margin-bottom: 0.3em;
}

article blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.75rem auto;
}

article figure {
  margin: 2rem 0;
}

article figure img {
  margin: 0 auto;
}

article figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

article hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--paper-deep);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  hyphens: none;
}

pre {
  background: var(--paper-deep);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.45;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}

.math-display {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 1.25rem 0;
}

.back {
  margin-top: 3rem;
}

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  body {
    font-size: 1.0625rem;
  }

  .cv {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cv dd {
    margin-bottom: 0.8rem;
  }

  .focus {
    margin-top: 3rem;
  }
}

/* Reading list */
.reading-toc {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin: 1.4rem 0 0.5rem;
}
.reading-toc p { margin: 0; }
.reading h2 { scroll-margin-top: 1rem; }
.reading li { margin-bottom: 0.55rem; }

/* Epigraph on the home page */
.epigraph {
  margin: 4.5rem 0 0;
  padding: 0;
  color: var(--muted);
}
.epigraph blockquote {
  margin: 0;
  padding: 0;
  border: 0;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
}
.epigraph blockquote p {
  margin: 0;
}
.epigraph figcaption {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-variant: small-caps;
}
.epigraph + .focus {
  margin-top: 2.25rem;
}
@media (max-width: 40rem) {
  .epigraph {
    margin-top: 3rem;
  }
}
