/* Armudu — слой анимаций (motion.css).
   Отдельный файл поверх app.css: не зависит от сборки Tailwind, откатывается удалением двух строк в layouts/site.php.
   Класс html.mo ставится в <head> только при поддержке IntersectionObserver и без prefers-reduced-motion. */

/* ───────── Плавные переходы между страницами (View Transitions, Chrome/Edge/Safari 18+) ───────── */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: mo-vt-out .28s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: mo-vt-in .55s cubic-bezier(.16,1,.3,1) both; }
@keyframes mo-vt-out { to { opacity: 0; transform: translate3d(0,-10px,0); } }
@keyframes mo-vt-in { from { opacity: 0; transform: translate3d(0,18px,0); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ───────── Главный экран ───────── */
.hero-embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; opacity: 0; transition: opacity 1.6s ease; }
.hero-embers.is-on { opacity: 1; }

/* медленное приближение заставки, пока грузится видео */
@keyframes mo-kb { from { transform: scale(1.14); } to { transform: scale(1.02); } }
.mo .hero-media picture img { animation: mo-kb 16s cubic-bezier(.2,.6,.35,1) both; transform-origin: 62% 55%; }
.mo .hero-video { transform: scale(1.02); }

/* заголовок выезжает построчно из-под маски */
@keyframes mo-rise { from { transform: translate3d(0,112%,0) rotate(2.5deg); } to { transform: none; } }
@keyframes mo-fade-up { from { opacity: 0; transform: translate3d(0,22px,0); } to { opacity: 1; transform: none; } }
.mo.js .hero-line { padding-bottom: .12em; margin-bottom: -.12em; }
.mo.js .hero-line > span { transform-origin: 0 100%; animation: mo-rise 1.15s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(.2s + var(--i,0) * .13s); }
.mo.js .hero-fade { animation: mo-fade-up 1s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--d, 0s) + .25s); }

/* ───────── Фото раскрываются «шторкой» ───────── */
.mo .mo-sh { clip-path: inset(100% 0 0 0); }
.mo .mo-sh img { transform: scale(1.22) !important; }
.mo .mo-sh.mo-in { clip-path: inset(0 0 0 0); transition: clip-path 1.15s cubic-bezier(.77,0,.18,1) var(--mo-d, 0s); }
.mo .mo-sh.mo-in img { transform: scale(1) !important; transition: transform 1.7s cubic-bezier(.16,1,.3,1) var(--mo-d, 0s) !important; }

/* ───────── Параллакс фото в «О нас» и «Шашлык» ───────── */
.mo .about-photo picture, .mo .fire-photo picture { transform: translate3d(0, var(--py, 0px), 0) scale(1.14); will-change: transform; }

/* ───────── Орнамент прорисовывается ───────── */
.mo .home-ornament.mo-orn { clip-path: inset(0 50% 0 50%); }
.mo .home-ornament.mo-orn.mo-in { clip-path: inset(0 0 0 0); transition: clip-path 2s cubic-bezier(.65,0,.35,1); }
.mo .mo-orn2 .orn-line { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.65,0,.35,1) .35s; }
.mo .mo-orn2 .orn-line.is-left { transform-origin: 100% 50%; }
.mo .mo-orn2 .orn-line.is-right { transform-origin: 0 50%; }
.mo .mo-orn2.mo-in .orn-line { transform: scaleX(1); }
.mo .mo-orn2 svg path, .mo .mo-orn2 svg circle { stroke-dasharray: var(--len, 200); stroke-dashoffset: var(--len, 200); transition: stroke-dashoffset 1.6s cubic-bezier(.65,0,.35,1); }
.mo .mo-orn2.mo-in svg path, .mo .mo-orn2.mo-in svg circle { stroke-dashoffset: 0; }

