:root {
  --ink: #172019;
  --paper: #f4f0e7;
  --card: #fffdf8;
  --sage: #71806c;
  --red: #a23e2b;
  --gold: #c79845;
  --line: #d8d1c3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", sans-serif;
}
button, input { font: inherit; }
a { color: inherit; }

.site-header {
  min-height: 76px;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header p { color: var(--sage); font-size: .86rem; }
.brand { font-weight: 700; letter-spacing: .13em; text-decoration: none; }
.brand span { color: var(--red); }

main { max-width: 1400px; margin: auto; }
.hero {
  min-height: 430px;
  padding: 74px 6vw 68px;
  display: grid;
  grid-template-columns: 1.7fr .7fr;
  align-items: center;
  overflow: hidden;
}
.eyebrow { margin: 0 0 14px; color: var(--red); font-size: .72rem; font-weight: 700; letter-spacing: .2em; }
h1, h2, h3 { font-family: "Playfair Display", serif; }
h1 { margin: 0; font-size: clamp(3.5rem, 7vw, 7.4rem); line-height: .94; letter-spacing: -.05em; }
h1 em { color: var(--red); font-weight: 600; }
.intro { max-width: 640px; margin: 28px 0 0; color: #526056; font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.7; }
.hero-mark {
  justify-self: end;
  width: min(25vw, 280px);
  aspect-ratio: 1;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  display: grid;
  place-items: center;
  font: 600 clamp(4rem, 9vw, 8rem)/1 "Playfair Display", serif;
  transform: rotate(-8deg);
  opacity: .7;
}

.library { padding: 56px 6vw 90px; border-top: 1px solid var(--line); }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); }
.search { min-width: min(100%, 390px); padding: 13px 16px; background: var(--card); border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0; }
.filter { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: #576159; cursor: pointer; }
.filter.active, .filter:hover { color: white; border-color: var(--ink); background: var(--ink); }
.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.card { background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; overflow: hidden; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgb(29 39 30 / 10%); }
.card-image { position: relative; aspect-ratio: 16/10; overflow: hidden; background: #ddd; }
.card-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; }
.card:first-child .card-image img { object-position: 45% 42%; }
.card-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 65%, rgb(0 0 0 / 35%)); }
.source-pill { position: absolute; z-index: 1; left: 16px; bottom: 14px; padding: 6px 9px; border-radius: 4px; color: white; background: rgb(23 32 25 / 78%); font-size: .72rem; }
.card-body { padding: 22px; }
.card h3 { margin: 0 0 6px; font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
.card-subtitle { color: var(--sage); margin: 0; }
.meta { display: flex; gap: 18px; margin-top: 18px; color: #667069; font-size: .8rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tag { color: var(--red); background: #f5e7e1; padding: 5px 8px; font-size: .7rem; }
.empty { padding: 60px 0; text-align: center; color: var(--sage); }

#recipe-dialog { width: min(1020px, calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 0; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgb(0 0 0 / 35%); }
#recipe-dialog::backdrop { background: rgb(12 17 13 / 75%); backdrop-filter: blur(3px); }
.close { position: fixed; z-index: 5; margin: 16px; right: max(16px, calc((100vw - 1020px)/2 + 16px)); width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--ink); color: white; font-size: 1.7rem; cursor: pointer; }
.detail-hero { min-height: 360px; padding: 50px; color: white; display: flex; align-items: end; background-size: cover; background-position: center; position: relative; }
.detail-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgb(5 10 6 / 80%)); }
.detail-title { position: relative; max-width: 740px; }
.detail-title h2 { font-size: clamp(2.7rem, 6vw, 5rem); line-height: 1; }
.detail-title p { margin-bottom: 0; }
.detail-content { display: grid; grid-template-columns: .85fr 1.15fr; gap: 52px; padding: 48px; }
.detail-content h3 { font-size: 1.7rem; margin: 0 0 18px; }
.detail-content ul, .detail-content ol { margin: 0; padding-left: 20px; }
.detail-content li { margin: 0 0 13px; line-height: 1.55; }
.detail-content ol li { padding-left: 8px; }
.detail-block + .detail-block { margin-top: 34px; }
.confidence { display: inline-flex; margin-top: 18px; padding: 7px 10px; border: 1px solid var(--gold); color: #7d5b20; font-size: .78rem; }
.source-link { display: inline-block; margin-top: 22px; color: var(--red); font-weight: 700; }
.notes { padding: 22px; background: #f1ece1; border-left: 3px solid var(--gold); }
.notes h3 { font-size: 1.35rem; }
.notes li { color: #586159; font-size: .88rem; }
footer { padding: 28px 6vw 44px; border-top: 1px solid var(--line); color: #5e6961; text-align: center; font-size: .88rem; line-height: 1.5; }

@media (max-width: 760px) {
  .site-header p, .hero-mark { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 390px; padding-top: 60px; }
  .hero::after { content: "FV"; margin-top: 32px; color: var(--gold); font: 600 2.2rem/1 "Playfair Display", serif; opacity: .75; }
  .toolbar { align-items: stretch; flex-direction: column; gap: 20px; }
  .filters { gap: 7px; margin-top: 24px; }
  .filter { padding: 7px 11px; font-size: .86rem; }
  .recipe-grid { grid-template-columns: 1fr; }
  .detail-content { grid-template-columns: 1fr; padding: 28px 22px; gap: 28px; }
  .detail-hero { min-height: 300px; padding: 28px 22px; }
  .close { right: 16px; }
}
