:root {
  --page: #fffdf8;
  --paper: #ffffff;
  --ink: #242323;
  --muted: #66615b;
  --line: #e8e1d8;
  --tomato: #e11919;
  --tomato-dark: #b91515;
  --basil: #2f7d32;
  --basil-dark: #1f5d23;
  --gold: #c98720;
  --soft-green: #ecf6e9;
  --soft-red: #fff0ed;
  --shadow: 0 20px 60px rgba(36, 35, 35, 0.11);
  --radius: 8px;
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(260px, 420px) auto;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(22px, 4vw, 64px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand img {
  width: 214px;
  height: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 52px);
  color: #191817;
  font-size: 17px;
  font-weight: 650;
}

.site-nav a,
.section__head a,
.hero__link {
  transition: color 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.section__head a:hover,
.hero__link:hover {
  color: var(--tomato);
}

.header-search,
.hero-search,
.listing-search {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1px solid #cfc8bd;
  border-radius: var(--radius);
  overflow: hidden;
}

.header-search {
  height: 54px;
  padding: 0 16px;
}

.header-search svg,
.hero-search svg {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  color: #2c2b2a;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.header-search input,
.hero-search input,
.listing-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.header-search input {
  padding: 0 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-actions a {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #111;
}

.header-actions svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(360px, 1.1fr);
  min-height: 560px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,253,248,0.98) 0%, rgba(255,253,248,0.88) 42%, rgba(255,253,248,0.06) 72%),
    radial-gradient(circle at 78% 20%, rgba(201,135,32,0.16), transparent 28%),
    #fffdf8;
  border-bottom: 1px solid var(--line);
}

.hero__content {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 660px;
  padding: clamp(58px, 8vw, 96px) 0 clamp(58px, 8vw, 96px) clamp(28px, 5vw, 72px);
}

.hero h1 {
  margin: 0 0 20px;
  max-width: 620px;
  font-size: clamp(58px, 7vw, 92px);
  line-height: 0.98;
  font-weight: 850;
  letter-spacing: 0;
}

.hero p {
  margin: 0 0 30px;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-search {
  width: min(640px, 100%);
  min-height: 62px;
  box-shadow: 0 16px 40px rgba(36, 35, 35, 0.08);
}

.hero-search svg {
  margin-left: 18px;
}

.hero-search input {
  min-height: 60px;
  padding: 0 16px;
  font-size: 17px;
}

.hero-search button,
.listing-search button {
  align-self: stretch;
  min-width: 170px;
  border: 0;
  background: var(--tomato);
  color: white;
  font-weight: 760;
  cursor: pointer;
  transition: background 160ms ease;
}

.hero-search button:hover,
.listing-search button:hover {
  background: var(--tomato-dark);
}

.hero__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: var(--basil);
  font-size: 19px;
  font-weight: 780;
}

.hero__media {
  min-height: 560px;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 48px);
}

.section--compact {
  padding-top: 32px;
  padding-bottom: 20px;
}

.section--tinted {
  max-width: none;
  padding-left: max(clamp(20px, 4vw, 64px), calc((100vw - var(--max)) / 2 + 48px));
  padding-right: max(clamp(20px, 4vw, 64px), calc((100vw - var(--max)) / 2 + 48px));
  background: linear-gradient(180deg, #fff8ed, #fffdf8);
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section__head h2,
.section__text h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section__head a {
  flex: 0 0 auto;
  color: var(--tomato);
  font-weight: 720;
}

.category-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(86px, 1fr));
  gap: 0;
  overflow-x: auto;
  padding-bottom: 10px;
}

.category-card {
  display: grid;
  min-width: 108px;
  min-height: 110px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  color: #262321;
  font-weight: 650;
  text-align: center;
}

.category-card:first-child {
  border-left: 1px solid var(--line);
}

.category-card:hover {
  color: var(--tomato);
}

.category-card__icon {
  display: grid;
  width: 56px;
  height: 48px;
  place-items: center;
  color: var(--tomato);
  font-size: 38px;
}

.category-card__icon::before {
  content: "🍽";
}

.category-card__icon--bowl::before { content: "🍲"; }
.category-card__icon--salad::before { content: "🥗"; }
.category-card__icon--cloche::before { content: "🍛"; }
.category-card__icon--pan::before { content: "🍳"; }
.category-card__icon--cupcake::before { content: "🧁"; }
.category-card__icon--pancakes::before { content: "🥞"; }
.category-card__icon--bottle::before { content: "🧃"; }
.category-card__icon--pizza::before { content: "🍕"; }
.category-card__icon--skewer::before { content: "🍢"; }
.category-card__icon--baby::before { content: "🍼"; }

.ingredient-rail {
  display: grid;
  grid-template-columns: repeat(10, minmax(130px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.ingredient-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 144px;
  min-height: 56px;
  padding: 10px 14px;
  background: #f5f1ec;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ingredient-chip:hover {
  transform: translateY(-2px);
  border-color: #d8cbbd;
  background: #fff;
}

.ingredient-chip span {
  font-size: 26px;
}

.ingredient-chip strong {
  font-size: 15px;
}

.ingredient-chip small {
  color: var(--basil);
  font-weight: 780;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.recipe-grid--small {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recipe-card {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(36, 35, 35, 0.06);
}

.recipe-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(225,25,25,0.1), rgba(47,125,50,0.12)),
    #eee5dc;
  overflow: hidden;
}

.recipe-card__media img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.recipe-card__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--basil-dark);
  font-size: 18px;
  font-weight: 820;
  text-align: center;
}