/* ───────── Бегущая строка с блюдами ───────── */
.marquee { position: relative; overflow: hidden; padding: 1.6rem 0; border-block: 1px solid rgba(209,165,99,.16); background: #0e0c0b; user-select: none; }
.marquee::before, .marquee::after { content: ''; position: absolute; top: 0; bottom: 0; z-index: 1; width: min(12vw, 160px); pointer-events: none; }
.marquee::before { left: 0; background: linear-gradient(90deg, #0e0c0b, transparent); }
.marquee::after { right: 0; background: linear-gradient(270deg, #0e0c0b, transparent); }
.marquee-track { display: flex; width: max-content; animation: mo-marquee var(--mq-dur, 60s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; flex-shrink: 0; }
.marquee-item { display: flex; align-items: center; white-space: nowrap; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: 1; letter-spacing: -.01em; color: #f3e8d6; }
.marquee-item:nth-of-type(even) { font-style: italic; color: transparent; -webkit-text-stroke: 1px rgba(209,165,99,.85); }
.marquee-sep { width: clamp(1.1rem, 2.2vw, 1.8rem); height: auto; margin: 0 clamp(1.2rem, 3vw, 2.6rem); color: #d1a563; opacity: .8; flex-shrink: 0; }
@keyframes mo-marquee { to { transform: translate3d(-50%,0,0); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ───────── Карточки блюд: увеличение и золотая рамка ───────── */
.home-dish-img::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(230,196,143,.85); opacity: 0; transform: scale(1.04); transition: opacity .5s ease, transform .7s cubic-bezier(.16,1,.3,1); pointer-events: none; }
.home-dish a:hover .home-dish-img::after, .home-dish a:focus-visible .home-dish-img::after { opacity: 1; transform: scale(1); }
.home-dish-img img { transition: transform 1s cubic-bezier(.16,1,.3,1), filter .6s ease !important; }
.home-dish a:hover .home-dish-img img { transform: scale(1.08); filter: saturate(1.12) brightness(1.04); }
.home-dish .h-display, .home-dish .font-display { transition: color .3s; }

/* категории — тарелка чуть поворачивается */
.home-cat-img img { transition: transform .9s cubic-bezier(.16,1,.3,1) !important; }
.home-cat:hover .home-cat-img img, .home-cat:focus-visible .home-cat-img img { transform: scale(1.1) rotate(10deg); }
.home-cat-img { transition: box-shadow .5s ease; }
.home-cat:hover .home-cat-img { box-shadow: inset 0 0 0 1px rgba(230,196,143,.9), 0 0 0 6px rgba(209,165,99,.08); }

/* рестораны и афиши — заметнее при наведении */
.rest-card:hover .rest-photo img, .poster:hover .poster-cover img, .loc-card:hover .card-zoom { transform: scale(1.06); }
.rest-photo img, .poster-cover img, .card-zoom { transition: transform 1.1s cubic-bezier(.16,1,.3,1) !important; }

/* ───────── «Открыто сейчас» с пульсом ───────── */
.rest-card { position: relative; }
.rest-card > .open-chip { position: absolute; left: .9rem; top: .9rem; z-index: 2; pointer-events: none; transition: opacity .6s ease .5s; }
.mo .rest-card:has(.mo-sh:not(.mo-in)) > .open-chip { opacity: 0; }
@keyframes mo-pulse { 0% { box-shadow: 0 0 0 0 rgba(127,191,106,.75); } 70%, 100% { box-shadow: 0 0 0 7px rgba(127,191,106,0); } }
.open-chip.is-open::before { animation: mo-pulse 2s cubic-bezier(.25,.6,.4,1) infinite; }
@media (prefers-reduced-motion: reduce) { .open-chip.is-open::before { animation: none; } }

/* ───────── Шапка прячется при прокрутке вниз ───────── */
.site-header { transition: transform .45s cubic-bezier(.4,0,.2,1), background-color .5s, border-color .5s; }
.site-header.mo-up { transform: translate3d(0,-100%,0); }
.menu-nav { transition: top .45s cubic-bezier(.4,0,.2,1); }
html.mo-hdr-up .menu-nav { top: -1px; }

/* ───────── Коллаж Instagram: сборка из разных сторон ───────── */
.mo .ig-asm > .ig-cell { opacity: 0; transform: translate3d(var(--ig-x, 0), var(--ig-y, 40px), 0) rotate(var(--ig-r, 0deg)) scale(.86); }
.mo .ig-asm > .ig-cell img { transform: scale(1.18); }
.mo .ig-asm.ig-in > .ig-cell { opacity: 1; transform: none; transition: transform 1.1s cubic-bezier(.16,1,.3,1) var(--ig-d, 0s), opacity .5s ease var(--ig-d, 0s); }
.mo .ig-asm.ig-in > .ig-cell img { transform: none; transition: transform 1.4s cubic-bezier(.16,1,.3,1) var(--ig-d, 0s); }
@media (prefers-reduced-motion: reduce) { .ig-asm > .ig-cell, .ig-asm > .ig-cell img { opacity: 1 !important; transform: none !important; } }
/* летящие плитки не должны расширять страницу на телефоне (иначе мобильный браузер уменьшает масштаб) */
.mo .ig-section { overflow: hidden; overflow: clip; }
