/* ========== Base Styles ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body, html {
  width: 100%;
  min-height: 100%;
  background: #000;
  overflow: hidden;
}

/* temporary.html: CC - Background */
body.temporary-bg {
  background: #000 url('/assets/site/99_background.jpeg') center top no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

/* bags-by-99.html: CC - Background */
body.bags-bg {
  background: #000 url('/assets/site/seat_background.jpg') center top no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

body {
  min-height: 100vh;
}

/* ========== 3D Viewer Section ========== */
#viewer3d {
  position: relative;
  width: 100vw;
  max-width: none;
  height: 80vh;
  margin: 0 auto;
  display: block;
  z-index: 1;
}

main, .container {
  color: #fff;
  margin-top: 80px; /* Account for fixed navbar */
}

main {
  position: relative;
  z-index: 2;
  min-height: 20vh;
}

/* ========== Canvas Background ========== */
canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
}

/* ========== Navigation Bar ========== */
.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.82); /*  0,0,0,0.85 semi-transparent for readability */
  padding: 1.2rem 2rem;
  z-index: 15;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
}

/* Reduced padding when using headline-icon */
.navbar-container:has(.headline-icon) {
  padding: 0.6rem 2rem;
}

#headline {
  font-weight: bold;
  font-size: 1.3rem;
  letter-spacing: 2px;
  color: #fff;
  margin-right: 2rem;
  pointer-events: none;
  display: flex;
  align-items: center;
  height: 100%;
}

.headline-icon {
  height: 3rem;
  width: auto;
  object-fit: contain;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
 /* transition: background 0.15s, color 0.15s; */
}

.nav-link:hover, .nav-link.active {
  /* background: #000; */
  color: #fff;
}

/* ========== Modal Styles ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.modal-content {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 8px 32px #000c;
  display: block;
  margin: 0 auto;
}
#modalImg, #modalVideo {
  display: none;
}
.modal.show-caption #modalImg, .modal.show-caption #modalVideo {
  display: block;
}
.modal-close {
  position: absolute;
  top: 2vw;
  right: 3vw;
  color: #fff;
  font-size: 1.1rem;   
  font-weight: normal;
  cursor: pointer;
  z-index: 1010;
  background: none;
  border: none;
  padding: 0.2em 0.5em;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.modal-close:hover {
  opacity: 1;
}

/* ========== Project Glide Presentation ========== */
.project-glide-presentation {
  display: block;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 2;
}

.glide-img {
  position: absolute;
  top: 50%;
  left: 50%;
  animation: fly1 20s linear infinite alternate;
  cursor: pointer;
  transition: transform 0.2s;
  pointer-events: auto;
}
.glide-img:nth-child(2) { animation-name: fly2; animation-delay: 0s; }
.glide-img:nth-child(3) { animation-name: fly3; animation-delay: 0s; }
.glide-img:nth-child(4) { animation-name: fly4; animation-delay: 0s; }
.glide-img:nth-child(5) { animation-name: fly5; animation-delay: 0s; }
.glide-img:nth-child(6) { animation-name: fly6; animation-delay: 0s; }

.glide-img img {
  width: 30vw;
  min-width: 180px;
  max-width: 320px;
  border-radius: 12px;
  box-shadow: 0 4px 24px #000a;
  transition: box-shadow 0.2s, transform 0.2s;
}

.glide-img figcaption, .glide-img .figure-text, .glide-img .caption, .glide-img-caption, .glide-caption, .glide-img figcaption, .glide-img .caption, .glide-img-caption {
  display: none !important;
}

