:root {
  --bg-main: #0b0b0c;
  --gold: #d4af37;
  --bone: #e5e2d2;
  --bone-soft: #cfcabb;
  --text-body: #e6e6e6;
  --ash: rgba(0,0,0,0.6);
}

/* GLOBAL */

body.history-page {
  background: var(--bg-main);
  color: var(--text-body);
  font-family: "Merriweather", serif;
  overflow-x: hidden;
  margin: 0;
}

/* NAV */

.main-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(10,10,10,0.4);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.8),
    0 0 40px rgba(212,175,55,0.15);
}

.main-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 60px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.logo {
  color: var(--gold);
  font-family: "Cinzel Decorative", serif;
  font-size: 1.8em;
  font-weight: 400;
  letter-spacing: 1px;
  text-shadow:
    0 0 8px rgba(212,175,55,0.4),
    0 0 30px rgba(212,175,55,0.15);
  filter: drop-shadow(0 0 4px rgba(212,175,55,0.4));
  white-space: nowrap;
}

/* PLAYER */

.nav-player {
  display: flex;
  align-items: center;
  gap: 10px;
  background: radial-gradient(circle at 30% 30%, rgba(40,40,40,0.6) 0%, rgba(10,10,10,0.3) 60%);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 30px;
  padding: 8px 16px;
  box-shadow:
    0 0 10px rgba(212,175,55,0.4),
    0 20px 60px rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
}

.play-btn {
  background: none;
  border: 2px solid var(--gold);
  color: var(--gold);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 8px rgba(212,175,55,0.4);
  font-size: 0.8rem;
  line-height: 28px;
  text-align: center;
  padding: 0;
}

.play-btn:hover {
  background: var(--gold);
  color: #0b0b0c;
  box-shadow: 0 0 12px rgba(212,175,55,0.8);
}

.track-title {
  font-family: "Cinzel Decorative", serif;
  font-size: 0.8em;
  letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(212,175,55,0.4);
  opacity: 0.9;
  white-space: nowrap;
}

.progress-bar {
  width: 150px;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 6px rgba(212,175,55,0.3);
}
.progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--gold) 0%,
    rgba(212,175,55,0) 100%
  );
}

/* NAV LINKOVI */

.nav-links {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  position: relative;
  font-size: 0.8em;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #f2f2f2;
  text-decoration: none;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  transition: color 0.3s ease;
  white-space: nowrap;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0px;
  height: 1px;
  width: 0%;
  background: radial-gradient(circle at 50% 50%, rgba(212,175,55,1) 0%, rgba(212,175,55,0) 70%);
  box-shadow: 0 0 8px rgba(212,175,55,0.8);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212,175,55,0.5);
}
.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active-link {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212,175,55,0.6);
}
.nav-links a.active-link::after {
  width: 100%;
  box-shadow: 0 0 12px rgba(212,175,55,0.8);
}

/* TOC / INDEX GORNJE SEKCIJE */

.section-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  padding: 80px 20px 100px;
  background: #000;
  box-shadow: 0 60px 120px rgba(0,0,0,0.9);
}

.section-buttons a {
  position: relative;
  text-decoration: none;
  font-family: "Cinzel Decorative", serif;
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.25em;
  text-transform: uppercase;

  color: var(--bone);
  opacity: 0.75;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);

  transition: all 0.3s ease;
  padding: 6px 0;
  filter: drop-shadow(0 0 2px rgba(229,226,210,0.25));
}

.section-buttons a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 1px;
  width: 0%;
  background: linear-gradient(
    90deg,
    rgba(212,175,55,0) 0%,
    rgba(212,175,55,1) 50%,
    rgba(212,175,55,0) 100%
  );
  box-shadow: 0 0 8px rgba(212,175,55,0.8);
  transition: width 0.3s ease;
}

.section-buttons a:hover {
  color: var(--gold);
  opacity: 1;
  text-shadow:
    0 0 8px rgba(212,175,55,0.4),
    0 0 30px rgba(212,175,55,0.15);
  filter: drop-shadow(0 0 4px rgba(212,175,55,0.4));
}
.section-buttons a:hover::after {
  width: 100%;
}

/* HISTORY SECTION / PARALLAX BLOKOVI */

.history-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #000; /* fallback */

  opacity: 0;
  transform: translateY(40px) scale(0.98);
  filter: blur(6px);
  transition:
    opacity 1.2s ease-out,
    transform 1.2s ease-out,
    filter 1.2s ease-out;
}

.history-section.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.image-full {
  position: absolute;
  inset: 0;

  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  filter: brightness(0.7) saturate(0.9) contrast(1.05) blur(0.5px);
  background-blend-mode: multiply;
  background-image: radial-gradient(
    circle at 50% 60%,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.85) 80%
  );

  z-index: 1;
}

.history-section::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  z-index: 2;
  pointer-events: none;
}