.recipe-card:hover .recipe-card__media img {
  transform: scale(1.035);
}

.recipe-card__body {
  padding: 18px;
}

.recipe-card__meta,
.recipe-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--basil);
  font-size: 13px;
  font-weight: 740;
}

.recipe-card__footer {
  justify-content: space-between;
  color: var(--muted);
}

.recipe-card h3 {
  margin: 10px 0 8px;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0;
}

.recipe-card p {
  display: -webkit-box;
  min-height: 72px;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.section--split {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.2fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: start;
}

.section__text p {
  max-width: 520px;
  color: var(--muted);
  font-size: 19px;
}

.cuisine-list {
  display: grid;
  gap: 12px;
}

.cuisine-list a {
  display: grid;
  gap: 5px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.cuisine-list strong {
  color: var(--tomato);
  font-size: 20px;
}

.cuisine-list span {
  color: var(--muted);
}

.listing-hero {
  padding: 58px clamp(22px, 5vw, 72px) 42px;
  background: linear-gradient(130deg, #fffdf8 0%, #fff3df 62%, #eff8ed 100%);
  border-bottom: 1px solid var(--line);
}

.listing-hero h1 {
  max-width: 860px;
  margin: 14px 0 12px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1;
  letter-spacing: 0;
}

.listing-hero p {
  max-width: 740px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 20px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.breadcrumbs a {
  color: var(--basil);
}

.listing-search {
  max-width: 620px;
  min-height: 56px;
}

.listing-search input {
  min-height: 54px;
  padding: 0 18px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 36px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px clamp(20px, 4vw, 48px) 76px;
}

.catalog-sidebar {
  position: sticky;
  top: 118px;
  align-self: start;
}

.catalog-sidebar h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.catalog-sidebar nav {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.catalog-sidebar a {
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 650;
}

.catalog-sidebar a:hover,
.catalog-sidebar a.is-active {
  background: var(--soft-green);
  color: var(--basil-dark);
}

.result-count {
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 720;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 34px;
  color: var(--muted);
  font-weight: 720;
}

.pagination a,
.empty-state a {
  color: var(--tomato);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.recipe-detail {
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 48px) 78px;
}

.recipe-hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: 34px 0 48px;
}

.recipe-hero__type {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--basil);
  font-weight: 800;
}

.recipe-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

.recipe-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.recipe-hero__image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(225,25,25,0.1), rgba(47,125,50,0.12)),
    #eee5dc;
  box-shadow: var(--shadow);
}

.recipe-hero__image img {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

.recipe-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.recipe-stats span {
  min-height: 70px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.recipe-stats strong {
  display: block;
  color: var(--ink);
  font-size: 21px;
}

.recipe-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 36px;
  align-items: start;
}

.ingredients-panel,
.steps-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ingredients-panel {
  position: sticky;
  top: 118px;
}

.ingredients-panel h2,
.steps-panel h2 {
  margin: 0;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 26px;
  letter-spacing: 0;
}

.ingredients-panel ul,
.steps-panel ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredients-panel li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}

.ingredients-panel li:last-child,
.steps-panel li:last-child {
  border-bottom: 0;
}

.ingredients-panel strong {
  color: var(--basil);
  white-space: nowrap;
}

.steps-panel li {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.steps-panel strong {
  color: var(--tomato);
  font-size: 18px;
}

.steps-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 38px clamp(22px, 5vw, 72px);
  background: #25231f;
  color: #fff8ed;
}

.site-footer img {
  width: 188px;
  filter: brightness(1.18);
}

.site-footer p {
  max-width: 460px;
  margin: 12px 0 0;
  color: #d7cec3;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: #fff8ed;
  font-weight: 650;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .header-search {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero__content {
    padding-right: clamp(28px, 5vw, 72px);
  }

  .hero__media {
    min-height: 360px;
  }

  .recipe-grid,
  .recipe-grid--small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand img {
    width: 190px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-actions {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(44px, 15vw, 66px);
  }

  .hero-search {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .hero-search button {
    grid-column: 1 / -1;
    min-height: 54px;
  }

  .category-strip,
  .ingredient-rail {
    grid-template-columns: repeat(10, minmax(120px, 1fr));
  }

  .section__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .recipe-grid,
  .recipe-grid--small,
  .catalog-layout,
  .recipe-hero,
  .recipe-body,
  .section--split {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar,
  .ingredients-panel {
    position: static;
  }

  .recipe-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .hero__content,
  .listing-hero,
  .recipe-detail,
  .section,
  .catalog-layout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero__media {
    min-height: 260px;
  }

  .listing-search {
    display: grid;
  }

  .listing-search button {
    min-height: 50px;
  }

  .recipe-card h3 {
    font-size: 20px;
  }
}