@keyframes fly1 {
  0%   { transform: translate(-50vw, -40vh) rotate(-8deg) scale(1); }
  25%  { transform: translate(10vw, -30vh) rotate(6deg) scale(1.08);}
  50%  { transform: translate(30vw, 10vh) rotate(-4deg) scale(1.04);}
  75%  { transform: translate(-10vw, 30vh) rotate(8deg) scale(1.1);}
  100% { transform: translate(-50vw, -40vh) rotate(-8deg) scale(1);}
}
@keyframes fly2 {
  0%   { transform: translate(10vw, -15vh) rotate(5deg) scale(1); }
  25%  { transform: translate(-15vw, 10vh) rotate(-8deg) scale(1.05);}
  50%  { transform: translate(15vw, 25vh) rotate(6deg) scale(1.08);}
  75%  { transform: translate(-10vw, -5vh) rotate(-4deg) scale(1.03);}
  100% { transform: translate(10vw, -15vh) rotate(5deg) scale(1);}
}
@keyframes fly3 {
  0%   { transform: translate(-20vw, 30vh) rotate(-12deg) scale(1); }
  25%  { transform: translate(20vw, 40vh) rotate(8deg) scale(1.08);}
  50%  { transform: translate(40vw, -20vh) rotate(-6deg) scale(1.04);}
  75%  { transform: translate(-40vw, -30vh) rotate(12deg) scale(1.1);}
  100% { transform: translate(-20vw, 30vh) rotate(-12deg) scale(1);}
}
@keyframes fly4 {
  0%   { transform: translate(10vw, 10vh) rotate(6deg) scale(1); }
  25%  { transform: translate(-30vw, 30vh) rotate(-8deg) scale(1.08);}
  50%  { transform: translate(-40vw, -10vh) rotate(4deg) scale(1.04);}
  75%  { transform: translate(30vw, -30vh) rotate(10deg) scale(1.1);}
  100% { transform: translate(10vw, 10vh) rotate(6deg) scale(1);}
}
@keyframes fly5 {
  0%   { transform: translate(30vw, -30vh) rotate(10deg) scale(1); }
  25%  { transform: translate(40vw, 20vh) rotate(-6deg) scale(1.1);}
  50%  { transform: translate(-20vw, 30vh) rotate(4deg) scale(1.06);}
  75%  { transform: translate(-30vw, -10vh) rotate(-10deg) scale(1.04);}
  100% { transform: translate(30vw, -30vh) rotate(10deg) scale(1);}
}
@keyframes fly6 {
  0%   { transform: translate(-40vw, 5vh) rotate(-15deg) scale(1); }
  25%  { transform: translate(15vw, -25vh) rotate(9deg) scale(1.12);}
  50%  { transform: translate(35vw, 25vh) rotate(-7deg) scale(1.08);}
  75%  { transform: translate(-25vw, 35vh) rotate(13deg) scale(1.05);}
  100% { transform: translate(-40vw, 5vh) rotate(-15deg) scale(1);}
}

/* ========== Responsive Styles ========== */
@media (max-width: 600px) {
  html, body {
    font-size: 0.85rem;
  }
  .navbar-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem; /* Scaled down from 1.2rem 2rem */
    background: rgba(0,0,0,0.82) !important; /* Ensure consistent background on mobile */
    z-index: 15; /* Higher than canvas z-index */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
  }
  nav {
    flex-wrap: nowrap;
    gap: 0.8rem; /* Scaled down from 1.5rem */
    justify-content: flex-end;
    font-size: 0.75rem; /* Scaled down from 1rem */
  }
  #headline {
    text-align: left;
    font-size: 0.9rem; /* Scaled down from 1.3rem */
    width: auto;
    margin: 0 1rem 0 0; /* Scaled down from 2rem */
    display: block;
    letter-spacing: 1px; /* Scaled down from 2px */
  }
  .nav-link {
    font-size: 0.75rem; /* Scaled down from 1rem */
    padding: 0.2rem 0.4rem; /* Scaled down from 0.3rem 0.7rem */
    white-space: nowrap;
  }
  .nav-link:hover, .nav-link.active {
  background: #000;
  color: #fff;
  }
  main, .container {
    max-width: 100vw;
    padding: 0;
    margin-top: 60px; /* Account for smaller fixed navbar on mobile */
  }
  canvas#bg {
    box-sizing: border-box;
    width: 80vw;
    height: 80vh;
  }
  
  /* Fix for index.html navbar background on mobile */
  body:has(canvas#bg) .navbar-container {
    background: #000 !important; /* Completely black background when canvas is present */
    z-index: 20 !important; /* Even higher z-index */
  }
}