/* === Visualization Post Layout === */

.viz-post-body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  overflow-x: hidden;
}

/* Fixed canvas layer - on top, fades to reveal essay behind */
#viz-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  background: #101010;
}

#viz-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Scroll spacer - tall invisible div that creates scroll range */
#scroll-spacer {
  position: relative;
  height: 300vh;
  z-index: 2;
}

/* Scroll hint at bottom of initial viewport */
#scroll-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  text-align: center;
  z-index: 10;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  margin: 8px auto 0;
  border-right: 2px solid rgba(255, 255, 255, 0.5);
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

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

/* Essay wrapper */
#essay-wrapper {
  position: relative;
  z-index: 2;
  background-color: #fff;
  opacity: 0;
}

/* Scrollbar styling for dark phase */
.viz-post-body::-webkit-scrollbar {
  width: 8px;
}
.viz-post-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.viz-post-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.viz-post-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #scroll-spacer {
    height: 200vh;
  }
  #scroll-hint {
    bottom: 20px;
    font-size: 12px;
  }
}
