/* Base Reset */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Header Styles */
.main-header {
  background: #ffffff;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: #4a5568;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #007bff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #007bff;
  border-radius: 1px;
}

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger {
  width: 25px;
  height: 3px;
  background: #1a1a1a;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger::before,
.hamburger::after {
  content: '';
  width: 25px;
  height: 3px;
  background: #1a1a1a;
  display: block;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger::before {
  transform: translateY(-8px);
}

.hamburger::after {
  transform: translateY(5px);
}

.hamburger.active {
  background: transparent;
}

.hamburger.active::before {
  transform: rotate(45deg);
}

.hamburger.active::after {
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .nav-links {
    position: fixed;
    top: 73px;
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
}

/* Canvas Styling */
canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

/* Canvas Containers */
.canvas-container {
  width: 100%;
  height: 400px;
  position: relative;
  margin: 1rem 0;
  overflow: hidden;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Grid Layout */
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Canvas Items */
.canvas-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.canvas-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

/* Canvas Info Section */
.canvas-info {
  padding: 1.25rem;
  background: white;
}

.canvas-info h3 {
  margin: 0 0 0.5rem 0;
  color: #1a1a1a;
  font-size: 1.25rem;
  font-weight: 600;
}

.canvas-description {
  margin: 0;
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .canvas-grid {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
  
  .canvas-container {
    height: 300px;
  }
}

/* 3D Canvas Specific */
#monkey-container,
#splitting-cube-container {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Ensure WebGL canvases are properly sized */
canvas[data-engine] {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Loading State */
.canvas-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: #6b7280;
  font-size: 0.9rem;
  background: #f8f9fa;
}

/* Footer Styles */
.main-footer {
  background: #1a1a1a;
  color: #ffffff;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-content p {
  margin: 0 0 1rem 0;
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #ffffff;
}

@media (max-width: 768px) {
  .footer-links {
    gap: 1rem;
  }
  
  .footer-link {
    font-size: 0.85rem;
  }
}
