:root {
  --navy: #004687;
  --brand-blue: #2980B9;
  --green: #009637;
  --green-dark: #007A2E;
  --pale-gray: #F8F9FA;
  --charcoal: #262626;
  --slate: #6A6A6A;
  --smoke: #ECECEC;
  --white: #FFFFFF;
  --font-sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-sm: 0 2px 14px rgba(0, 0, 0, 0.082);
  --shadow-md: 0 16px 40px rgba(112, 144, 176, 0.2);
  --bar-h: 64px;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--pale-gray);
  -webkit-font-smoothing: antialiased;
}

/* ================= TOP BAR ================= */

.bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--bar-h);
  background: var(--white);
  border-bottom: 1px solid var(--smoke);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.bar__brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--navy);
  letter-spacing: -0.2px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar__brand::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 150, 55, 0.18);
}

.bar__nav {
  display: flex;
  flex: 1;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bar__nav::-webkit-scrollbar {
  display: none;
}

.bar__link {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: color 200ms var(--ease-out-quart),
              transform 200ms var(--ease-out-quart);
}

.bar__link:hover {
  color: var(--navy);
  transform: translateY(-1px);
}

.bar__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 280ms var(--ease-out-quart);
}

.bar__link.is-active {
  color: var(--navy);
  font-weight: 600;
}

.bar__link.is-active::after {
  transform: scaleX(1);
}

.bar__indicator {
  font-size: 12px;
  color: var(--slate);
  white-space: nowrap;
  padding: 6px 12px;
  background: var(--pale-gray);
  border: 1px solid var(--smoke);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.bar__indicator strong {
  color: var(--navy);
  font-weight: 600;
}

/* ================= STAGE ================= */

.stage {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.page {
  position: relative;
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 360ms var(--ease-out-expo),
              transform 360ms var(--ease-out-expo);
}

.page.is-active {
  display: block;
}

.page.is-entered {
  opacity: 1;
  transform: translateY(0);
}

.page__shell {
  position: relative;
  background: var(--white);
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  overflow: hidden;
}

/* Skeleton shimmer pre nego što slika stigne */
.page__shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--pale-gray) 0%,
    #eef1f4 50%,
    var(--pale-gray) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1400ms ease-in-out infinite;
  z-index: 1;
  opacity: 1;
  transition: opacity 400ms ease;
}

.page__shell.is-loaded::before {
  opacity: 0;
  pointer-events: none;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.page__img {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 2;
  filter: blur(20px);
  opacity: 0;
  transform: scale(1.015);
  transition: filter 700ms var(--ease-out-expo),
              opacity 600ms var(--ease-out-expo),
              transform 800ms var(--ease-out-expo);
}

.page__img.is-loaded {
  filter: blur(0);
  opacity: 1;
  transform: scale(1);
}

/* ================= PROGRESS DOTS ================= */

.dots {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--smoke);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

.dots__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--smoke);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 320ms var(--ease-out-expo),
              background 280ms var(--ease-out-quart);
}

.dots__dot:hover {
  background: var(--slate);
}

.dots__dot.is-active {
  width: 28px;
  background: var(--green);
}

/* ================= KEYBOARD HINT ================= */

.hint {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  font-size: 12px;
  color: var(--slate);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--smoke);
  border-radius: 999px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity 600ms ease, transform 600ms var(--ease-out-quart);
}

.hint kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  background: var(--white);
  border: 1px solid var(--smoke);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--charcoal);
  min-width: 16px;
  text-align: center;
}

.hint.is-faded {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 768px) {
  .bar {
    padding: 0 12px;
    gap: 12px;
  }
  .bar__indicator {
    display: none;
  }
  .stage {
    padding: 16px 12px 80px;
  }
  .hint {
    display: none;
  }
}

/* ================= PRINT (svi mockup-ovi ispod sebe za PDF) ================= */

@media print {
  .bar, .dots, .hint {
    display: none;
  }
  .page {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    page-break-after: always;
  }
  .page__shell::before {
    display: none;
  }
  .page__img {
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
