/* ════════════════════════════════════════════════════════════
   feature.css — два раздела-иллюстрации (см. feature.js):
   «Вас ждут» — пять окон дворца; «Пир» — накрытый стол сверху.
   ════════════════════════════════════════════════════════════ */

/* ══════════ «Вас ждут»: пять светящихся окон ══════════ */
.wins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.8rem, 2vw, 2.4rem); margin-top: clamp(1.5rem, 4vw, 3.5rem); padding-bottom: clamp(3.5rem, 8vw, 7rem); }
.win { position: relative; text-align: center; color: var(--ivory); }
/* окна стоят «лесенкой» — ритм колоннады, а не таблица */
.win:nth-child(even) { margin-top: clamp(1.6rem, 4.4vw, 4rem); }
.win__arch { position: relative; transition: transform 1s var(--ease); }
/* окно — стопка готовых картинок (см. feature.js): ореол, сценка по слоям в проёме арки, затемнение, рама.
   Зажигание и вся «жизнь» — только opacity и transform */
.win__arch { aspect-ratio: 244 / 366; }
.win__halo { transition: opacity 1.2s var(--ease); }
.win.is-dark .win__halo { opacity: 0; }
.win__scene { position: absolute; overflow: hidden; border-radius: 50% 50% 0 0 / 30.87% 30.87% 0 0; }
.win__dim { position: absolute; inset: 0; background: #031318; opacity: 0; transition: opacity 1.2s var(--ease); }
.win.is-dark .win__dim { opacity: .9; }
.w-layer { position: absolute; }
.w-rays { animation: f-spin 90s linear infinite; }
@keyframes f-spin { to { transform: rotate(360deg); } }
.w-sway { animation: f-sway 7s ease-in-out infinite; }
@keyframes f-sway { 0%, 100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.w-frond { animation: f-frond 8s ease-in-out infinite; }
@keyframes f-frond { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.8deg); } }
.w-spotl { animation: f-spotl 6.5s ease-in-out infinite; }
.w-spotr { animation: f-spotr 7.5s ease-in-out infinite; }
@keyframes f-spotl { 0%, 100% { transform: rotate(-7deg); opacity: .45; } 50% { transform: rotate(8deg); opacity: .9; } }
@keyframes f-spotr { 0%, 100% { transform: rotate(7deg); opacity: .9; } 50% { transform: rotate(-8deg); opacity: .45; } }
.w-tw { animation: f-tw 4s ease-in-out infinite; }
.w-tw--b { animation-duration: 5.2s; animation-delay: -2.4s; }
@keyframes f-tw { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
/* рябь: ±8 единиц рисунка = ±4.35% ширины проёма */
.w-rip { animation: f-rip 6s ease-in-out infinite; }
@keyframes f-rip { 0%, 100% { transform: translateX(-4.35%); } 50% { transform: translateX(4.35%); } }
.w-fl { animation: f-fl 2.4s ease-in-out infinite; }
.w-fl--b { animation-duration: 2.9s; animation-delay: -1.3s; }
@keyframes f-fl { 0%, 100% { opacity: 1; } 38% { opacity: .75; } 70% { opacity: .96; } }
.win:nth-child(2) .w-fl { animation-delay: -.7s; }
.win:nth-child(3) .w-fl { animation-delay: -1.5s; }
/* тёмное окно не тратит кадры на невидимую жизнь */
.win.is-dark .win__scene * { animation-play-state: paused; }
.win:hover .win__arch { transform: translateY(-12px) scale(1.035); }
.win > i { display: block; margin-top: .9rem; font-family: var(--f-d); font-style: italic; font-weight: 300; font-size: 1.5rem; line-height: 1; color: var(--gold-hi); }
.win h3 { margin-top: .45rem; font-family: var(--f-d); font-weight: 900; font-stretch: 62.5%; font-size: clamp(1.25rem, 1.9vw, 2.05rem); line-height: .95; text-transform: uppercase; text-wrap: balance; }
.win p { margin-top: .6rem; font-size: .86rem; line-height: 1.45; color: var(--muted); text-wrap: balance; }

/* свечи между подачами на столе: transform и opacity — на видеокарте */
.sep { animation: f-flick 2.4s ease-in-out infinite; }
@keyframes f-flick { 0%, 100% { opacity: 1; transform: scale(1); } 38% { opacity: .75; transform: scale(.9, 1.12); } 70% { opacity: .96; transform: scale(1.05, .94); } }

/* ══════════ «Пир»: стол сверху ══════════ */
/* overflow: visible — иначе position: sticky у стола не работает */
.pg--table { padding: 0; overflow: visible; }
/* колонка minmax(0,1fr): иначе длинный стол распирает сетку и заголовок уезжает за край */
.feast-pin { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); padding: clamp(5rem, 11vh, 6.5rem) 0 clamp(1.6rem, 4vh, 3rem); }
.pg--table.is-pinned .feast-pin { position: sticky; top: 0; height: 100vh; height: 100svh; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.pg--table.is-pinned .tbl { overflow: hidden; }

.feast-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); align-items: end; gap: clamp(1.5rem, 5vw, 5rem); }
.pg--table .pg__head { text-align: left; max-width: none; margin: 0; padding: 0; }
.pg--table .pg__head .lb { color: var(--laz-print); }
.pg--table .pg__title { margin: .5rem 0 0; font-size: min(7.4vw, 15svh); line-height: .84; text-wrap: nowrap; }
.pg--table .pg__title i { display: inline; font-size: 1em; margin: 0; }
.pg--table .pg__head .lb::before { display: none; }
.pg--table .pg__lead { margin: 0; max-width: none; text-align: left; font-family: var(--f-d); font-stretch: 87.5%; font-style: italic; font-weight: 300; font-size: clamp(1.05rem, 1.35vw, 1.4rem); line-height: 1.3; color: var(--ink); }
.feast-steps { display: flex; gap: .45rem; margin-top: 1.1rem; }
.feast-steps li { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--f-d); font-style: italic; font-size: 1rem; line-height: 1; color: var(--ink); transition: background-color .5s var(--ease), color .5s var(--ease), transform .5s var(--ease); }
.feast-steps li.is-on { background: var(--ink); color: var(--paper); transform: scale(1.12); }

