/* Personal Assistant Recipes — set like a printed book: a paper leaf on a desk, Garamond, red rubrics. */
/* Iznik palette: cobalt, turquoise, tile-white, and the red of the old Iznik kilns. */
:root {
  --desk: #17347c;
  --paper: #fbf8f1;
  --ink: #17203a;
  --ink-2: #3a4560;
  --muted: #687089;
  --rubric: #1d3f91;
  --accent: #c8432f;
  --turq: #2a9a96;
  --rule: #d3d8e4;
  --check: #fbf8f1;
  --on-desk: #c9d5f2;
  --grain-blend: multiply;
  --grain-opacity: 0.3;
  --leaf-shadow: 0 2px 2px rgba(5, 15, 45, 0.25), 0 30px 70px -24px rgba(5, 15, 45, 0.7);
  --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23305aae' stroke-width='1.3'%3E%3Crect x='26' y='26' width='36' height='36'/%3E%3Crect x='26' y='26' width='36' height='36' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='10'/%3E%3Cpath d='M0 22A22 22 0 0 0 22 0M66 0A22 22 0 0 0 88 22M88 66A22 22 0 0 0 66 88M22 88A22 22 0 0 0 0 66'/%3E%3C/g%3E%3Ccircle cx='44' cy='44' r='3.4' fill='%2346b8b2'/%3E%3Cg fill='%23b8574a'%3E%3Ccircle cx='0' cy='0' r='3.2'/%3E%3Ccircle cx='88' cy='0' r='3.2'/%3E%3Ccircle cx='0' cy='88' r='3.2'/%3E%3Ccircle cx='88' cy='88' r='3.2'/%3E%3C/g%3E%3C/svg%3E");
  --frieze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='28' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' fill='%231d3f91'/%3E%3Crect y='3' width='44' height='1' fill='%23fbf8f1' opacity='.5'/%3E%3Crect y='24' width='44' height='1' fill='%23fbf8f1' opacity='.5'/%3E%3Cg transform='translate(22 14)'%3E%3Crect x='-6' y='-6' width='12' height='12' fill='%23fbf8f1'/%3E%3Crect x='-6' y='-6' width='12' height='12' fill='%23fbf8f1' transform='rotate(45)'/%3E%3Ccircle r='3.3' fill='%23d4553d'/%3E%3C/g%3E%3Ccircle cx='0' cy='14' r='2.2' fill='%2346b8b2'/%3E%3Ccircle cx='44' cy='14' r='2.2' fill='%2346b8b2'/%3E%3C/svg%3E");
  --rosette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='-20 -20 40 40'%3E%3Cg fill='%232a9a96'%3E%3Ccircle cx='0' cy='-17' r='1.8'/%3E%3Ccircle cx='0' cy='17' r='1.8'/%3E%3Ccircle cx='-17' cy='0' r='1.8'/%3E%3Ccircle cx='17' cy='0' r='1.8'/%3E%3C/g%3E%3Cg fill='%231d3f91'%3E%3Crect x='-10' y='-10' width='20' height='20'/%3E%3Crect x='-10' y='-10' width='20' height='20' transform='rotate(45)'/%3E%3C/g%3E%3Ccircle r='7.2' fill='%23fbf8f1'/%3E%3Ccircle r='4.6' fill='%23c8432f'/%3E%3C/svg%3E");
  --display: "Cormorant Garamond", "Cormorant", Garamond, "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", ui-sans-serif, system-ui, sans-serif;
  --text: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --desk: #0a1430;
    --paper: #111a2e;
    --ink: #ece8de;
    --ink-2: #c5c9d6;
    --muted: #8f98ad;
    --rubric: #8fb0f0;
    --accent: #ea7a62;
    --turq: #5cc7c2;
    --rule: #26324d;
    --check: #111a2e;
    --on-desk: #8f9fc6;
    --grain-blend: soft-light;
    --grain-opacity: 0.2;
    --leaf-shadow: 0 2px 2px rgba(0, 0, 0, 0.5), 0 30px 70px -24px rgba(0, 0, 0, 0.9);
    --tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%231d3263' stroke-width='1.3'%3E%3Crect x='26' y='26' width='36' height='36'/%3E%3Crect x='26' y='26' width='36' height='36' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='10'/%3E%3Cpath d='M0 22A22 22 0 0 0 22 0M66 0A22 22 0 0 0 88 22M88 66A22 22 0 0 0 66 88M22 88A22 22 0 0 0 0 66'/%3E%3C/g%3E%3Ccircle cx='44' cy='44' r='3.4' fill='%232f8f8b'/%3E%3Cg fill='%239c3f31'%3E%3Ccircle cx='0' cy='0' r='3.2'/%3E%3Ccircle cx='88' cy='0' r='3.2'/%3E%3Ccircle cx='0' cy='88' r='3.2'/%3E%3Ccircle cx='88' cy='88' r='3.2'/%3E%3C/g%3E%3C/svg%3E");
    --frieze: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='28' viewBox='0 0 44 28'%3E%3Crect width='44' height='28' fill='%231b2d58'/%3E%3Crect y='3' width='44' height='1' fill='%23cfd9f2' opacity='.5'/%3E%3Crect y='24' width='44' height='1' fill='%23cfd9f2' opacity='.5'/%3E%3Cg transform='translate(22 14)'%3E%3Crect x='-6' y='-6' width='12' height='12' fill='%23cfd9f2'/%3E%3Crect x='-6' y='-6' width='12' height='12' fill='%23cfd9f2' transform='rotate(45)'/%3E%3Ccircle r='3.3' fill='%23b8574a'/%3E%3C/g%3E%3Ccircle cx='0' cy='14' r='2.2' fill='%235cc7c2'/%3E%3Ccircle cx='44' cy='14' r='2.2' fill='%235cc7c2'/%3E%3C/svg%3E");
    --rosette: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='-20 -20 40 40'%3E%3Cg fill='%235cc7c2'%3E%3Ccircle cx='0' cy='-17' r='1.8'/%3E%3Ccircle cx='0' cy='17' r='1.8'/%3E%3Ccircle cx='-17' cy='0' r='1.8'/%3E%3Ccircle cx='17' cy='0' r='1.8'/%3E%3C/g%3E%3Cg fill='%238fb0f0'%3E%3Crect x='-10' y='-10' width='20' height='20'/%3E%3Crect x='-10' y='-10' width='20' height='20' transform='rotate(45)'/%3E%3C/g%3E%3Ccircle r='7.2' fill='%23111a2e'/%3E%3Ccircle r='4.6' fill='%23ea7a62'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--desk) var(--tile) 0 0 / 88px 88px;
  color: var(--ink);
  font: 400 19px/1.55 var(--text);
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, input:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--rubric) 22%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.sc { font-variant-caps: all-small-caps; letter-spacing: 0.08em; }

