:root {
  --paper: #f4eee4;
  --paper-2: #ebe2d3;
  --cream: #f8f2e7;
  --ink: #1d2822;
  --ink-soft: #405048;
  --muted: #73776c;
  --line: #d5c9b6;
  --forest: #1f332a;
  --pomegranate: #972f2f;
  --brass: #b2833c;
  --display: "Prata", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--pomegranate); color: var(--cream); }

a { color: inherit; }

button, input, select { font: inherit; }

button { color: inherit; }

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

.hero :focus-visible { outline-color: var(--brass); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 14px;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.wrap {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

/* Header */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 238, 228, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.head-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.32rem;
  letter-spacing: 0.005em;
}

.brand-mark {
  width: 27px;
  height: 27px;
  color: var(--pomegranate);
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover { color: var(--pomegranate); border-color: currentColor; }

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--forest);
  color: var(--cream);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 48px;
  padding: 88px 0 44px;
}

.hero-copy { min-width: 0; }

.hero-kicker {
  margin: 0 0 22px;
  color: var(--brass);
  font-size: 0.82rem;
  letter-spacing: 0.045em;
}

.hero h1 {
  margin: 0 0 26px;
  max-width: 13ch;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.9rem, 6.3vw, 5.5rem);
  line-height: 0.99;
  letter-spacing: -0.022em;
}

.hero-lede {
  max-width: 54ch;
  margin: 0;
  color: #d5ded4;
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  line-height: 1.6;
}

.hero-search {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 34px 0 24px;
  border-bottom: 1px solid rgba(248, 242, 231, 0.38);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  padding: 14px 2px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-size: 1.02rem;
}

.hero-search input::placeholder { color: rgba(248, 242, 231, 0.48); }

.hero-search button {
  flex: none;
  border: 0;
  background: var(--pomegranate);
  color: var(--cream);
  padding: 0 22px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease;
}

.hero-search button:hover { background: #812626; }

.ledger {
  margin: 0;
  color: #aebcaf;
  font-size: 0.8rem;
  letter-spacing: 0.015em;
}

.ledger span { color: var(--brass); padding: 0 0.65em; }

.hero-mark {
  position: relative;
  align-self: end;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 250px;
  text-align: right;
}

.hero-word {
  color: rgba(248, 242, 231, 0.07);
  font-family: "Sylfaen", "Segoe UI", "Noto Sans Georgian", sans-serif;
  font-size: clamp(5.5rem, 12vw, 9.5rem);
  line-height: 0.8;
  letter-spacing: 0.01em;
  -webkit-text-stroke: 1px rgba(248, 242, 231, 0.3);
}

.hero-word-note {
  max-width: 24ch;
  margin-top: 18px;
  color: #9fb0a2;
  font-size: 0.74rem;
  line-height: 1.45;
}

/* Sections */

.section {
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.section-catalog { background: rgba(235, 226, 211, 0.28); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 410px);
  gap: 40px;
  align-items: end;
  margin-bottom: 34px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--pomegranate);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 1.04;
  letter-spacing: -0.012em;
}