.tbl { position: relative; display: flex; align-items: center; min-width: 0; min-height: 0; overflow-x: auto; scrollbar-width: none; margin-top: clamp(1.2rem, 3.4vh, 2.6rem); outline-offset: -4px; }
/* скатерть: лазурь с веерным узором и египетским фризом по кромкам */
.tbl__track::before {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, #0E7C8A 0 7px, #F2D694 7px 14px) top / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, #0E7C8A 0 7px, #F2D694 7px 14px) bottom / 100% 9px no-repeat,
    linear-gradient(#F2D694, #F2D694) 0 13px / 100% 1px no-repeat,
    linear-gradient(#F2D694, #F2D694) 0 calc(100% - 13px) / 100% 1px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%232CB1C0' stroke-width='1' opacity='.34'%3E%3Cpath d='M36 60V36M36 60L24 40M36 60l12-20M36 60L14 48M36 60l22-12'/%3E%3Cpath d='M12 50A26 26 0 0 1 60 50'/%3E%3Ccircle cx='36' cy='12' r='3'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 72px 72px,
    radial-gradient(ellipse 70% 120% at 50% 50%, #12707D, #0A4E59);
  box-shadow: 0 34px 60px -34px rgba(20, 17, 12, .75), 0 -1px 0 rgba(20, 17, 12, .25);
}
.tbl__track { position: relative; flex: none; min-width: 100%; display: flex; align-items: center; gap: clamp(1.6rem, 4.4vw, 4.6rem); margin: 0; padding: clamp(1.4rem, 3.6vh, 2.8rem) max(var(--pad), 9vw); will-change: transform; }
.tbl__track > * { position: relative; }
.course { flex: none; display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.8rem); }

/* карточка подачи — как именная карточка на столе */
.course__card {
  flex: none; width: clamp(118px, 10.5vw, 168px); padding: 1.2rem .8rem 1.05rem; text-align: center; transform: rotate(-4deg);
  background: var(--paper); color: var(--ink); outline: 1px solid rgba(168, 132, 63, .7); outline-offset: -7px;
  box-shadow: 0 18px 30px -14px rgba(2, 22, 27, .85);
}
.course:nth-child(4n + 1) .course__card { transform: rotate(3deg); }
.course__card i { display: block; font-family: var(--f-d); font-weight: 900; font-stretch: 62.5%; font-style: normal; font-size: clamp(2.6rem, 4vw, 4rem); line-height: .8; color: var(--foil); }
.course__card h3 { margin-top: .7rem; font: 700 .625rem/1.35 var(--f-s); letter-spacing: .2em; text-transform: uppercase; color: var(--laz-print); text-wrap: balance; }

.dish { flex: none; width: clamp(180px, 30svh, 320px); margin: 0; text-align: center; }
.dish__plate svg { display: block; width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.dish:hover .dish__plate svg { transform: rotate(10deg) scale(1.05); }
.dish figcaption { max-width: 17ch; margin: .2rem auto 0; font-family: var(--f-d); font-stretch: 80%; font-weight: 400; font-size: clamp(1rem, 1.3vw, 1.4rem); line-height: 1.14; color: var(--ivory); text-wrap: balance; }

/* свеча между подачами, вид сверху */
.sep { flex: none; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle, #FFFFFF 0 10%, #FFE9B0 11% 26%, #F3E6C6 27% 46%, #C9A366 47% 58%, #8F6F3F 59% 64%, transparent 65%); box-shadow: 0 0 60px 26px rgba(255, 214, 130, .42); }

.tbl__hint { display: none; margin: .9rem var(--pad) 0; color: var(--ink-soft); }

/* ══════════ Адаптив ══════════ */
@media (max-width: 860px) {
  /* «Лесенка»: окна спускаются зигзагом — то у левого края, то у правого, подпись встаёт
     в свободной половине напротив окна. Соседние ступени заходят друг за друга.
     Никакой горизонтальной прокрутки */
  .wins { display: block; margin-top: 1.4rem; padding-bottom: 2.6rem; }
  .win {
    --ww: 50vw;
    display: grid; grid-template-columns: var(--ww) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr; column-gap: 1.1rem;
    text-align: left;
  }
  .win + .win { margin-top: -7vw; }
  .win:nth-child(even) { margin-top: -7vw; grid-template-columns: minmax(0, 1fr) var(--ww); text-align: right; }
  .win__arch { grid-column: 1; grid-row: 1 / -1; }
  .win:nth-child(even) .win__arch { grid-column: 2; }
  .win > i, .win h3, .win p { grid-column: 2; }
  .win:nth-child(even) > i, .win:nth-child(even) h3, .win:nth-child(even) p { grid-column: 1; }
  .win > i { grid-row: 2; margin-top: 0; font-size: 2.6rem; line-height: .9; }
  .win h3 { grid-row: 3; margin-top: .5rem; font-size: 1.42rem; line-height: .98; text-wrap: balance; }
  .win p { grid-row: 4; margin-top: .5rem; font-size: .8rem; line-height: 1.4; text-wrap: pretty; }
  .win:hover .win__arch { transform: none; }

  .feast-head { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .pg--table .pg__title { font-size: 14.4vw; white-space: normal; text-wrap: balance; }
  .pg--table .pg__title i { display: block; }
  .feast-steps { display: none; }
  .tbl { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tbl::-webkit-scrollbar { display: none; }
  .course { scroll-snap-align: start; scroll-margin-left: var(--pad); }
  .dish { width: 56vw; }
  .tbl__hint { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .win.is-dark .win__dim { opacity: 0; }
  .win.is-dark .win__halo { opacity: 1; }
}