/* ---------- the leaf ---------- */
.book { max-width: 880px; margin: 40px auto 0; padding: 0 20px; }
.leaf {
  position: relative;
  display: block;
  background: var(--paper);
  box-shadow: var(--leaf-shadow);
  padding: 56px clamp(24px, 8vw, 88px) 64px;
  border-radius: 3px;
  isolation: isolate;
}
/* binding shadow along the left edge + paper grain */
.leaf {
  background:
    var(--frieze) left top / 44px 28px repeat-x,
    var(--frieze) left bottom / 44px 28px repeat-x,
    var(--paper);
  padding-top: 84px;
  padding-bottom: 92px;
}
.leaf::before {
  content: "";
  position: absolute;
  inset: 40px 12px;
  border: 1px solid color-mix(in srgb, var(--rubric) 30%, transparent);
  outline: 1px solid color-mix(in srgb, var(--rubric) 18%, transparent);
  outline-offset: -5px;
  pointer-events: none;
  z-index: -1;
}
.leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .25 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.005em; }
.fleuron { margin: 22px auto; width: 40px; height: 40px; background: var(--rosette) center / contain no-repeat; font-size: 0; }

/* ---------- title page ---------- */
.title-page { text-align: center; padding: 48px 0 40px; }
.title-page-small { padding: 24px 0 8px; }
.overline {
  margin: 0 0 22px;
  font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.title-page h1 {
  color: var(--rubric);
  font-size: clamp(46px, 9vw, 92px);
  line-height: 0.92;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.title-page h1 .the {
  display: block;
  font-weight: 500;
  font-size: 0.5em;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-top: 10px;
}
.title-page-small h1 { font-size: clamp(44px, 8vw, 72px); text-transform: capitalize; }
.lede {
  margin: 0 auto;
  max-width: 27em;
  font: 400 clamp(20px, 2.6vw, 22px)/1.5 var(--text);
  color: var(--ink-2);
}
.edition { margin: 22px 0 0; font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* ---------- contents ---------- */
.contents-wrap { border-top: 1px solid var(--rule); padding-top: 34px; }
.contents-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contents-head h2 { font-size: 40px; font-weight: 500; }
.lookup { display: flex; align-items: baseline; gap: 12px; flex: 1 1 260px; max-width: 360px; }
.lookup label { font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); }
.lookup input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--ink-2);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 400 16px/1.3 var(--sans);
  padding: 4px 0 5px;
  -webkit-appearance: none;
  appearance: none;
}
.lookup input:focus { outline: none; border-bottom-color: var(--rubric); box-shadow: 0 1px 0 var(--rubric); }
.lookup input::placeholder { color: var(--muted); opacity: 0.8; }
.lookup input::-webkit-search-cancel-button { -webkit-appearance: none; }

