@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("/fonts/NunitoSans.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --bg: #fbf4e8;
  --paper: #fffaf1;
  --ink: #2c211a;
  --muted: #7a6656;
  --line: #eadcc6;
  --accent: #c8452c;
  --accent-ink: #fff6ec;
  --accent-soft: #f8dfd4;
  --olive: #5f7230;
  --olive-soft: #e6ead2;
  --mustard: #b9851a;
  --mustard-soft: #fbedc9;
  --done: #b8a998;
  --shadow: 0 1px 0 rgba(90, 60, 30, 0.06), 0 6px 18px -10px rgba(90, 60, 30, 0.35);
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211b17;
    --paper: #2b241f;
    --ink: #f3e8da;
    --muted: #b4a290;
    --line: #42372f;
    --accent: #ec7552;
    --accent-ink: #2a160f;
    --accent-soft: #4a2a20;
    --olive: #aebf74;
    --olive-soft: #343a24;
    --mustard: #e7b54f;
    --mustard-soft: #43361a;
    --done: #6f6155;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 8px 22px -12px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  padding: 0 16px 48px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  line-height: 1.15;
  font-weight: 600;
  margin: 0;
}

a { color: var(--accent); }

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

.chip {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--olive-soft);
  color: var(--olive);
  font-weight: 700;
  font-size: 0.85rem;
}

.masthead, .plans {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.crumbs, .recipe-head, .before, .method, .plain, .extra {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.masthead { padding: 48px 0 24px; }
.masthead h1 { font-size: clamp(2.6rem, 9vw, 4rem); font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.masthead p { margin: 6px 0 0; color: var(--muted); font-size: 1.1rem; }

.plan {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.plan summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px;
}
.plan summary::-webkit-details-marker { display: none; }
.plan summary::before { content: "▸"; color: var(--accent); margin-right: 4px; transition: transform 0.15s; }
.plan[open] summary::before { transform: rotate(90deg); }
.plan-date { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; flex: 1; }
.plan-count { color: var(--muted); font-size: 0.95rem; }

.cards { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  height: 100%;
  transition: transform 0.12s, border-color 0.12s;
}
.card:hover, .card:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.card-num {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 1.15rem var(--serif);
}
.card-body { display: grid; gap: 4px; min-width: 0; }
.card-title { font: 600 1.15rem/1.25 var(--serif); }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.9rem; }
.empty { color: var(--muted); }

.crumbs { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 20px 0 8px; font-size: 0.95rem; }
.crumbs a { text-decoration: none; font-weight: 700; }

.recipe-head { padding: 8px 0 20px; }
.recipe-head h1 { font-size: clamp(2rem, 7vw, 3.1rem); letter-spacing: -0.015em; }
.meta { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.meta li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.92rem; }
.meta-key { color: var(--muted); font-weight: 700; margin-right: 2px; }

.before {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.before { background: var(--mustard-soft); border-left: 6px solid var(--mustard); }
.before h2 { font-size: 1.15rem; color: var(--mustard); margin-bottom: 4px; }
.before ul { margin: 4px 0 0; padding-left: 20px; }
.before p { margin: 4px 0; }

.method, .extra, .plain {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 8px;
}
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 1.5rem; }
.section-head .muted { font-size: 0.9rem; font-weight: 700; }

.step input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.step input:focus-visible + .step-num { outline: 3px solid var(--accent); outline-offset: 2px; }

.steps { list-style: none; margin: 0; padding: 0; }


.step-divider { border: 0; border-top: 2px solid var(--olive-soft); margin: 10px 0; }

.step label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  position: relative;
  padding: 12px 6px;
  border-top: 1px dashed var(--line);
  cursor: pointer;
}
.steps .step:first-child label { border-top: 0; }
.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font: 700 1rem var(--serif);
}
.step-text { display: block; font-size: 1.08rem; }
.step:has(input:checked) .step-text { color: var(--done); }
.step:has(input:checked) .step-num { background: var(--olive); color: transparent; position: relative; }
.step:has(input:checked) .step-num::after { content: ""; position: absolute; left: 50%; top: 45%; width: 0.4rem; height: 0.8rem; border: solid var(--paper); border-width: 0 3px 3px 0; transform: translate(-50%, -50%) rotate(45deg); }

mark { background: var(--mustard-soft); color: var(--ink); font-weight: 800; padding: 0 3px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.step:has(input:checked) mark { background: transparent; color: var(--done); font-weight: 700; }

.extra { margin-top: 20px; padding-bottom: 14px; }
.extra.above { margin: 0 auto 20px; }
.extra h2 { font-size: 1.35rem; margin-bottom: 6px; }
.extra ol, .extra ul { padding-left: 22px; }
.extra li { margin: 4px 0; }
.plain { padding-bottom: 14px; }
.plain h2 { margin-top: 18px; }


.tools { display: flex; gap: 8px; margin-top: 14px; }
.tools[hidden] { display: none; }
.tools button {
  font: 700 0.9rem var(--sans);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.tools .toggle[aria-pressed="true"] { background: var(--olive); color: var(--paper); border-color: var(--olive); }

@media (max-width: 520px) {
  body { padding: 0 8px 32px; }
  .masthead { padding: 24px 4px 16px; }
  .crumbs { padding: 12px 4px 6px; }
  .recipe-head { padding: 4px 4px 14px; }
  .method, .extra, .plain { padding: 12px 10px 4px; border-radius: 12px; }
  .extra { margin-top: 12px; padding-bottom: 10px; }
  .extra.above { margin: 0 auto 12px; }
  .before { padding: 10px 12px; margin-bottom: 12px; }
  .step label { padding: 10px 2px; gap: 10px; }
  .plan summary { padding: 12px 14px; }
  .cards { padding: 0 6px 6px; gap: 6px; }
  .card { padding: 10px 12px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.note { background: var(--mustard-soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-weight: 700; }
.note p { margin: 2px 0; }

.step-text, mark { overflow-wrap: anywhere; }
