:root {
  --cream: #fff9f2;
  --paper: #ffffff;
  --brown: #4b2f24;
  --brown-dark: #2f1d17;
  --terracotta: #a94e2c;
  --terracotta-dark: #82371f;
  --gold: #c58b45;
  --sand: #ead8c5;
  --sand-light: #f4e8dc;
  --muted: #76675e;
  --border: #e8d9cc;
  --shadow: 0 18px 50px rgba(75, 47, 36, .10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown-dark);
  font-family: "Poppins", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 249, 242, .95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-content {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--terracotta);
  color: white;
  font-weight: 700;
}

.logo-text strong {
  display: block;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 22px;
  color: var(--brown);
}

.logo-text small {
  display: block;
  margin-top: -2px;
  color: var(--muted);
  font-size: 10px;
}

.main-nav {
  display: flex;
  gap: 5px;
}

.main-nav a {
  padding: 10px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.main-nav a:hover {
  background: var(--sand-light);
  color: var(--terracotta);
}

.hero {
  padding: 60px 0 50px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr .88fr;
  gap: 55px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  color: var(--terracotta);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.hero h1 {
  max-width: 650px;
  margin: 9px 0 18px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(48px, 6vw, 78px);
  line-height: .98;
  font-weight: 400;
  color: var(--brown-dark);
}

.hero h1 span {
  color: var(--terracotta);
}

.hero p {
  max-width: 590px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 16px;
}

.primary-button {
  display: inline-block;
  margin-top: 12px;
  padding: 13px 21px;
  border: 0;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(169, 78, 44, .20);
}

.primary-button:hover {
  background: var(--terracotta-dark);
}

.hero-image {
  height: 430px;
  overflow: hidden;
  border-radius: 35px 35px 35px 90px;
  box-shadow: var(--shadow);
  background: var(--sand);
}

.hero-image img {
  height: 100%;
  object-fit: cover;
}

.search-section {
  padding: 30px 0 50px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading.center {
  display: block;
  text-align: center;
}

.section-heading h2 {
  margin: 5px 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 38px;
  font-weight: 400;
}

.search-box {
  width: min(760px, 100%);
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(75, 47, 36, .07);
}

.search-box > span {
  color: var(--terracotta);
  font-size: 28px;
  transform: rotate(-20deg);
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 13px 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--brown-dark);
}

.search-box input::placeholder {
  color: #a0958e;
}

.search-box button {
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  background: var(--sand-light);
  color: var(--muted);
  font-size: 21px;
}

.section {
  padding: 48px 0;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 13px;
}

.category-card {
  min-height: 145px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--brown);
  transition: .2s ease;
}

.category-card:hover,
.category-card.active {
  border-color: var(--terracotta);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(75, 47, 36, .08);
}

.category-card.active {
  background: var(--terracotta);
  color: #fff;
}

.category-icon {
  display: block;
  margin-bottom: 15px;
  font-size: 30px;
}

.category-card strong,
.category-card small {
  display: block;
}

.category-card strong {
  font-size: 14px;
}

.category-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.category-card.active small {
  color: #f8ddd0;
}

.recipes-section {
  padding-top: 25px;
}

.recipe-count {
  color: var(--muted);
  font-size: 13px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.recipe-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 25px rgba(75, 47, 36, .05);
  transition: .2s ease;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.recipe-image {
  height: 210px;
  overflow: hidden;
}

.recipe-image img {
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.recipe-card:hover .recipe-image img {
  transform: scale(1.04);
}

.recipe-body {
  padding: 16px;
}

.recipe-tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--sand-light);
  color: var(--terracotta);
  font-size: 9px;
  font-weight: 700;
}

.recipe-body h3 {
  margin: 10px 0 6px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.recipe-body p {
  min-height: 46px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.recipe-meta {
  display: flex;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.recipe-button {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: var(--brown);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.recipe-button:hover {
  background: var(--terracotta);
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 42px;
}

.empty-state h3 {
  margin: 10px 0 5px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.empty-state p {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-background {
  position: absolute;
  inset: 0;
  background: rgba(35, 23, 18, .70);
  backdrop-filter: blur(4px);
}

.recipe-modal {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: 94vh;
  overflow-y: auto;
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .25);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--brown);
  font-size: 26px;
}

.modal-image {
  height: 340px;
  object-fit: cover;
}

.modal-content {
  padding: 27px;
}

.modal-content h2 {
  margin: 11px 0 5px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
}

.modal-description {
  color: var(--muted);
  line-height: 1.7;
}

.modal-info {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 17px 0 25px;
}

.modal-info span {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--sand-light);
  color: var(--muted);
  font-size: 11px;
}

.recipe-detail-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 30px;
}

.recipe-detail-grid h3 {
  margin-top: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 27px;
  font-weight: 400;
}

.recipe-detail-grid ul,
.recipe-detail-grid ol {
  margin: 0;
  padding-left: 21px;
}

.recipe-detail-grid li {
  margin-bottom: 11px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.nutrition-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.nutrition-section h3 {
  margin: 0 0 14px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 27px;
  font-weight: 400;
}

.nutrition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 24px;
  margin: 0;
  padding-left: 21px;
}

.nutrition-list li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal-content .primary-button {
  border: 0;
}

.site-footer {
  margin-top: 45px;
  padding: 35px 0;
  background: var(--brown-dark);
  color: #f8eee6;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer-content strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 25px;
  font-weight: 400;
}

.footer-content p {
  margin: 5px 0;
  color: #cdbdb2;
  font-size: 11px;
}

@media (max-width: 1000px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (max-width: 760px) {
  .header-content {
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
  }

  .main-nav a {
    padding: 8px 9px;
    font-size: 11px;
  }

  .hero {
    padding-top: 35px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero h1 {
    font-size: 54px;
  }

  .hero-image {
    height: 300px;
    border-radius: 28px;
  }

  .recipe-detail-grid {
    grid-template-columns: 1fr;
  }

  .nutrition-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
    .category-grid,
    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: auto;
    }

    .recipe-image {
        height: 230px;
    }

    .section-heading h2 {
        font-size: 32px;
    }

    .modal-image {
        height: 240px;
    }

    .modal-content {
        padding: 20px;
    }

        .modal-content h2 {
            font-size: 34px;
        }

    .footer-content {
        flex-direction: column;
    }

    .recipe-image {
        height: 210px !important;
        overflow: hidden !important;
        background: #ead8c5;
    }

        .recipe-image img {
            width: 100% !important;
            height: 100% !important;
            display: block !important;
            object-fit: cover !important;
        }
