:root {
  color-scheme: light dark;
  --bg: light-dark(#fdf9f0, #171412);
  --surface: light-dark(#ffffff, #221e1b);
  --text: light-dark(#221c19, #f3ece0);
  --muted: light-dark(#665b53, #bcb0a2);
  --edge: light-dark(#e6dccb, #3b3530);
  --accent: light-dark(#b23a1e, #ff9a7a);
  --on-accent: light-dark(#ffffff, #221c19);
  --red: light-dark(#fbddd3, #45261e);
  --yellow: light-dark(#fcecbb, #423517);
  --green: light-dark(#d5efdf, #1e3a2c);
  --pink: light-dark(#f9dde9, #43242f);
  --blue: light-dark(#d8eafa, #1e3144);
  --border: 1px solid var(--edge);
  --radius: .75rem;
  --lift: 0 8px 22px rgb(0 0 0 / .1);
  --display: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 1.0625rem/1.6 var(--display); }
header.site, main { max-width: 66rem; margin: 0 auto; padding-inline: 1.25rem; }
main { padding-block: 2rem 5rem; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, .brand { font-weight: 700; line-height: 1.15; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: -.02em; margin: .3em 0; }
h2 { font-size: 1.6rem; letter-spacing: -.01em; }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; }

header.site { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.1rem; }
header.site a { text-decoration: none; }
.brand { font-size: 1.4rem; color: var(--text); background: var(--yellow); border-radius: var(--radius); padding: .3rem .8rem; }
header.site nav { display: flex; gap: .75rem; }
header.site nav a { color: var(--text); font-weight: 600; padding: .25rem .7rem; border: 1px solid transparent; border-radius: var(--radius); }
header.site nav a:hover { border-color: var(--edge); }

input, button { font: inherit; font-weight: 700; color: var(--text); background: var(--surface); border: var(--border); border-radius: var(--radius); padding: .5rem .8rem; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }

.hero-block { border-radius: 1.25rem; background: var(--red); color: var(--text); border: var(--border); padding: clamp(1.25rem, 5vw, 3.5rem); margin-bottom: 2.5rem; }
.hero-block h1 { margin-top: 0; }
#search { width: min(100%, 36rem); padding: .9rem 1.1rem; background: var(--surface); }
#search::placeholder { color: var(--muted); }
.hero-block .tags { margin-bottom: 0; margin-top: 1.5rem; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags a { text-transform: capitalize; border-radius: 2rem; background: var(--surface); color: var(--text); border: var(--border); padding: .1rem .7rem; font-size: .8rem; font-weight: 600; text-decoration: none; }
.tags a:hover { border-color: var(--accent); }

.cards { list-style: none; padding: 0; display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.cards > li, .tag-index li { --block: var(--yellow); }
:is(.cards > li, .tag-index li):nth-child(4n+2) { --block: var(--green); }
:is(.cards > li, .tag-index li):nth-child(4n+3) { --block: var(--pink); }
:is(.cards > li, .tag-index li):nth-child(4n+4) { --block: var(--blue); }
.cards > li { border-radius: var(--radius); overflow: hidden; position: relative; display: flex; flex-direction: column; background: var(--block); color: var(--text); border: var(--border); transition: transform .12s, box-shadow .12s; }
.cards > li:hover { transform: translateY(-2px); }
.cards > li:focus-within { outline: 4px solid var(--accent); outline-offset: 8px; }
.cards img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-bottom: var(--border); }
.cards .body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem; }
.cards h2 { margin: 0; font-size: 1.5rem; }
.cards h2 a { color: var(--text); text-decoration: none; }
.cards h2 a::after { content: ""; position: absolute; inset: 0; }
.cards p { margin: .5rem 0; }
.cards .meta { display: flex; gap: 1rem; margin-top: auto; padding-top: 1.5rem; font-size: .8rem; font-weight: 600; }
.cards .tags { position: relative; z-index: 1; align-self: flex-start; }
#empty { font-size: 1.4rem; font-weight: 600; }

.tag-index { list-style: none; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.tag-index a { text-transform: capitalize; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; min-height: 5rem; border-radius: var(--radius); padding: 1rem 1.25rem; background: var(--block); color: var(--text); border: var(--border); text-decoration: none; font-size: 1.3rem; font-weight: 700; }
.tag-index a:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.tag-index small { font-size: 1.75rem; line-height: .9; }

.intro { border-radius: 1.25rem; background: var(--yellow); color: var(--text); border: var(--border); padding: clamp(1.25rem, 4vw, 2.75rem); }
.intro .tags { margin: 0; }
.intro h1 { margin: .35em 0 .25em; }
.lede { font-size: 1.25rem; margin-top: 0; }
.facts { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 0; }
.facts div { border-radius: var(--radius); background: var(--surface); border: var(--border); padding: .4rem 1rem; min-width: 7rem; }
.facts dt { font-size: .7rem; font-weight: 600; }
.facts dd { margin: 0; font-size: 1.4rem; font-weight: 700; }
.hero { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: var(--border); margin-top: 1.25rem; }

.columns { display: grid; gap: 2.5rem; align-items: start; margin-top: 2.5rem; }
@media (min-width: 48rem) {
  .columns { grid-template-columns: 22rem 1fr; gap: 3rem; }
  .panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.panel { border-radius: var(--radius); background: var(--surface); border: var(--border); padding: 1.25rem; }
.panel h2, .method h2 { margin: 0 0 1rem; }
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper label { margin-right: auto; font-weight: 600; font-size: .8rem; }
.stepper button { width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.3rem; }
#servings { width: 3.75rem; height: 2.75rem; text-align: center; padding-inline: .2rem; appearance: textfield; }
#servings::-webkit-inner-spin-button { appearance: none; }
.ingredients { list-style: none; padding: 0; }
.ingredients li { padding: .55rem 0; border-bottom: var(--border); }
#cook { width: 100%; padding: .8rem; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
#cook:hover { filter: brightness(1.08); }
#cook[aria-pressed="true"] { background: var(--green); color: var(--text); }
#wake { margin: .6rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
#wake:empty { display: none; }

.method ol { list-style: none; padding: 0; counter-reset: step; }
.method ol > li { counter-increment: step; position: relative; min-height: 3.5rem; margin-bottom: 1.25rem; padding: .35rem 0 0 4.5rem; font-size: 1.15rem; }
.method ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--text); border: var(--border); font-size: 1.15rem; font-weight: 700; }
.method ol > li:nth-child(3n+2)::before { background: var(--pink); }
.method ol > li:nth-child(3n+3)::before { background: var(--blue); }

.cooking .recipe { font-size: 1.2rem; }
.cooking li label { display: flex; gap: .75rem; align-items: baseline; cursor: pointer; }
.cooking li input { width: 1.3rem; height: 1.3rem; flex: none; accent-color: var(--accent); }
.cooking li input:checked + span { text-decoration: line-through; opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .cards > li { transition: none; }
  .cards > li:hover, .tag-index a:hover { transform: none; }
}