/* dramaturško mračenje */
.light-section .image-full {
  filter: brightness(0.7) saturate(0.9) contrast(1.05) blur(0.4px);
}
.mid-section .image-full {
  filter: brightness(0.6) saturate(0.85) contrast(1.1) blur(0.5px);
}
.dark-section .image-full {
  filter: brightness(0.7) saturate(0.8) contrast(1.15) blur(0.6px);
}
.terminal-section .image-full {
  filter: brightness(0.7) saturate(1) contrast(1.2) blur(0.7px);
}

/* TEKST BLOKOVI U SEKCIJAMA */

.text-overlay {
  position: relative;
  z-index: 3;
  max-width: 850px;

  text-align: left;
  padding: 80px 40px;

  color: var(--text-body);
  text-shadow: 0 0 15px rgba(0,0,0,0.8);

  background: radial-gradient(
    circle at 40% 30%,
    rgba(0,0,0,0.6) 0%,
    rgba(0,0,0,0.25) 60%,
    rgba(0,0,0,0) 100%
  );
  border-radius: 8px;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.9),
    0 0 60px rgba(0,0,0,0.8);
}

.text-overlay.right {
  margin-left: auto;
  text-align: left;
}

.section-title {
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(1.8rem, 1rem + 1vw, 2.4rem);
  letter-spacing: 0.05em;
  margin: 0 0 20px 0;
  line-height: 1.2;
}

/* naslovi po tipu */
.archive-title {
  color: var(--bone);
  text-shadow:
    0 0 2px rgba(0,0,0,0.8),
    0 0 6px rgba(0,0,0,0.9),
    0 0 20px rgba(229,226,210,0.15);
}

.evoke-title {
  color: var(--bone-soft);
  text-shadow:
    0 0 2px rgba(0,0,0,0.8),
    0 0 10px rgba(0,0,0,0.8),
    0 0 20px rgba(207,202,187,0.25);
  font-style: normal;
}

.terminal-title {
  color: var(--gold);
  text-shadow:
    0 0 10px rgba(212,175,55,0.4),
    0 0 30px rgba(212,175,55,0.15),
    0 0 60px rgba(212,175,55,0.1);
  animation: terminalGlow 6s ease-in-out infinite;
}

@keyframes terminalGlow {
  0%,100% {
    text-shadow:
      0 0 6px rgba(212,175,55,0.25),
      0 0 20px rgba(212,175,55,0.15);
  }
  50% {
    text-shadow:
      0 0 10px rgba(212,175,55,0.6),
      0 0 30px rgba(212,175,55,0.3),
      0 0 60px rgba(212,175,55,0.15);
  }
}

/* tekst tela */
.text-overlay p {
  font-family: "Cormorant Garamond", serif;
  line-height: 1.7;
  font-size: 1.15em;
  margin: 0 0 1.2em 0;
}

.text-overlay p.archive {
  color: var(--bone-soft);
  font-style: normal;
  opacity: 0.9;
}

.text-overlay p.evoke {
  color: var(--text-body);
  font-style: italic;
  opacity: 0.9;
}

/* STRELICE / LINKOVI NA SLEDEĆU SEKCIJU */

.ritual-arrow,
.ritual-arrow-top {
  display: inline-block;
  text-decoration: none;

  min-width: 42px;
  min-height: 42px;
  line-height: 42px;
  text-align: center;

  font-size: 1.2em;
  font-family: "Cinzel Decorative", serif;
  letter-spacing: 0.1em;
  color: var(--gold);

  background: rgba(10,10,10,0.2);
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 4px;

  margin-top: 30px;
  cursor: pointer;
  transition: all 0.3s ease;

  box-shadow:
    0 20px 40px rgba(0,0,0,0.9),
    0 0 20px rgba(212,175,55,0.2);
}

.ritual-arrow:hover,
.ritual-arrow-top:hover {
  box-shadow:
    0 30px 60px rgba(0,0,0,1),
    0 0 30px rgba(212,175,55,0.4);
  text-shadow:
    0 0 8px rgba(212,175,55,0.8),
    0 0 20px rgba(212,175,55,0.4);
  color: #fff;
  border-color: rgba(212,175,55,0.9);
}

/* FOOTER */

footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid #333;
  color: #999;
  font-size: 0.9em;
  background-color: #0b0b0c;
  box-shadow: 0 -40px 120px rgba(0,0,0,0.9);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .main-nav-inner {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }

  .nav-links {
    justify-content: center;
    row-gap: 10px;
  }

  .nav-player {
    order: 3;
  }

  .section-buttons {
    padding: 60px 16px 80px;
    gap: 24px;
  }

  .section-buttons a {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
  }

  .text-overlay {
    padding: 60px 25px;
    max-width: 90%;
    margin: 0 auto;
  }

  .section-title {
    font-size: clamp(1.6rem, 1rem + 1vw, 2rem);
  }

  .text-overlay p {
    font-size: 1.05em;
  }

  /* parallax isključujemo jer na mobilnom krcka i ume da kvari klik */
  .image-full {
    background-attachment: scroll;
  }
}

/* Prva sekcija istorije mora biti odmah vidljiva,
   čak i pre nego što istorija.js odradi scroll-logiku. */
.history-section:first-of-type {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: none;
}
