:root {
  --paper: #f5f6f2;
  --surface: #ffffff;
  --ink: #14201a;
  --muted: #5e6b60;
  --line: #dce0d6;
  --green: #24604a;
  --green-dark: #1a4836;
  --amber: #d9822b;
  --amber-soft: #fbeee0;
  --amber-ink: #8a4b12;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

.scaler, .ingredients, .facts, .step, .more { scroll-margin-top: 92px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* header */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.brand__mark {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--amber);
  border-radius: 50%;
  position: relative;
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--amber);
  border-radius: 50%;
}
.nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--amber); }

/* hero */
.hero {
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(36, 96, 74, 0.08), transparent 70%),
    radial-gradient(700px 320px at 88% 0%, rgba(217, 130, 43, 0.12), transparent 65%),
    var(--paper);
  padding: clamp(40px, 7vw, 84px) 20px clamp(28px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
}
.hero__inner { max-width: 1120px; margin: 0 auto; }
.hero h1 { max-width: 16ch; margin-bottom: 0.35em; }
.hero__lead {
  max-width: 58ch;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted);
  margin-bottom: 1.6em;
}

.search { max-width: 620px; }
.search__label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}
.search__input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
.search__input::placeholder { color: #9aa39b; }
.search__input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(36, 96, 74, 0.12); }
.search__status { margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); min-height: 1.4em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--green); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* sections */
.sect { max-width: 1120px; margin: 0 auto; padding: clamp(34px, 5vw, 56px) 20px 0; }
.sect__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 26px;
}
.sect__head h2 { margin: 0; }
.sect__note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

/* grid + cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px 24px;
}
.card { background: transparent; }
.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.card__media {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--line);
  aspect-ratio: 3 / 2;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card__link:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 4px; }
.card__cat {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--amber-ink);
  font-weight: 700;
}
.card__title { font-size: 1.16rem; font-weight: 750; letter-spacing: -0.015em; line-height: 1.25; }
.card__text { font-size: 0.94rem; color: var(--muted); line-height: 1.45; }
.card__meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.card__meta b { font-weight: 400; color: #a9b2a9; }

.empty {
  margin: 30px 0 0;
  padding: 26px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* categories list */
.cats { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) 20px 0; }
.cats h2 { margin-bottom: 0.7em; }
.cats__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cats__list li { border-bottom: 1px solid var(--line); }
.cats__list a {
  display: grid;
  grid-template-columns: minmax(150px, 200px) 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 18px 4px;
  text-decoration: none;
  color: var(--ink);
}
.cats__list a:hover .cats__title { color: var(--green); }
.cats__title { font-weight: 750; font-size: 1.1rem; }
.cats__desc { color: var(--muted); font-size: 0.94rem; }
.cats__n { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

/* prose */
.prose { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) 20px; }
.prose > * { max-width: 68ch; }
.prose h2 { margin-top: 0.2em; }
.prose--wide > * { max-width: 70ch; }

/* wrap + crumbs */
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 20px 0; }
.crumbs { font-size: 0.88rem; color: var(--muted); margin-bottom: 26px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--green); text-decoration: underline; }
.crumbs span[aria-current], .crumbs span:last-child { color: var(--ink); }
.crumbs > span:not(:last-child) { margin: 0 6px; color: #b6bfb6; }

.page-head { max-width: 62ch; margin-bottom: 34px; }
.page-head h1 { margin-bottom: 0.3em; }
.page-head .lead { font-size: 1.08rem; color: var(--muted); margin-bottom: 0.6em; }
.page-head__count { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); margin: 0; }

/* recipe */
.recipe-head { max-width: 68ch; margin-bottom: 26px; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--amber-ink);
}
.recipe-head .lead { font-size: clamp(1.02rem, 1.8vw, 1.2rem); color: var(--muted); }

.facts {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.facts li {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.facts__k { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.facts__v { font-family: var(--mono); font-size: 0.98rem; font-weight: 600; }

.recipe-media { margin: 0 0 34px; }
.recipe-media img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 18px;
}

.recipe-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: clamp(26px, 4vw, 52px);
  align-items: start;
}

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.ingredients { position: sticky; top: 84px; }
.ingredients h2 { font-size: 1.25rem; margin-bottom: 0.8em; }

.scaler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  background: var(--paper);
  border-radius: 10px;
  margin-bottom: 16px;
}
.scaler__label { font-size: 0.86rem; color: var(--muted); }
.scaler__ctrl { display: flex; align-items: center; gap: 6px; }
.scaler__btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.scaler__btn:hover { border-color: var(--green); color: var(--green); }
.scaler__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.scaler__value { font-family: var(--mono); font-weight: 700; min-width: 2ch; text-align: center; font-size: 1.05rem; }

.ing { list-style: none; margin: 0; padding: 0; }
.ing__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
.ing__n { flex: 0 1 auto; }
.ing__note { display: block; font-size: 0.82rem; color: var(--muted); }
.ing__dots {
  flex: 1 1 auto;
  min-width: 18px;
  border-bottom: 1px dotted #c3cbc1;
  transform: translateY(-4px);
}
.ing__q { flex: 0 0 auto; font-family: var(--mono); font-size: 0.86rem; font-weight: 600; }
.hint { margin: 14px 0 0; font-size: 0.82rem; color: var(--muted); }

.steps h2 { font-size: 1.25rem; margin-bottom: 1em; }
.steps__list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  padding: 0 0 22px;
  position: relative;
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 46px;
  bottom: 0;
  width: 1.5px;
  background: var(--line);
}
.step__num {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1.4px var(--amber);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.step__body p { margin: 0 0 6px; }
.step__time {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.tips { margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.tips h2 { font-size: 1.15rem; }
.tips ul { margin: 0; padding-left: 20px; }
.tips li { margin-bottom: 8px; color: #2a3a30; }

.more { padding: clamp(40px, 6vw, 64px) 0 0; }
.more h2 { margin-bottom: 1.1em; }

/* footer */
.foot { margin-top: clamp(50px, 8vw, 90px); border-top: 1px solid var(--line); background: #eef1ea; }
.foot__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 20px 22px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.foot__brand { font-weight: 800; margin-bottom: 0.5em; letter-spacing: -0.02em; }
.foot__about { font-size: 0.9rem; color: var(--muted); max-width: 46ch; margin: 0; }
.foot__head { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.8em; }
.foot__col a { display: block; font-size: 0.92rem; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.foot__col a:hover { color: var(--green); text-decoration: underline; }
.foot__copy {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 30px;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 880px) {
  .recipe-grid { grid-template-columns: 1fr; }
  .ingredients { position: static; }
  .foot__inner { grid-template-columns: 1fr 1fr; }
  .foot__col:first-child { grid-column: 1 / -1; }
  .cats__list a { grid-template-columns: 1fr; gap: 4px; }
  .cats__n { order: 3; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top__inner { gap: 12px 20px; padding: 12px 16px; }
  .nav { gap: 14px; font-size: 0.88rem; }
  .top__inner { flex-wrap: nowrap; align-items: center; }
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .step { grid-template-columns: 46px 1fr; }
  .step:not(:last-child)::after { left: 19px; }
  .step__num { font-size: 1.25rem; }
  .foot__inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .card__link:hover .card__media img { transform: none; }
}

@media print {
  .top, .foot, .more, .chips, .search, .scaler, .crumbs { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .recipe-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
  .ingredients { position: static; border: none; padding: 0; }
  .box { border: none; padding: 0; }
}
