/* Panaroma – warm, editorial food design */
:root {
  --bg: #fbf7f1;
  --surface: #ffffff;
  --surface-2: #f4ede3;
  --text: #24201b;
  --muted: #6d655b;
  --border: #ebe2d5;
  --accent: #c4451c;        /* paprika */
  --accent-ink: #ffffff;
  --accent-soft: #fbe7dc;
  --saffron: #e3a032;
  --herb: #3f7d4e;
  --herb-soft: #e3f0e5;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .08);
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120e; --surface: #1f1b16; --surface-2: #29231c; --text: #f3ede5; --muted: #b3a99b; --border: #352d24;
    --accent: #ef7d52; --accent-ink: #1a0f08; --accent-soft: #3a2117; --saffron: #f0b44d; --herb: #7fc08d; --herb-soft: #1e2d21;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: .2em 0 .3em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 1.8em 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .3em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--serif); font-weight: 700; font-size: 1.45rem; letter-spacing: -.02em; }
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .95rem; }
.nav a:hover, .nav a[aria-current] { background: var(--surface-2); }
.nav .pill { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav .pill:hover { background: var(--accent); filter: brightness(1.06); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font: 600 1rem var(--sans); background: var(--accent); color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.small { padding: 8px 14px; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font: 500 .9rem var(--sans); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"], .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 .75rem var(--sans); background: var(--herb-soft); color: var(--herb); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 48px 0 24px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede { font-size: 1.15rem; color: var(--muted); max-width: 34ch; }
.search { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px; box-shadow: var(--shadow); max-width: 520px; margin: 22px 0 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: 1rem var(--sans); color: var(--text); padding: 8px 14px; outline: none; }
.collage { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 180px 180px; gap: 12px; }
.collage img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.collage img:first-child { grid-row: span 2; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 28px; } .collage { grid-template-rows: 140px 140px; } }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.rcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s; }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rcard .img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.rcard img { width: 100%; height: 100%; object-fit: cover; }
.rcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rcard .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.rcard .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.rcard .match { font-size: .82rem; color: var(--herb); font-weight: 600; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.cta-band { display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: center; background: var(--text); color: var(--bg); border-radius: 24px; padding: 36px; margin: 56px 0; }
.cta-band h2 { margin-top: 0; color: var(--bg); }
.cta-band p { color: color-mix(in srgb, var(--bg) 78%, transparent); }
.cta-band .btn { background: var(--saffron); color: #241505; }
@media (max-width: 860px) { .cta-band { grid-template-columns: 1fr; padding: 26px; } }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.regions .panel h3 { margin-bottom: 10px; }

/* Recipe page */
.crumbs { font-size: .88rem; color: var(--muted); margin: 22px 0 0; }
.crumbs a { color: var(--muted); }
.recipe-head { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; margin: 12px 0 28px; }
.recipe-head .intro { font-size: 1.12rem; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 92px; }
.fact b { display: block; font-size: 1.05rem; }
.fact span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.photo { margin: 0; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow); }
.photo figcaption { font-size: .75rem; color: var(--muted); margin-top: 6px; }
.photo figcaption a { color: var(--muted); }
@media (max-width: 860px) { .recipe-head { grid-template-columns: 1fr; } .recipe-head .photo { order: -1; } }
.cook { display: grid; grid-template-columns: 360px 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .cook { grid-template-columns: 1fr; } }
.ingredients { position: sticky; top: 84px; }
.ingredients h2, .method h2 { margin-top: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); color: var(--text); width: 36px; height: 36px; font-size: 1.1rem; cursor: pointer; }
.stepper output { min-width: 84px; text-align: center; font-weight: 600; font-size: .92rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 8px 12px; font: 500 .85rem var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list input { accent-color: var(--herb); width: 18px; height: 18px; margin-top: 3px; flex: none; }
.ing-list .q { font-weight: 700; white-space: nowrap; }
.ing-list li.done span { text-decoration: line-through; color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 18px 54px; cursor: pointer; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 1rem var(--serif); display: grid; place-items: center; }
.steps li.done { color: var(--muted); }
.steps li.done::before { content: "✓"; background: var(--herb-soft); color: var(--herb); }
.tip { background: var(--herb-soft); border-radius: 14px; padding: 16px 18px; margin: 10px 0 22px; }
.tip b { color: var(--herb); }
.allergens { font-size: .9rem; }
.fav { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 10px 16px; font: 600 .92rem var(--sans); cursor: pointer; }
.fav[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 18px 0 24px; }
.filters input[type=search], .filters select { font: .95rem var(--sans); color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; }
.filters input[type=search] { flex: 1 1 220px; }
.count { color: var(--muted); font-size: .9rem; margin: -8px 0 16px; }

/* Pantry */
.pantry-picks { display: flex; flex-wrap: wrap; gap: 8px; max-height: 340px; overflow: auto; padding: 4px; }

/* Chef */
.chat { display: flex; flex-direction: column; gap: 14px; min-height: 260px; }
.msg { max-width: 760px; padding: 14px 18px; border-radius: 18px; line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.bot .grid { margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.composer { display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 10px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; resize: none; border: 0; background: transparent; color: var(--text); font: 1rem var(--sans); min-height: 48px; outline: none; padding: 6px 8px; }
.quota { font-size: .85rem; color: var(--muted); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* Premium */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 26px 0; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; }
.plan.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.plan .price { font: 700 2.6rem var(--serif); }
.plan ul { padding-left: 0; list-style: none; }
.plan li { padding: 6px 0 6px 28px; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--herb); font-weight: 700; }
.plan li.no::before { content: "–"; color: var(--muted); }
.license { display: flex; gap: 8px; flex-wrap: wrap; }
.license input { flex: 1 1 260px; font: 1rem var(--sans); padding: 11px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }

/* Planner */
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.day h3 { font-size: 1rem; }
.day select { width: 100%; margin: 4px 0 8px; font: .9rem var(--sans); padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.shop { columns: 2 240px; padding-left: 18px; }
.locked { position: relative; }
.locked::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, var(--bg) 85%); pointer-events: none; }

/* Prose & footer */
.prose { max-width: 720px; }
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: space-between; }
.site-footer a { color: var(--muted); margin-right: 16px; }
@media print {
  .site-header, .site-footer, .controls, .fav, .noprint, .related { display: none !important; }
  body { background: #fff; color: #000; }
  .cook { grid-template-columns: 1fr 1.6fr; }
  .ingredients { position: static; }
}
