:root {
  --bg: #0f0d0a;
  --card: #171410;
  --fg: #f5f1ea;
  --muted: #a39d93;
  --amber: #f59e0b;
  --border: rgba(255, 255, 255, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.font-display { font-family: "Fraunces", Georgia, serif; }

::selection { background: rgba(245, 158, 11, 0.35); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0f0d0a; }
::-webkit-scrollbar-thumb { background: #2e2a24; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3d3830; }

/* grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 13, 10, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 80rem;
  margin: 0 auto;
  height: 4rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--fg);
}

.logo-icon {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #fbbf24, #ea580c);
  color: #000;
  transition: transform 0.2s;
}

.logo:hover .logo-icon { transform: rotate(6deg); }

.logo-text { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; }
.logo-text .dot { color: var(--amber); }

.header-nav { display: flex; align-items: center; gap: 0.75rem; }

.nav-link {
  display: none;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: #fff; }
@media (min-width: 640px) { .nav-link { display: block; } }

.fav-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.fav-btn:hover { border-color: rgba(244, 63, 94, 0.4); color: #fda4af; }

.fav-count {
  display: flex;
  height: 1.25rem;
  min-width: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #f43f5e;
  padding: 0 0.375rem;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.fav-count.hidden { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }

.hero-glow {
  pointer-events: none;
  position: absolute;
  top: -10rem;
  left: 50%;
  height: 500px;
  width: 800px;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.1);
  filter: blur(120px);
}

.hero-word {
  font-family: "Fraunces", Georgia, serif;
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 2.5rem;
  user-select: none;
  white-space: nowrap;
  text-align: center;
  font-size: 18vw;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  -webkit-text-stroke: 1px rgba(245, 241, 234, 0.14);
  color: transparent;
  opacity: 0.6;
}

.hero-inner {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}
@media (min-width: 640px) { .hero-inner { padding-top: 8rem; } }
@media (min-width: 1024px) { .hero-inner { padding-top: 10rem; } }

.hero-content { max-width: 48rem; margin: 0 auto; text-align: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
  padding: 0.375rem 1rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #fcd34d;
}

.hero-title {
  margin-top: 1.5rem;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
}
@media (min-width: 640px) { .hero-title { font-size: 3.75rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 4.5rem; } }

.hero-title em { font-weight: 300; font-style: italic; color: #fbbf24; }

.hero-sub {
  max-width: 36rem;
  margin: 1.5rem auto 0;
  font-size: 1rem;
  line-height: 1.625;
  color: var(--muted);
}
@media (min-width: 640px) { .hero-sub { font-size: 1.125rem; } }

.hero-stats {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
@media (min-width: 640px) { .hero-stats { gap: 3rem; } }

.stat-num {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.25rem;
  font-weight: 600;
  color: #fbbf24;
}
@media (min-width: 640px) { .stat-num { font-size: 3rem; } }

.stat-label {
  margin-top: 0.25rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
}

.stat-divider { height: 2.5rem; width: 1px; background: rgba(255, 255, 255, 0.1); }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 3rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  padding: 1rem 2rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  text-decoration: none;
  box-shadow: 0 10px 40px -10px rgba(245, 158, 11, 0.5);
  transition: box-shadow 0.3s;
}
.hero-cta:hover { box-shadow: 0 16px 50px -10px rgba(245, 158, 11, 0.7); }
.hero-cta svg { transition: transform 0.2s; }
.hero-cta:hover svg { transform: translateY(4px); }

/* ---------- marquee ---------- */
.marquee {
  position: relative;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee-item {
  display: flex;
  align-items: center;
}

.marquee-item span:first-child {
  font-family: "Fraunces", Georgia, serif;
  padding: 0 1.5rem;
  font-size: 1.125rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
}

.marquee-item .star { color: rgba(245, 158, 11, 0.6); }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- explorer ---------- */
.explorer {
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  scroll-margin-top: 5rem;
}

.explorer-head {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .explorer-head { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}

.section-kicker {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #fbbf24;
}

.section-title {
  margin-top: 0.5rem;
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}
@media (min-width: 640px) { .section-title { font-size: 3rem; } }
.section-title em { font-weight: 300; font-style: italic; color: #fbbf24; }

.explorer-controls { display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 640px) { .explorer-controls { flex-direction: row; align-items: center; } }

.search-wrap { position: relative; }
.search-wrap svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.search-input {
  width: 100%;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  font-size: 0.875rem;
  color: #fff;
  outline: none;
  transition: all 0.2s;
}
@media (min-width: 640px) { .search-input { width: 18rem; } }
.search-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.search-input:focus { border-color: rgba(251, 191, 36, 0.6); background: rgba(255, 255, 255, 0.06); }

.sort-wrap { position: relative; }
.sort-wrap svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.sort-select {
  width: 100%;
  appearance: none;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  font-size: 0.875rem;
  color: #fff;
  outline: none;
  cursor: pointer;
}
@media (min-width: 640px) { .sort-select { width: auto; } }
.sort-select:focus { border-color: rgba(251, 191, 36, 0.6); }
.sort-select option { background: #16130f; }

/* pills */
.pills {
  margin-bottom: 2.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover { border-color: rgba(255, 255, 255, 0.25); color: #fff; }

.pill.active {
  border-color: #fbbf24;
  background: #fbbf24;
  color: #000;
  box-shadow: 0 6px 20px -6px rgba(245, 158, 11, 0.6);
}

.pill-count {
  border-radius: 9999px;
  padding: 0 0.375rem;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
}
.pill.active .pill-count { background: rgba(0, 0, 0, 0.15); }

/* ---------- cards grid ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  transition: all 0.3s;
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
}

.card-accent {
  height: 4px;
  width: 100%;
  transition: height 0.3s;
}
.card:hover .card-accent { height: 6px; }

.card-fav {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 10;
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}
.card-fav:hover { border-color: rgba(244, 63, 94, 0.4); color: #fb7185; }
.card-fav:active { transform: scale(0.9); }
.card-fav.faved {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}
.card-fav.faved svg { fill: currentColor; animation: heart-pop 0.35s ease; }

.card-body {
  display: flex;
  flex-direction: column;
  height: calc(100% - 4px);
  padding: 1.25rem 1.5rem 1.5rem;
}

.card-cat {
  margin-bottom: 0.75rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.card-title {
  padding-right: 2rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.375;
  transition: color 0.2s;
}
.card:hover .card-title { color: #fcd34d; }

.card-desc {
  margin-top: 0.5rem;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--muted);
}

.card-meta {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.625rem;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.meta-chip svg { width: 0.75rem; height: 0.75rem; }

.meta-protein { font-weight: 600; }

/* ---------- empty state ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  padding: 6rem 1.5rem;
  text-align: center;
}

.empty-icon {
  display: flex;
  height: 4rem;
  width: 4rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.3);
}

.empty-title { margin-top: 1.5rem; font-size: 1.5rem; font-weight: 600; }
.empty-text { margin-top: 0.5rem; max-width: 24rem; font-size: 0.875rem; color: var(--muted); }

.empty-btn {
  margin-top: 1.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: transparent;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fcd34d;
  cursor: pointer;
  transition: background 0.2s;
}
.empty-btn:hover { background: rgba(251, 191, 36, 0.1); }

.results-count {
  margin-top: 2rem;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 1.5rem; } }
.modal-backdrop.hidden { display: none; }

.modal {
  position: relative;
  display: flex;
  max-height: 92vh;
  width: 100%;
  max-width: 48rem;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem 1.5rem 0 0;
  background: #16130f;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  animation: modal-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (min-width: 640px) { .modal { border-radius: 1.5rem; } }

.modal-head {
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
}
@media (min-width: 640px) { .modal-head { padding: 2rem; } }

.modal-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.modal-cat {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
}

.modal-title {
  margin-top: 0.5rem;
  padding-right: 3rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
}
@media (min-width: 640px) { .modal-title { font-size: 1.875rem; } }

.modal-desc { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted); }

.modal-meta { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.modal-meta .meta-chip { padding: 0.375rem 0.75rem; font-size: 11px; }

.modal-actions {
  position: absolute;
  right: 1rem;
  top: 1rem;
  display: flex;
  gap: 0.5rem;
}
@media (min-width: 640px) { .modal-actions { right: 1.5rem; top: 1.5rem; } }

.modal-action-btn {
  display: flex;
  height: 2.5rem;
  width: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s;
}
.modal-action-btn:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.modal-action-btn:active { transform: scale(0.9); }
.modal-action-btn.faved {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}
.modal-action-btn.faved svg { fill: currentColor; animation: heart-pop 0.35s ease; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: grid;
  gap: 2rem;
}
@media (min-width: 640px) {
  .modal-body { padding: 2rem; grid-template-columns: 1fr 1.3fr; }
}

.modal-section-title {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #fbbf24;
}

.ingredient {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.8);
  list-style: none;
}

.ingredient + .ingredient { margin-top: 0.625rem; }

.ing-dot {
  margin-top: 0.375rem;
  height: 0.375rem;
  width: 0.375rem;
  flex-shrink: 0;
  border-radius: 9999px;
}

.step { display: flex; gap: 1rem; list-style: none; }
.step + .step { margin-top: 1rem; }

.step-num {
  display: flex;
  height: 2rem;
  width: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.875rem;
  font-weight: 700;
}

.step-text { padding-top: 0.25rem; font-size: 0.875rem; line-height: 1.625; color: rgba(255, 255, 255, 0.8); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
@media (min-width: 640px) {
  .footer-top { flex-direction: row; align-items: center; justify-content: space-between; }
}

.footer-brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.4); }

.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fcd34d; }

.footer-bottom {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
}
@media (min-width: 640px) {
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- animations ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes heart-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.45); }
  100% { transform: scale(1); }
}
