/* Dark Theme - Matching Main Landing Page */
:root {
  /* Dark Theme Color System */
  --bg-deep: #0A0A0A;
  --bg-surface: #121212;
  --bg-card: #1A1A1A;
  --bg-elevated: #242424;
  
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  --gold: #FFD700;
  --gold-dark: #FFC107;
  --gold-light: #FFE54C;
  --gold-dim: rgba(255, 215, 0, 0.15);
  --gold-glow: rgba(255, 215, 0, 0.4);
  
  --border: rgba(255, 255, 255, 0.1);
  --divider: rgba(255, 255, 255, 0.05);
  
  /* Status colors */
  --status-success: #10B981;
  --status-error: #FF6347;
  
  /* Semantic Tokens */
  --color-bg: var(--bg-deep);
  --color-surface: var(--bg-surface);
  --color-card: var(--bg-card);
  --color-elevated: var(--bg-elevated);
  
  --color-text: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted: var(--text-muted);
  
  --color-border: var(--border);
  --color-divider: var(--divider);
  
  --color-accent: var(--gold);
  --color-accent-dark: var(--gold-dark);
  --color-focus: var(--gold);
  
  --gradient-accent: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  --gradient-hero: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
  --gradient-gold: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --glow-accent: 0 0 24px var(--gold-glow);
  --glow-strong: 0 0 48px var(--gold-glow);
  
  /* Core tokens (required by standards/design_rules.md) */
  --bg: var(--bg-deep);
  --surface: var(--bg-surface);
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --border: var(--border);
  --accent: var(--gold);
  --danger: var(--status-error);
  --success: var(--status-success);
  
  /* Landing page extensions (required) */
  --gradient-primary: var(--gradient-accent);
  
  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Core tokens (required) */
  --radius-1: var(--radius-sm);
  --radius-2: var(--radius-md);
  
  /* Shadows */
  --shadow-1: var(--shadow-sm);
  
  /* Typography */
  --font-sans: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --font-display: 'Satoshi', ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "Courier New", monospace;
}

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

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-top: var(--space-12);
  margin-bottom: var(--space-6);
}

h3 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

p {
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

ul, ol {
  margin-left: var(--space-6);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}

/* Header */
header {
  padding: var(--space-4) 0;
  background: rgba(10, 10, 10, 0.8);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
}

.logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 16px var(--gold-glow);
  transition: all 0.2s ease;
}

.logo:hover {
  color: var(--gold-light);
  text-shadow: 0 0 24px var(--gold-glow);
}

/* Hero Section */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: var(--space-8) var(--space-4);
  background: linear-gradient(180deg, #0A0A0A 0%, #121212 100%);
}

#hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: breathe 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.8;
  }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 900px;
}

#hero h1 {
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

#hero h1 strong {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.6s forwards;
}


.scroll-cue {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeInUp 0.8s ease 1s forwards;
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

/* Content Sections */
.content-section {
  padding: var(--space-16) 0;
}

.content-section.alt-bg {
  background: var(--bg-surface);
}

@media (max-width: 768px) {
  .content-section {
    padding: var(--space-16) 0;
  }
}

/* Chaos Problem Section */
#chaos-problem {
  padding: var(--space-24) 0;
  background: var(--bg-deep);
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.scattered-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.scattered-element {
  position: absolute;
  width: 80px;
  height: 80px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  opacity: 0.6;
}

.scattered-element:nth-child(1) { top: 20%; left: 10%; }
.scattered-element:nth-child(2) { top: 30%; right: 15%; }
.scattered-element:nth-child(3) { bottom: 40%; left: 20%; }
.scattered-element:nth-child(4) { bottom: 30%; right: 25%; }
.scattered-element:nth-child(5) { top: 50%; left: 5%; }

#chaos-problem .container {
  position: relative;
  z-index: 2;
}

#chaos-problem h2 {
  text-align: center;
  margin-bottom: var(--space-8);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

#chaos-problem .section-text {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  font-size: clamp(16px, 2vw, 20px);
}

/* Principles Grid */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  margin: var(--space-12) 0;
}

.principle-card {
  background: var(--bg-card);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.principle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-gold);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.principle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  border-color: var(--gold);
}

.principle-card:hover::before {
  transform: scaleY(1);
}

.principle-card h3 {
  margin-top: 0;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.principle-card p {
  color: var(--text-secondary);
}

/* Information Pyramid Section */
#information-pyramid {
  padding: var(--space-24) 0;
  background: var(--bg-surface);
}

.pyramid-container {
  max-width: 600px;
  margin: var(--space-12) auto;
  position: relative;
}

.pyramid-interactive {
  position: relative;
  width: 100%;
  height: 350px;
}

.pyramid-layer-interactive {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.pyramid-layer-interactive:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px var(--gold-glow);
  transform: translateX(-50%) scale(1.02);
  z-index: 10;
}

.pyramid-layer-interactive.layer-1 {
  width: 340px;
  height: 70px;
  bottom: 0;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
  z-index: 1;
  clip-path: polygon(5% 0%, 95% 0%, 100% 100%, 0% 100%);
}

.pyramid-layer-interactive.layer-2 {
  width: 300px;
  height: 70px;
  bottom: 70px;
  z-index: 2;
  clip-path: polygon(6.67% 0%, 93.33% 0%, 100% 100%, 0% 100%);
}

