/* Base Styles */
:root {
  --primary-color: #0f1b3a;
  --accent-color: #4f8cff;
  --accent-color-2: #ff1b6b;
  --text-color: #ffffff;
  --secondary-text: rgba(255, 255, 255, 0.7);
  --transition-speed: 0.6s;
  --font-main: 'Space Grotesk', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* WebGL Canvas */
#webgl-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 1s ease-out;
}

.loader {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
  position: relative;
}

.loader::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 3px solid transparent;
  border-bottom-color: var(--accent-color-2);
  border-radius: 50%;
  animation: spin 1.5s linear infinite reverse;
}

.loading-text {
  font-size: 1.2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: pulse 1.5s infinite;
  margin-bottom: 10px;
}

.loading-progress {
  font-size: 0.9rem;
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 20px;
}

.error-message h2 {
  margin-bottom: 15px;
  color: var(--accent-color);
}

.error-message p {
  margin-bottom: 10px;
  max-width: 400px;
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 30px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  mix-blend-mode: difference;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
  position: relative;
  padding: 5px 0;
  transition: all 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active::after {
  width: 100%;
}

/* Mobile Navigation */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
  z-index: 110;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-color);
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  height: 100%;
  background-color: rgba(15, 27, 58, 0.95);
  z-index: 105;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: right 0.5s ease;
  backdrop-filter: blur(10px);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 500;
  margin: 20px 0;
  position: relative;
  transition: all 0.3s ease;
}

.mobile-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.mobile-nav a:hover::after {
  width: 100%;
}

/* Content Sections */
.content {
  position: relative;
  z-index: 10;
}

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10%;
  position: relative;
}

.section-content {
  max-width: 1200px;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.active .section-content {
  opacity: 1;
  transform: translateY(0);
}

/* Typography */
.title {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(to right, #ffffff, #4f8cff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 40px;
  color: var(--secondary-text);
}

.description {
  font-size: 1.2rem;
  line-height: 1.6;
  max-width: 600px;
  color: var(--secondary-text);
}

/* Buttons */
.cta-button, .submit-button {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  padding: 15px 40px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  font-family: var(--font-main);
  z-index: 1;
}

.cta-button::before, .submit-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  transition: all 0.3s ease;
  z-index: -1;
}

.cta-button:hover, .submit-button:hover {
  color: var(--primary-color);
}

.cta-button:hover::before, .submit-button:hover::before {
  left: 0;
}

/* Contact Form */
.contact-form {
  display: flex;
  margin-top: 30px;
  max-width: 500px;
}

.contact-form input {
  flex: 1;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-color);
  font-family: var(--font-main);
}

.contact-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.contact-form .submit-button {
  border-left: none;
}

/* Fallback Background */
.fallback-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Virtual Scroll Container */
.virtual-scroll {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .title {
    font-size: 4rem;
  }
}

@media (max-width: 992px) {
  .main-nav {
    padding: 20px 30px;
  }
  
  .title {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  .main-nav {
    padding: 20px;
  }
  
  .nav-links {
    display: none;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .title {
    font-size: 3rem;
  }
  
  .subtitle {
    font-size: 1.2rem;
  }
  
  .description {
    font-size: 1rem;
  }
  
  .section {
    padding: 0 5%;
  }
  
  .contact-form {
    flex-direction: column;
  }
  
  .contact-form input {
    margin-bottom: 10px;
  }
  
  .contact-form .submit-button {
    width: 100%;
    border-left: 1px solid var(--accent-color);
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 2.5rem;
  }
  
  .cta-button, .submit-button {
    padding: 12px 30px;
    font-size: 0.9rem;
  }
  
  .loader {
    width: 50px;
    height: 50px;
  }
  
  .loading-text {
    font-size: 1rem;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles for accessibility */
a:focus, button:focus, input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

/* Print styles */
@media print {
  #webgl-canvas, .main-nav, .mobile-nav, .cta-button {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .section {
    page-break-inside: avoid;
    min-height: auto;
    padding: 20px 0;
  }
  
  .title {
    color: black;
    -webkit-text-fill-color: black;
  }
  
  .description, .subtitle {
    color: #333;
  }
}