/* Публичный сайт «Марфа». Тёплая «печная» гамма вокруг бордового из значка, светлая и тёмная темы. */
:root {
  --bg: #f4efe8; --surface: #fffbf5; --sunk: #ebe3d8; --fg: #241b15; --muted: #74675a; --line: #e0d5c7;
  --brand: #8c1c34; --brand-ink: #fbf3ea; --brass: #94702f;
  --ink: #17110d; --ink-2: #221913; --ink-fg: #f3e9dc; --ink-muted: #bcaa94; --ink-line: rgba(243, 233, 220, .16);
  --font-display: "Forum", "Times New Roman", serif;
  --font-body: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 12px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #13100d; --surface: #1c1713; --sunk: #251f19; --fg: #efe5d8; --muted: #a8998a; --line: #342b23;
  --brand: #d66b7e; --brand-ink: #1a110e; --brass: #cfa65f; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #13100d; --surface: #1c1713; --sunk: #251f19; --fg: #efe5d8; --muted: #a8998a; --line: #342b23;
  --brand: #d66b7e; --brand-ink: #1a110e; --brass: #cfa65f; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: .005em; line-height: 1.08; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 74rem; margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.eyebrow { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.muted { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-brand { background: #8c1c34; color: #fbf3ea; }
.btn-brand:hover { background: #a3233f; }
.btn-ghost { border-color: var(--ink-line); color: var(--ink-fg); }
.btn-ghost:hover { border-color: var(--ink-muted); }
.btn-line { border-color: var(--line); color: var(--fg); background: var(--surface); }
.btn-line:hover { border-color: var(--muted); }

/* Шапка */
.top { position: sticky; top: 0; z-index: 30; background: var(--ink); color: var(--ink-fg); padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--ink-line); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; flex: none; }
.logo img { height: 40px; width: auto; }
@media (max-width: 26rem) { .logo img { height: 30px; } }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--ink-muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink-fg); }
.top .phone { color: var(--ink-fg); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.top .btn { min-height: 40px; padding: 0 16px; font-size: 14.5px; }
.subnav { display: none; }
@media (max-width: 56rem) {
  .nav, .top .phone { display: none; }
  .top .btn { margin-left: auto; }
  .subnav { display: flex; gap: 6px; overflow-x: auto; padding: 0 var(--gutter-r) 10px var(--gutter); scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { flex: none; color: var(--ink-muted); text-decoration: none; font-size: 14px; padding: 5px 12px; border: 1px solid var(--ink-line); border-radius: 999px; }
  .subnav a[aria-current="page"] { color: var(--ink-fg); border-color: var(--ink-muted); }
}

/* Первый экран */
.hero { background: var(--ink); color: var(--ink-fg); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding-block: 44px 56px; }
.hero h1 { font-size: clamp(42px, 6.2vw, 76px); margin-top: 14px; }
.hero .lead { color: var(--ink-muted); font-size: 18px; max-width: 32ch; margin-top: 16px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--ink-line); font-size: 13.5px; color: var(--ink-muted); }
.facts b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--ink-fg); line-height: 1.2; font-variant-numeric: tabular-nums; }
.collage { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 1 / 1; max-width: 100%; }
.collage figure { margin: 0; overflow: hidden; border-radius: var(--r); background: var(--ink-2); }
.collage figure:first-child { grid-row: 1 / 3; }
.collage img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 56rem) {
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; padding-block: 28px 36px; }
  .collage { aspect-ratio: 4 / 3; }
}

/* Секции */
.section { padding-block: 64px; }
.section + .section { padding-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 50px); margin-top: 8px; }
@media (max-width: 40rem) { .section { padding-block: 44px; } }

/* Хиты */
.hits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hit { display: grid; gap: 12px; }
.hit figure { margin: 0; overflow: hidden; border-radius: var(--r); aspect-ratio: 4 / 5; background: var(--sunk); }
.hit img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hit:hover img { transform: scale(1.03); }
.hit h3 { font-size: 26px; }
.hit .price { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .hits { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory;
    margin-right: calc(-1 * var(--gutter-r)); padding-right: var(--gutter-r); scrollbar-width: none; }
  .hits::-webkit-scrollbar { display: none; }
  .hit { scroll-snap-align: start; }
}

