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

:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --paper: #f5faf6;
  --panel: #ffffff;
  --accent: #16a34a;
  --accent-strong: #0f9f6e;
  --accent-amber: #f59e0b;
  --accent-blue: #0ea5e9;
  --border: #e2e8f0;
  --shadow-soft: 0 20px 45px -28px rgba(15, 23, 42, 0.5);
  --shadow-card: 0 18px 40px -32px rgba(15, 23, 42, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rubik", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, rgba(52, 211, 153, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.16), transparent 24%),
    linear-gradient(135deg, #f9fafb 0%, #f5faf6 45%, #f0fdf4 100%);
  min-height: 100vh;
}

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

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

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent;
}

.shell {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

.page-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.top {
  padding: 1.25rem 0 0.5rem;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.brand-text {
  display: grid;
  gap: 0.1rem;
  line-height: 1.1;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.hero-panel {
  background: var(--panel);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: 0 28px 60px -38px rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
  display: grid;
  gap: 1rem;
}

.hero-compact {
  padding: 1.5rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.hero-copy h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.2rem 0 0.6rem;
  font-weight: 800;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent-strong);
  margin: 0;
}

.lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0;
}

.search-card {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.6rem;
  width: 100%;
}

.search-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.45rem 0.45rem 0.45rem 0.75rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  min-height: 60px;
}

.search-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent-strong);
  background: #e2fbe8;
  flex-shrink: 0;
}

.search-icon svg {
  width: 18px;
  height: 18px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.8rem 0.6rem;
  font-size: 1.02rem;
  color: var(--ink);
}

.search-bar input:focus {
  outline: none;
}

.search-help {
  margin: 0;
  color: var(--ink-soft);
}

.chip-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.pill.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
}

.pill-strong {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  box-shadow: 0 12px 24px -14px rgba(22, 163, 74, 0.9);
}

.pill-soft {
  background: #ecfdf3;
  color: #047857;
  border-color: #bbf7d0;
}

.pill-ghost {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.pill-muted {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}

.results {
  margin-bottom: 1rem;
  background: transparent;
  margin-top: 0.5rem;
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-title {
  font-size: 1.7rem;
  margin: 0 0 0.25rem;
}

.results-meta {
  margin: 0;
  color: var(--ink-soft);
}

.results-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  grid-auto-rows: 1fr;
}

.card {
  background: var(--panel);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  animation: rise 0.35s ease both;
  animation-delay: calc(var(--delay) * 50ms);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px -32px rgba(16, 185, 129, 0.55);
}

.card-link {
  display: grid;
  height: 100%;
  color: inherit;
}

.card-media {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(14, 165, 233, 0.12));
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.card-badges {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  gap: 0.35rem;
  justify-items: end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 10px 24px -16px rgba(15, 23, 42, 0.8);
}

.badge-light {
  background: #ecfdf3;
  color: #047857;
  border: 1px solid #bbf7d0;
  box-shadow: none;
}

.card-body {
  padding: 1.05rem 1.15rem 1.2rem;
  display: grid;
  gap: 0.65rem;
}

.card-meta {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.card-body h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.card-intro {
  margin: 0;
  color: var(--ink-soft);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cta-link {
  color: var(--accent-strong);
  font-weight: 800;
}

.empty {
  padding: 2rem;
  border-radius: 16px;
  border: 1px dashed var(--border);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.pagination {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: min(70%, 720px);
  margin-left: auto;
  margin-right: auto;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #ffffff;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 12px 30px -20px rgba(22, 163, 74, 0.85);
  font-weight: 800;
  letter-spacing: 0.01em;
  min-height: 44px;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.page-link.is-disabled {
  opacity: 0.65;
  pointer-events: none;
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
}

.page-status {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: center;
}

.crumbs {
  margin: 1rem 0 1.25rem;
  color: var(--ink-soft);
}

.crumbs a {
  color: var(--accent-strong);
  font-weight: 700;
}

.recipe-page {
  margin-bottom: 3rem;
}

.recipe-hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  background: var(--panel);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.detail-hero h1 {
  margin: 0.3rem 0 0.6rem;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.pill-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.meta-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  font-size: 0.95rem;
}

.meta-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}

.tag-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.pill-stack {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.pill-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.pill-row.labeled {
  gap: 0.35rem;
}

.tag-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 0.2rem;
}

.tag {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #ecfdf3;
  color: #065f46;
  font-weight: 500;
  font-size: 0.8rem;
}

.tag.muted {
  background: #eef2ff;
  color: #4338ca;
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.hero-media.framed {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(14, 165, 233, 0.1));
  border: 1px solid var(--border);
}

.recipe-grid {
  margin-top: 2rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-surface {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-card);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.ingredients ul,
.instructions ol {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink);
}

.ingredients li,
.instructions li {
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.instructions ol.unstyled-steps {
  list-style: none;
  padding-left: 0;
}

.qty {
  font-weight: 800;
  margin-right: 0.3rem;
}

.unit {
  margin-right: 0.35rem;
  color: var(--ink-soft);
}

.step {
  display: inline-block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.notes {
  margin-top: 1.4rem;
}

.footer {
  margin-top: auto;
  padding: 2rem 0 2.5rem;
  background: rgba(255, 255, 255, 0.6);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: grid;
  gap: 0.35rem;
  color: var(--ink-soft);
}

.footer-note {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
    transition: none;
    transform: none;
  }
}

@media (max-width: 720px) {
  body {
    background: #f8fafc;
  }

  .shell {
    width: 96vw;
  }

  .hero-panel {
    padding: 1.1rem 1.2rem;
    border-radius: 20px;
  }

  .search-bar {
    padding: 0.4rem 0.4rem 0.4rem 0.7rem;
    border-radius: 14px;
  }

  .results-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }

  .card {
    border-radius: 20px;
  }

  .card-media {
    height: 170px;
  }

  .page-link {
    display: inline-flex;
    width: auto;
    min-width: 120px;
    text-align: center;
    min-height: 44px;
  }

  .page-status {
    width: auto;
    text-align: center;
  }
}
