:root {
  --paper: #f7efe0;
  --card: #fffaf2;
  --ink: #3b2718;
  --mute: #7a5f48;
  --berry: #c44536;
  --leaf: #3f7d4e;
  --butter: #e8b84a;
  --line: rgba(59, 39, 24, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 0%, rgba(232, 184, 74, 0.22), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: Nunito, ui-sans-serif, system-ui, sans-serif;
}

button { font: inherit; color: inherit; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + var(--safe-top)) 16px 12px;
  background: rgba(247, 239, 224, 0.92);
  border-bottom: 1px solid var(--line);
}

.brand strong {
  display: block;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--mute);
}

.back {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0 14px;
}

#view { padding: 16px; }

.hero-copy h1 {
  margin: 0 0 6px;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.7rem;
}

.hero-copy p {
  margin: 0 0 16px;
  color: var(--mute);
  line-height: 1.45;
}

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.cats button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
}

.cats button.on {
  background: var(--berry);
  color: #fff;
  border-color: transparent;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  min-height: 210px;
}

.card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #ead9b8;
}

.card .meta {
  padding: 10px 11px 12px;
}

.card h2 {
  margin: 0 0 4px;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.02rem;
  line-height: 1.2;
}

.card span {
  color: var(--mute);
  font-size: 0.78rem;
}

.recipe img.hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #ead9b8;
}

.kicker {
  margin: 12px 0 4px;
  color: var(--berry);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}

.recipe h1 {
  margin: 0 0 8px;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 2rem;
  line-height: 1.1;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.facts b {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.why, .helper {
  margin: 0 0 14px;
  line-height: 1.45;
}

.helper { color: var(--leaf); font-weight: 700; }

.recipe h2 {
  margin: 18px 0 8px;
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 1.15rem;
}

.recipe ul, .recipe ol {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
}

.recipe li { margin: 0 0 8px; }

.recipe ol li::marker { font-weight: 800; color: var(--berry); }