.chapters { display: flex; flex-wrap: wrap; gap: 2px 22px; margin: 18px 0 0; line-height: 1.8; }
.chapter {
  font: 500 14.5px/1.4 var(--sans);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.chapter:hover { color: var(--ink); }
.chapter.is-on { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

.results:empty { display: none; }
.results { margin: 14px 0 0; font: 400 14px/1.4 var(--sans); color: var(--muted); }

.contents { list-style: none; margin: 18px 0 0; padding: 0; }
.entry {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) minmax(1.5rem, 5rem) auto;
  column-gap: 10px;
  align-items: start;
  padding: 16px 0;
}
.entry[hidden] { display: none; }
.entry + .entry { border-top: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); }
.entry-no {
  font: 600 27px/1.1 var(--display);
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.entry-link { text-decoration: none; }
.entry-link::after { content: ""; position: absolute; inset: 0; }
.entry-quote {
  display: block;
  font: 400 clamp(19px, 2.4vw, 21px)/1.4 var(--text);
  color: var(--ink);
  transition: color 0.15s;
  text-wrap: pretty;
}
.entry-tweet .entry-quote::before { content: "“"; }
.entry-tweet .entry-quote::after { content: "”"; }
.entry-title {
  display: block;
  margin-top: 6px;
  font: 400 14px/1.4 var(--sans);
  line-height: 1.35;
  color: var(--muted);
}
.entry-leader { margin-top: 1.05em; border-bottom: 2px dotted var(--rule); }
.entry-date { font: 400 13px/2.1 var(--sans); font-variant-numeric: lining-nums tabular-nums; color: var(--muted); white-space: nowrap; }
.entry:hover .entry-quote { color: var(--turq); }

.entry-via { color: var(--turq); }
.epigraph-chat { max-width: 28em; }
.epigraph-note { margin: 0; font: italic 400 clamp(22px, 3.2vw, 28px)/1.35 var(--display); color: var(--ink-2); text-wrap: balance; }
.epigraph-chat figcaption { font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--turq); }
.empty { text-align: center; padding: 40px 0 24px; color: var(--muted); }
.empty-title { font: 500 28px/1.2 var(--display); color: var(--ink); margin: 0 0 6px; }

/* ---------- recipe ---------- */
.running-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: -20px 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.running-head a { text-decoration: none; }
.running-head a:hover { color: var(--rubric); }

.epigraph { margin: 56px auto 0; max-width: 30em; text-align: center; }
.epigraph blockquote {
  margin: 0;
  font: italic 500 clamp(26px, 4.2vw, 38px)/1.24 var(--display);
  color: var(--ink);
  text-wrap: balance;
}
.epigraph blockquote a { text-decoration: none; }
.epigraph blockquote a:hover { color: var(--rubric); }
.epigraph blockquote::before { content: "“"; color: var(--accent); }
.epigraph blockquote::after { content: "”"; color: var(--accent); }
.epigraph figcaption { margin-top: 18px; font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.epigraph figcaption a { text-decoration: none; font-weight: 600; letter-spacing: 0.08em; }
.epigraph figcaption a:hover { color: var(--rubric); }

.recipe-head { text-align: center; margin: 48px 0 0; padding-top: 36px; position: relative; }
.recipe-head::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 32px;
  background:
    var(--rosette) center / 32px 32px no-repeat,
    linear-gradient(var(--rule), var(--rule)) left center / calc(50% - 26px) 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) right center / calc(50% - 26px) 1px no-repeat;
}
.plate { margin: 0 0 12px; font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); }
.recipe-head h1 { color: var(--rubric); font-size: clamp(34px, 5.6vw, 54px); line-height: 1.04; font-weight: 600; text-wrap: balance; }
.serves { margin: 16px auto 0; max-width: 30em; color: var(--ink-2); }
.serves span { font-style: normal; font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); margin-right: 6px; }

