/* ============================================
   ANIMATIONS & POLISH
   Loaded last. Same motion as before (hero entrance, infinity loop,
   shimmer, counters, reveal, hover lifts, WhatsApp pulse) restyled for
   the Adriatic theme. Everything respects prefers-reduced-motion.
   ============================================ */

/* ---------- Scroll progress bar ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--color-sea), var(--color-sea-bright), var(--color-sun-light));
  z-index: calc(var(--z-header) + 1);
  pointer-events: none;
}

/* ---------- Buttons: shine sweep ---------- */

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-gold::after,
.btn-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--ease-out);
}

.btn-gold:hover::after,
.btn-dark:hover::after {
  transform: translateX(120%);
}

/* ---------- Hero ---------- */

.hero-img {
  animation: kenburns 22s ease-in-out infinite alternate;
  transform-origin: 55% 50%;
}

@keyframes kenburns {
  from { transform: scale(1.04); }
  to   { transform: scale(1.16) translate(-2%, -1.5%); }
}

/* Infinity loop drawn around the arched photo */
/* Sits above the photo (below the floating cards) so the light trails
   glide across the coastline and out onto the page. */
.hero-infinity {
  position: absolute;
  left: -38%;
  top: 56%;
  width: 176%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(239, 197, 110, 0.45));
}

.hero-infinity path {
  fill: none;
  stroke-linecap: round;
}

.hero-infinity .loop-base {
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 2 9;
}

.hero-infinity .loop-gold {
  stroke: url(#infGold);
  stroke-width: 4;
  stroke-dasharray: 180 820;
  animation: loopTravel 7s linear infinite;
}

.hero-infinity .loop-blue {
  stroke: url(#infBlue);
  stroke-width: 4;
  stroke-dasharray: 120 880;
  animation: loopTravel 7s linear infinite;
  animation-delay: -3.5s;
}

@keyframes loopTravel {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* Staggered entrance for hero copy */
.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: riseIn 900ms var(--ease-out) forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 150ms; }
.hero-content > *:nth-child(2) { animation-delay: 300ms; }
.hero-content > *:nth-child(3) { animation-delay: 420ms; }
.hero-content > *:nth-child(4) { animation-delay: 540ms; }
.hero-content > *:nth-child(5) { animation-delay: 680ms; }
.hero-content > *:nth-child(6) { animation-delay: 800ms; }

@keyframes riseIn {
  to { opacity: 1; transform: none; }
}

/* Arched photo + floating cards entrance, then a gentle float */
.hero-visual {
  animation: visualIn 1200ms var(--ease-out) 200ms both;
}

@keyframes visualIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

.hero-float--fleet {
  animation: popIn 800ms var(--ease-out) 900ms both, bob 6s ease-in-out 1.7s infinite;
}

.hero-float--place {
  animation: popIn 800ms var(--ease-out) 1100ms both, bob 7s ease-in-out 1.9s infinite reverse;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Pulsing dot in the eyebrow pill */
.hero-eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-sea-bright);
  box-shadow: 0 0 0 0 rgba(63, 193, 201, 0.6);
  animation: dotPulse 2.2s ease-out infinite;
}

@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 193, 201, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(63, 193, 201, 0); }
}

/* Shimmer across the italic accent words */
.hero-title .accent,
.page-hero-title .accent {
  background: linear-gradient(100deg, var(--color-sea) 0%, var(--color-sea) 30%, var(--color-sea-bright) 45%, var(--color-sun) 55%, var(--color-sea) 70%, var(--color-sea) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldShimmer 7s ease-in-out infinite;
}

@keyframes goldShimmer {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: 0% 0; }
}

.trust-item .icon-box {
  transition: transform var(--transition-base), background-color var(--transition-base), color var(--transition-base);
}

.trust-item:hover .icon-box {
  transform: translateY(-3px) rotate(-8deg);
  background: var(--color-sea);
  color: var(--color-white);
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  width: 24px;
  height: 38px;
  margin-left: -12px;
  border: 2px solid rgba(16, 35, 58, 0.25);
  border-radius: 14px;
}

.scroll-cue::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--color-sea);
  animation: scrollCue 1.8s ease-in-out infinite;
}

@keyframes scrollCue {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

@media (max-width: 1023px) {
  .scroll-cue { display: none; }
}

/* ---------- Stats ---------- */

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .stat + .stat { border-left: 1px dashed rgba(255, 255, 255, 0.18); }
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 3.8rem);
  font-weight: var(--fw-regular);
  line-height: 1;
  color: var(--color-white);
  font-variant-numeric: lining-nums tabular-nums;
}

.stat-value .stat-suffix {
  color: var(--color-sun-light);
}

.stat-label {
  display: block;
  margin: 10px auto 0;
  max-width: 180px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- Section heading flourish draws in ---------- */

.section-heading .section-title::before {
  width: 0;
  transition: width 900ms var(--ease-out) 200ms;
}

.section-heading.is-visible .section-title::before {
  width: 46px;
}

/* ---------- Cards ---------- */

.card {
  transition: transform 450ms var(--ease-out), box-shadow 450ms var(--ease-out), border-color var(--transition-base);
}

.card-fleet,
.card-service {
  position: relative;
}

.card-fleet:hover,
.card-service:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card-fleet-img {
  transition: transform 900ms var(--ease-out);
}

.card-fleet:hover .card-fleet-img {
  transform: scale(1.07);
}

.card-service .icon-box {
  transition: transform 500ms var(--ease-out), background 400ms ease, color 400ms ease;
}

.card-service:hover .icon-box {
  transform: rotate(-10deg) scale(1.08);
  background: var(--color-sea);
  color: var(--color-white);
}

.card-destination img {
  transition: transform 1s var(--ease-out);
}

.card-destination:hover img {
  transform: scale(1.1);
}

.card-destination-label {
  transition: transform 450ms var(--ease-out);
}

.card-destination:hover .card-destination-label {
  transform: translateY(-6px);
}

.card-destination-label::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  margin: 8px auto 0;
  background: var(--color-sun-light);
  transition: width 450ms var(--ease-out);
}

