/* tometino — scroll-driven motion (guide bird, hero depth, curtains, gallery film).
   Everything here is progressive: without motion.js (or with reduced motion) the site looks as before. */

/* ---------- the bird ---------- */
.bird { position: fixed; left: 0; top: 0; width: 44px; height: 24px; pointer-events: none; z-index: 46; opacity: 0; will-change: transform, opacity; }
.bird svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--gold-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bird .b-wl, .bird .b-wr { transform-box: view-box; transform-origin: 30px 18px; transition: transform .6s var(--ease); }
.bird .b-wl { transform: rotate(4deg); }
.bird .b-wr { transform: rotate(-4deg); }
.bird.flap .b-wl { animation: wingL .46s ease-in-out infinite alternate; }
.bird.flap .b-wr { animation: wingR .46s ease-in-out infinite alternate; }
@keyframes wingL { from { transform: rotate(24deg); } to { transform: rotate(-22deg); } }
@keyframes wingR { from { transform: rotate(-24deg); } to { transform: rotate(22deg); } }
.bird .b-perch { display: none; }
.bird.perched .b-fly { display: none; }
.bird.perched .b-perch { display: inline; }

/* hero fly-by: lives inside the hero frame */
.bird.hero-bird { position: absolute; z-index: 5; width: 150px; height: 85px; transform-origin: 50% 50%; }
@media (max-width: 700px) { .bird.hero-bird { width: 104px; height: 59px; } }
.bird.hero-bird svg { stroke: #f0d7a6; stroke-width: 1.7; filter: drop-shadow(0 1px 2px rgba(10, 14, 18, .55)) drop-shadow(0 0 10px rgba(10, 14, 18, .35)); }

/* flock at "130+" */
.loc-stats > div { position: relative; }
.bird.mini { position: absolute; left: 50%; top: 18%; width: 26px; height: 14px; margin-left: -13px; z-index: 3; opacity: 0;
  animation: flock 2.9s cubic-bezier(.2, .7, .3, 1) var(--d, 0s) forwards; }
.bird.mini svg { stroke-width: 2; }
@keyframes flock {
  0% { opacity: 0; transform: translate(0, 0) scale(.35); }
  14% { opacity: 1; }
  70% { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* scroll-progress line at the left edge (desktop) */
.guide-line { position: fixed; left: 22px; top: 96px; bottom: 96px; width: 1px; z-index: 45; pointer-events: none; opacity: 0;
  background: rgba(200, 164, 106, .14); transition: opacity .6s var(--ease); }
.guide-line i { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: linear-gradient(rgba(200, 164, 106, 0), rgba(200, 164, 106, .75));
  transform-origin: top; transform: scaleY(var(--gp, 0)); }

/* ---------- hero depth while scrolling ---------- */
.motion-on .hero-slides { scale: calc(1.1 - var(--hp, 0) * .1); translate: 0 calc(var(--hp, 0) * 8%); }
.hero-fog { position: absolute; inset: -10% -5%; pointer-events: none; opacity: 0;
  background:
    radial-gradient(60% 34% at 30% 62%, rgba(226, 232, 240, .28), rgba(226, 232, 240, 0) 70%),
    radial-gradient(50% 28% at 74% 48%, rgba(226, 232, 240, .22), rgba(226, 232, 240, 0) 70%),
    radial-gradient(80% 30% at 50% 92%, rgba(226, 232, 240, .25), rgba(226, 232, 240, 0) 70%);
  filter: blur(8px); }
body.p3.motion-on .hero-fog { opacity: calc(.35 + var(--hp, 0) * .65); translate: 0 calc(var(--hp, 0) * 16%); }
.motion-on .hero-copy { translate: 0 calc(var(--hp, 0) * -120px); opacity: calc(1 - var(--hp, 0) * 1.7); }

/* ---------- wind rose driven by scroll (JS sets the rotation / flow) ---------- */
.wr-scroll .wr-rose, .wr-scroll .flow { animation: none; }

/* ---------- photo curtains in the rhythm of the scroll ---------- */
.img-reveal.scrub::before { transform: scaleY(var(--cur, 1)) !important; transition: none !important; }
.img-reveal.scrub img { transform: scale(var(--isc, 1.18)) translateY(var(--py, 0px)) !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .bird, .guide-line, .hero-fog { display: none !important; }
}

/* ---------- "Dan u Tometinom polju": the light changes from morning fog to dusk while scrolling ---------- */
.daylight { position: fixed; inset: 0; z-index: 44; pointer-events: none;
  background:
    linear-gradient(180deg, var(--dl-top, transparent) 0%, transparent 55%),
    radial-gradient(120% 60% at 50% 115%, var(--dl-glow, transparent) 0%, transparent 70%),
    var(--dl-wash, transparent); }
.daylight::after { content: ''; position: absolute; inset: 0; mix-blend-mode: soft-light; background: var(--dl-tone, transparent); }
body.locked .daylight { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .daylight { display: none; } }

/* night sky over the footer: stars appear as the day ends */
.stars { position: absolute; inset: 0; pointer-events: none; opacity: var(--night, 0); }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #f3ead9;
  animation: twinkle var(--tw, 4s) ease-in-out var(--td, 0s) infinite alternate; }
.stars i.b { width: 3px; height: 3px; box-shadow: 0 0 6px rgba(243, 234, 217, .6); }
@keyframes twinkle { from { opacity: .15; } to { opacity: .85; } }
.bird.hero-bird.flap .b-wl, .bird.hero-bird.flap .b-wr { animation-duration: .64s; }
