/* Flamenco Nova – "wow" layer for the front page: scribble, parallax,
   spotlight, expanding destinations, drag scroller, cursor preview,
   word reveal. Progressive and off for prefers-reduced-motion. */

/* ---------- Hand-drawn underline ---------- */
.fn-scribble { position: relative; display: inline-block; }
.fn-scribble__line { position: absolute; left: -2%; right: -4%; bottom: -.08em; width: 106%; height: .32em; overflow: visible; z-index: -1; }
.fn-scribble__line path { fill: none; stroke: var(--fn-sun); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 620; stroke-dashoffset: 620; animation: fn-draw 1.1s .9s var(--fn-ease) forwards; }
.fn-scribble__line path + path { stroke-width: 5; }
@keyframes fn-draw { to { stroke-dashoffset: 0; } }

/* Countdown kicker */
[data-fn-countdown] b { font-variant-numeric: tabular-nums; color: var(--fn-red); }

/* ---------- Scroll-driven parallax (Chrome, Edge, Safari 26+) ---------- */
@supports (animation-timeline: scroll()) {
  @keyframes fn-hero-text-out { to { opacity: .15; transform: translateY(-70px); } }
  @keyframes fn-hero-photo-out { to { transform: translateY(70px) scale(.94) rotate(-1.2deg); } }
  @media (min-width: 1025px) {
    .fn-hero__grid > :first-child { animation: fn-hero-text-out linear both; animation-timeline: scroll(root); animation-range: 0 620px; }
    .fn-hero__visual { animation: fn-hero-photo-out linear both; animation-timeline: scroll(root); animation-range: 0 700px; }
  }
}

/* ---------- Spotlight that follows the cursor ---------- */
.fn-spot { --mx: -999px; --my: -999px; }
.fn-card.fn-spot, .fn-row.fn-spot, .fn-service.fn-spot, .fn-where.fn-spot {
  background-image: radial-gradient(420px circle at var(--mx) var(--my), rgba(16, 179, 204, .13), rgba(30, 79, 216, .05) 30%, transparent 60%);
}
.fn-card.fn-spot::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(230, 40, 58, .55), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* ---------- Magnetic elements ---------- */
.fn-magnet { transition: transform .35s var(--fn-ease); will-change: transform; }

/* ---------- Destinations as expanding panels (desktop) ---------- */
@media (min-width: 1025px) {
  .fn-bento { display: flex; grid-template-columns: none; grid-template-rows: none; height: 520px; gap: 14px; }
  .fn-bento .fn-tile { flex: 1 1 0; min-width: 0; min-height: 0; transition: flex-grow .7s var(--fn-ease); }
  .fn-bento .fn-tile--big { flex-grow: 3.2; grid-row: auto; }
  .fn-bento:hover .fn-tile, .fn-bento:focus-within .fn-tile { flex-grow: 1; }
  .fn-bento .fn-tile:hover, .fn-bento .fn-tile:focus-visible { flex-grow: 3.2; }
  .fn-bento .fn-tile h3 { font-size: 1.6rem; transition: font-size .5s var(--fn-ease); white-space: nowrap; }
  .fn-bento .fn-tile--big h3, .fn-bento .fn-tile:hover h3, .fn-bento .fn-tile:focus-visible h3 { font-size: clamp(2.4rem, 1.4rem + 2.2vw, 3.8rem); }
  .fn-bento:hover .fn-tile--big:not(:hover) h3 { font-size: 1.6rem; }
  .fn-bento .fn-tile small { max-height: 0; opacity: 0; overflow: hidden; transition: opacity .4s ease, max-height .5s var(--fn-ease); }
  .fn-bento .fn-tile--big small, .fn-bento .fn-tile:hover small { max-height: 3em; opacity: .92; }
  .fn-bento:hover .fn-tile--big:not(:hover) small { max-height: 0; opacity: 0; }
  .fn-bento .fn-tile__body { flex-wrap: wrap; }
  .fn-bento .fn-tile::before { content: "Istraži →"; position: absolute; top: 18px; left: 18px; z-index: 1; padding: 7px 14px; border-radius: 999px; background: var(--fn-paper); color: var(--fn-ink); font: 800 .82rem var(--fn-body); opacity: 0; transform: translateY(-6px); transition: opacity .3s ease, transform .35s var(--fn-ease); }
  .fn-bento .fn-tile:hover::before, .fn-bento .fn-tile:focus-visible::before { opacity: 1; transform: none; }
  .fn-bento .fn-tile img { transition: transform 1.2s var(--fn-ease); }
  .fn-bento .fn-tile:hover img { transform: scale(1.04); }
}

/* ---------- Drag-to-scroll card rail + progress ---------- */
.fn-scroller.is-draggable { cursor: grab; }
.fn-scroller.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.fn-scroller.is-dragging a { pointer-events: none; }
.fn-scrollbar { position: relative; height: 4px; margin-top: 18px; border-radius: 4px; background: rgba(10, 26, 51, .1); overflow: hidden; }
.fn-scrollbar span { position: absolute; top: 0; bottom: 0; left: 0; width: var(--w, 30%); border-radius: inherit; background: linear-gradient(90deg, var(--fn-red), var(--fn-sun)); transform: translateX(var(--x, 0)); transition: transform .15s linear; }
@media (max-width: 560px) { .fn-scrollbar { margin-inline: 0; } }

/* ---------- Floating image preview for list rows ---------- */
.fn-peek { position: fixed; z-index: 45; left: 0; top: 0; width: 280px; height: 200px; border-radius: 22px; overflow: hidden; pointer-events: none;
  box-shadow: var(--fn-shadow-l); opacity: 0; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(var(--r, 0deg)) scale(.85);
  transition: opacity .25s ease, transform .18s ease-out; }
.fn-peek.is-on { opacity: 1; transform: translate3d(var(--x, 0), var(--y, 0), 0) rotate(var(--r, 0deg)) scale(1); }
.fn-peek img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Word-by-word headings ---------- */
.fn-words .fn-w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.fn-words .fn-w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--fn-ease); transition-delay: calc(var(--i, 0) * 70ms); }
.fn-words.is-in .fn-w > span { transform: none; }

/* ---------- Card photo wipe on reveal ---------- */
.fn-card.fn-reveal .fn-card__media img { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s var(--fn-ease) .15s, transform .9s var(--fn-ease); }
.fn-card.fn-reveal.is-in .fn-card__media img { clip-path: inset(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  .fn-scribble__line path { animation: none; stroke-dashoffset: 0; }
  .fn-hero__grid > :first-child, .fn-hero__visual { animation: none !important; }
  .fn-words .fn-w > span { transform: none !important; transition: none; }
  .fn-bento .fn-tile { transition: none; }
}
