.hero {
  position: relative;
  width: auto;
  /* Fill a good chunk of the first screen */
  height: clamp(520px, 78vh, 820px);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0C4076; /* fallback blue */
}



/* ---- Waving Serbian flag (SVG, animated) ---- */
.hero-flag {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* Lower this to let the background image show through the flag */
  opacity: 0.9;
  animation: flagWave 6s ease-in-out infinite;
  transform-origin: center;
}

.hero-flag svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.35));
}

/* Gentle overall flutter on top of the SVG's path morphing */
@keyframes flagWave {
  0%, 100% { transform: skewX(0deg) skewY(0deg); }
  25%      { transform: skewX(1.5deg) skewY(-0.5deg); }
  50%      { transform: skewX(0deg) skewY(0.5deg); }
  75%      { transform: skewX(-1.5deg) skewY(-0.25deg); }
}

/* Subtle wave on the coat of arms */
.hero-flag .coat {
  animation: coatSway 6s ease-in-out infinite;
  transform-origin: 180px 180px;
}

@keyframes coatSway {
  0%, 100% { transform: translate(180px, 180px) rotate(-1deg); }
  50%      { transform: translate(180px, 180px) rotate(1deg); }
}

/* ---- Content on top: logo + title + subtitle ---- */
.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  color: #fff;
  padding: 2rem;
  transform: translateY(16px);
  opacity: 0;
  animation: heroIn 1s ease 0.3s forwards;
}

@keyframes heroIn {
  to { transform: translateY(0); opacity: 1; }
}

/* Logo slot */
.hero-logo {
  width: clamp(90px, 12vw, 150px);
  height: clamp(90px, 12vw, 150px);
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow:
    0 4px 24px rgba(0, 0, 0, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  margin: 0.5rem 0 0;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.95;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-content,
  .hero-flag,
  .hero-flag .coat,
  .hero-flag svg animate {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* Mobile */
@media (max-width: 1024px) {
  .hero {
    height: clamp(400px, 60vh, 560px);
  }
}