/* Base Variables */
:root {
  --bg-color: #1e1e24;
  --text-color: #e0e0e0;
  --cyan: #00f3ff;
  --lime: #39ff14;
  --grid-color: rgba(255, 255, 255, 0.05);
  --font-heading: 'Arial Black', Impact, monospace;
  --font-body: system-ui, -apple-system, sans-serif;
  --transition-speed: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-speed: 0s;
  }
}

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

html {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-top: 60px; /* Space for fixed nav */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #ffffff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
  margin-bottom: 0.5rem;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  border-left: 4px solid var(--lime);
  padding-left: 15px;
  margin-top: 3rem;
}

h3 {
  font-size: 1.4rem;
  color: var(--cyan);
}

p {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition-speed), text-shadow var(--transition-speed);
}

a:hover, a:focus {
  color: var(--lime);
  text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
  outline: none;
}

/* Visible Focus for Accessibility */
:focus-visible {
  outline: 2px dashed var(--lime);
  outline-offset: 4px;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(30, 30, 36, 0.95);
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
  font-family: var(--font-heading);
  letter-spacing: 1px;
}

.nav-links a:hover {
  color: var(--lime);
}

/* Hero Section & Interactive Canvas */
.hero {
  position: relative;
  width: 100vw;
  height: 80vh;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  border-bottom: 2px solid var(--cyan);
  background: radial-gradient(circle at center, #2a2a35 0%, #1e1e24 70%);
}

.hero-content {
  position: absolute;
  top: 20%;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through to canvas */
}

.subtitle {
  font-size: 1.5rem;
  color: var(--lime);
  font-family: var(--font-heading);
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.demo-controls {
  margin-top: 20px;
  pointer-events: auto; /* Enable clicks on buttons */
  display: flex;
  gap: 15px;
  justify-content: center;
}

.demo-controls button {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-speed);
  text-transform: uppercase;
}

.demo-controls button:hover {
  background: rgba(57, 255, 20, 0.2);
  border-color: var(--lime);
  color: var(--lime);
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 1;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.intro-section {
  max-width: 800px;
  margin: 0 auto 60px auto;
  text-align: center;
}

/* Application Grid */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.card {
  background: rgba(30, 30, 36, 0.8);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 243, 255, 0.5);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto 60px auto;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--cyan);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  width: 50%;
  padding-right: 40px;
}

.timeline-item:nth-child(even) {
  left: 50%;
  padding-left: 40px;
  padding-right: 0;
}

.timeline-year {
  position: absolute;
  top: 0;
  right: -60px;
  background: var(--bg-color);
  color: var(--lime);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  padding: 5px 10px;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  z-index: 2;
}

.timeline-item:nth-child(even) .timeline-year {
  left: -60px;
  right: auto;
}

.timeline-content {
  background: rgba(30, 30, 36, 0.8);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-content h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.timeline-content p {
  margin-bottom: 0;
  font-size: 1rem;
}

/* Glossary */
.glossary {
  max-width: 800px;
  margin: 0 auto 60px auto;
  background: rgba(30, 30, 36, 0.8);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glossary dl {
  display: grid;
  gap: 20px;
}

.glossary dt {
  font-family: var(--font-heading);
  color: var(--cyan);
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.glossary dd {
  margin-left: 0;
  padding-left: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

/* Footer */
footer {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  font-size: 0.9rem;
  color: #888;
  background: var(--bg-color);
}

footer a {
  color: #aaa;
  margin: 0 10px;
}

footer a:hover {
  color: var(--cyan);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* Hide links on small screens for simplicity in this static version */
  }

  .hero {
    height: 60vh;
    min-height: 400px;
  }

  .hero-content {
    top: 10%;
  }

  h1 {
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 60px;
    padding-right: 0;
  }

  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-year {
    left: 0;
    right: auto;
    top: 0;
    font-size: 1rem;
    padding: 2px 5px;
  }

  .timeline-item:nth-child(even) .timeline-year {
    left: 0;
  }
}
