/* ========================================
   CIRCADIUS DESIGN SYSTEM
   Industrial Aerospace Aesthetic
   ======================================== */

:root {
  /* Color Palette */
  --color-bg-primary: #0a0a0a;
  --color-bg-secondary: #1a1a1a;
  --color-bg-tertiary: #2d3748;
  --color-text-primary: #e8e8e8;
  --color-text-secondary: #a0aec0;
  --color-text-muted: #718096;
  --color-accent: #1a4d7a;
  --color-accent-bright: #2563eb;
  --color-border: #2d3748;
  --color-hover: #374151;
  
  /* Typography */
  --font-display: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  
  /* Layout */
  --max-width: 1400px;
  --max-width-reading: 800px;
  --border-radius: 2px;
  --transition-speed: 0.3s;
}

/* ========================================
   RESET & BASE
   ======================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-bottom: var(--space-lg); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: var(--space-md); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-md); }
h4 { font-size: 1.25rem; margin-bottom: var(--space-sm); }

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-accent-bright);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--color-text-primary);
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-reading {
  max-width: var(--max-width-reading);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

section {
  padding: var(--space-3xl) 0;
  position: relative;
}

/* Grid Background Effect */
.grid-bg {
  position: relative;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px),
    linear-gradient(0deg, var(--color-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.grid-bg > * {
  position: relative;
  z-index: 1;
}

/* ========================================
   NAVIGATION
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: transform var(--transition-speed);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-menu {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  transition: color var(--transition-speed);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent-bright);
  transition: width var(--transition-speed);
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 1001;
  transition: all var(--transition-speed);
}

.nav-toggle:hover {
  color: var(--color-accent-bright);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-lg);
    transition: left var(--transition-speed);
    border-top: 1px solid var(--color-border);
    z-index: 999;
    overflow-y: auto;
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-link {
    font-size: 1.125rem;
    padding: var(--space-sm) 0;
  }
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 100px;
}

.hero-content {
  max-width: 900px;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.2s forwards;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
  max-width: 700px;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.6s forwards;
}

.stat {
  padding: var(--space-md);
  border-left: 2px solid var(--color-accent);
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-text-primary);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.8s forwards;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  font-family: var(--font-display);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-md) var(--space-xl);
  border: 2px solid var(--color-accent-bright);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--color-accent-bright);
  transition: left var(--transition-speed);
  z-index: -1;
}

.btn:hover::before {
  left: 0;
}

.btn:hover {
  color: var(--color-text-primary);
}

.btn-primary {
  background: var(--color-accent-bright);
  border-color: var(--color-accent-bright);
}

.btn-primary::before {
  background: var(--color-accent);
}

.btn-secondary {
  border-color: var(--color-text-secondary);
}

.btn-secondary:hover {
  border-color: var(--color-accent-bright);
}

/* ========================================
   TIMELINE COMPONENT
   ======================================== */

.timeline {
  position: relative;
  padding: var(--space-xl) 0;
}

.timeline-track {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-xl) 0;
}

.timeline-line {
  position: relative;
  height: 2px;
  background: var(--color-border);
  margin: 0 auto;
  width: 100%;
}

.timeline-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: var(--color-accent-bright);
  animation: timelineProgress 2s ease forwards;
}

.timeline-items {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: calc(var(--space-xl) * -1);
}

.timeline-item {
  position: relative;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition-speed);
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }
.timeline-item:nth-child(4) { animation-delay: 0.8s; }
.timeline-item:nth-child(5) { animation-delay: 1s; }

.timeline-item:hover {
  transform: translateY(-8px);
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--color-accent-bright);
  border: 3px solid var(--color-bg-primary);
  border-radius: 50%;
  margin: 0 auto var(--space-sm);
  position: relative;
  z-index: 2;
}

.timeline-label {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ========================================
   CASE STUDY CARDS
   ======================================== */

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.case-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--color-accent-bright);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-speed);
}

.case-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
}

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

.case-category {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.case-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.case-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
}

.case-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.case-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.case-meta-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: block;
}

.modal-content {
  max-width: 900px;
  margin: var(--space-3xl) auto;
  padding: var(--space-xl);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 2rem;
  cursor: pointer;
  transition: color var(--transition-speed);
  z-index: 10;
}

.modal-close:hover {
  color: var(--color-text-primary);
}

.modal-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.modal-body {
  line-height: 1.8;
}

.modal-section {
  margin-bottom: var(--space-xl);
}

.modal-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
  margin-top: var(--space-3xl);
}

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

.footer-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-link {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

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

@keyframes timelineProgress {
  to {
    width: 100%;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-accent { color: var(--color-accent-bright); }
.text-muted { color: var(--color-text-muted); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  :root {
    --space-3xl: 3rem;
  }
  
  .hero {
    min-height: auto;
    padding: var(--space-3xl) 0;
  }
  
  .hero-stats {
    grid-template-columns: 1fr;
  }
  
  .case-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-items {
    flex-direction: column;
    gap: var(--space-xl);
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
