:root {
  --bg: #0d0907;
  --bg-soft: #15100c;
  --card: rgba(30, 22, 17, 0.72);
  --card-hover: rgba(42, 30, 22, 0.9);
  --line: rgba(255, 196, 140, 0.14);
  --line-strong: rgba(255, 196, 140, 0.3);
  --text: #f6ece2;
  --muted: #b9a696;
  --dim: #8a7666;
  --ember: #ff6b35;
  --amber: #ffb347;
  --chili: #e63946;
  --green: #7fbf7f;
  --radius: 20px;
  --maxw: 1240px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 3px 3px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 75%);
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.glow-a {
  width: 620px;
  height: 620px;
  top: -280px;
  left: 8%;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.4), transparent 70%);
}

.glow-b {
  width: 520px;
  height: 520px;
  top: 120px;
  right: -180px;
  background: radial-gradient(circle, rgba(255, 179, 71, 0.22), transparent 70%);
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  backdrop-filter: blur(14px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 1.3rem;
  background: linear-gradient(145deg, rgba(255, 107, 53, 0.28), rgba(255, 179, 71, 0.1));
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px -10px var(--ember);
}

.brand-mark img {
  width: 26px;
  height: 26px;
  display: block;
}

.inline-emoji {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 2px;
}

.brand-text em {
  font-style: italic;
  color: var(--amber);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.92rem;
  color: var(--muted);
}

.topnav a:hover {
  color: var(--text);
}

.ghost-btn,
.solid-btn,
.reset-btn {
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.ghost-btn {
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 0.88rem;
}

.ghost-btn:hover {
  background: rgba(255, 107, 53, 0.14);
  border-color: rgba(255, 107, 53, 0.5);
  transform: translateY(-1px);
}

.solid-btn {
  padding: 10px 22px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--ember), var(--amber));
  color: #241006;
  font-weight: 700;
}

.solid-btn:hover {
  transform: translateY(-1px);
}

/* ---------- Hero ---------- */

main {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  padding: 84px 0 48px;
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--amber);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.grad {
  background: linear-gradient(100deg, #ffcf8a 0%, var(--ember) 45%, #d94b1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 28px 0 0;
  max-width: 640px;
  font-size: 1.06rem;
  color: var(--muted);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 44px;
}

.stat {
  min-width: 132px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--text);
}

.stat span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- Controls ---------- */

.atlas {
  padding: 26px 0 40px;
  scroll-margin-top: 80px;
}

.controls {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 15, 11, 0.6);
  backdrop-filter: blur(10px);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 18px;
  font-size: 1.3rem;
  color: var(--dim);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 15px 18px 15px 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#search::placeholder {
  color: var(--dim);
}

#search:focus {
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip.active {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(255, 179, 71, 0.85));
  border-color: transparent;
  color: #221006;
  font-weight: 700;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 16px;
}

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--dim);
}

.select-wrap select {
  padding: 9px 34px 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-color: rgba(0, 0, 0, 0.4);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.2s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch input:checked + .switch-track {
  background: rgba(127, 191, 127, 0.25);
  border-color: rgba(127, 191, 127, 0.5);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
  background: var(--green);
}

.reset-btn {
  margin-left: auto;
  padding: 8px 14px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--dim);
  font-size: 0.82rem;
}

.reset-btn:hover {
  color: var(--text);
  border-color: var(--amber);
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 26px 4px 18px;
}

#resultCount {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#resultCount strong {
  color: var(--amber);
}

.hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--dim);
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 18px;
}

.card {
  --hue: 24;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(var(--hue) 80% 50% / 0.13), transparent 55%),
    var(--card);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  animation: rise 0.5s ease backwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 179, 71, 0.42);
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(var(--hue) 85% 52% / 0.2), transparent 55%),
    var(--card-hover);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-emoji {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 1.7rem;
  border-radius: 14px;
  background: hsl(var(--hue) 60% 45% / 0.15);
  border: 1px solid hsl(var(--hue) 70% 60% / 0.25);
}

.card-emoji img {
  width: 30px;
  height: 30px;
  display: block;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(255, 179, 71, 0.1);
  border: 1px solid rgba(255, 179, 71, 0.22);
  white-space: nowrap;
}

.tag.veg {
  color: var(--green);
  background: rgba(127, 191, 127, 0.1);
  border-color: rgba(127, 191, 127, 0.28);
}

.card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.34rem;
  font-weight: 600;
  line-height: 1.2;
}

.card .local {
  margin: -8px 0 0;
  font-size: 0.8rem;
  color: var(--dim);
  font-style: italic;
}

.card .place {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.flag {
  font-size: 0.95rem;
  line-height: 1;
}

.flag img {
  width: 20px;
  height: 15px;
  display: inline-block;
  vertical-align: -2px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card .desc {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 196, 140, 0.1);
}

.ing {
  font-size: 0.72rem;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spice {
  font-size: 0.7rem;
  letter-spacing: 1px;
  white-space: nowrap;
  filter: saturate(0.9);
}

.spice .off {
  opacity: 0.18;
  filter: grayscale(1);
}

/* ---------- Empty ---------- */

.empty {
  padding: 70px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  margin-top: 18px;
}

.empty-emoji {
  font-size: 2.6rem;
}

.empty h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 10px 0 4px;
}

.empty p {
  color: var(--muted);
  margin: 0 0 20px;
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  padding: 70px 0;
  margin-top: 30px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.about h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
}

.about-copy p {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 560px;
}

.about-copy code {
  font-size: 0.85em;
  color: var(--amber);
  background: rgba(255, 179, 71, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--dim);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-veg { background: var(--green); }
.dot-spice { background: var(--chili); }
.dot-live { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* ---------- Footer ---------- */

.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 28px 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--dim);
  position: relative;
  z-index: 1;
}

.footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--amber);
}

/* ---------- Modal ---------- */

.modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: none;
  border-radius: 24px;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(6, 4, 2, 0.78);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(100% 60% at 100% 0%, rgba(255, 107, 53, 0.16), transparent 60%),
    #17110d;
  box-shadow: 0 40px 90px -30px #000;
  animation: pop 0.25s ease;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.modal-emoji {
  font-size: 2.6rem;
  margin-bottom: 6px;
}

.modal-emoji img {
  width: 48px;
  height: 48px;
  display: block;
}

.modal-kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.modal h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 500;
  padding-right: 30px;
}

.modal-desc {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.76rem;
  color: var(--muted);
}

.modal-ingredients h4 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.modal-ingredients ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 26px;
}

.modal-ingredients li {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 179, 71, 0.16);
  font-size: 0.8rem;
  color: #e8c9a8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .about {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 50px 0;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 14px 20px;
  }

  .topnav a {
    display: none;
  }

  main {
    padding: 0 20px;
  }

  .hero {
    padding: 52px 0 34px;
  }

  .stats {
    gap: 10px;
  }

  .stat {
    flex: 1 1 40%;
    min-width: 0;
    padding: 13px 16px;
  }

  .stat strong {
    font-size: 1.5rem;
  }

  .controls {
    padding: 16px;
  }

  .reset-btn {
    margin-left: 0;
  }

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

  .hint {
    display: none;
  }

  .footer {
    padding: 24px 20px 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
