:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --text: #2a2a24;
  --muted: #6b6a5e;
  --line: #e4dccb;
  --accent: #2f5d3a;
  --accent-soft: #e3ecdf;
  --warm: #c8643b;
  --shadow: 0 1px 2px rgb(60 50 30 / 6%), 0 6px 20px rgb(60 50 30 / 8%);
  --radius: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a16;
    --surface: #20241f;
    --text: #ece8dd;
    --muted: #a3a294;
    --line: #343a32;
    --accent: #8cc497;
    --accent-soft: #263529;
    --warm: #e38a62;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 20px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font: 700 1.2rem var(--serif); }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-header nav a:hover { color: var(--accent); }
.site-footer { margin-top: 64px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* Home hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0 0 24px; }
.search input {
  width: 100%; max-width: 560px; padding: 14px 18px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chips */
.filters, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.filters { justify-content: center; margin: 8px 0 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 500 .9rem var(--sans); text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.chip small { color: var(--muted); }
.result-count { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 16px; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* Recipe grid cards */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card[hidden] { display: none; }
.card-link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card-link:hover { transform: translateY(-3px); }
.card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--accent-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--warm) 18%, var(--accent-soft)));
}
.card-placeholder span { font: 700 3.5rem var(--serif); color: var(--accent); opacity: .5; }
.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--surface); color: var(--text);
  font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin: 0 0 6px; font-size: 1.2rem; }
.card-desc {
  margin: 0 0 12px; color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin: auto 0 0; display: flex; gap: 4px 14px; font-size: .85rem; color: var(--muted); min-width: 0; }
.card-meta span:first-child { white-space: nowrap; flex: none; }
.card-meta span + span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Generic page */
.page { padding-top: 32px; }
.prose { max-width: 680px; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 24px 0 16px; display: flex; gap: 8px; }
.crumbs a { color: var(--muted); }

/* Recipe page card */
.recipe { max-width: 960px; }
.recipe-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.recipe-hero.has-image { display: grid; }
.recipe-image { width: 100%; max-height: 460px; object-fit: cover; }
.recipe-hero.no-image { background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--warm) 15%, var(--accent-soft))); }
.recipe-heading { padding: 32px 32px 8px; }
.eyebrow { margin: 0 0 6px; color: var(--warm); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.recipe-heading h1 { margin: 0 0 10px; font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
.lede { margin: 0 0 16px; color: var(--muted); font-size: 1.08rem; max-width: 60ch; }
.recipe-stats {
  display: flex; flex-wrap: wrap; margin: 0; padding: 0 32px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.recipe-stats div { padding: 14px 24px 14px 0; margin-right: 24px; }
.recipe-stats dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.recipe-stats dd { margin: 0; font-weight: 600; }
.recipe-actions { padding: 16px 32px 0; }
.btn {
  font: 600 .9rem var(--sans); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent); color: var(--surface); }
.recipe-columns { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 40px; padding: 8px 32px 24px; }
.recipe-columns h2, .notes h2 { font-size: 1.4rem; margin: 20px 0 12px; }
.recipe-columns h3 { font: 600 .85rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--warm); margin: 18px 0 6px; }
.ingredients { background: var(--accent-soft); border-radius: 12px; padding: 4px 20px 16px; align-self: start; margin-top: 16px; }
.ingredients h2 { margin-top: 16px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.checklist input { accent-color: var(--accent); width: 1rem; height: 1rem; flex: none; translate: 0 2px; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 48px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--surface); font: 700 .95rem var(--serif);
}
.notes { margin: 0 32px 24px; padding: 4px 20px 8px; border-left: 4px solid var(--warm); background: color-mix(in srgb, var(--warm) 8%, var(--surface)); border-radius: 0 12px 12px 0; }
.recipe-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 32px 28px; border-top: 1px solid var(--line); }

