@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #1e1e2e;
  --bg-alt: #181825;
  --surface: #313244;
  --surface-2: #45475a;
  --surface-3: #585b70;
  --text: #cdd6f4;
  --muted: #a6adc8;
  --subtle: #7f849c;

  --accent: #cba6f7;
  --accent-2: #f5c2e7;
  --accent-hover: #a675d6;
  --accent-soft: rgba(203, 166, 247, 0.15);

  --good: #a6e3a1;
  --bad: #f38ba8;
  --warn: #f9e2af;
  --info: #89dceb;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(135deg, #cba6f7 0%, #f5c2e7 60%, #89dceb 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(203, 166, 247, 0.12), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(137, 220, 235, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(30, 30, 46, 0.78);
  border-bottom: 1px solid var(--surface-2);
  padding: 14px 28px;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: 1180px;
  margin-inline: auto;
}
nav .brand {
  margin-right: auto;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.2px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
nav ul li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
  display: inline-block;
}
nav ul li a:hover { background: var(--accent-soft); color: var(--accent); }
nav ul li a.active { background: var(--accent-soft); color: var(--accent); }

main {
  max-width: 1180px;
  margin: 28px auto 48px;
  padding: 0 28px;
}

h1, h2, h3 { margin-top: 0; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 34px; font-weight: 800; line-height: 1.15; }
h2 { font-size: 24px; font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }

p { margin: 8px 0; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.hidden { display: none !important; }

.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(203, 166, 247, 0.18), rgba(137, 220, 235, 0.10)),
    var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 380px;
  height: 380px;
  background: radial-gradient(closest-side, rgba(245, 194, 231, 0.35), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.hero h1 {
  font-size: 38px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.hero .lede { font-size: 16px; color: var(--muted); max-width: 620px; }

.section {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}
.section:hover { border-color: var(--surface-3); }
.section + .section { margin-top: 0; }

.custom-btn,
button {
  background: var(--accent);
  color: #1e1e2e;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-weight: 600;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 12px rgba(203, 166, 247, 0.25);
}
.custom-btn:hover,
button:hover { background: var(--accent-hover); box-shadow: 0 6px 18px rgba(203, 166, 247, 0.35); }
.custom-btn:active,
button:active { transform: translateY(1px); }
.custom-btn:focus-visible,
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--surface-3); box-shadow: none; }

.btn-danger {
  background: var(--bad);
  color: #1e1e2e;
  box-shadow: 0 4px 12px rgba(243, 139, 168, 0.25);
}
.btn-danger:hover { background: #e16a8b; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--surface-2);
  box-shadow: none;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

input[type="text"], select, textarea {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: var(--subtle); }

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.row input[type="text"] { flex: 1 1 280px; min-width: 0; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  min-height: 24px;
}
.chip {
  background: var(--surface-2);
  color: var(--text);
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--surface-3);
  transition: transform 0.12s ease, background 0.15s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip button {
  background: transparent;
  color: var(--muted);
  padding: 2px 8px;
  font-weight: 700;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: none;
  line-height: 1;
}
.chip button:hover { background: rgba(243, 139, 168, 0.15); color: var(--bad); box-shadow: none; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.recipe-card {
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}
.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.recipe-card .img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface);
}
.recipe-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.recipe-card:hover img { transform: scale(1.05); }
.recipe-card .body {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recipe-card .title { font-weight: 600; font-size: 14.5px; color: var(--text); }
.recipe-card .meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.recipe-card .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-3);
}
.recipe-card .badge.good { color: var(--good); border-color: rgba(166, 227, 161, 0.4); }
.recipe-card .badge.bad { color: var(--bad); border-color: rgba(243, 139, 168, 0.4); }

table { width: 100%; border-collapse: collapse; margin-top: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--surface-2); }
th { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }

.swiper { width: 100%; padding: 8px 4px 38px; }
.swiper-slide {
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.swiper-slide:hover { transform: translateY(-3px); border-color: var(--accent); }
.swiper-slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.swiper-slide .cap { padding: 10px 14px; font-size: 13.5px; line-height: 1.45; }
.swiper-slide .cap strong { display: block; margin-bottom: 4px; }
.swiper-button-next, .swiper-button-prev {
  color: var(--accent) !important;
  background: rgba(30, 30, 46, 0.6);
  width: 38px !important;
  height: 38px !important;
  border-radius: 50%;
  backdrop-filter: blur(6px);
}
.swiper-button-next:after, .swiper-button-prev:after { font-size: 16px !important; font-weight: 800; }
.swiper-pagination-bullet { background: var(--surface-3) !important; opacity: 1; }
.swiper-pagination-bullet-active { background: var(--accent) !important; }

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 26px;
  align-items: start;
}
.detail-hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  background: var(--surface-2);
  color: var(--good);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(166, 227, 161, 0.25);
}

#ingredient-list, #instruction-list { padding-left: 22px; }
#ingredient-list li, #instruction-list li { padding: 5px 0; }
#instruction-list li { margin-bottom: 8px; }

.status {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 20px;
  display: inline-block;
}
.status.error { color: var(--bad); }
.status.success { color: var(--good); }

.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 14px 0;
  color: var(--text);
  font-size: 14px;
}

code, pre {
  background: var(--bg-alt);
  border: 1px solid var(--surface-2);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  color: var(--accent-2);
}

footer {
  text-align: center;
  padding: 28px 20px 40px;
  color: var(--subtle);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.section, .hero { animation: fade-up 0.45s ease both; }
.recipe-card, .swiper-slide { animation: fade-up 0.4s ease both; }

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.status:empty { display: none; }

@media (max-width: 720px) {
  nav { padding: 12px 18px; }
  nav .brand { font-size: 17px; }
  nav ul { gap: 2px; flex-wrap: wrap; }
  nav ul li a { padding: 6px 10px; font-size: 13.5px; }
  main { padding: 0 18px; margin: 18px auto 32px; }
  .hero { padding: 28px 22px; }
  .hero h1 { font-size: 28px; }
  h1 { font-size: 26px; }
  .detail-hero { grid-template-columns: 1fr; gap: 18px; }
  .recipe-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .swiper-slide img { height: 180px; }
}
