/* Публичное меню (страница целиком). Карточки блюд: cards.css.
   Эталон: docs/reference/index.html — телефон до 1024 px, компьютер от 1024 px. */

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
/* Без scroll-behavior: smooth на всей странице: плавный переход к разделу делает menu.js по клику */
html { background: var(--linen); }
body { margin: 0; background: var(--linen); font-family: var(--font-body); color: var(--ink); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
h3 { margin: 0; font: inherit; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { max-width: 1280px; margin: 0 auto; }

/* ───── Шапка ───── */
.hero { position: relative; height: 290px; overflow: hidden; background: var(--ink); }
.hero .ph { position: absolute; inset: 0; background-color: var(--ink); }
.hero .ph img { object-position: 38% 50%; }
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; padding: 12px; }
.logo, .toplinks, .call { display: none; }
.langs { display: flex; gap: 6px; margin-left: auto; }
.langs a { display: grid; place-items: center; min-width: 44px; height: 32px; border: 1.5px solid var(--linen); background: rgba(26,23,20,.6); color: var(--linen); border-radius: 16px; font: 700 13px var(--font-body); text-decoration: none; }
.langs a[aria-current] { background: var(--linen); color: var(--ink); }
.brandbar { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(26,23,20,.86); color: var(--linen); }
.brandbar .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 10px 18px 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .emblem { flex: none; }
.brand .script { font-family: var(--font-script); font-size: 22px; line-height: 1; color: var(--gold); }
.brand h1 { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 32px; line-height: 1.05; }
.brandbar .lead { display: none; }

.intro { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 4px; text-align: center; }
.intro p { margin: 0; }
.intro .sub { font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.intro .txt { font-size: 15px; line-height: 1.45; }
.intro i { color: var(--red); }

/* ───── Плашка-объявление ───── */
.page > .revelion { padding: 14px 16px 0; }

/* ───── Раскладка: на телефоне категории прилипают к верху лентой ───── */
.layout { width: 100%; }
aside { position: sticky; top: 0; z-index: 5; background: var(--linen); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
aside.stuck { box-shadow: 0 4px 10px rgba(35,31,28,.08); border-bottom-color: var(--line); }
.navlabel, .contacts, aside > .band { display: none; }
.cats { position: relative; display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--red); color: var(--red); text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; transition: background-color .25s ease-out, color .25s ease-out; }
.cats a svg { display: none; }
.cats a.on { background: var(--red); color: var(--linen); }
/* С JS фон рисует одна плашка, которая скользит между категориями */
.cats .pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 22px; background: var(--red); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), width .35s var(--ease), height .35s var(--ease), opacity .2s; }
.cats.pilled a.on { background: transparent; }

main { display: flex; flex-direction: column; gap: 32px; padding: 10px 16px 32px; min-width: 0; }
section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 76px; }
.sechead { display: flex; align-items: center; gap: 10px; }
.sechead .dia { flex: none; }
.sechead h2 { margin: 0; font-family: var(--font-head); font-size: 27px; line-height: 1.1; color: var(--red); }
.sechead .rule { display: none; }
.secnote { margin: -6px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }

