html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: 'Fira Code', monospace;
  background: #faf9f3;
}

@font-face {
  font-family: 'Fira Code';
  src: url('./MainPageAssets/fonts/Fira_Code_v6/woff2/FiraCode-Regular.woff2') format('woff2'),
       url('./MainPageAssets/fonts/Fira_Code_v6/woff/FiraCode-Regular.woff') format('woff'),
       url('./MainPageAssets/fonts/Fira_Code_v6/ttf/FiraCode-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* 3D Viewer positioning */
#viewer {
  width: 100vw;
  height: 100vh;
  display: block;
  margin-top: -40px;
  background: transparent;
}

#viewer canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  transition: opacity 0.5s;
}

#loading-text {
  font-size: 24px;
  color: #333;
  font-family: monospace;
}

#errorOverlay {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 1000;
  color: #900;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px;
  border-radius: 4px;
  display: none;
  max-width: 40vw;
  white-space: pre-wrap;
  font-family: monospace;
}

/* Header Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 40px;
  gap: 40px;
  background: transparent;
  z-index: 1000;
  font-size: 16px;
  color: #3f3a36;
}

.nav-item {
  cursor: pointer;
  transition: opacity 0.3s;
}

.nav-item:hover {
  opacity: 0.7;
}

.title {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 38px;
  font-weight: 600;
  color: #3f3a36;
  z-index: 30;
  text-align: center;
  pointer-events: none;
}

.scroll-arrow {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 30px;
  height: 30px;
  border: 2px solid #3f3a36;
  border-left: none;
  border-top: none;
  cursor: pointer;
  z-index: 30;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0) rotate(45deg);
  }
  40% {
    transform: translateX(-50%) translateY(-10px) rotate(45deg);
  }
  60% {
    transform: translateX(-50%) translateY(-5px) rotate(45deg);
  }
}

.page {
  height: 100vh;
  width: 100vw;
  position: relative;
}

.page.first {
  z-index: 10;
  overflow: visible;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.page.first.shift-up {
  transform: translateY(-100vh);
}

.page.second {
  position: fixed;
  top: 100vh;
  background: #faf9f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 50px 60px 40px 60px;
  font-size: 18px;
  color: #3f3a36;
  z-index: 5;
  transition: top 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  overflow-y: auto;
  min-height: 100vh;
}

.page.second.visible {
  top: 0;
}

.directory-header {
  font-family: 'Fira Code', monospace;
  font-size: 2.8rem;
  font-weight: 600;
  color: #3f3a36;
  text-align: center;
  margin-bottom: 60px;
  letter-spacing: 1px;
}

.directory-section {
  width: 90%;
  max-width: 850px;
  margin-bottom: 25px;
  padding: 28px 35px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #8B6F47;
  border-radius: 12px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.directory-section:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: #3f3a36;
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(63, 58, 54, 0.15);
}

.directory-section h3 {
  font-family: 'Fira Code', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: #3f3a36;
  margin: 0 0 15px 0;
  letter-spacing: 0.5px;
}

.directory-section p {
  font-family: 'Fira Code', monospace;
  font-size: 1rem;
  line-height: 1.6;
  color: #6b635c;
  margin: 0;
  letter-spacing: 0.3px;
}

@media (max-width: 768px) {
  .title {
    font-size: 22px;
  }
  .nav-item {
    padding: 6px 8px;
  }
  #viewer {
    height: 60vh;
  }
  .page.second {
    padding: 30px 20px 20px 20px;
  }
}
