/* Overrides for smooth scrolling */

html,
body {
  overflow: auto !important;
  height: auto !important;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #000000;
  /* Fix for white bars on mobile */
}

.perspective {
  position: relative;
  width: 100%;
  height: auto !important;
  overflow: visible !important;
}

/* When modal is open, we need to lock scroll */
.perspective--modalview {
  position: fixed;
  height: 100% !important;
  overflow: hidden !important;
}

.container {
  /* Remove transform that creates containing block for fixed elements */
  transform: none;
  min-height: 100vh;
  /* Only apply transform when modal is open */
}

/* Re-apply transform when modal is open */
.perspective--modalview .container {
  transform: translateZ(-1800px) translateX(-50%) rotateY(45deg);
  outline: 30px solid #0f33ff;
}

.l-viewport {
  position: relative;
  width: 100%;
  height: auto;
  overflow: visible;
}

.l-section {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 100vh;
  z-index: 1;
  /* Ensure they are visible */
}

.section {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none;
  /* Remove the translateY animation */
  position: relative;
  height: auto;
  min-height: 100vh;
}

/* Ensure content is visible */
.section--is-active {
  opacity: 1;
  visibility: visible;
}

/* Fix for absolute positioning inside sections if any */
.intro,
.work,
.about,
.contact,
.hire {
  position: relative;
  height: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Adjust side nav to be fixed and aligned with content */
.l-side-nav {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1440px;
  max-width: 90%;
  height: 100vh;
  z-index: 10;
  pointer-events: none;
  /* Allow clicks to pass through the container */
  display: flex;
  align-items: center;
  /* Vertically center the content */
  justify-content: flex-start;
  /* Align content to the left */
}

/* Ensure the vertical line is visible and positioned correctly */
.l-side-nav::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 2px;
  height: 70%;
  max-height: 750px;
  background-color: #555;
  opacity: 0.35;
  z-index: 10;
}

.side-nav {
  pointer-events: auto;
  /* Re-enable clicks on the menu items */
  position: relative;
  width: 100px;
  /* Restore original width */
  height: 70%;
  /* Restore original height */
  max-height: 750px;
  /* Restore original max-height */
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  /* Restore original spacing */
  padding: 0;
  margin: 0;
}

/* Adjust header to be fixed and aligned with content */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1440px;
  max-width: 90%;
  z-index: 11;
}

@media (max-width: 768px) {
  .l-side-nav {
    display: none;
  }
}

/* Performance optimizations for smooth scroll */
html {
  scroll-behavior: auto;
  /* Let Lenis handle smooth scrolling */
}

/* Hardware acceleration for animated elements */
.scroll-reveal,
.intro--banner,
.work--lockup,
.experience-card,
.glitch,
#custom-cursor {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Optimize Three.js canvas */
#starfield-canvas {
  will-change: transform;
  transform: translateZ(0);
}

/* Optimize scroll-triggered animations */
.scroll-reveal.is-visible {
  will-change: auto;
  /* Remove will-change after animation completes */
}

/* Smooth font rendering */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}