:root {
  --bg: #fffaf4;
  --surface: #ffffff;
  --ink: #2b1d14;
  --muted: #7a6758;
  --line: #efe2d3;
  --accent: #c2410c;
  --accent-soft: #fde9dc;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { font: 700 22px/1 var(--serif); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 18px/1 var(--sans); }
nav { display: flex; gap: 18px; }
nav a { color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
@media (max-width: 420px) { nav { gap: 12px; } .logo { font-size: 19px; } }
nav a:hover { color: var(--accent); }

/* hero */
.hero { padding: 48px 0 28px; }
.hero h1 { font: 700 clamp(30px, 5vw, 48px)/1.1 var(--serif); margin: 0 0 10px; max-width: 18ch; }
.hero p { color: var(--muted); margin: 0 0 22px; max-width: 56ch; }
#search { width: 100%; max-width: 520px; padding: 14px 18px; font: inherit; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); outline: none; }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.tag { font: 500 14px/1 var(--sans); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.tag.active, .tag:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* grid + cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; margin-bottom: 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(43, 29, 20, .08); }
.card-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--accent-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; }
.card h3 { font: 700 19px/1.25 var(--serif); margin: 0 0 6px; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }
.empty, .empty-state { color: var(--muted); }
.empty-state { text-align: center; padding: 60px 20px; border: 2px dashed var(--line); border-radius: var(--radius); margin-bottom: 48px; }

/* recipe */
.recipe { max-width: 820px; padding-top: 36px; padding-bottom: 20px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.recipe h1 { font: 700 clamp(30px, 5vw, 44px)/1.12 var(--serif); margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 12px; }
.byline { font-size: 15px; color: var(--muted); margin: 0 0 24px; }

.video { margin: 0 0 24px; }
.video-facade, .video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); overflow: hidden; }
.video-facade { position: relative; padding: 0; cursor: pointer; background: #000; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.play { position: absolute; inset: 0; margin: auto; width: 76px; height: 54px; border-radius: 14px; background: var(--accent); }
.play::after { content: ""; position: absolute; left: 31px; top: 16px; border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; }
.video-facade:hover .play { filter: brightness(1.1); }
.video-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

.recipe-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
@media (max-width: 760px) { .recipe-cols { grid-template-columns: 1fr; } }
.recipe h2 { font: 700 24px/1.2 var(--serif); margin: 0 0 14px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
@media (min-width: 761px) { .box { position: sticky; top: 80px; } }
.group { font: 600 15px/1.3 var(--sans); margin: 16px 0 6px; color: var(--muted); }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { border-bottom: 1px dashed var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients label { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; cursor: pointer; }
.ingredients input { accent-color: var(--accent); transform: translateY(2px); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.tip { background: var(--accent-soft); border-radius: 12px; padding: 14px 18px; margin-top: 6px; }
.credit { margin: 36px 0; padding: 18px 22px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.credit p { margin: 0; }
.related { margin-top: 40px; }

/* prose */
.prose { max-width: 720px; padding-top: 40px; padding-bottom: 40px; }
.prose h1 { font: 700 40px/1.15 var(--serif); }
.prose h2 { font: 700 24px/1.2 var(--serif); margin-top: 32px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0; font-size: 14px; color: var(--muted); margin-top: 20px; }
.site-footer p { margin: 0 0 8px; max-width: 70ch; }

@media print {
  .site-header, .site-footer, .video, .related, nav { display: none; }
  .recipe-cols { grid-template-columns: 1fr; }
}
