/* ============================================
   DeepLab — Precision Routing Matrix Aesthetic
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg-deep: #F4F6F8;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #E9ECEF;
  
  --accent-cyan: #007BFF;
  --accent-purple: #6F42C1;
  --accent-matrix: #198754;
  
  --text-main: #212529;
  --text-muted: #6C757D;
  --text-matrix: #198754;
  
  --border-light: rgba(0, 0, 0, 0.1);
  --border-glow-cyan: rgba(0, 123, 255, 0.4);
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --space-xs: 8px; --space-sm: 16px; --space-md: 24px;
  --space-lg: 48px; --space-xl: 80px; --space-2xl: 120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-display);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient canvas setup behind everything */
canvas#lab-sim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none; /* Let clicks pass through to underneath elements if any */
}

.ambient-glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60vw; height: 60vh;
  background: radial-gradient(circle, rgba(111, 66, 193, 0.1) 0%, transparent 60%);
  z-index: 1; pointer-events: none;
}

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

/* Typography */
h1, h2, h3 { font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.mono-label {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  color: var(--accent-cyan); letter-spacing: 0.1em; margin-bottom: var(--space-sm);
  display: flex; align-items: center; gap: 8px;
}
.mono-label::before { content: '>'; color: var(--accent-matrix); font-weight: 700; }

/* Nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; padding: var(--space-xs) var(--space-lg);
  display: flex; justify-content: space-between; align-items: center; z-index: 100;
  background: linear-gradient(to bottom, rgba(244, 246, 248, 0.95), transparent); backdrop-filter: blur(8px);
}
.nav .btn { padding: 8px 16px; font-size: 12px; }
.nav__logo {
  font-family: var(--font-mono); font-weight: 700; font-size: 20px;
  display: flex; align-items: center; gap: 8px; text-decoration:none; color:var(--text-main);
}

.nav__links { display: flex; gap: var(--space-md); list-style: none; }
.nav__link { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); transition: 0.3s; text-decoration:none; }
.nav__link:hover { color: var(--accent-cyan); text-shadow: 0 0 8px rgba(0,240,255,0.5); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 28px; font-family: var(--font-mono);
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; text-decoration:none;
  cursor: pointer; transition: all 0.3s ease; position: relative; border: 1px solid transparent; backdrop-filter: blur(5px);
}
.btn--primary { background: rgba(0, 240, 255, 0.1); color: var(--accent-cyan); border-color: var(--accent-cyan); box-shadow: 0 0 15px rgba(0, 240, 255, 0.2) inset; }
.btn--primary:hover { background: rgba(0, 240, 255, 0.25); box-shadow: 0 0 30px rgba(0, 240, 255, 0.4) inset, 0 0 15px rgba(0, 240, 255, 0.6); }
.btn--secondary { border-color: var(--border-light); color: var(--text-main); background: rgba(0, 0, 0, 0.02); }
.btn--secondary:hover { border-color: rgba(0, 0, 0, 0.3); background: rgba(0, 0, 0, 0.08); }

/* ======== PRECISION HERO ======== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden; /* For absolute canvas containment */
  padding-top: var(--space-xl);
}

.hero__wrapper {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

/* Glass panel carrying all typography to keep it legible over chaotic matrix */
.hero__glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 60px;
  border-radius: 12px;
  border: 1px solid rgba(0, 123, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1), inset 0 0 40px rgba(111, 66, 193, 0.1);
  max-width: 650px;
}

.hero__title {
  font-size: clamp(52px, 6vw, 84px);
  line-height: 1.0;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: var(--space-md);
}

.text-glow {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--accent-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.hero__desc {
  font-size: clamp(16px, 1.8vw, 18px);
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.hero-stats {
  display: flex;
  gap: var(--space-lg);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--text-matrix); font-family: var(--font-mono); }
.stat-text { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 0.1em; }
.hero__btn-group { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* Sections Generic */
.section { padding: var(--space-2xl) 0; position: relative; border-top: 1px solid var(--border-light); background: var(--bg-deep); z-index: 10; }
.section::before { content: ''; position: absolute; top: -2px; left: 0; width: 100px; height: 3px; background: var(--accent-cyan); box-shadow: 0 0 10px var(--accent-cyan); }
.section h2 { font-size: clamp(32px, 4vw, 48px); margin-bottom: var(--space-lg); }

/* Fade out the matrix canvas gradually across the Services section */
#services {
  background: linear-gradient(to bottom, rgba(244, 246, 248, 0) 0%, rgba(244, 246, 248, 0.5) 60%, var(--bg-deep) 100%);
}

/* Research Cards */
.research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-lg); }
.r-card {
  background: var(--bg-surface-elevated); border: 1px solid var(--border-light); padding: var(--space-lg);
  position: relative; transition: 0.4s; overflow: hidden; z-index: 1;
}
.r-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 0;
  background: var(--accent-purple); transition: 0.4s; z-index: -1; box-shadow: 0 0 10px var(--accent-purple);
}
.r-card:hover { border-color: rgba(111, 66, 193, 0.4); transform: translateY(-5px); background: rgba(111, 66, 193, 0.03); }
.r-card:hover::before { height: 100%; }
.r-card-coord { position: absolute; top: var(--space-sm); right: var(--space-sm); font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); opacity: 0.5; }
.r-card-icon { font-size: 32px; margin-bottom: var(--space-md); filter: grayscale(1); transition: 0.4s ease; color: var(--accent-cyan); }
.r-card:hover .r-card-icon { filter: grayscale(0); transform: scale(1.1); text-shadow: 0 0 15px var(--accent-cyan); }
.r-card h3 { font-size: 24px; margin-bottom: var(--space-sm); color: var(--text-main); }
.r-card p { color: var(--text-muted); font-size: 15px; }

