:root {
  color-scheme: light;
  --paper: #fcfbf8;
  --ink: #242722;
  --muted: #585d55;
  --rule: #d4d5cb;
  --accent: #963d2c;
  --serif: "STIX Two Text", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #edc8b8; color: var(--ink); }

.frame {
  width: min(65rem, calc(100% - clamp(2.5rem, 10vw, 8rem)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset: 0.5rem auto auto 0.5rem;
  transform: translateY(-160%);
  z-index: 1;
  padding: 0.75rem;
  background: var(--paper);
}
.skip-link:focus { transform: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.header-inner, .site-nav, .archive-header, .site-footer, .byline {
  display: flex;
  align-items: center;
}
.header-inner, .archive-header, .site-footer { justify-content: space-between; }
.header-inner {
  min-height: 5rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.065em;
  text-decoration: none;
}
.wordmark::after {
  content: "";
  display: inline-block;
  width: 0.18em;
  height: 0.18em;
  margin-left: 0.07em;
  border-radius: 50%;
  background: var(--accent);
}
.site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem 1.6rem; }
.site-nav a, .site-footer a {
  padding-block: 0.5rem;
  font-size: 0.9375rem;
  text-decoration: none;
}
.site-nav a[aria-current="page"], .site-nav a:hover, .site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-color: var(--accent);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 500; }
.intro h1 {
  font-size: clamp(3.5rem, 7.5vw, 6.25rem);
  line-height: 0.97;
  letter-spacing: -0.055em;
}
.intro em { display: block; color: var(--accent); }
.intro p {
  max-width: 33ch;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  line-height: 1.6;
}
.notebook-art {
  display: block;
  justify-self: center;
  width: min(100%, 25rem);
  height: auto;
  max-height: 18rem;
  object-fit: contain;
}

.archive { padding-bottom: clamp(3rem, 7vw, 6rem); }
.archive-header {
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.2rem 0 1rem;
  border-top: 2px solid var(--ink);
}
.archive h2 { font-size: 2.25rem; line-height: 1.2; letter-spacing: -0.045em; }
.section-filter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.9375rem;
}
.section-filter select {
  appearance: none;
  min-width: 0;
  padding: 0.45rem 1.6rem 0.45rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 0.25rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 0.8rem center / 0.3rem 0.3rem no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 0.5rem center / 0.3rem 0.3rem no-repeat,
    var(--paper);
  color: var(--ink);
  font: inherit;
}
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(0, 3fr) minmax(5rem, 0.9fr);
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  border-top: 1px solid var(--rule);
  padding-block: 1.5rem;
}
time { color: var(--muted); font: 0.9375rem/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.section-name { color: var(--accent); font: 500 0.9375rem/1.5 var(--sans); overflow-wrap: anywhere; }
.entry-row .section-name { text-align: right; }
.entry-copy h3 { font-size: 1.65rem; line-height: 1.25; letter-spacing: -0.035em; overflow-wrap: anywhere; }
.entry-copy a { text-decoration: none; }
.entry-copy a:hover { text-decoration: underline; }
.entry-copy p, .empty-archive { color: var(--muted); font-size: 1rem; line-height: 1.6; }
.entry-copy p { margin: 0.35rem 0 0; }

.reading-page {
  max-width: 42rem;
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(4rem, 10vw, 8rem);
}
.reading-header { margin-bottom: 2rem; }
.reading-header h1 {
  font-size: clamp(2.75rem, 7vw, 4.75rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}
.byline { flex-wrap: wrap; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.prose { font: 1.25rem/1.65 var(--serif); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { line-height: 1.2; margin: 1.6em 0 0.5em; }
.prose h2 { font-size: 1.9rem; }
.prose h3 { font-size: 1.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose a { color: var(--accent); }
.prose img { max-width: 100%; height: auto; }
.prose pre, .prose table { display: block; overflow-x: auto; }
.prose pre { padding: 1rem; background: #f0efe8; }
.prose code { font-size: 0.86em; }
.prose blockquote { margin-inline: 0; padding-inline-start: 1em; border-left: 2px solid var(--accent); }

.site-footer {
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

@media (max-width: 40rem) {
  .header-inner { min-height: 4rem; }
  .site-nav { column-gap: 1rem; }
  .intro { grid-template-columns: 1fr; gap: 1.4rem; padding-block: 2.75rem 2rem; }
  .notebook-art { width: min(63%, 14rem); max-height: 10.5rem; }
  .entry-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0.6rem; }
  .entry-copy { grid-row: 2; grid-column: 1 / -1; }
  .entry-row .section-name { grid-row: 1; grid-column: 2; }
}

@media print {
  :root { background: white; color: black; }
  .site-nav, .skip-link, .site-footer, .section-filter { display: none; }
  .frame { width: 100%; }
  .reading-page { max-width: none; padding-block: 2rem; }
  .prose { font-size: 12pt; }
}
