:root {
  --font-display: display, Georgia, "Times New Roman", serif;
  --font-mono: mono, ui-monospace, "SF Mono", Menlo, monospace;
  --font-ui: ui, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --rule: #e5e5e5;
  --accent: #7a1f2b;
  --section: #9a9a9a;
  --paper: #fff;
  --fill: #f1f1f1;
  --pill-radius: 0.35rem;
  --tag-radius: 1rem;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-display);
  color: var(--ink);
  background: var(--paper);
  margin: 0 auto;
  max-width: 46rem;
  padding: 0 1.25rem 4rem;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Site header */
.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.site .brand {
  font-style: italic;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
}

.content-nav {
  display: flex;
  gap: 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.5rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.4rem;
}

.intro,
.empty {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

/* Meta pills */
.meta {
  margin: 0.6rem 0 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  border-radius: var(--pill-radius);
  white-space: nowrap;
}

.pill.solid {
  background: var(--fill);
  color: var(--ink);
  border: 1px solid transparent;
}

a.pill.solid:hover {
  border-color: var(--rule);
  text-decoration: none;
}

.pill.tag {
  border: 1px solid var(--rule);
  border-radius: var(--tag-radius);
  color: var(--muted);
}

.pill.tag:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Listings */
.recipelist,
.indexlist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.recipelist li,
.indexlist li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
}

.recipelist .yield,
.indexlist .count {
  margin-left: auto;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
}

.letter-group h2 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--section);
  margin: 1.75rem 0 0.35rem;
}

/* Recipe body */
.recipe header,
.utensil header {
  margin-bottom: 1.75rem;
}

.preamble {
  color: var(--ink);
}

.section ul,
.section ol {
  padding-left: 1.3rem;
}

.section li {
  margin: 0.3rem 0;
}

.section li > ul,
.section li > ol {
  margin-top: 0.3rem;
}

.section-ingredients li,
.section-utensils li {
  font-variant-numeric: tabular-nums;
}

.crosslinks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

/* Utensil mentions and their popovers */
a.utensil {
  color: inherit;
  text-decoration: underline dotted var(--section);
  text-underline-offset: 0.2em;
  cursor: help;
}

a.utensil:hover {
  color: var(--accent);
  text-decoration: underline solid var(--accent);
}

.utensil-panel {
  position: absolute;
  margin: 0;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  background: var(--paper);
  box-shadow: 0 8px 28px rgb(0 0 0 / 12%);
  font-size: 0.92rem;
}

.utensil-panel h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.utensil-panel p {
  margin: 0.4rem 0 0;
}

.utensil-spec {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
}

.utensil-more {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

/* Tables (the measurements page) */
.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

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

th {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--section);
  font-weight: 400;
}

td.mono {
  font-family: var(--font-mono);
}

td.muted {
  color: var(--muted);
  white-space: normal;
}

img {
  max-width: 100%;
  height: auto;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececec;
    --muted: #9d9d9d;
    --rule: #333;
    --accent: #e39aa5;
    --section: #7d7d7d;
    --paper: #171717;
    --fill: #242424;
  }
}
