:root {
  --primary: #f4511e;
  --primary-dark: #c6350c;
  --accent: #ffab91;
  --ink: #2d211d;
  --muted: #6f625c;
  --surface: #ffffff;
  --surface-soft: #fff8f4;
  --page: #fffdfb;
  --border: #eadfd9;
  --shadow: 0 18px 50px rgba(74, 39, 24, .10);
  --radius: 24px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #fff7f2;
  --muted: #d2c4bc;
  --surface: #241c19;
  --surface-soft: #2d231f;
  --page: #181311;
  --border: #493a34;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 16px/1.65 Outfit, system-ui, sans-serif; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .16em; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #1565c0; outline-offset: 3px; }
[hidden] { display: none !important; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 820px; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -100px; padding: 10px 16px; background: var(--ink); color: var(--surface); }
.skip-link:focus { top: 16px; }

.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 93%, transparent); backdrop-filter: blur(14px); }
.nav-row { min-height: 76px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 25px/1 'Playfair Display', serif; }
.brand > span > span, .footer-brand span { color: var(--primary); }
.brand img { border-radius: 10px; }
.desktop-nav { display: flex; gap: 28px; margin-left: auto; }
.desktop-nav a { text-decoration: none; font-weight: 600; }
.desktop-nav a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-link, .theme-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 20px; }
.compact-menu { display: none; position: relative; }
.compact-menu summary { list-style: none; border: 1px solid var(--border); border-radius: 999px; padding: 8px 15px; font-weight: 700; background: var(--surface); }
.compact-menu summary::-webkit-details-marker { display: none; }
.compact-menu nav { position: absolute; right: 0; top: 50px; width: 220px; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.compact-menu nav a { display: block; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.compact-menu nav a:hover { background: var(--surface-soft); color: var(--primary); }

.button, .save-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 999px; background: var(--primary); color: #fff; padding: 13px 22px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgba(244,81,30,.24); }
.button:hover, .save-button:hover { background: var(--primary-dark); }
.save-button[aria-pressed="true"] { background: var(--ink); }
.eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.16; margin: 0 0 .65em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; }
.lead { font-size: clamp(1.08rem, 2vw, 1.3rem); color: var(--muted); }
.page-shell { padding-block: 28px 90px; }
.page-header { max-width: 850px; margin: 35px 0 52px; }
.page-header p { color: var(--muted); font-size: 1.15rem; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.breadcrumb a:hover { color: var(--primary); }

.home-hero { min-height: min(700px, calc(100vh - 76px)); position: relative; display: grid; align-items: center; overflow: hidden; color: #fff; background: #3a2119; }
.hero-images, .hero-images::after, .hero-images img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-images img { object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.hero-images img.active { opacity: 1; }
.hero-images::after { content: ''; z-index: 2; background: linear-gradient(90deg, rgba(25,12,8,.84), rgba(25,12,8,.3)); }
.hero-copy { position: relative; z-index: 3; padding-block: 85px; }
.hero-copy h1 { max-width: 780px; font-size: clamp(3rem, 8vw, 6.5rem); text-shadow: 0 5px 30px rgba(0,0,0,.35); }
.hero-copy h1 span { color: var(--accent); }
.hero-copy > p:not(.eyebrow) { max-width: 620px; font-size: 1.22rem; }
.home-section, .surface-section { padding-block: 90px; }
.surface-section { background: var(--surface-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > a { color: var(--primary); font-weight: 700; }

.tile-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 5px; padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); text-decoration: none; box-shadow: 0 8px 25px rgba(74,39,24,.05); }
.tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.tile strong { font-size: 1.1rem; }
.tile span { color: var(--muted); }
.tile .tile-icon { color: inherit; font-size: 2rem; }
.cuisine-tiles { grid-template-columns: repeat(4, minmax(0,1fr)); }

.recipe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; }
.recipe-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 26px rgba(74,39,24,.07); }
.card-image { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.recipe-card:hover .card-image img { transform: scale(1.035); }
.card-body { padding: 22px; }
.card-body h2 { margin-top: 8px; font-size: 1.42rem; }
.card-body h2 a { text-decoration: none; }
.card-body h2 a:hover { color: var(--primary); }
.card-body p { color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; color: var(--muted); font-weight: 600; font-size: .9rem; }

.filters { display: grid; grid-template-columns: 2fr repeat(3,1fr); align-items: end; gap: 14px; padding: 22px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.filters label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.filters input[type="search"], .filters select { min-width: 0; width: 100%; min-height: 45px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); color: var(--ink); }
.checkbox-filter { display: flex !important; align-items: center; flex-direction: row; min-height: 45px; }
.text-button { border: 0; background: none; color: var(--primary); font-weight: 700; justify-self: start; padding: 4px; }
.results-count { margin: 0 0 20px; color: var(--muted); }

.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
.directory-card { padding: 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.directory-card > span { font-size: 2.4rem; }
.directory-card h2 { margin-top: 12px; }
.directory-card p { color: var(--muted); }
.directory-card strong { color: var(--primary); }
.directory-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.recipe-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 48px; align-items: center; margin: 36px 0 65px; }
.recipe-hero-image { aspect-ratio: 4/3; border-radius: 30px; overflow: hidden; background: var(--surface-soft); box-shadow: var(--shadow); }
.recipe-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.recipe-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 26px 0; }
.recipe-facts div { padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.recipe-facts dt { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; }
.recipe-facts dd { margin: 2px 0 0; font-weight: 700; }
.recipe-columns { display: grid; grid-template-columns: 340px minmax(0,1fr); gap: 55px; align-items: start; }
.ingredients { position: sticky; top: 105px; padding: 28px; border-radius: var(--radius); background: var(--surface-soft); border: 1px solid var(--border); }
.ingredients > p { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { margin-top: 11px; }
.checklist label { display: flex; gap: 10px; cursor: pointer; }
.checklist input { width: 19px; height: 19px; margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.step { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 18px; margin-bottom: 34px; }
.step > span { display: grid; place-items: center; align-self: start; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.step h3 { margin-top: 8px; }
.step-copy { color: var(--muted); }
.step-copy img, .prose img { width: min(100%, 680px); aspect-ratio: 16/9; object-fit: cover; margin: 24px auto; border-radius: 18px; }
.tips, .recipe-notes, .faq, .related { margin-top: 70px; }
.tips { padding: 34px; border-left: 5px solid var(--primary); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface-soft); }
.tips li + li { margin-top: 12px; }
.recipe-notes { padding: 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.prose { color: var(--muted); }
.prose a { color: var(--primary); font-weight: 700; }
.faq details { border-top: 1px solid var(--border); padding: 18px 0; }
.faq summary { font-weight: 700; font-size: 1.05rem; }
.faq p { color: var(--muted); }

.prose-page { padding: 20px 0; }
.prose-page > p, .prose-page > ul { color: var(--muted); }
.prose-page h2 { margin-top: 1.5em; }
.contact-card { margin-top: 32px; padding: 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.contact-card a { color: var(--primary); font-weight: 700; }
.error-page { min-height: 65vh; display: grid; place-content: center; justify-items: start; padding-block: 80px; }
.error-code { margin: 0; color: var(--primary); font: 800 clamp(5rem,18vw,11rem)/.8 'Playfair Display',serif; }

.site-footer { padding: 70px 0 28px; background: #241915; color: #f9ede7; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; }
.footer-grid section p { max-width: 420px; color: #d8c8c0; }
.footer-brand { font: 800 28px 'Playfair Display',serif; text-decoration: none; }
.footer-grid nav { display: flex; flex-direction: column; gap: 8px; }
.footer-grid nav h2 { font: 700 1rem Outfit,sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.footer-grid nav a { color: #d8c8c0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 35px; margin-top: 45px; border-top: 1px solid #4c3931; color: #c9b6ac; font-size: .9rem; }
.bottom-nav { display: none; }

@media (max-width: 1000px) {
  .desktop-nav { display: none; }
  .compact-menu { display: block; }
  .nav-actions { margin-left: auto; }
  .recipe-grid, .directory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tile-grid, .cuisine-tiles { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .recipe-hero { grid-template-columns: 1fr; }
  .recipe-hero-image { aspect-ratio: 16/9; }
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  body { padding-bottom: 62px; }
  .container { width: min(100% - 28px, 1180px); }
  .site-header { position: relative; }
  .nav-row { min-height: 68px; }
  .brand { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .icon-link { display: none; }
  .home-hero { min-height: 570px; }
  .hero-copy { padding-block: 65px; }
  .hero-images::after { background: rgba(25,12,8,.60); }
  .home-section, .surface-section { padding-block: 60px; }
  .section-heading { align-items: start; }
  .tile-grid, .cuisine-tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .recipe-grid, .directory-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .recipe-facts { grid-template-columns: repeat(2,1fr); }
  .recipe-columns { grid-template-columns: 1fr; gap: 45px; }
  .ingredients { position: static; }
  .recipe-hero { gap: 26px; margin-bottom: 45px; }
  .recipe-hero-image { border-radius: 20px; }
  .step { grid-template-columns: 36px minmax(0,1fr); gap: 12px; }
  .step > span { width: 36px; height: 36px; }
  .tips, .recipe-notes { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { flex-direction: column; }
  .bottom-nav { position: fixed; z-index: 99; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; padding: 10px max(8px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: var(--surface); }
  .bottom-nav a { text-decoration: none; font-size: .82rem; font-weight: 700; }
}

@media (max-width: 420px) {
  .theme-button { width: 38px; height: 38px; }
  .compact-menu summary { padding-inline: 12px; }
  .tile { padding: 18px; }
  .section-heading { display: block; }
  .section-heading > a { display: inline-block; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .hero-images img:not(.active) { display: none; }
}

@media print {
  .site-header, .site-footer, .bottom-nav, .save-button, .related { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .page-shell { padding: 0; }
  .recipe-hero, .recipe-columns { display: block; }
  .recipe-hero-image { max-width: 500px; }
  .ingredients { position: static; break-inside: avoid; }
}
