/* Golubovi Poštari — pokret i završna obrada (dodatni sloj; ne menja raspored ni podatke).
   Sve animacije koriste samo transform/opacity i gase se uz prefers-reduced-motion. */
:root {
  --gpm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gpm-amber: #f59e0b;
  --gpm-blue: #3b82f6;
}

/* Traka napretka čitanja na vrhu */
.gpm-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--gpm-blue), var(--gpm-amber));
  pointer-events: none;
}

/* Zaglavlje se sabija kad se krene niz stranu */
.site-header { transition: box-shadow 0.3s var(--gpm-ease), background 0.3s var(--gpm-ease); }
.site-header .nav { transition: min-height 0.3s var(--gpm-ease); }
.site-header.is-scrolled {
  background: rgba(15, 23, 42, 0.97);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}
.site-header.is-scrolled .nav { min-height: 60px; }
.site-nav a { position: relative; }
.site-nav a.is-current { color: #fff; }
.site-nav a.is-current::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--gpm-amber);
}

/* Hero: spora svetlosna pozadina + putanja leta */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero > .container { position: relative; z-index: 1; }
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
  will-change: transform;
}
.hero::before {
  top: -22vmax;
  right: -14vmax;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.55), transparent 62%);
  animation: gpm-drift-a 22s ease-in-out infinite alternate;
}
.hero::after {
  bottom: -26vmax;
  left: -16vmax;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.5), transparent 62%);
  animation: gpm-drift-b 27s ease-in-out infinite alternate;
}
@keyframes gpm-drift-a { to { transform: translate3d(-9vmax, 7vmax, 0) scale(1.12); } }
@keyframes gpm-drift-b { to { transform: translate3d(10vmax, -6vmax, 0) scale(1.08); } }

.gpm-flight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.gpm-flight path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 2 9;
}
.gpm-flight .gpm-flight-dot { fill: var(--gpm-amber); }
.gpm-flight .gpm-flight-end { fill: none; stroke: rgba(245, 158, 11, 0.7); stroke-width: 1.5; }
.gpm-flight .gpm-flight-pulse {
  fill: none;
  stroke: rgba(245, 158, 11, 0.55);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: gpm-pulse 2.6s ease-out infinite;
}
@keyframes gpm-pulse {
  from { transform: scale(0.6); opacity: 0.9; }
  to { transform: scale(2.6); opacity: 0; }
}

/* Ulazak hero sadržaja pri učitavanju */
.gp-motion .hero-text > *,
.gp-motion .hero-panel > * {
  animation: gpm-rise 0.7s var(--gpm-ease) both;
}
.gp-motion .hero-text > *:nth-child(1) { animation-delay: 0.05s; }
.gp-motion .hero-text > *:nth-child(2) { animation-delay: 0.12s; }
.gp-motion .hero-text > *:nth-child(3) { animation-delay: 0.19s; }
.gp-motion .hero-text > *:nth-child(4) { animation-delay: 0.26s; }
.gp-motion .hero-text > *:nth-child(5) { animation-delay: 0.33s; }
.gp-motion .hero-text > *:nth-child(n + 6) { animation-delay: 0.4s; }
.gp-motion .hero-panel > *:nth-child(1) { animation-delay: 0.3s; }
.gp-motion .hero-panel > *:nth-child(2) { animation-delay: 0.4s; }
.gp-motion .hero-panel > *:nth-child(n + 3) { animation-delay: 0.5s; }
@keyframes gpm-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: none; }
}

/* Brojači */
.stat-card { position: relative; overflow: hidden; }
.stat-card strong { font-variant-numeric: tabular-nums; }
.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gpm-amber), transparent);
  transform: scaleX(0);
  transition: transform 0.9s var(--gpm-ease);
}
.stat-card.is-counted::after { transform: scaleX(1); }

/* Pojavljivanje pri skrolovanju (samo kad JS radi — bez njega je sve vidljivo) */
.gp-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 0.7s var(--gpm-ease), transform 0.7s var(--gpm-ease);
  transition-delay: var(--gpm-delay, 0s);
}
.gp-motion [data-reveal].is-in { opacity: 1; transform: none; }

/* Naslovi sekcija: linija koja se iscrta */
.section-head { position: relative; }
.gp-motion .section-head h2 { position: relative; padding-bottom: 10px; }
.gp-motion .section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gpm-blue), var(--gpm-amber));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.8s var(--gpm-ease) 0.2s;
}
.gp-motion .section-head.is-in h2::after { transform: scaleX(1); }

/* Dugmad: odsjaj */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--gpm-ease);
  pointer-events: none;
}
.btn:hover::before { left: 120%; }
.btn:active { transform: translateY(1px) scale(0.985); }

/* Tabele koje stižu naknadno: redovi ulaze jedan za drugim */
.gp-motion .av-table tbody tr,
.gp-motion .ag-fed-stats-table tbody tr {
  animation: gpm-row 0.45s var(--gpm-ease) both;
}
.gp-motion .av-table tbody tr:nth-child(2), .gp-motion .ag-fed-stats-table tbody tr:nth-child(2) { animation-delay: 0.03s; }
.gp-motion .av-table tbody tr:nth-child(3), .gp-motion .ag-fed-stats-table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.gp-motion .av-table tbody tr:nth-child(4), .gp-motion .ag-fed-stats-table tbody tr:nth-child(4) { animation-delay: 0.09s; }
.gp-motion .av-table tbody tr:nth-child(5), .gp-motion .ag-fed-stats-table tbody tr:nth-child(5) { animation-delay: 0.12s; }
.gp-motion .av-table tbody tr:nth-child(6) { animation-delay: 0.15s; }
.gp-motion .av-table tbody tr:nth-child(7) { animation-delay: 0.18s; }
.gp-motion .av-table tbody tr:nth-child(8) { animation-delay: 0.21s; }
.gp-motion .av-table tbody tr:nth-child(n + 9) { animation-delay: 0.24s; }
@keyframes gpm-row {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: none; }
}
.av-table tbody tr, .ag-fed-stats-table tbody tr { transition: background-color 0.15s ease; }

/* Polja forme */
.contact-form input, .contact-form textarea, .hero-pigeon-search input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--gpm-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}
.hero-pigeon-search input:focus {
  outline: none;
  border-color: var(--gpm-amber);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22);
}

/* Dugme „na vrh” */
.gpm-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.32);
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s var(--gpm-ease), transform 0.3s var(--gpm-ease);
}
.gpm-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.gpm-top:hover { transform: translate3d(0, -3px, 0); }
.gpm-top:focus-visible { outline: 3px solid var(--gpm-amber); outline-offset: 3px; }

@media (max-width: 640px) {
  .hero::before, .hero::after { filter: blur(50px); opacity: 0.28; }
  .gpm-flight { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after, .gpm-flight .gpm-flight-pulse { animation: none; }
  .gp-motion .hero-text > *, .gp-motion .hero-panel > *,
  .gp-motion .av-table tbody tr, .gp-motion .ag-fed-stats-table tbody tr { animation: none; }
  .gp-motion [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn::before { display: none; }
  .gpm-top, .site-header, .site-header .nav { transition: none; }
}
