/* ===== «Барака» — главный экран: пастбище → схема разделки, прелоадер ===== */

/* ---------- прелоадер ---------- */
#loader { position: fixed; inset: 0; z-index: 100; background: var(--coal); display: grid; place-items: center; align-content: center; gap: 26px; }
.ld-mark { width: 120px; height: 120px; }
.ld-ring { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 541; stroke-dashoffset: 541; animation: draw 1.6s var(--ease) .1s forwards; }
.ld-em { fill: var(--gold); opacity: 0; transform-origin: 100px 100px; animation: ldPop .9s var(--ease) .7s forwards; }
@keyframes ldPop { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
.ld-word { font: 800 30px/1 var(--serif); letter-spacing: .5em; padding-left: .5em; color: var(--cream); opacity: 0; animation: ldPop .9s var(--ease) 1s forwards; }
.ld-count { position: absolute; right: 32px; bottom: 26px; font: 500 clamp(60px, 10vw, 140px)/1 var(--caps); color: rgba(243,234,217,.08); }
.ld-stamp { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; border: 3px solid var(--gold);
  display: grid; place-items: center; font: 700 54px/1 Amiri, serif; color: var(--gold); opacity: 0; transform: scale(2.6) rotate(-18deg); }
#loader.stamp .ld-stamp { animation: stamp .55s cubic-bezier(.5, 0, .7, 1.4) forwards; }
#loader.stamp .ld-mark, #loader.stamp .ld-word { opacity: .12 !important; transition: opacity .3s; animation: none; }
@keyframes stamp { 70% { opacity: 1; transform: scale(.92) rotate(-8deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }

/* ---------- сцена ---------- */
.story { height: 380vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--coal); }
.sky { position: absolute; inset: 0; background: linear-gradient(180deg, #120f17 0%, #211a26 32%, #4a2b2e 58%, #a65a3a 78%, #e39a5c 92%, #f2bb75 100%); }
.glow { position: absolute; left: 50%; top: 66%; width: 110vmax; height: 70vmax; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 196, 120, .55), rgba(255, 150, 80, .18) 45%, transparent 75%); pointer-events: none; }
.stars { position: absolute; inset: 0 0 45% 0; pointer-events: none; }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff3dc; opacity: .5; animation: tw 3s infinite alternate; }
@keyframes tw { to { opacity: .1; } }
.land { position: absolute; left: 0; bottom: 0; width: 100%; height: 72%; }
.m1 { fill: #2b2029; } .m2 { fill: #1d1719; } .m3 { fill: #120e0d; }
.grass path { fill: #1a1411; stroke: rgba(240, 180, 110, .16); stroke-width: .8; transform-box: fill-box; transform-origin: 50% 100%; animation: sway 3.2s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.calm .grass path, .calm .stars i { animation-play-state: paused; }

/* ---------- корова ---------- */
.cow-wrap { position: absolute; right: 3vw; bottom: 9vh; width: min(45vw, 740px); transform-origin: 0 0; will-change: transform; z-index: 2; }
.cow-target { position: absolute; left: 2vw; top: 27vh; width: min(62vw, 1000px); aspect-ratio: 1000 / 560; pointer-events: none; visibility: hidden; }
.cow { width: 100%; height: auto; overflow: visible; }
.cow-body { fill: #110d0b; }
.cow-far path { fill: #0b0908; }
.cow-line { fill: none; stroke: var(--gold-l); stroke-width: 2.4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cow-far-line path { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: 0; }
.cow-detail { fill: none; stroke: var(--gold-l); stroke-width: 2.2; stroke-linecap: round; }
.tail { stroke-width: 3; }
.cow-tuft { fill: var(--gold-d); }
.zone { fill: url(#meat); fill-opacity: 0; transition: fill-opacity .45s var(--ease); pointer-events: none; }
.interactive .zone { pointer-events: auto; cursor: pointer; }
.interactive .zone:hover { fill-opacity: .55 !important; }
.interactive .zone.on { fill-opacity: .92 !important; }
.cut-lines path { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cut-lines path.dash { stroke-dasharray: 6 6; stroke-dashoffset: 0; opacity: 0; }
.cut-nums g { cursor: pointer; }
.cut-nums circle { fill: var(--coal); stroke: var(--gold); stroke-width: 2; transition: fill .3s; }
.cut-nums text { font: 500 15px var(--caps); fill: var(--gold-l); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cut-nums g.on circle { fill: var(--gold); } .cut-nums g.on text { fill: var(--coal); }
.cut-nums > g > * { transform-box: fill-box; transform-origin: center; }
.cut-nums g { opacity: 0; pointer-events: none; }
.interactive .cut-nums g { pointer-events: auto; }

/* ---------- тексты сцены ---------- */
.hero-copy { position: absolute; z-index: 3; left: 6vw; top: 50%; transform: translateY(-46%); width: min(780px, 54vw); }
.hero-copy .lead { max-width: 500px; }
.hero-copy .h-hero { text-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.hero-copy .lead { margin-top: 26px; color: rgba(243, 234, 217, .78); }
.cuts-copy { position: absolute; z-index: 3; left: 6vw; top: 104px; width: min(520px, 44vw); opacity: 0; visibility: hidden; }
.cuts-copy .eyebrow { margin-bottom: 14px; }
.cuts-copy .muted { margin-top: 14px; font-size: 15px; }
.cut-panel { position: absolute; z-index: 4; right: 4vw; top: 50%; width: 350px; transform: translateY(-40%); padding: 26px; border-radius: 24px;
  background: rgba(28, 23, 20, .86); border: 1px solid rgba(201, 161, 90, .35); backdrop-filter: blur(14px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
  opacity: 0; visibility: hidden; }
.cp-head { display: flex; gap: 14px; align-items: center; }
.cp-num { width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--coal); display: grid; place-items: center; font: 600 20px/1 var(--caps); flex: none; }
.cp-head h3 { font: 800 28px/1.05 var(--serif); }
.cp-en { font: 500 11px/1 var(--caps); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.cp-use { margin-top: 16px; font-weight: 700; font-size: 16px; }
.cp-note { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.5; min-height: 44px; }
.cp-buy { display: flex; align-items: baseline; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.cp-buy b { font: 700 26px/1 var(--sans); } .cp-buy > span { color: var(--muted); font-size: 14px; }
.cp-buy .btn { margin-left: auto; }
.cp-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cp-list button { height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: none; font-size: 12.5px; color: var(--muted); transition: all .25s; }
.cp-list button b { color: var(--gold); font-weight: 600; margin-right: 5px; }
.cp-list button:hover { color: var(--cream); border-color: var(--gold); }
.cp-list button.on { background: var(--gold); border-color: var(--gold); color: var(--coal); } .cp-list button.on b { color: var(--coal); }
.cut-panel.swap .cp-head, .cut-panel.swap .cp-use, .cut-panel.swap .cp-note, .cut-panel.swap .cp-buy b { animation: swapIn .5s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(8px); } }

.scroll-hint { position: absolute; z-index: 3; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; justify-items: center; gap: 10px;
  font: 500 11px/1 var(--caps); letter-spacing: .3em; text-transform: uppercase; color: rgba(243, 234, 217, .7); }
.scroll-hint span { width: 1px; height: 46px; background: linear-gradient(var(--gold), transparent); animation: hint 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* без JS-анимаций — схема сразу нарисована */
html:not(.fx) .cow-line, html:not(.fx) .cut-lines path { stroke-dashoffset: 0; }
html:not(.fx) .cut-nums g { opacity: 1; }

/* раскладка заголовков */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.si { display: inline-block; will-change: transform; }
em.split { background: none; -webkit-text-fill-color: currentColor; padding-right: 0; }
.si.gold { background: linear-gradient(100deg, #f6e2b0, #c9a15a 55%, #f1d79c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding-right: .06em; }

/* на телефоне плавающие кнопки не закрывают панель разделки */
@media (max-width: 720px) {
  .in-cuts .float-call, .has-cart.in-cuts .cart-bar { transform: translateY(170%); }
}

/* ---------- адаптив сцены ---------- */
@media (max-width: 1100px) {
  .hero-copy { width: min(600px, 60vw); }
  .cow-wrap { width: 50vw; right: 2vw; bottom: 3vh; }
  .hero-copy .btn-ghost { display: none; }
  .cut-panel { width: 310px; right: 24px; }
  .cow-target { width: 56vw; top: 36vh; }
}
@media (max-width: 720px) {
  .story { height: 360vh; }
  .hero-copy { left: 16px; right: 16px; width: auto; top: 88px; transform: none; }
  .hero-copy .h-hero { font-size: clamp(40px, 11.5vw, 54px); }
  .hero-copy .lead { margin-top: 16px; font-size: 15px; }
  .hero-copy .cta-row { margin-top: 22px; }
  .hero-copy .btn-ghost { display: none; }
  .cow-wrap { width: 92vw; left: 4vw; right: auto; bottom: 7vh; }
  .cow-target { left: 2vw; width: 96vw; top: 200px; }
  .cuts-copy { left: 16px; right: 16px; width: auto; top: 80px; }
  .cuts-copy .h2 { font-size: 34px; }
  .cuts-copy .muted { display: none; }
  .cut-panel { left: 12px; right: 12px; width: auto; top: auto; bottom: 12px; transform: none; padding: 18px 18px 16px; border-radius: 20px; }
  .cp-head h3 { font-size: 23px; } .cp-num { width: 38px; height: 38px; font-size: 17px; }
  .cp-use { margin-top: 10px; font-size: 15px; } .cp-note { font-size: 13.5px; min-height: 0; }
  .cp-buy { margin-top: 12px; } .cp-buy b { font-size: 22px; }
  .cp-list { flex-wrap: nowrap; overflow-x: auto; margin: 14px -18px 0; padding: 14px 18px 2px; scrollbar-width: none; }
  .cp-list button { flex: none; }
  .scroll-hint { display: none; }
}
@media (max-width: 720px) and (max-height: 700px) {
  .cp-note { display: none; }
  .cow-target { top: 170px; }
}
