:root {
  --bg: #fff8f2;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #8a7a6d;
  --accent: #ff6b35;
  --accent-soft: #ffe9df;
  --green: #2e9e6b;
  --yellow: #ffb703;
  --shadow: 0 10px 30px rgba(80, 50, 30, 0.10);
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

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

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(1000px 400px at 85% -10%, #ffd9c4 0%, transparent 60%),
    linear-gradient(160deg, #ff7a45 0%, #ff5f2e 55%, #ff8a3d 100%);
  color: #fff;
  padding: 46px 0 40px;
  border-radius: 0 0 34px 34px;
}

.hero-inner { text-align: center; }

.logo {
  display: inline-block;
  font-weight: 800;
  letter-spacing: .5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 15px;
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  margin: 18px 0 8px;
  line-height: 1.15;
}

.subtitle {
  margin: 0 auto;
  opacity: .95;
  font-size: clamp(15px, 2.4vw, 19px);
}

/* ===== Controls ===== */
.controls {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

#search {
  width: min(560px, 100%);
  padding: 15px 22px;
  font-size: 17px;
  border: none;
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow);
  color: var(--ink);
}

#search:focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, .55), var(--shadow); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  border: 1.5px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .14);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s;
}

.chip:hover { background: rgba(255, 255, 255, .3); transform: translateY(-1px); }

.chip.active {
  background: #fff;
  color: var(--accent);
  border-color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}

/* ===== Sections ===== */
main { padding: 34px 0 50px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h2 { margin: 0; font-size: 24px; }

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

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  animation: pop .35s ease both;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(80, 50, 30, 0.16);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.card-emoji {
  font-size: 58px;
  text-align: center;
  padding: 26px 10px 14px;
  background: linear-gradient(180deg, var(--accent-soft), #fff6f0);
}

.card-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title { margin: 0; font-size: 18px; line-height: 1.3; }

.card-desc { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag {
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: #f2ede8;
  color: #6b5b4e;
}

.tag.time { background: #e5f6ee; color: var(--green); }
.tag.kcal { background: #fff3d6; color: #a06a00; }

/* ===== Empty ===== */
.empty { text-align: center; padding: 50px 10px; color: var(--muted); }
.empty-icon { font-size: 54px; margin-bottom: 8px; }
.hidden { display: none !important; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(40, 25, 15, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(3px);
}

.modal-card {
  background: #fff;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 26px;
  padding: 30px 30px 34px;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .3);
  animation: pop .28s ease both;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #f4efe9;
  font-size: 16px;
  cursor: pointer;
  transition: .15s;
}

.modal-close:hover { background: var(--accent); color: #fff; }

.recipe-head { text-align: center; margin-bottom: 6px; }

.recipe-head .big-emoji { font-size: 66px; }

.recipe-head h3 { margin: 6px 0 4px; font-size: 26px; }

.recipe-head p { margin: 0 auto; color: var(--muted); max-width: 460px; }

.recipe-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
}

.recipe-section { margin-top: 22px; }

.recipe-section h4 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: 14px;
}

.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.ingredients li {
  background: #fbf7f3;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 14.5px;
  border-left: 4px solid var(--accent-soft);
}

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 12px; }

.steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  background: #fbf7f3;
  border-radius: 14px;
  font-size: 15px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}

.tip {
  margin-top: 20px;
  background: #fff7e6;
  border: 1.5px dashed var(--yellow);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 14.5px;
}

/* ===== Footer ===== */
.footer {
  background: #2b2118;
  color: #d9cfc5;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 560px) {
  .modal-card { padding: 24px 18px 28px; }
  .hero { padding: 34px 0 32px; }
}