.section-note {
  justify-self: end;
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Recipes */

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

.recipe-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 220px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.recipe-card:hover {
  border-color: var(--ink-soft);
  background: var(--cream);
}

.recipe-cat {
  color: var(--pomegranate);
  font-size: 0.74rem;
}

.recipe-name {
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.15;
}

.recipe-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.recipe-open {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 18px;
  border-bottom: 1px solid currentColor;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.recipe-mark { color: var(--pomegranate); }

.recipe-meta-line {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.ingredient-table {
  width: 100%;
  margin: 0 0 24px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.ingredient-table th {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-align: left;
}

.ingredient-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.ingredient-table th:first-child,
.ingredient-table td:first-child { padding-left: 0; }

.ingredient-table th:last-child,
.ingredient-table td:last-child { padding-right: 0; }

.ingredient-table td.amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.recipe-steps {
  margin: 0 0 24px;
  padding-left: 1.25em;
}

.recipe-steps li { margin-bottom: 8px; }

.recipe-steps li::marker { color: var(--pomegranate); }

.recipe-result {
  margin: 0 0 20px;
}

.recipe-notes {
  margin: 0 0 20px;
  padding-left: 1.1em;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.recipe-notes li { margin-bottom: 5px; }

/* Shortlist */

.menu-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: 1px solid var(--line);
}

.menu-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  width: 100%;
  padding: 18px 8px 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, padding-left 180ms ease;
}

.menu-row:hover { background: var(--paper-2); padding-left: 10px; }

.menu-main { display: flex; flex-direction: column; gap: 2px; }

.menu-cat {
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.02em;
}

.menu-name {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.2;
}

.menu-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

/* Toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 28px 0 10px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--cream);
  color: var(--ink);
  appearance: none;
}

.field select {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.search-field { flex: 1 1 230px; max-width: 420px; }

.select-field { flex: 0 0 210px; }

.chips {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  order: 3;
}

.chip {
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.chip:hover { border-color: var(--ink-soft); }

.chip.active {
  border-color: var(--forest);
  background: var(--forest);
  color: var(--cream);
}

.result-line {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

/* Catalog list */

.group-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: 1px solid var(--line);
}

.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  width: 100%;
  padding: 14px 8px 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, padding-left 160ms ease;
}

.group-row:hover { background: var(--paper-2); padding-left: 8px; }

.group-name {
  grid-column: 1;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1.25;
}

.group-cat {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.73rem;
}

.group-count {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  color: var(--pomegranate);
  font-size: 0.74rem;
  white-space: nowrap;
}

.group-date {
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Sources table */

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.source-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.source-table th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.source-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.source-table th:first-child,
.source-table td:first-child { padding-left: 0; }

.source-table th:last-child,
.source-table td:last-child { padding-right: 0; }

.source-table td.date,
.source-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.source-table td.num { text-align: right; }

.source-table a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.source-table a:hover { color: var(--pomegranate); border-color: currentColor; }

.dish-tag {
  display: inline-block;
  padding: 2px 7px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 0.73rem;
  line-height: 1.4;
}

.more {
  margin-top: 24px;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.more:hover { background: var(--ink); color: var(--paper); }

/* Footer */

.site-foot {
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}

.foot-inner p { margin: 0; }

/* Detail dialog */

.detail {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(18, 29, 23, 0.38);
}

.detail::backdrop {
  background: rgba(18, 29, 23, 0.56);
  backdrop-filter: blur(2px);
}

.detail[open] { animation: detail-in 220ms ease-out; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(10px) scale(0.992); }
  to { opacity: 1; transform: none; }
}

.detail-shell {
  position: relative;
  max-height: calc(100vh - 48px);
  padding: 32px 32px 28px;
  overflow-y: auto;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.detail-close:hover { border-color: var(--line); color: var(--ink); }

.detail-cat {
  margin: 0 0 8px;
  color: var(--pomegranate);
  font-size: 0.78rem;
}

.detail-title {
  margin: 0 0 10px;
  padding-right: 30px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.08;
}

.detail-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-base-card {
  display: block;
  margin: 18px 0 26px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.detail-base-card:hover { border-color: var(--ink-soft); background: #fbf7ef; }

.detail-base-label {
  display: block;
  margin-bottom: 5px;
  color: var(--pomegranate);
  font-size: 0.72rem;
}

.detail-base-title {
  display: block;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.3;
}

.detail-base-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.detail-sub {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
}

.detail-sources {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.detail-sources li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.83rem;
}

.detail-sources .src-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.detail-sources .src-channel {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
}

.detail-sources a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.detail-sources a:hover { color: var(--pomegranate); border-color: currentColor; }

.detail-foot {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

/* Responsive */

@media (max-width: 920px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 64px 0 38px;
  }

  .hero-mark { display: none; }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-note { justify-self: start; }

  .menu-list,
  .group-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 104px; }

  .wrap { width: calc(100% - 32px); }

  .head-inner {
    min-height: 0;
    padding: 14px 0 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .brand { font-size: 1.22rem; }

  .nav { gap: 18px; }

  .hero-inner { padding: 48px 0 34px; }

  .hero h1 { max-width: 100%; }

  .hero-search { margin-top: 28px; }

  .hero-search button { padding: 0 16px; }

  .section { padding: 56px 0; }

  .toolbar { align-items: stretch; }

  .search-field,
  .select-field { flex: 1 1 100%; max-width: none; }

  .menu-row { padding-right: 0; }

  .source-table th:nth-child(3),
  .source-table td:nth-child(3) { display: none; }

  .source-table th.num,
  .source-table td.num { display: none; }

  .detail-shell { padding: 28px 20px 24px; }

  .detail-sources li { grid-template-columns: 74px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
