:root {
  --surface: #fff8ef;
  --surface-bright: #fdfbf7;
  --surface-low: #faf3e6;
  --surface-container: #f4ede0;
  --surface-high: #e9e2d5;
  --surface-white: #ffffff;
  --text: #1e1b14;
  --muted: #454742;
  --outline: #c6c7c0;
  --outline-strong: #767872;
  --primary: #5e5e5c;
  --sage: #56642b;
  --sage-soft: #f8ffda;
  --terracotta: #9f5f45;
  --terracotta-soft: #f7e5dc;
  --max: 1200px;
  --content: 800px;
  --gutter: 24px;
  --radius: 8px;
  --shadow: 0 12px 40px rgba(30, 27, 20, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-bright);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.625;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 248, 239, 0.94);
  border-bottom: 1px solid var(--outline);
  backdrop-filter: blur(12px);
}

.site-header__inner,
.site-footer__inner,
.collection-hero,
.content-band,
.recipes-page,
.simple-page {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header__inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.15;
}

.brand {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  padding-block: 10px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav .is-active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--outline);
  border-radius: 6px;
  background: var(--surface-bright);
  align-items: center;
  justify-content: center;
}

.nav-toggle span[aria-hidden] {
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.nav-toggle span[aria-hidden]::before,
.nav-toggle span[aria-hidden]::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
}

.nav-toggle span[aria-hidden]::before {
  top: -6px;
}

.nav-toggle span[aria-hidden]::after {
  top: 6px;
}

.collection-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  align-items: stretch;
  gap: clamp(32px, 6vw, 72px);
  padding-block: clamp(48px, 8vw, 88px);
}

.collection-hero h1,
.recipe-hero h1,
.simple-page h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.08;
}

.collection-hero p,
.recipe-hero__content > p,
.simple-page > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-recipe {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-recipe:hover,
.recipe-card:hover,
.term-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.hero-recipe__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--outline);
}

.hero-recipe__body {
  padding: 24px;
}

.hero-recipe h2 {
  margin: 14px 0 10px;
  font-size: 30px;
}

.hero-recipe p,
.recipe-card p,
.recent-card p,
.recipe-results__header p,
.term-card strong {
  color: var(--muted);
}

.content-band {
  padding-block: clamp(32px, 7vw, 80px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--surface-high);
}

.section-heading h2,
.recipe-results__header h1,
.simple-page h1 {
  margin: 0;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.section-heading a {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gutter);
}

.recent-card__media {
  aspect-ratio: 1;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
}

.recent-card h3 {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.recent-card p {
  margin: 4px 0 0;
  font-size: 14px;
}

.favorite-grid,
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  align-items: start;
}

.recipe-grid--single {
  grid-template-columns: minmax(280px, 420px);
}

.recipe-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.recipe-card[hidden] {
  display: none;
}

.recipe-card__link {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.recipe-card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 4px;
  background: var(--surface-container);
  border-bottom: 1px solid rgba(198, 199, 192, 0.7);
}

.recipe-card__media img,
.hero-recipe__media img,
.recent-card__media img,
.recipe-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
}

.recipe-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.recipe-card h2 {
  display: -webkit-box;
  min-height: 2.3em;
  margin: 0;
  overflow: hidden;
  font-size: 24px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recipe-card p {
  display: -webkit-box;
  min-height: 3.25em;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recipe-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: #3e4c16;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip--category {
  background: var(--terracotta-soft);
  color: var(--terracotta);
}

.recipe-art {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: calc(var(--radius) - 2px);
  background:
    radial-gradient(circle at 30% 25%, rgba(248, 255, 218, 0.95), transparent 34%),
    radial-gradient(circle at 72% 70%, rgba(194, 125, 96, 0.28), transparent 32%),
    linear-gradient(135deg, #f7efe0, #dfe7c0 58%, #f3ddcf);
  color: rgba(30, 27, 20, 0.58);
}

.recipe-art span {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(30, 27, 20, 0.14);
  border-radius: 50%;
  background: rgba(255, 248, 239, 0.72);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 34px;
  font-weight: 700;
}

.recipes-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px);
  padding-block: clamp(36px, 7vw, 80px);
}