.pyramid-layer-interactive.layer-3 {
  width: 260px;
  height: 70px;
  bottom: 140px;
  z-index: 3;
  clip-path: polygon(7.69% 0%, 92.31% 0%, 100% 100%, 0% 100%);
}

.pyramid-layer-interactive.layer-4 {
  width: 220px;
  height: 70px;
  bottom: 210px;
  z-index: 4;
  clip-path: polygon(9.09% 0%, 90.91% 0%, 100% 100%, 0% 100%);
}

.pyramid-layer-interactive.layer-5 {
  width: 180px;
  height: 70px;
  bottom: 280px;
  z-index: 5;
  clip-path: polygon(11.11% 0%, 88.89% 0%, 100% 100%, 0% 100%);
}

.pyramid-layer-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.pyramid-layer-interactive.layer-1 .pyramid-layer-label {
  color: var(--bg-deep);
}

.pyramid-layer-description {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 300px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pyramid-layer-interactive:hover .pyramid-layer-description {
  opacity: 1;
}

/* Journey Timeline */
#journey {
  padding: var(--space-24) 0;
  background: var(--bg-deep);
}

.timeline-container {
  position: relative;
  max-width: 1000px;
  margin: var(--space-12) auto;
  padding: var(--space-8) 0;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 1;
  overflow: hidden;
}

.timeline-line-progress {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-gold);
  transform: translateY(-50%);
  z-index: 2;
}

.timeline-phases {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  gap: var(--space-4);
}

.phase-timeline-card {
  flex: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: var(--space-8);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.phase-timeline-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg), var(--glow-accent);
}

.phase-timeline-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--gold-glow);
  z-index: 3;
}

.phase-timeline-card h3 {
  color: var(--gold);
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.phase-timeline-card .phase-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: var(--space-4);
}

.phase-timeline-card:hover .phase-number {
  color: var(--gold);
}

.phase-timeline-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

.iteration-arrow {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 24px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* Villagers Section */
#villagers {
  padding: var(--space-24) 0;
  background: var(--bg-surface);
}

.villagers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
  margin: var(--space-12) 0;
}

@media (min-width: 1200px) {
  .villagers-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.villager-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-8);
  transition: all 0.3s ease;
  text-align: center;
}

.villager-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  border-color: var(--gold);
}

.villager-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-6);
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  background: var(--bg-card);
  box-shadow: 0 0 20px var(--gold-glow);
  border: 2px solid var(--gold);
  transition: all 0.3s ease;
}

.villager-card h3 {
  color: var(--gold);
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.villager-role {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.villager-outputs {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Methodology Infographic */
.methodology-infographic {
  margin: var(--space-12) auto;
  max-width: 100%;
  text-align: center;
}

.methodology-infographic img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Cycle Visualization */
#cycle {
  padding: var(--space-24) 0;
  background: var(--bg-deep);
}

.cycle-flow {
  max-width: 900px;
  margin: var(--space-12) auto;
  position: relative;
}

.cycle-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.cycle-step {
  flex: 1;
  min-width: 150px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: var(--space-6);
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.cycle-step:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-md), var(--glow-accent);
}

.cycle-step::after {
  content: '→';
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  color: var(--text-muted);
}

.cycle-step:last-child::after {
  display: none;
}

.cycle-step h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: var(--space-2);
}

.cycle-step p {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .cycle-steps {
    flex-direction: column;
  }
  
  .cycle-step::after {
    content: '↓';
    right: 50%;
    top: 100%;
    transform: translateX(50%);
  }
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
  margin: var(--space-12) 0;
}

.benefit-card {
  background: var(--bg-card);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--glow-accent);
  border-color: var(--gold);
}

.benefit-card h3 {
  margin-top: 0;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.benefit-card p {
  color: var(--text-secondary);
}

/* CTA Section */
.cta-section {
  text-align: center;
  margin: var(--space-16) 0;
  padding: var(--space-12);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 52px;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-gold);
  color: var(--bg-deep);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--glow-accent);
}

.btn-primary:focus {
  outline: 3px solid var(--gold-glow);
  outline-offset: 2px;
}

/* Links */
a {
  color: var(--gold);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--gold-light);
}

a:focus {
  outline: 3px solid var(--gold-glow);
  outline-offset: 2px;
}

/* Footer */
footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  margin-top: var(--space-20);
}

footer .muted {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.footer-link {
  margin-left: var(--space-4);
  color: var(--text-muted);
}

.footer-link:hover {
  color: var(--gold);
}

/* Reveal animations for GSAP */
.reveal {
  opacity: 1;
  will-change: opacity, transform;
  transform: translateY(0);
}

/* Accessibility */
*:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .principles-grid,
  .benefits-grid,
  .villagers-grid {
    grid-template-columns: 1fr;
  }
  
  .villager-avatar {
    width: 80px;
    height: 80px;
  }
  
  .timeline-phases {
    flex-direction: column;
  }
  
  .timeline-line {
    left: 20px;
    width: 2px;
    height: 100%;
    top: 0;
    transform: none;
  }
  
  .phase-timeline-card::before {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
  }
}