/* Arch Diagram */
.arch-diagram {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  margin-top: var(--space-lg); padding: var(--space-lg); background: var(--bg-surface-elevated);
  border: 1px dashed rgba(0,0,0,0.15); overflow-x: auto;
}
.node { padding: 20px 24px; border: 1px solid var(--accent-cyan); background: rgba(0,123,255,0.05); text-align: center; position: relative; min-width: 160px; box-shadow: inset 0 0 10px rgba(0,123,255,0.1); }
.node-title { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-cyan); }
.node-sub { font-family:var(--font-mono); font-size:10px; color:var(--text-muted); margin-top:4px; }
.edge { height: 2px; flex-grow: 1; min-width: 40px; background: repeating-linear-gradient(90deg, var(--text-muted) 0, var(--text-muted) 4px, transparent 4px, transparent 8px); position: relative; }
.edge::after { content: '→'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-surface); border:1px solid var(--border-light); padding: 2px 8px; color: var(--accent-purple); }

/* Terminals */
.terminal { background: #050505; border: 1px solid #222; padding: var(--space-md); border-radius: 6px; font-family: var(--font-mono); font-size: 13px; color: var(--text-matrix); margin-top: var(--space-lg); box-shadow: 0 20px 40px rgba(0,0,0,0.8); overflow-x: auto; }
.terminal-header { display: flex; gap: 8px; margin-bottom: var(--space-sm); padding-bottom: var(--space-sm); border-bottom: 1px solid #222; }
.term-dot { width: 12px; height: 12px; border-radius: 50%; background: #333; }
.term-dot:nth-child(1){background: #FF5F56; box-shadow: 0 0 5px #FF5F56;} 
.term-dot:nth-child(2){background: #FFBD2E; box-shadow: 0 0 5px #FFBD2E;} 
.term-dot:nth-child(3){background: #27C93F; box-shadow: 0 0 5px #27C93F;}
.term-line { display:flex; gap:12px; margin-bottom:4px; }
.term-path { color:var(--accent-purple); }
.term-cmd { color:#fff; }
.term-out { color:var(--text-muted); margin-bottom:12px; }

/* Responsive */
@media (max-width: 992px) {
  .hero__glass-panel { max-width: 100%; text-align: center; }
  .hero-stats { justify-content: center; }
  .hero__btn-group { justify-content: center; }
}
@media (max-width: 768px) {
  .nav { padding: var(--space-sm) var(--space-md); }
  .nav__links { display: none; }
  .hero__title { font-size: 42px; }
  .hero__glass-panel { padding: 32px 24px; }
  .arch-diagram { flex-direction: column; align-items: stretch; }
  .edge { width: 2px; height: 40px; margin: 0 auto; background: repeating-linear-gradient(180deg, var(--text-muted) 0, var(--text-muted) 4px, transparent 4px, transparent 8px); }
  .edge::after { content: '↓'; padding: 4px 0; }
  .hero-stats { flex-direction: column; align-items: center; gap: var(--space-md); }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ======== MATRIX FOOTER ======== */
.site-footer {
  position: relative;
  background: transparent;
  color: #FFFFFF;
  padding: var(--space-2xl) 0 0 0;
  z-index: 10;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-xl); padding-bottom: var(--space-xl); }
.f-col h4 { font-family: var(--font-mono); font-size: 14px; color: var(--accent-matrix); margin-bottom: var(--space-md); }
.f-col a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 12px; font-size: 15px; transition: 0.3s; }
.f-col a:hover { color: var(--accent-matrix); }

.neon-strip {
  height: 12px;
  width: 100%;
  background: var(--accent-matrix);
  box-shadow: 0 -5px 25px rgba(25, 135, 84, 0.8), 0 -10px 50px rgba(25, 135, 84, 0.4);
  position: absolute;
  bottom: 0;
  left: 0;
}