.filters {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.filter-search label,
.filter-group h2 {
  display: block;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-search input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--outline);
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-search input:focus {
  border-color: var(--text);
}

.filter-chips,
.filter-checks,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chips button {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chips button.is-active {
  border-color: transparent;
  background: var(--surface-high);
}

.filter-checks {
  flex-direction: column;
  align-items: start;
}

.filter-checks label,
.ingredient-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.filter-checks input,
.ingredient-list input {
  appearance: none;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: transparent;
}

.filter-checks input:checked,
.ingredient-list input:checked {
  border-color: var(--sage);
  background: radial-gradient(circle, #fff 0 26%, var(--sage) 30%);
}

.recipe-results {
  min-width: 0;
}

.recipe-results__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.recipe-results__header h1 {
  font-size: clamp(36px, 5vw, 56px);
}

.recipe-results__header p {
  margin: 8px 0 0;
}

.results-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  padding: 40px;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.recipe-detail {
  width: min(var(--content), calc(100% - 40px));
  margin-inline: auto;
  padding-block: clamp(36px, 7vw, 80px);
}

.recipe-hero {
  margin-bottom: clamp(44px, 8vw, 80px);
}

.recipe-hero__media {
  aspect-ratio: 2 / 1;
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
}

.recipe-hero__content h1 {
  margin-top: 18px;
}

.recipe-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin: 32px 0 0;
  padding-block: 16px;
  border-block: 1px solid var(--outline);
}

.recipe-stats div {
  min-width: 0;
}

.recipe-stats dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recipe-stats dd {
  margin: 4px 0 0;
}

.recipe-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
}

.ingredients-panel h2,
.instructions-panel h2,
.notes-panel h2 {
  margin: 0 0 22px;
  font-size: 28px;
}

.ingredient-list,
.notes-panel ul {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
  background: var(--surface-white);
  list-style: none;
}

.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ingredient-list label {
  cursor: pointer;
}

.ingredient-list input:checked + label {
  color: var(--muted);
  text-decoration: line-through;
}

.instructions-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.instructions-panel__heading h2 {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.button--outline {
  border: 1px solid var(--sage);
  background: transparent;
  color: var(--sage);
}

.button--outline:hover {
  background: var(--sage-soft);
}

.step-list,
.cook-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.step-list {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.step-list li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 18px;
}

.step-list li::before {
  content: counter(steps);
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.step-list h3,
.cook-steps h3 {
  margin: 0 0 8px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.step-list h3,
.step-list p {
  grid-column: 2;
}

.step-list p,
.cook-steps p {
  margin: 0;
  color: var(--muted);
}

.notes-panel {
  margin-top: clamp(44px, 8vw, 80px);
}

.notes-panel li + li {
  margin-top: 10px;
}

.prose {
  width: min(var(--content), calc(100% - 40px));
  margin-inline: auto;
}

.simple-page {
  padding-block: clamp(44px, 8vw, 88px);
}

.prose h1,
.prose h2,
.prose h3 {
  margin-top: 1.4em;
}

.prose p,
.prose li {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  margin-top: 32px;
}

.term-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 92px;
  padding: 20px;
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.term-card span {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.cook-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  overflow: auto;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  background: var(--surface-bright);
  color: var(--text);
}

.cook-dialog::backdrop {
  background: rgba(30, 27, 20, 0.25);
  backdrop-filter: blur(4px);
}

.cook-dialog__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.cook-dialog__header button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cook-dialog h2 {
  margin: 8px 0 28px;
  font-size: clamp(30px, 5vw, 46px);
}

.cook-steps {
  display: grid;
  gap: 28px;
}

.cook-steps li {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--surface-high);
}

.cook-steps h3 {
  font-size: 18px;
}

.cook-steps p {
  font-size: 20px;
  line-height: 1.7;
}

.site-footer {
  margin-top: clamp(48px, 8vw, 88px);
  background: var(--surface-low);
  border-top: 1px solid var(--outline);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 112px;
  color: var(--muted);
  font-size: 14px;
}

.footer-mark {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .collection-hero,
  .recipes-page,
  .recipe-body {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--surface-high);
  }

  .favorite-grid,
  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recent-grid,
  .term-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header__inner,
  .site-footer__inner,
  .collection-hero,
  .content-band,
  .recipes-page,
  .recipe-detail,
  .simple-page,
  .prose {
    width: min(100% - 32px, var(--max));
  }

  .site-header__inner {
    min-height: 64px;
  }

  .brand {
    font-size: 24px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--surface-bright);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 14px;
    border-bottom: 0;
    border-radius: 6px;
  }

  .site-nav a.is-active {
    background: var(--surface-low);
  }

  .recipe-results {
    order: 1;
  }

  .filters {
    order: 2;
  }

  .collection-hero {
    padding-block: 36px 48px;
  }

  .collection-hero h1,
  .recipe-hero h1,
  .simple-page h1 {
    font-size: 38px;
    line-height: 1.12;
  }

  .collection-hero p,
  .recipe-hero__content > p,
  .simple-page > p:not(.eyebrow) {
    font-size: 16px;
  }

  .section-heading,
  .recipe-results__header,
  .instructions-panel__heading,
  .site-footer__inner {
    align-items: stretch;
    flex-direction: column;
  }

  .favorite-grid,
  .recipe-grid,
  .recent-grid,
  .term-grid {
    grid-template-columns: 1fr;
  }

  .recipe-card h2 {
    min-height: 0;
  }

  .recipe-card p {
    min-height: 0;
  }

  .recipe-hero__media {
    aspect-ratio: 4 / 3;
    margin-bottom: 24px;
  }

  .recipe-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ingredient-list {
    padding: 18px;
  }

  .step-list li {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 14px;
  }

  .step-list li::before {
    width: 28px;
    height: 28px;
  }

  .button {
    width: 100%;
  }

  .cook-steps p {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
