:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f0ece3;
  --ink: #12151c;
  --muted: #5d6573;
  --line: #e2ddd2;
  --accent: #c2410c;
  --accent-soft: #fbe7d9;
  --gold: #e8a54b;
  --dark: #0b0f15;
  --dark-2: #111821;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18,21,28,.05), 0 6px 24px rgba(18,21,28,.06);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f15;
    --surface: #111821;
    --surface-2: #17202c;
    --ink: #e8eef7;
    --muted: #9aa8ba;
    --line: #263548;
    --accent: #f08a4b;
    --accent-soft: #2a1c14;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; }
#main { outline: none; min-height: 70vh; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--dark); color: #e8eef7; border-bottom: 1px solid #1d2733; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--gold); color: var(--dark); display: grid; place-items: center; font: 700 18px var(--serif); }
.brand-text { font-size: 17px; letter-spacing: .01em; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 15px; color: #c9d3e0; }
.nav a:hover, .nav a.active { background: #1a2330; color: #fff; }
.nav-ext { color: var(--gold) !important; }
.fav-count { background: var(--gold); color: var(--dark); border-radius: 99px; font-size: 12px; padding: 0 7px; margin-left: 4px; font-weight: 700; }
.menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--dark); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid #1d2733; }
  .nav.open { display: flex; }
}

/* Hero */
.hero { background: radial-gradient(1200px 400px at 80% -10%, #2a1a10 0%, transparent 60%), var(--dark); color: #e8eef7; padding: 64px 0 56px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--gold); margin-bottom: 14px; }
.hero h1 { font-size: clamp(34px, 5.5vw, 60px); max-width: 15ch; }
.hero p { color: #9aa8ba; max-width: 58ch; font-size: 18px; }
.search { margin-top: 28px; display: flex; max-width: 620px; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.search input { flex: 1; border: 0; padding: 16px 18px; font: inherit; font-size: 17px; color: #12151c; outline: none; min-width: 0; }
.search span { display: grid; place-items: center; padding: 0 16px; color: #5d6573; font-size: 20px; }
.stats { display: flex; gap: 36px; margin-top: 36px; flex-wrap: wrap; }
.stats div strong { display: block; font: 700 30px var(--serif); color: #fff; }
.stats div span { color: #9aa8ba; font-size: 14px; }

/* Filters */
.filters { padding: 28px 0 8px; display: grid; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 14px; border-radius: 99px; font: 500 14px var(--sans); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.result-line { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 14px; gap: 12px; flex-wrap: wrap; }
.result-line select { font: inherit; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }

/* Section */
.section { padding: 40px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 28px; margin: 0; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-art { height: 150px; display: grid; place-items: center; font-size: 68px; position: relative; }
.photo { background-size: cover; background-position: center; }
.card-art.photo { height: 170px; }
.more { display: flex; justify-content: center; margin-top: 28px; }
.source { font-size: 14px; border-top: 1px solid var(--line); padding-top: 16px; }
.source a { color: var(--accent); }
.card-flag { position: absolute; top: 12px; left: 12px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-country { font-size: 13px; color: var(--muted); font-weight: 500; }
.card h3 { font-size: 21px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 10px; display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.flag { width: 28px; height: 20px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.12); vertical-align: middle; background: #ddd; }
.flag.lg { width: 42px; height: 30px; }

/* Featured */
.featured { display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; text-decoration: none; }
.featured-art { display: grid; place-items: center; font-size: 140px; min-height: 280px; }
.featured-body { padding: 36px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.featured-body h3 { font-size: 34px; margin: 0; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured-art { min-height: 180px; font-size: 100px; } .featured-body { padding: 24px; } }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Recipe page */
.recipe-hero { padding: 40px 0 32px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.recipe-top { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: center; }
.recipe-top h1 { font-size: clamp(34px, 5vw, 54px); }
.recipe-country { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; text-decoration: none; margin-bottom: 14px; }
.recipe-lead { font-size: 19px; color: var(--muted); max-width: 60ch; }
.recipe-art { aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center; font-size: 140px; }
.meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.meta { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.meta small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.meta strong { font-size: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 820px) { .recipe-top { grid-template-columns: 1fr; } .recipe-art { order: -1; aspect-ratio: auto; height: 180px; font-size: 100px; } }

.recipe-body { display: grid; grid-template-columns: 360px 1fr; gap: 48px; padding: 40px 0; align-items: start; }
@media (max-width: 900px) { .recipe-body { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.ingredients { position: sticky; top: 84px; }
@media (max-width: 900px) { .ingredients { position: static; } }
.panel h2 { font-size: 24px; }
.servings { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.servings button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 18px; cursor: pointer; }
.servings strong { color: var(--ink); font-size: 18px; min-width: 22px; text-align: center; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { border-top: 1px solid var(--line); }
.ing-list label { display: flex; gap: 12px; padding: 10px 0; cursor: pointer; align-items: baseline; }
.ing-list input { accent-color: var(--accent); transform: translateY(2px); }
.ing-list .qty { font-weight: 700; min-width: 74px; white-space: nowrap; }
.ing-list input:checked ~ span { text-decoration: line-through; opacity: .5; }
.ing-group { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--accent); padding: 14px 0 6px; border-top: 0 !important; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); cursor: pointer; }
.steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font: 700 17px var(--serif); }
.steps li.done { opacity: .45; }
.steps li.done::before { content: "✓"; background: var(--accent); color: #fff; }
.prose h2 { font-size: 26px; margin-top: 8px; }
.prose p { margin: 0 0 1em; }
.block { margin-bottom: 40px; }
.tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tips li { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.history h2 { font-size: 22px; }
.tagline { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12.5px; background: var(--surface-2); padding: 3px 10px; border-radius: 99px; color: var(--muted); }

/* Countries */
.region-block { margin-bottom: 36px; }
.region-block h2 { font-size: 26px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.country { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.country:hover { border-color: var(--accent); }
.country span { margin-left: auto; color: var(--muted); font-size: 13px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty div { font-size: 54px; }
.page-head { padding: 40px 0 10px; }
.page-head h1 { font-size: clamp(30px, 4.5vw, 46px); }

/* Footer */
.footer { background: var(--dark); color: #c9d3e0; margin-top: 60px; padding: 48px 0 24px; }
.footer .muted { color: #9aa8ba; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-inner p { max-width: 42ch; font-size: 14px; }
.footer h4 { margin: 0 0 10px; color: #fff; font-size: 14px; }
.footer-inner > div > a { display: block; text-decoration: none; padding: 3px 0; font-size: 14px; }
.footer-inner > div > a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid #1d2733; margin-top: 32px; padding-top: 20px; font-size: 13px; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }

@media print {
  .topbar, .footer, .actions, .recipe-art, .related, .crumbs { display: none !important; }
  body { background: #fff; color: #000; }
  .recipe-body { grid-template-columns: 1fr 1.6fr; gap: 24px; }
  .panel, .history { border: 0; padding: 0; }
  .steps li.done { opacity: 1; }
}
