/* Aion Visualization - Minimalist Design System */

/* Fonts (self-hosted or system-stable) */
@import url('./styles/fonts.css');

/* CSS Variables - Dark Theme Only */
@import url('./styles/tokens.css');
@import url('./styles/shared-components.css');

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--accent-light);
}

/* Layout Components */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.section {
  padding: var(--space-16) 0;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: transform var(--transition-base);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
  transition: all var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-glass);
}

.nav-link.active {
  color: var(--text-primary);
}

/* Hero Sections */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  z-index: 1;
}

.hero-title {
  font-size: clamp(var(--text-5xl), 8vw, var(--text-8xl));
  font-weight: 200;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: var(--text-secondary);
  font-weight: 300;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.2s forwards;
}

/* Cards */
.card {
  background: var(--surface-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: var(--space-4);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--surface-glass-hover);
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.button:hover {
  background: var(--surface-glass);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.button-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Chapter Specific */
.chapter-number {
  font-size: var(--text-sm);
  font-weight: 600;
  /* Small labels still need AA contrast on dark backgrounds. */
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.chapter-card {
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.chapter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, var(--surface-glass));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.chapter-card:hover::before {
  opacity: 1;
}

.chapter-card-number {
  font-size: var(--text-5xl);
  font-weight: 200;
  line-height: 1;
  opacity: 0.1;
  transition: opacity var(--transition-base);
}

.chapter-card:hover .chapter-card-number {
  opacity: 0.2;
}

.chapter-card-content {
  z-index: 1;
}

.chapter-card-title {
  font-size: var(--text-xl);
  font-weight: 400;
  margin-bottom: var(--space-1);
}

.chapter-card-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    gap: var(--space-4);
  }
  
  .hero-title {
    font-size: var(--text-5xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-lg);
  }
  
  .chapter-grid {
    grid-template-columns: 1fr;
  }
  
  p {
    font-size: var(--text-base);
  }
}
