:root {
  --paper: #f3eee4;
  --ink: #241e15;
  --muted: #7d7464;
  --rule: #ddd4c3;
  --accent: #62702a;
  --accent-soft: #e6e5d3;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 40rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16140f;
    --ink: #ece5d6;
    --muted: #9b927f;
    --rule: #2f2b22;
    --accent: #a9b86a;
    --accent-soft: #23261a;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.62 var(--serif);
  font-variant-numeric: lining-nums;
}

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

.site, .page, .foot { width: 100%; max-width: 54rem; margin: 0 auto; padding: 0 1.25rem; }

.site { padding-top: 3.5rem; padding-bottom: 3rem; }
.site::before { content: ""; display: block; width: 4.5rem; height: 3px; background: var(--accent); margin-bottom: 1.25rem; }
.site__name { font-size: 2.25rem; font-style: italic; text-decoration: none; letter-spacing: -0.01em; }
.site__tagline { color: var(--muted); font-style: italic; margin-left: 0.6rem; }

.page { padding-bottom: 5rem; }

.intro { font-size: 1.2rem; color: var(--muted); max-width: var(--measure); margin: 0 0 4rem; }
.empty { color: var(--muted); }

.finder { display: flex; gap: 0.75rem; align-items: center; max-width: var(--measure); margin: 0 0 1.5rem; border-bottom: 1px solid var(--ink); }
.finder__input { flex: 1; min-width: 0; padding: 0.6rem 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: 1.15rem; outline: none; }
.finder__input::placeholder { color: var(--muted); }
.finder__button { padding: 0.5rem 0; border: 0; background: none; color: var(--accent); font: 600 0.75rem/1 system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; }

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.pill { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px; font: 0.85rem/1.2 system-ui, sans-serif; text-decoration: none; color: var(--ink); }
.pill:hover { border-color: var(--accent); color: var(--ink); }
.pill--active, .pill--active:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.pill__count { font-size: 0.75rem; opacity: 0.65; }
.pill--small { padding: 0.2rem 0.6rem; font-size: 0.75rem; margin-right: 0.4rem; color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }

.sort { margin: 0 0 2.5rem; font: 0.85rem/1.6 system-ui, sans-serif; color: var(--muted); }
.sort__option { margin-left: 0.6rem; color: var(--muted); text-decoration: none; }
.sort__option--active { color: var(--ink); font-weight: 600; }

.entries { list-style: none; margin: 0 0 4rem; padding: 0; border-top: 1px solid var(--rule); }
.entry { padding: 1.5rem 0 1.6rem; border-bottom: 1px solid var(--rule); }
.entry__title { font-size: 1.75rem; line-height: 1.2; text-decoration: none; }
.entry__summary { margin: 0.4rem 0 0; max-width: var(--measure); }
.entry__meta, .recipe__meta, .revision__time, .revision__delta { font: 0.78rem/1.5 var(--mono); color: var(--muted); }
.entry__meta { margin: 0.6rem 0 0; }

.back { display: inline-block; font-size: 0.9rem; color: var(--muted); text-decoration: none; margin-bottom: 2.5rem; }

.recipe__head { margin-bottom: 3rem; }
.recipe__category { margin: 0 0 1.25rem; }
.recipe__title { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; font-weight: normal; margin: 0 0 1rem; letter-spacing: -0.01em; }
.recipe__summary { font-size: 1.25rem; line-height: 1.5; margin: 0 0 1rem; max-width: var(--measure); }
.recipe__meta { margin: 0; }

.toc { margin: 0 0 3.5rem; padding: 1.25rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc__label { font: 600 0.75rem/1 system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.75rem; }
.toc ol { margin: 0; padding-left: 1.25rem; columns: 2 18rem; column-gap: 2rem; }
.toc li { break-inside: avoid; margin: 0.15rem 0; }
.toc a { text-decoration: none; }

.notice { padding: 0.9rem 1.1rem; background: var(--accent-soft); border-left: 3px solid var(--accent); margin: 0 0 2.5rem; }

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3 { font-weight: normal; line-height: 1.2; scroll-margin-top: 1.5rem; }
.prose h1, .prose h2 { font-size: 1.75rem; margin: 3.5rem 0 1rem; }
.prose h3 { font-size: 1.25rem; font-style: italic; margin: 2.25rem 0 0.75rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose li { margin: 0.25rem 0; }
.prose strong { font-weight: 600; }
.prose del { color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }
.prose code { font: 0.85em var(--mono); background: var(--accent-soft); padding: 0.1em 0.3em; border-radius: 3px; }
.prose pre { margin: 1.5rem 0; padding: 1rem 1.1rem; background: var(--accent-soft); white-space: pre-wrap; overflow-wrap: anywhere; font: 0.85rem/1.55 var(--mono); }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { margin: 1.5rem 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--accent); font-size: 1.08rem; }

.markdown-alert { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--accent-soft); border-left: 3px solid var(--accent); }
.markdown-alert > :last-child { margin-bottom: 0; }
.markdown-alert-title { font: 600 0.75rem/1 system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; max-width: calc(100vw - 2.5rem); }
.prose table { border-collapse: collapse; min-width: 60%; font-size: 0.95rem; line-height: 1.4; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 1.25rem 0.5rem 0; border-bottom: 1px solid var(--rule); }
.prose th { font: 600 0.72rem/1.3 system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose .num { text-align: right; font-variant-numeric: tabular-nums; }

.history__title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: normal; line-height: 1.15; margin: 0 0 2.5rem; }
.revisions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.revision { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.revision__number { font-size: 1.15rem; }
.revision__current { font: 600 0.7rem/1 system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.revision__author { font-style: italic; }
.revision__note { flex-basis: 100%; color: var(--muted); }

.foot { padding-top: 2rem; padding-bottom: 3rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }

@media (min-width: 72rem) {
  .recipe:has(.toc) { display: grid; grid-template-columns: minmax(0, var(--measure)) 13rem; column-gap: 4rem; }
  .recipe:has(.toc) .recipe__head { grid-column: 1 / -1; }
  .recipe:has(.toc) .prose { grid-column: 1; grid-row: 2; }
  .recipe:has(.toc) .toc { grid-column: 2; grid-row: 2; align-self: start; position: sticky; top: 1.5rem; border: 0; padding: 0; font-size: 0.9rem; }
  .recipe:has(.toc) .toc ol { columns: 1; padding-left: 1.1rem; }
  .table-wrap { max-width: none; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site, .foot, .back, .toc, .recipe__meta, .notice { display: none; }
  .recipe { display: block !important; }
  .prose { max-width: none; }
  .table-wrap { overflow: visible; }
  .prose table, .prose blockquote, .markdown-alert { break-inside: avoid; }
  .prose h2, .prose h3 { break-after: avoid; }
}
