*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --surface: #141417;
  --border: #242428;
  --border-light: #2e2e34;
  --text: #e2e0d8;
  --text-secondary: #8a8880;
  --text-dim: #4a4a52;
  --gold: #c9a96e;
  --gold-line: rgba(201,169,110,0.28);
  --white: #f0ede6;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Instrument Sans', sans-serif;
  --gutter: 60px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
a { color: var(--gold); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Header / footer ── */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px var(--gutter);
}
.logo {
  font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--white); text-decoration: none;
}
.home-link, .back {
  color: var(--text-secondary); text-decoration: none; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; transition: color 0.25s;
}
.home-link:hover, .back:hover { color: var(--gold); }
.site-footer {
  padding: 40px var(--gutter); margin-top: 80px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; letter-spacing: 0.08em; text-align: center;
}

/* ── Type ── */
h1 {
  font-family: var(--font-serif); font-weight: 300; color: var(--white);
  font-size: clamp(40px, 7vw, 72px); line-height: 1.05; letter-spacing: -0.01em;
}
h1 em { font-style: italic; color: var(--gold); }
h2 {
  font-family: var(--font-serif); font-weight: 400; color: var(--white);
  font-size: 28px; margin-bottom: 18px;
}
h3 {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 24px 0 10px;
}
.eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px; font-weight: 500;
}

/* ── Index ── */
.hero { padding: 60px 0 40px; }
.search input {
  width: 100%; max-width: 520px; margin-top: 36px;
  background: var(--surface); border: 1px solid var(--border-light); color: var(--text);
  font: inherit; font-size: 16px; padding: 14px 18px; border-radius: 2px; outline: none;
  transition: border-color 0.2s;
}
.search input:focus { border-color: var(--gold); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag {
  display: inline-block; font: inherit; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-secondary); text-decoration: none;
  background: none; border: 1px solid var(--border-light); padding: 5px 12px;
  border-radius: 999px; cursor: pointer; transition: all 0.2s;
}
.tag:hover { color: var(--gold); border-color: var(--gold-line); }
.filters:not(.expanded) .tag.rare:not(.active) { display: none; }
.more-tags {
  font: inherit; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  background: none; border: none; color: var(--gold); cursor: pointer; padding: 5px 8px;
}
.tag.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }

.cards {
  list-style: none; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card { border: 1px solid var(--border); transition: border-color 0.25s; }
.card:hover { border-color: var(--gold-line); }
.card[hidden] { display: none; }
.card a {
  display: flex; flex-direction: column; height: 100%; padding: 28px;
  color: inherit; text-decoration: none; transition: background 0.25s;
}
.card a:hover { background: var(--surface); }
.card h2 { font-size: 26px; margin-bottom: 8px; transition: color 0.25s; }
.card a:hover h2 { color: var(--gold); }
.card p { color: var(--text-secondary); font-size: 14px; flex: 1; }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim);
}
.empty { color: var(--text-secondary); padding: 40px 0; text-align: center; }

/* ── Recipe ── */
.recipe { padding-top: 20px; }
.recipe-header { padding: 36px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 48px; }
.recipe-header .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.lede {
  font-family: var(--font-serif); font-size: 22px; font-style: italic;
  color: var(--text-secondary); margin-top: 16px; max-width: 640px; line-height: 1.4;
}
.meta { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 32px; }
.meta dt { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.meta dd { color: var(--white); font-size: 15px; }
.time-note { margin-top: 14px; font-size: 13px; color: var(--text-secondary); font-style: italic; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.scaler {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border-light); border-radius: 999px; padding: 4px;
}
.scaler span { padding: 0 12px; font-size: 13px; color: var(--text-secondary); }
.scaler strong { color: var(--white); font-weight: 600; }
.scaler button, .wake, .pill {
  font: inherit; background: none; color: var(--text); border: none; cursor: pointer;
  transition: all 0.2s;
}
.scaler button {
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1;
}
.scaler button:hover { background: var(--surface); color: var(--gold); }
.wake, .pill {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--border-light); border-radius: 999px; padding: 10px 16px;
  color: var(--text-secondary);
}
.wake:hover, .pill:hover { color: var(--gold); border-color: var(--gold-line); }
.wake[aria-pressed="true"] { color: var(--bg); background: var(--gold); border-color: var(--gold); }

.ingredients-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.ingredients-head h2 { margin-bottom: 0; }
.pill { padding: 7px 14px; white-space: nowrap; }
.recipe-body { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 64px; align-items: start; }
.ingredients { position: sticky; top: 24px; }
.ingredients ul { list-style: none; }
.ingredients li {
  padding: 10px 0 10px 28px; border-bottom: 1px solid var(--border); position: relative;
  cursor: pointer; user-select: none; transition: color 0.2s;
}
.ingredients li::before {
  content: ''; position: absolute; left: 0; top: 15px; width: 14px; height: 14px;
  border: 1px solid var(--border-light); border-radius: 2px; transition: all 0.2s;
}
.ingredients li.done { color: var(--text-dim); text-decoration: line-through; }
.ingredients li.done::before { background: var(--gold); border-color: var(--gold); }
.qty { color: var(--white); font-weight: 600; }
.ingredients li.done .qty { color: inherit; }

.method ol { list-style: none; counter-reset: step; }
.method li {
  counter-increment: step; position: relative; padding: 0 0 28px 56px; cursor: pointer;
  transition: opacity 0.2s;
}
.method li::before {
  content: counter(step); position: absolute; left: 0; top: -6px;
  font-family: var(--font-serif); font-size: 32px; color: var(--gold); line-height: 1;
}
.method li.done { opacity: 0.35; }
.method p, .extra p { margin-bottom: 14px; }

.extra { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); max-width: 720px; }
.extra ul, .extra ol { padding-left: 20px; }
.extra li { margin-bottom: 6px; }
.source { margin-top: 40px; font-size: 13px; color: var(--text-dim); }
code { background: var(--surface); padding: 1px 6px; border-radius: 2px; font-size: 0.9em; }

/* ── Responsive ── */
@media (max-width: 800px) {
  :root { --gutter: 16px; }
  .site-header { padding: 20px var(--gutter); }
  .hero { padding: 32px 0 28px; }
  .recipe-body { grid-template-columns: 1fr; gap: 40px; }
  .ingredients { position: static; }
  .cards { grid-template-columns: 1fr; }
  .meta { gap: 24px; }
}

/* ── Print ── */
@media print {
  :root { --bg: #fff; --text: #111; --white: #000; --text-secondary: #444; --text-dim: #666; --gold: #8a6a2e; --border: #ddd; }
  .site-header, .site-footer, .back, .tools, .pill, .recipe-header .tags { display: none; }
  .recipe-body { grid-template-columns: 1fr 2fr; gap: 32px; }
  .ingredients { position: static; }
  .ingredients li.done, .method li.done { text-decoration: none; opacity: 1; color: inherit; }
}