.headnote { margin: 34px auto 0; max-width: 32em; font-size: 20px; line-height: 1.6; color: var(--ink-2); hyphens: auto; }
.headnote::first-letter {
  float: left;
  font: 600 3.55em/0.78 var(--display);
  color: var(--accent);
  padding: 0.07em 0.08em 0 0;
}

.spread { display: grid; grid-template-columns: minmax(200px, 0.8fr) 1.7fr; margin: 44px 0 0; }
.spread h2 { font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rubric); margin: 0 0 16px; }
.ingredients { padding-right: 30px; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li + li { border-top: 1px dotted var(--rule); }
.ingredients label { display: flex; gap: 12px; padding: 9px 0; cursor: pointer; line-height: 1.35; font-size: 18px; }
.ingredients input {
  appearance: none;
  flex: none;
  width: 15px;
  height: 15px;
  margin: 5px 0 0;
  border: 1.25px solid var(--muted);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.ingredients input::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--check); transform: scale(0); transition: transform 0.12s; }
.ingredients input:checked { background: var(--turq); border-color: var(--turq); }
.ingredients input:checked::before { transform: scale(1); }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rubric); }
.method { padding-left: 30px; border-left: 1px solid var(--rule); }
.method ol { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.method li { counter-increment: step; display: grid; grid-template-columns: 2.2rem 1fr; padding: 0 0 18px; }
.method li::before {
  content: counter(step) ".";
  font: 600 26px/1 var(--display);
  color: var(--accent);
  font-variant-numeric: lining-nums;
  padding-top: 2px;
}
.method li p { margin: 0; line-height: 1.5; text-wrap: pretty; }

.recipe-foot { margin-top: 36px; text-align: center; }
.filed { margin: 0; font: 400 14px/1.6 var(--sans); color: var(--muted); }
.filed .chapter { margin: 0 4px; }
.filed .chapter:hover { color: var(--rubric); }
.folio { margin: 28px 0 0; font: 400 14px/1 var(--sans); color: var(--muted); }

.see-also { margin: 44px 0 0; padding-top: 32px; border-top: 1px solid var(--rule); }
.see-also h2 { font-size: 32px; font-weight: 500; text-align: center; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; font: 500 20px/1.25 var(--display); }
.pager a span { display: block; margin-bottom: 6px; font: 500 12px/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; letter-spacing: 0.14em; color: var(--rubric); }
.pager a:hover { color: var(--rubric); }
.pager-next { text-align: right; }

/* ---------- colophon ---------- */
.colophon { max-width: 36em; margin: 28px auto 48px; padding: 18px 26px; background: var(--desk); border-radius: 4px; text-align: center; font-size: 15.5px; font-family: var(--sans); font-size: 14px; color: var(--on-desk); }
.colophon p { margin: 0 0 6px; }
.colophon a { color: #fff; }

/* ---------- small screens: the leaf becomes the page ---------- */
@media (max-width: 680px) {
  body { font-size: 18px; }
  .book { margin: 0; padding: 0; }
  .leaf { border-radius: 0; box-shadow: none; padding: 36px 20px 44px; }
  .leaf::before { inset: 36px 8px; }
  .leaf { padding-top: 64px; padding-bottom: 72px; }
  .colophon { color: var(--on-desk); }
  .title-page { padding: 28px 0 32px; }
  .running-head { margin-top: -12px; }
  .entry { grid-template-columns: 2rem minmax(0, 1fr); }
  .entry-leader { display: none; }
  .entry-date { grid-column: 2; margin-top: 4px; font-size: 15px; }
  .chapters { display: flex; overflow-x: auto; margin: 16px -20px 0; padding: 0 20px; scrollbar-width: none; }
  .chapters::-webkit-scrollbar { display: none; }
  .epigraph { margin-top: 40px; }
  .spread { grid-template-columns: 1fr; }
  .ingredients { padding: 0 0 26px; }
  .method { padding: 26px 0 0; border-left: 0; border-top: 1px solid var(--rule); }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .colophon { padding: 28px 20px 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body { background: #fff; }
  .book { margin: 0; max-width: none; }
  .leaf { box-shadow: none; }
  .leaf::after, .leaf::before, .lookup, .chapters, .pager, .see-also, .colophon { display: none; }
}