footer { margin-top: auto; background: var(--ink); color: var(--linen); }
footer .wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
footer .script { display: none; }
footer .bye { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--gold); }
footer .info { font-size: 14px; color: var(--dark-muted); line-height: 1.5; }
footer .info a { color: var(--gold); }
footer .credit { font-size: 11px; color: #9C8F7E; }

/* ───── Компьютер ───── */
@media (min-width: 1024px) {
    .hero { height: 560px; }
    .hero .ph img { object-position: 50% 42%; }
    .topbar { background: rgba(26,23,20,.72); }
    .topbar .wrap { padding: 14px 48px; }
    .logo { display: flex; align-items: center; gap: 10px; flex: 1; text-decoration: none; }
    .logo span { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--linen); }
    .toplinks { display: flex; gap: 28px; }
    .toplinks a { color: var(--dark-muted); text-decoration: none; font-weight: 500; font-size: 16px; padding-bottom: 2px; }
    .toplinks a:hover { color: var(--linen); }
    .toplinks a.cur { color: var(--linen); font-weight: 700; border-bottom: 2px solid var(--gold); }
    .langs { margin-left: 0; }
    .langs a { height: 34px; border-radius: 17px; }
    .langs a:not([aria-current]) { background: transparent; }
    .call { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 22px; background: var(--red); color: var(--linen); text-decoration: none; font-weight: 700; font-size: 15px; }
    .call:hover { background: #86162A; }
    .brandbar .wrap { padding: 28px 48px 32px; }
    .brand { gap: 20px; }
    .brand .emblem { width: 60px; height: 69px; }
    .brand .script { font-size: 32px; }
    .brand h1 { font-size: 64px; line-height: 1; }
    .brandbar .lead { display: block; margin: 0; max-width: 440px; font-size: 17px; line-height: 1.5; color: var(--dark-muted); }
    .brandbar .lead i { color: var(--gold); }
    .intro { display: none; }

    /* Нижний отступ внутри main, а не у .layout: иначе прилипшей колонке не хватает места над подвалом */
    .layout { max-width: 1280px; margin: 0 auto; padding: 48px 48px 0; display: flex; gap: 48px; align-items: flex-start; }
    aside { flex: 0 0 260px; top: 24px; background: none; display: flex; flex-direction: column; gap: 28px; border: 0; }
    aside.stuck { box-shadow: none; }
    aside > .band { display: block; }
    .navlabel { display: block; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 14px 6px; }
    .cats { flex-direction: column; gap: 6px; padding: 0; overflow: visible; }
    .cats a { height: auto; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; color: var(--ink); font-weight: 500; font-size: 17px; white-space: normal; }
    .cats a svg { display: block; flex: none; }
    .cats a:hover { background: #EADFCB; }
    .cats a.on { background: var(--red); color: var(--linen); font-weight: 700; }
    .cats.pilled a.on, .cats.pilled a.on:hover { background: transparent; }
    .cats .pill { border-radius: 10px; }
    .contacts { display: flex; flex-direction: column; gap: 10px; padding: 0 14px; scroll-margin-top: 24px; }
    .contacts .lbl { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
    .contacts .tel { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--red); text-decoration: none; }
    .contacts .addr { font-size: 15px; line-height: 1.5; }
    footer { scroll-margin-top: 24px; }

    main { flex: 1; padding: 0 0 80px; gap: 56px; }
    section { gap: 24px; scroll-margin-top: 24px; }
    .sechead { gap: 16px; }
    .sechead h2 { font-size: 38px; }
    .sechead .rule { display: block; flex: 1; border-top: 2px dotted #C9B89C; margin-top: 6px; }
    .secnote { margin: 0; font-size: 16px; }
    .layout .sauces { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 48px; padding: 8px 32px 12px; border-radius: 12px; }
    .layout .sauce { gap: 14px; padding: 18px 0; }
    .layout .sauce:last-child { border-bottom: 1px dashed #D3C3A7; }
    .layout .sauce .nm { font-size: 18px; }
    .layout .sauce .pr { font-size: 16px; }
    .layout .sauce .ds { margin-top: 4px; font-size: 14.5px; line-height: 1.4; }

    /* Фирменное: фото слева, текст справа */
    .layout .feat { flex-direction: row; border-radius: 14px; }
    .layout .feat .pic { flex: 3 1 0; min-width: 0; height: 380px; aspect-ratio: auto; border-radius: 14px 0 0 14px; }
    .layout .feat .body { flex: 2 1 0; justify-content: center; gap: 12px; padding: 36px 40px; }
    /* Лента в правом верхнем углу повторяет скругление карточки (своя обрезка, карточка не обрезает) */
    .layout .feat .body > .band { position: absolute; top: 0; left: 0; width: 100%; margin: 0; clip-path: inset(0 0 -14px 0 round 0 14px 0 0); }
    .layout .feat .label { font-size: 13px; letter-spacing: .18em; }
    .layout .feat .row { flex-direction: column; gap: 12px; }
    .layout .feat .name { font-size: 38px; line-height: 1.05; }
    .layout .feat .price { font-size: 22px; }
    .layout .feat .desc { font-size: 17px; line-height: 1.5; }
    .layout .feat .story { font-size: 15px; line-height: 1.45; padding-top: 12px; }

    .layout .grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
    .layout .card { border-radius: 12px; }
    .layout .card .pic { border-radius: 11px 11px 0 0; }
    .layout .card, .anim .layout .card { transition: opacity .35s var(--ease), transform .25s ease, box-shadow .25s ease; }
    .layout .card.in:hover, html:not(.anim) .layout .card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(35,31,28,.10); }
    .layout .card .body { gap: 6px; padding: 16px 18px 18px; }
    .layout .card .head { display: flex; gap: 12px; align-items: baseline; order: 1; }
    .layout .card .name { flex: 1; font-size: 19px; }
    .layout .card .price { font-size: 17px; white-space: nowrap; }
    .layout .card .desc { font-size: 15px; line-height: 1.45; }
    .layout .card .story { font-size: 14px; line-height: 1.45; padding-top: 10px; margin-top: 4px; }
    .layout .stamp { font-size: 14px; padding: 6px 14px; }

    footer .wrap { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 40px; padding: 40px 48px 44px; text-align: left; }
    footer .script { display: block; font-family: var(--font-script); font-size: 24px; color: var(--gold); line-height: 1; }
    footer .bye { font-size: 34px; color: var(--linen); }
    footer .info { font-size: 15px; }
    footer .credit { font-size: 13px; color: #A89A86; max-width: 280px; }

    .page > .revelion { width: 100%; max-width: 1280px; margin: 0 auto; padding: 40px 48px 0; }
    .page > .revelion article { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; padding: 36px 44px; border-radius: 16px; }
    .page > .revelion .info { display: flex; align-items: center; gap: 24px; flex: 1 1 480px; }
    .page > .revelion .star { display: block; flex: none; }
    .page > .revelion .ttl { font-size: 38px; line-height: 1.05; }
    .page > .revelion .txt { font-size: 16px; }
    .page > .revelion .btn { align-self: auto; height: 52px; padding: 0 26px; border-radius: 26px; font-size: 17px; margin-top: 0; }
}

/* ───── Зимняя тема (html.winter). Цвета и карточки — в cards.css ───── */
.winter .hero { background: var(--pine); }
.winter .hero .ph { background-color: var(--pine); }
.winter .hero .ph img { filter: saturate(.75) brightness(.92); }
.winter .brandbar { background: rgba(23,58,46,.9); }
.winter .langs a { background: rgba(23,58,46,.6); }
.winter .langs a[aria-current] { background: var(--linen); color: var(--ink); }
.winter .sechead .dia polygon { fill: var(--pine); }
.winter footer { background: var(--pine); }
.snow { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; background-repeat: repeat; }
.snow.s1 { top: -140px; background-color: rgba(201,220,228,.14); background-size: 140px 140px; background-image: radial-gradient(circle at 12px 18px, #fff 2px, transparent 2.5px), radial-gradient(circle at 96px 31px, rgba(255,255,255,.85) 2.4px, transparent 3px), radial-gradient(circle at 34px 72px, #fff 2.8px, transparent 3.3px), radial-gradient(circle at 112px 118px, rgba(255,255,255,.85) 2.2px, transparent 2.7px), radial-gradient(circle at 64px 136px, rgba(255,255,255,.8) 1.8px, transparent 2.3px); }
.snow.s2 { top: -260px; background-size: 260px 260px; background-image: radial-gradient(circle at 40px 60px, #fff 4px, transparent 4.6px), radial-gradient(circle at 190px 34px, rgba(255,255,255,.9) 3.4px, transparent 4px), radial-gradient(circle at 130px 170px, #fff 4.4px, transparent 5px); }
.orn { position: absolute; z-index: 1; pointer-events: none; }
.orn.l { top: 0; left: 10px; width: 120px; }
.orn.r { display: none; }
@media (min-width: 1024px) {
    .winter .topbar { background: rgba(23,58,46,.86); }
    .winter .langs a:not([aria-current]) { background: transparent; }
    .orn.l { top: 72px; left: 24px; width: 170px; }
    .orn.r { display: block; top: 72px; right: 24px; width: 170px; }
}

/* Невысокий экран (ноутбук): прилипает только список категорий, иначе колонка не помещается
   над подвалом и уезжает вверх. Телефон для брони остаётся в кнопке наверху и в подвале. */
@media (min-width: 1024px) and (max-height: 799px) {
    aside > .band, .contacts { display: none; }
}

/* ───── Карточка во весь экран ───── */
html:has(.sheet[open]) { overflow: hidden; }
.card[role=button], .feat[role=button] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.card[role=button]:focus-visible, .feat[role=button]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.sheet:focus { outline: none; }
.sh-body .story summary { pointer-events: none; cursor: default; }
.sheet::backdrop { background: rgba(26,23,20,.94); }
.sh { max-width: 560px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; }
.sh-pic .ph { transform-origin: 0 0; }
.sh-pic .ph img { height: auto; max-height: 70vh; }
.sheet.is-off .sh-pic .ph { filter: grayscale(1) opacity(.6); }
.sh-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px calc(32px + env(safe-area-inset-bottom)); background: var(--linen); }
.sh-body > .band { display: none; }
.sh-body .label { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.sh-body .row, .sh-body .head { display: flex; gap: 12px; align-items: baseline; }
.sh-body .row .name, .sh-body .head .name { flex: 1; }
.sh-body .name { font-family: var(--font-head); font-weight: 700; font-size: 26px; line-height: 1.1; }
.sh-body .price { font-weight: 700; font-size: 18px; color: var(--red); white-space: nowrap; }
.sh-body .weight { font-weight: 400; color: var(--muted); font-size: 15px; }
.sh-body .desc { font-size: 16px; line-height: 1.45; color: var(--muted); }
.sh-body .story { font-size: 15px; font-style: italic; color: var(--story); line-height: 1.45; border-top: 1px dashed #D3C3A7; padding-top: 10px; margin-top: 4px; }
.sh-body .story .pl::after { display: none; }
.sh-x { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(26,23,20,.6); color: var(--linen); font-size: 18px; cursor: pointer; }
@media (min-width: 1024px) {
    .sheet { padding: 40px 0; }
    .sh { min-height: 0; border-radius: 14px; overflow: hidden; }
    .sh-x { top: 20px; right: 20px; }
}

/* ───── Анимации. Контент не ждёт: всё короткое, а при «Уменьшить движение» выключено. ───── */
@media (prefers-reduced-motion: no-preference) {
    /* Картина один раз мягко «наезжает» при загрузке и дальше стоит. Бесконечное медленное
       приближение в Firefox дёргается (округление до пикселя), поэтому от него отказались. */
    .hero .ph img { transform-origin: 40% 50%; animation: settle 1.8s cubic-bezier(.25,.6,.3,1) both; }

    /* Ромбики живут постоянно: тёмный ромб медленно вращается, золотая серединка мерцает
       и крутится навстречу, как блестящая нитка в вышивке. */
    .spin, .core { transform-box: fill-box; transform-origin: center; }
    .spin { animation: spin 9s linear infinite; }
    .core { animation: twinkle 2.6s ease-in-out infinite alternate; }
    .cats a .spin { animation-duration: 12s; }
    .cats a.on .spin { animation-duration: 4s; }
    section:nth-child(2n) .spin, .cats a:nth-child(2n) .spin { animation-delay: -3s; }
    section:nth-child(3n) .spin, .cats a:nth-child(3n) .spin { animation-delay: -6s; }
    section:nth-child(2n) .core { animation-delay: -1.3s; }
    .brand h1 { animation: rise .45s var(--ease) .05s both; }
    .brand .script { animation: rise .45s var(--ease) .2s both; }
    .brand .emblem { animation: fade .45s var(--ease) both; }
    .brandbar .lead { animation: fade .6s var(--ease) .3s both; }
    header > .band { position: relative; overflow: hidden; }
    header > .band::after { content: ""; position: absolute; inset: 0; background: var(--linen); transform-origin: 100% 50%; animation: stitch .9s steps(40, end) .15s both; }
    .ph img { transition: opacity .4s var(--ease); }
    .ph img.ld { opacity: 0; }
    .story[open] p { transform-origin: 0 0; animation: story-in .4s var(--ease) both; }
    /* Подсказка «тронь меня»: раз в ~6 с от пилюли расходится волна, ромбик вздрагивает, стрелка подмигивает. Соседние карточки
       не в такт. После первого открытия (.seen, menu.js) у этой карточки затихает. */
    .in .story:not([open], .seen) .pl::before { animation: ripple 6s ease-out var(--hd, 1.2s) infinite; }
    .in .story:not([open], .seen) .sd { animation: beat 6s var(--ease) var(--hd, 1.2s) infinite; }
    .in .story:not([open], .seen) .pl::after { animation: nudge 6s var(--ease) var(--hd, 1.2s) infinite; }
    .grid > :nth-child(3n+2) { --hd: 2.2s; }
    .grid > :nth-child(3n) { --hd: 3.3s; }

    .anim .card, .anim .feat, .anim .sauces { transition: opacity .35s var(--ease), transform .35s var(--ease); }
    .anim .card:not(.in), .anim .feat:not(.in), .anim .sauces:not(.in) { opacity: 0; transform: translateY(14px); animation: fallback 0s 2.5s forwards; }
    .anim .sechead .dia { transition: transform .45s var(--ease), opacity .3s; }
    .anim .sechead:not(.in) .dia { opacity: 0; transform: rotate(-45deg) scale(.6); animation: fallback 0s 2.5s forwards; }

    /* Снег падает сдвигом слоя ровно на размер узора: цикл бесшовный */
    .snow.s1 { animation: snow1 16s linear infinite; }
    .snow.s2 { animation: snow2 26s linear infinite; }
    /* Игрушки чуть покачиваются на нитках */
    .orn .sw { transform-box: fill-box; transform-origin: 50% 0; animation: swing 3.4s ease-in-out infinite alternate; }
    .orn .sw.d2 { animation-duration: 4.1s; animation-delay: -1.2s; }
    .orn .sw.d3 { animation-duration: 2.9s; animation-delay: -2s; }

    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
}
@media (prefers-reduced-motion: reduce) {
    .cats .pill, .layout .card { transition: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@keyframes snow1 { to { transform: translate3d(0, 140px, 0); } }
@keyframes snow2 { to { transform: translate3d(0, 260px, 0); } }
@keyframes swing { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { from { transform: rotate(0) scale(.55); } to { transform: rotate(-180deg) scale(1.25); } }
@keyframes story-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes ripple { 0%, 66% { opacity: 0; transform: none; } 70% { opacity: .9; transform: none; } 92%, 100% { opacity: 0; transform: scale(1.1, 1.45); } }
/* Ромб симметричен на 90°: 180° выглядит как 0°, поэтому цикл замыкается без рывка назад */
@keyframes beat { 0%, 80% { transform: none; } 85% { transform: rotate(90deg) scale(1.35); } 91% { transform: rotate(180deg) scale(.9); } 100% { transform: rotate(180deg); } }
@keyframes nudge { 0%, 84%, 100% { transform: none; } 88% { transform: translateX(4px); } 92% { transform: none; } 95% { transform: translateX(2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes stitch { to { transform: scaleX(0); } }
/* Если menu.js не загрузился, карточки всё равно появятся */
@keyframes fallback { to { opacity: 1; transform: none; } }

/* ───── Заглушка главной, 404 ───── */
.hello { min-height: 100dvh; display: grid; place-content: center; text-align: center; padding: 0 16px; background: var(--linen); }
.hello h1 { font-family: var(--font-head); color: var(--red); font-size: clamp(2rem, 8vw, 3.5rem); margin: 0; }
.hello .script { font-family: var(--font-script); font-size: 1.8rem; color: var(--muted); margin: .25rem 0 1rem; }
.hello a { color: var(--red); font-weight: 700; }
.hello .emblem { justify-self: center; }
.hello .req { font-size: 12px; color: var(--muted); }
