/* Base styling */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Georgia', serif;
  overflow: hidden;
  position: relative; /* Added for absolute positioning context */
}

/* Desktop background & layout */
@media screen and (min-width: 769px) {
  body {
    background-color: #000;
    background-image: 
      linear-gradient(to right, #000 0%, transparent 20%, transparent 80%, #000 100%),
      url('assets/forestbackground.png');
    background-repeat: no-repeat, no-repeat;
    background-position: center center, center center;
    background-attachment: fixed, fixed;
    background-size: 100% 100%, contain;
  }

  .menu {
    position: relative;
    width: 100%;
    height: 100%;
  }
}

/* Mobile background + updated mobile menu positioning */
@media screen and (max-width: 768px) {
  body {
    background: url('assets/forestbackground-mobile.png') no-repeat left center fixed;
    background-size: cover;
    overflow-x: hidden;
  }

  .menu {
    position: fixed;
    bottom: 20px;
    left: 20px;
    text-align: left;
  }

  .menu-link {
    position: static !important;
    display: block;
    margin: 60px 0;
    font-size: 26px;
    animation: fadeIn 1s forwards, pulse 4s infinite;
    text-align: left;
  }

  .orb-hitbox {
    display: none;
  }

  .art-gallery {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .art-gallery img {
    height: 200px;
  }
}

/* Fading veil */
#veil {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  opacity: 1;
  z-index: 9999;
  pointer-events: none;
  animation: fadeVeil 1.5s ease-out forwards;
}

/* Fireflies and Magic Dust */
#fireflies, #magic-dust {
  position: fixed;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.5;
  animation: moveFirefly 30s linear infinite;
}

.magic-dust-sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #ffffff 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  opacity: 0;
  animation: magicDustFloat 10s linear forwards;
}

/* Sparkles on link hover */
.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #fff8c9 0%, rgba(255,255,255,0) 80%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.8;
  animation: sparkleMove 1s ease-out forwards;
  z-index: 10000;
}

/* Frames */
#top-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 140px;
}

#left-frame {
  position: absolute;
  top: 140px;
  left: 0;
  width: 500px;
  height: calc(100% - 140px);
}

/* Content Area */
#content-area {
  position: absolute;
  top: 140px;
  left: 500px;
  right: 0;
  bottom: 0;
  padding: 20px;
  overflow-y: auto;
}

/* Navigation Links */
.menu-link {
  position: absolute;
  color: #EEE8AA;
  font-size: 22px;
  text-decoration: none;
  font-weight: bold;
  opacity: 0;
  animation: fadeIn 1.5s forwards, pulse 4s infinite;
  transition: all 0.3s ease;
}

#stacks-link {
  top: 48vh;
  left: 90px;
  animation-delay: 0.5s, 2s;
}

#secrets-link {
  top: 66vh;
  left: 135px;
  animation-delay: 1s, 2.5s;
}

#art-link {
  top: 71vh;
  left: 290px;
  font-size: 20px;
  animation-delay: 1.5s, 3s;
}

#home-link-art {
  top: 71vh;
  left: 290px;
  font-size: 20px;
  animation-delay: 1.5s, 3s;
}

#home-link-stacks {
  top: 48vh;
  left: 90px;
  font-size: 20px;
  animation-delay: 1.5s, 3s;
}

#home-link-secrets {
  top: 66vh;
  left: 135px;
  font-size: 20px;
  animation-delay: 1.5s, 3s;
}

/* Orb hitboxes */
.orb-hitbox {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

/* Hover Effects */
.menu-link:hover {
  color: #F7D174;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  transform: scale(1.05);
}

/* Art Gallery */
.art-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.art-gallery img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
}

.art-gallery img:hover {
  transform: scale(1.05);
}

/* Page Title */
h1 {
  color: #EEE8AA;
  font-size: 38px;
  text-align: center;
  margin-top: 50px;
  text-shadow:
    0 0 6px rgba(255, 215, 0, 0.5),
    0 0 12px rgba(255, 215, 0, 0.4),
    0 0 20px rgba(255, 215, 0, 0.3);
  animation: pulse 4s infinite;
}

.gallery-description, .gallery-caption {
  color: #EEE8AA;
  text-align: center;
  font-size: 18px;
  margin-top: 10px;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* Animations */
@keyframes fadeVeil {
  to { opacity: 0; }
}

@keyframes moveFirefly {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0.5; }
  50% { transform: translate(150px, 300px) scale(1); opacity: 0.7; }
  100% { transform: translate(-200px, 600px) scale(0.9); opacity: 0.4; }
}

@keyframes magicDustFloat {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  10% { opacity: 0.7; }
  50% { transform: translate(20px, -100px) scale(1); opacity: 0.4; }
  100% { transform: translate(40px, -200px) scale(0.8); opacity: 0; }
}

@keyframes sparkleMove {
  0% { transform: translateY(0) scale(1); opacity: 0.8; }
  50% { transform: translateY(-10px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-20px) scale(0.5); opacity: 0; }
}

@keyframes sparkleFade {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.3); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%   { text-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
  50%  { text-shadow: 0 0 15px rgba(255, 215, 0, 0.9); }
  100% { text-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
}

/* UPDATED orb positions and visibility fix */
.orb {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #d2ba6c, #8b7c4a);
  box-shadow: 0 0 15px rgba(210,186,108,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000; /* bring above background */
}

.label {
  color: #fefefe;
  font-family: serif;
  font-size: 0.8rem;
  pointer-events: none;
}

#orb1 { top: 68%; left: 12%; }
#orb2 { top: 52%; left: 18%; }
#orb3 { top: 38%; left: 22%; }