@media (max-width: 720px) {
  .recipe-heading { padding: 24px 20px 8px; }
  .recipe-stats, .recipe-actions, .recipe-tags { padding-left: 20px; padding-right: 20px; }
  .recipe-columns { grid-template-columns: 1fr; gap: 8px; padding: 8px 20px 20px; }
  .notes { margin: 0 20px 20px; }
  .recipe { padding: 0; }
  .recipe .crumbs { padding: 0 16px; }
  .recipe-card { border-radius: 0; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --accent: #000; --accent-soft: #fff; --shadow: none; }
  .site-header, .site-footer, .crumbs, .recipe-actions, .recipe-tags, .skip { display: none; }
  .recipe-image { max-height: 240px; }
  .recipe-card { box-shadow: none; }
  .recipe-columns { grid-template-columns: 2fr 3fr; }
  .ingredients { border: 1px solid #ccc; }
  .checklist input { display: none; }
  .steps li::before { background: none; color: #000; border: 1px solid #000; }
  .steps li, .checklist li { break-inside: avoid; }
}

.image-note { margin: 6px 32px 0; font-size: .75rem; color: var(--muted); text-align: right; }
@media (max-width: 720px) { .image-note { margin: 6px 20px 0; } }
.notes h4 { font: 600 .8rem var(--sans); letter-spacing: .06em; color: var(--warm); margin: 18px 0 4px; }
.notes p { margin: 0 0 12px; }

/* ===== Home redesign ===== */
:root { --deep: #1f3d28; --deep-2: #2b5236; --lime: #c9e265; --on-deep: #f4f1e6; }
@media (prefers-color-scheme: dark) { :root { --deep: #12241a; --deep-2: #1b3324; --lime: #c9e265; --on-deep: #ece8dd; } }

.home .site-header { background: var(--deep); border-bottom-color: transparent; }
.home .site-header .brand { color: var(--on-deep); }
.home .site-header nav a { color: color-mix(in srgb, var(--on-deep) 75%, transparent); }
.home .site-header nav a:hover { color: var(--lime); }

.hero-x {
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--lime) 18%, transparent), transparent 60%),
    linear-gradient(160deg, var(--deep) 0%, var(--deep-2) 100%);
  color: var(--on-deep);
  padding: 56px 0 72px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--lime); margin: 0 0 14px; }
.hero-copy h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.04; margin: 0 0 18px; letter-spacing: -.01em; }
.hero-copy h1 em { font-style: italic; color: var(--lime); }
.hero-sub { font-size: 1.12rem; line-height: 1.6; max-width: 34em; color: color-mix(in srgb, var(--on-deep) 85%, transparent); margin: 0 0 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-solid, .btn-ghost { display: inline-flex; align-items: center; padding: 13px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.btn-solid { background: var(--lime); color: #1a2a12; }
.btn-solid:hover { transform: translateY(-2px); }
.btn-ghost { color: var(--on-deep); border: 1px solid color-mix(in srgb, var(--on-deep) 35%, transparent); }
.btn-ghost:hover { border-color: var(--lime); color: var(--lime); }

.hero-feature { position: relative; display: block; text-decoration: none; color: inherit; min-height: 380px; }
.stack img {
  position: absolute; width: 46%; aspect-ratio: 1; object-fit: cover; border-radius: 18px;
  box-shadow: 0 20px 40px rgb(0 0 0 / 35%); border: 4px solid color-mix(in srgb, var(--on-deep) 90%, transparent);
  transition: transform .4s ease;
}
.stack .stack-0 { top: -6px; right: -4%; transform: rotate(7deg); }
.stack .stack-1 { bottom: -10px; right: 2%; transform: rotate(-5deg); width: 40%; }
.stack .stack-2 { top: 30%; right: -10%; transform: rotate(14deg); width: 34%; opacity: .9; }
.stack .stack-3 { display: none; }
.feature-card {
  position: relative; margin: 0; width: 78%; border-radius: 22px; overflow: hidden;
  box-shadow: 0 30px 60px rgb(0 0 0 / 40%); transform: rotate(-2deg); transition: transform .35s ease;
  background: var(--surface);
}
.feature-card img { width: 100%; aspect-ratio: 4 / 3.4; object-fit: cover; transition: transform .6s ease; }
.hero-feature:hover .feature-card { transform: rotate(0deg) translateY(-6px); }
.hero-feature:hover .feature-card img { transform: scale(1.04); }
.hero-feature:hover .stack-0 { transform: rotate(10deg) translateX(8px); }
.hero-feature:hover .stack-1 { transform: rotate(-8deg) translateY(6px); }
.feature-card figcaption {
  position: absolute; inset: auto 0 0 0; padding: 48px 20px 18px; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / 78%));
  display: flex; flex-direction: column; gap: 6px;
}
.feature-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); font-weight: 700; }
.feature-card strong { font: 700 1.35rem/1.2 var(--serif); }
.feature-meta { display: flex; gap: 12px; align-items: center; font-size: .88rem; }