.card-destination:hover .card-destination-label::after {
  width: 40%;
}

/* ---------- Reveal-on-scroll (smoother + stagger) ---------- */

[data-reveal] {
  transform: translateY(28px);
  transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

/* ---------- Dark sections: soft glow ---------- */

.section--dark {
  position: relative;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(63, 193, 201, 0.22), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(239, 197, 110, 0.14), transparent 45%),
    var(--color-sea-deep);
}

/* ---------- Page hero: floating emblem ---------- */

.page-hero::after {
  content: '';
  position: absolute;
  right: 4%;
  top: 58%;
  width: 380px;
  height: 215px;
  transform: translateY(-50%);
  background: url('../assets/logo/emblem-sm.png') no-repeat center / contain;
  opacity: 0.14;
  animation: floatY 8s ease-in-out infinite;
  pointer-events: none;
}

@media (max-width: 767px) {
  .page-hero::after { width: 220px; height: 125px; right: -40px; top: 30%; opacity: 0.1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(-50%); }
  50%      { transform: translateY(calc(-50% - 12px)); }
}

.page-hero-title,
.page-hero-sub,
.page-hero-breadcrumb {
  position: relative;
  z-index: 1;
  animation: riseIn 800ms var(--ease-out) both;
}

.page-hero-breadcrumb { animation-delay: 80ms; }
.page-hero-title      { animation-delay: 180ms; }
.page-hero-sub        { animation-delay: 300ms; }

/* ---------- Footer ---------- */

.footer-social a {
  transition: transform var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.footer-social a:hover {
  transform: translateY(-3px);
}

/* ---------- WhatsApp: pulse ring ---------- */

.whatsapp-float {
  background: #25d366;
  color: #fff;
}

.whatsapp-float::before,
.whatsapp-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #25d366;
  animation: pulseRing 2.6s ease-out infinite;
}

.whatsapp-float::after {
  animation-delay: 1.3s;
}

@keyframes pulseRing {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(1.7); opacity: 0; }
}

.mobile-contact-bar .whatsapp-btn {
  background: #25d366;
  color: var(--color-ink); /* dark text: 8:1 contrast on WhatsApp green (white was 2:1) */
}

/* ---------- Small screens ---------- */

@media (max-width: 639px) {
  /* Quote button lives in the mobile menu + bottom bar */
  .header-actions > .btn-gold {
    display: none;
  }
  .brand-logo {
    height: 34px;
  }
}

@media (max-width: 1023px) {
  .whatsapp-float {
    display: none;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-content > *,
  .hero-visual,
  .hero-float,
  .page-hero-title,
  .page-hero-sub,
  .page-hero-breadcrumb {
    opacity: 1;
    transform: none;
  }
  .hero-infinity .loop-gold,
  .hero-infinity .loop-blue {
    stroke-dasharray: none;
  }
  .section-heading .section-title::before { width: 46px; }
  .scroll-progress { display: none; }
}

/* ---------- Explore Albania map: thoughts forming ---------- */

@keyframes mapPop {
  from { opacity: 0; scale: 0.3; }
  70%  { opacity: 1; scale: 1.08; }
  to   { opacity: 1; scale: 1; }
}

@keyframes mapFloat {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -7px; }
}

@keyframes mapPing {
  0%   { opacity: 0.9; scale: 1; }
  100% { opacity: 0; scale: 2.6; }
}

@keyframes mapRoute {
  to { stroke-dashoffset: -120; }
}

.albania-map[data-reveal] {
  transform: none;
}

.albania-map:not(.is-visible) .map-pin,
.albania-map:not(.is-visible) .map-dots i,
.albania-map:not(.is-visible) .map-bubble {
  opacity: 0;
}

.albania-map.is-visible .map-pin {
  animation: mapPop 500ms var(--ease-out) backwards;
  animation-delay: calc(var(--i) * 160ms);
}

.albania-map.is-visible .map-dots i {
  animation: mapPop 380ms var(--ease-out) backwards;
  /* dots appear from the pin outwards, like a thought rising */
  animation-delay: calc(var(--i) * 160ms + 220ms + (var(--n) - 1 - var(--k)) * 90ms);
}

.albania-map.is-visible .map-bubble {
  animation:
    mapPop 650ms var(--ease-out) backwards,
    mapFloat 5s ease-in-out infinite;
  animation-delay:
    calc(var(--i) * 160ms + 600ms),
    calc(var(--i) * -0.7s);
}

.albania-map.is-visible .map-pin::after {
  animation: mapPing 2.4s ease-out infinite;
  animation-delay: calc(var(--i) * 0.45s + 1.5s);
}

.map-route path {
  animation: mapRoute 6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .albania-map .map-pin,
  .albania-map .map-dots i,
  .albania-map .map-bubble {
    opacity: 1;
    animation: none !important;
  }
}