/* О ресторане */
.about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.about .text { display: grid; gap: 18px; }
.about .text p { font-size: 18px; max-width: 46ch; }
.about figure { margin: 0; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 5; max-height: 34rem; }
.about figure img { width: 100%; height: 100%; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
@media (max-width: 56rem) { .about { grid-template-columns: 1fr; } .about figure { aspect-ratio: 4 / 3; } }

/* Галерея */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 15rem; gap: 12px; }
.gallery figure { margin: 0; overflow: hidden; border-radius: var(--r); background: var(--sunk); position: relative; }
.gallery figure:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px; font-size: 13.5px; color: #f3e9dc;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
@media (max-width: 56rem) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 11rem; } }

/* Контакты */
.contacts { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: stretch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; display: grid; gap: 18px; align-content: start; }
.kv { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv a { text-decoration: none; border-bottom: 1px solid var(--line); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.map { min-height: 22rem; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--sunk); }
.map iframe { width: 100%; height: 100%; min-height: 22rem; border: 0; display: block; }
@media (max-width: 56rem) { .contacts { grid-template-columns: 1fr; } }
@media (max-width: 30rem) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }

/* Меню */
.menu-head { background: var(--ink); color: var(--ink-fg); }
.menu-head .wrap { padding-block: 36px 30px; display: grid; gap: 10px; }
.menu-head h1 { font-size: clamp(40px, 6vw, 64px); }
.menu-head p { color: var(--ink-muted); }
.cats { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.cats .wrap { display: flex; gap: 6px; overflow-x: auto; padding-block: 10px; scrollbar-width: none; }
.cats .wrap::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; }
.cats a.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
@media (max-width: 56rem) { .cats { top: calc(104px + env(safe-area-inset-top, 0px)); } }
.menu-cat { padding-block: 40px 8px; scroll-margin-top: 9rem; }
.menu-cat h2 { font-size: clamp(30px, 4vw, 42px); }
.menu-cat .note { color: var(--muted); margin-top: 4px; }
.dishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 26px 20px; margin-top: 22px; }
.dish { display: grid; gap: 10px; align-content: start; }
.dish figure { margin: 0; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 5; background: var(--sunk); }
.dish img { width: 100%; height: 100%; object-fit: cover; }
.dish .t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dish h3 { font-size: 23px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.dish p { color: var(--muted); font-size: 14.5px; }
.dish .w { color: var(--muted); font-size: 13px; }
@media (max-width: 40rem) {
  .dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .dish h3 { font-size: 19px; }
  .dish .t { display: grid; gap: 2px; }
  .dish p { font-size: 13.5px; }
}
.badge { justify-self: start; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.plain { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 0 36px; }
.plain li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.plain b { font-weight: 500; }
.plain p { grid-column: 1 / -1; color: var(--muted); font-size: 14.5px; }

/* Простые страницы */
.page { padding-block: 48px 72px; display: grid; gap: 18px; max-width: 46rem; }
.page h1 { font-size: clamp(36px, 5vw, 54px); }
.page h2 { font-size: 26px; margin-top: 18px; }
.page p, .page li { font-size: 16.5px; }

/* Подвал */
.foot { background: var(--ink); color: var(--ink-muted); font-size: 14px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot .wrap { display: flex; justify-content: space-between; gap: 14px 28px; flex-wrap: wrap; padding-block: 28px; }
.foot a { color: var(--ink-fg); text-decoration: none; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot .legal { flex-basis: 100%; order: 3; font-size: 12.5px; max-width: 70ch; opacity: .85; }
.foot-brand { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.foot-brand img { height: 28px; width: auto; }

/* Бронирование (booking_form.html, booking.js) */
:root { --ok: #2e7a4c; --warn: #9c650f; --bad: #ad3f2c; --info: #2f5fae; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #6cc28f; --warn: #e0a64a; --bad: #e8826f; --info: #7aa7e8; } }
:root[data-theme="dark"] { --ok: #6cc28f; --warn: #e0a64a; --bad: #e8826f; --info: #7aa7e8; }
.bk { padding-block: 32px 64px; display: grid; gap: 22px; }
.bk-head { display: grid; gap: 8px; max-width: 46rem; }
.bk-head h1 { font-size: clamp(36px, 5vw, 54px); }
.bk-note { background: var(--sunk); border-radius: var(--r); padding: 10px 14px; font-size: 14px; }
.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 20px; align-items: start; }
.bk-main { display: grid; gap: 16px; min-width: 0; }
.bk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 16px; min-width: 0; }
.bk-card h2 { font-size: 26px; }
.bk-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; }
.bk-field { display: grid; gap: 7px; min-width: 0; }
.bk-label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.bk-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.bk-day { flex: none; width: 3.6rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 10px; padding: 7px 0; line-height: 1.2; font: inherit; cursor: pointer; }
.bk-day small { display: block; font-size: 11.5px; color: var(--muted); }
.bk-day b { font-size: 18px; font-weight: 600; }
.bk-day[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bk-day[aria-checked="true"] small { color: inherit; opacity: .85; }
.bk-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; justify-self: start; }
.bk-stepper button { width: 46px; height: 44px; border: 0; background: var(--bg); color: var(--fg); font-size: 20px; cursor: pointer; }
.bk-stepper button:disabled { opacity: .35; cursor: default; }
.bk-stepper output { min-width: 6.5rem; text-align: center; font-weight: 600; }
.bk-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 6px; }
.bk-slots p { grid-column: 1 / -1; }
.bk-slot { border: 1px solid var(--line); background: var(--bg); color: var(--fg); border-radius: 9px; padding: 9px 0; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.bk-slot:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.bk-slot[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.bk-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.bk-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-free { border: 2px solid var(--ok); } .lg-busy { background: var(--line); } .lg-small { border: 1.5px dashed var(--muted); }
.bk-floor { width: 100%; height: auto; display: block; background: var(--sunk); border-radius: 10px; }
.bk-floor text { font-family: var(--font-body); font-size: 26px; font-weight: 600; fill: var(--fg); pointer-events: none; }
.bk-floor text.seats { font-size: 15px; font-weight: 400; fill: var(--muted); }
.bk-floor .chair { fill: var(--line); }
.bk-floor .top { stroke-width: 2.5; }
.bk-floor .free .top { fill: var(--surface); stroke: var(--ok); }
.bk-floor .free, .bk-floor .sel { cursor: pointer; }
.bk-floor .free:hover .top { fill: var(--bg); }
.bk-floor .busy .top { fill: var(--line); stroke: var(--line); }
.bk-floor .busy text { fill: var(--muted); }
.bk-floor .small .top { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 6 5; }
.bk-floor .small text { fill: var(--muted); }
.bk-floor .sel .top { fill: var(--brand); stroke: var(--brand); }
.bk-floor .sel .chair { fill: var(--brand); opacity: .55; }
.bk-floor .sel text { fill: var(--brand-ink); }
.bk-floor g:focus-visible { outline: none; }
.bk-floor g:focus-visible .top { stroke: var(--brass); stroke-width: 5; }
.bk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-card input, .bk-card textarea { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--fg); width: 100%; }
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bk-check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.bk-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.bk-summary { position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); }
.bk-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.bk-summary dt { color: var(--muted); } .bk-summary dd { margin: 0; text-align: right; font-weight: 500; }
.bk-submit { width: 100%; }
.bk-submit:disabled { opacity: .45; cursor: not-allowed; }
.bk-small { font-size: 13px; }
.bk-error { color: var(--bad); font-size: 14.5px; }
.bk-ok { color: var(--ok); }
.bk-done { border-color: var(--ok); max-width: 40rem; }
.bk-done .btn { justify-self: start; }
.bk-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 13.5px; font-weight: 500; background: var(--sunk); }
.bk-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pending { color: var(--warn); } .st-confirmed { color: var(--info); } .st-arrived { color: var(--ok); }
.st-cancelled, .st-declined { color: var(--muted); } .st-noshow { color: var(--bad); }
@media (max-width: 56rem) {
  .bk-grid { grid-template-columns: 1fr; }
  .bk-summary { position: sticky; bottom: 0; top: auto; z-index: 10; border-radius: var(--r) var(--r) 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .12); gap: 10px; }
  .bk-summary dl { grid-template-columns: repeat(4, auto); gap: 2px 10px; font-size: 13.5px; }
  .bk-summary dt { grid-row: 1; } .bk-summary dd { grid-row: 2; text-align: left; }
  .bk-summary .eyebrow, .bk-small { display: none; }
}
@media (max-width: 30rem) { .bk-two { grid-template-columns: 1fr; } .bk-card { padding: 16px; } }

/* Частые вопросы */
.faq { display: grid; gap: 8px; max-width: 52rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 18px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 17px; list-style-position: outside; }
.faq details p { padding: 0 0 14px; color: var(--muted); max-width: 60ch; }