.protein-pill {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--lime); color: #1a2a12; font-size: .78rem; padding: 4px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 25%);
}
.protein-pill strong { font-size: .95rem; }
.protein-pill.inline { position: static; box-shadow: none; }

.stats-band { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stats-grid div { padding: 26px 8px; display: flex; flex-direction: column; gap: 2px; }
.stats-grid div + div { border-left: 1px solid var(--line); }
.stats-grid strong { font: 700 2.1rem/1 var(--serif); color: var(--accent); }
.stats-grid span { font-size: .88rem; color: var(--muted); }

.shelf { margin-top: 56px; }
.shelf-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.shelf-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.shelf-head p { margin: 0; color: var(--muted); }

.row {
  list-style: none; margin: 0 -16px; padding: 4px 16px 18px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 22%);
  gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  scroll-padding-inline: 16px;
}
.row > .card { scroll-snap-align: start; }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.card-media { overflow: hidden; }
.card-media img { transition: transform .5s ease; }
.card-link:hover .card-media img { transform: scale(1.06); }
.card-link:hover { box-shadow: 0 2px 4px rgb(60 50 30 / 8%), 0 14px 32px rgb(60 50 30 / 16%); }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.cat-tile {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden;
  background: var(--deep); color: #fff; text-decoration: none; box-shadow: var(--shadow);
}
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; opacity: .85; }
.cat-tile:hover img { transform: scale(1.07); }
.cat-tile span {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px;
  background: linear-gradient(transparent 35%, rgb(0 0 0 / 70%));
}
.cat-tile strong { font: 700 1.3rem var(--serif); }
.cat-tile small { opacity: .85; }

.browse { margin-top: 56px; }
.browse .search { margin-bottom: 14px; }
.browse .search input { max-width: none; box-shadow: none; }
.browse .filters { justify-content: flex-start; }
.browse .result-count { text-align: left; }

.stat-protein dd { color: var(--accent); }
.nutrition-line { margin: 10px 32px 0; font-size: .82rem; color: var(--muted); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-feature { min-height: 0; max-width: 460px; }
  .stack img { width: 40%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid div:nth-child(3) { border-left: 0; }
  .stats-grid div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .row { grid-auto-columns: 72%; }
  .nutrition-line { margin: 10px 20px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Nutrition panel */
.nutrition { margin: 20px 32px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.nutrition-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nutrition-head h2 { margin: 0; font-size: 1.15rem; }
.nutrition-head small { font: 400 .85rem var(--sans); color: var(--muted); }
.nut-badge { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.nut-badge.verified { background: var(--accent); color: var(--surface); }
.nut-badge.estimate { border: 1px dashed var(--muted); color: var(--muted); }
.nutrition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0; }
.nutrition-grid div { background: var(--surface); border-radius: 10px; padding: 10px 12px; }
.nutrition-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.nutrition-grid dd { margin: 2px 0 0; font: 700 1.35rem var(--serif); }
.nutrition-grid dd span { font: 500 .8rem var(--sans); color: var(--muted); margin-left: 2px; }
.nutrition-grid .hi { background: var(--lime); }
.nutrition-grid .hi dt, .nutrition-grid .hi dd, .nutrition-grid .hi dd span { color: #1a2a12; }
.nutrition .nutrition-line { margin: 12px 0 0; }
.nutrition-line.solo { margin: 14px 32px 0; }
.protein-pill .tick { font-weight: 700; }
@media (max-width: 720px) { .nutrition { margin: 16px 20px 0; } .nutrition-line.solo { margin: 14px 20px 0; } }

/* About page */
.about { max-width: 760px; }
.about-head { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center; margin-bottom: 12px; }
.about-photo { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.about-head h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 2.8rem); }
.kicker-dark { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; color: var(--warm); margin: 0 0 6px; }
.about .prose { max-width: none; }
.about .prose h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.about .prose p { font-size: 1.05rem; }
@media (max-width: 600px) {
  .about-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .about-photo { width: 150px; height: 150px; }
}
