/* ============================================
   1. Variables & Reset
   ============================================ */
:root {
  --bg-deep: #050508;
  --bg-surface: #080c14;
  --bg-elevated: #0f172a;
  --neon-blue: #00f0ff;
  --neon-blue-dim: #00a3bb;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --text-primary: #f0f9ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(0, 240, 255, 0.12);
  --glass-border-hover: rgba(0, 240, 255, 0.35);
  --header-height: 72px;
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   2. Typography
   ============================================ */
h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ============================================
   3. Utilities & Layout
   ============================================ */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  max-width: 640px;
  margin-bottom: 56px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--neon-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.04), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card:hover,
.glass-card:focus-visible {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  outline: none;
}

.glass-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.6), rgba(5, 8, 20, 0.7));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   4. Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  border: 2px solid var(--neon-blue);
  border-radius: 6px;
  position: relative;
  display: inline-block;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.logo-icon::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--neon-blue);
  border-radius: 2px;
  opacity: 0.9;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-blue), var(--accent-blue));
  transition: width 0.3s ease;
}

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

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

/* ============================================
   5. Hero
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-height);
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
              linear-gradient(to bottom, rgba(5, 5, 8, 0.2) 0%, var(--bg-deep) 100%);
  z-index: 1;
  pointer-events: none;
}

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

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-hover);
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon-blue);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  margin-bottom: 24px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-blue) 60%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 40px;
}

.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 40px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(37, 99, 235, 0.25));
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.btn-neon:hover {
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.25), inset 0 0 12px rgba(0, 240, 255, 0.2);
  transform: translateY(-2px);
}

.btn-neon::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.btn-neon:hover::before {
  left: 100%;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--neon-blue);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.8s infinite ease-in-out;
}

/* ============================================
   6. About
   ============================================ */
.about {
  background: linear-gradient(to bottom, var(--bg-deep), var(--bg-surface));
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.about-features {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  flex-shrink: 0;
}

.hologram-card {
  position: relative;
  padding: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.03), rgba(37, 99, 235, 0.05));
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.server-rack {
  width: 140px;
  height: 240px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  background: linear-gradient(to bottom, rgba(0, 240, 255, 0.03), transparent);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.server-rack::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(to bottom, rgba(0, 240, 255, 0.3), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.rack-unit {
  height: 10px;
  border-radius: 2px;
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 4px rgba(0, 240, 255, 0.15);
  animation: pulseUnit 3s infinite ease-in-out alternate;
}

.rack-unit:nth-child(3n) {
  background: rgba(0, 240, 255, 0.25);
  animation-delay: 0.2s;
}

.rack-unit:nth-child(3n+2) {
  animation-delay: 0.5s;
}

.hologram-label {
  margin-top: 24px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  color: var(--neon-blue);
  letter-spacing: 1px;
}

.hologram-status {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: statusBlink 2s infinite ease-in-out;
}

/* ============================================
   7. Programs
   ============================================ */
.programs {
  background: var(--bg-surface);
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.program-card {
  padding: 32px;
  cursor: pointer;
}

.program-icon {
  width: 48px;
  height: 48px;
  color: var(--neon-blue);
  margin-bottom: 20px;
}

.program-icon svg {
  width: 100%;
  height: 100%;
}

.program-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.program-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.card-link {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neon-blue);
  position: relative;
}

.card-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon-blue);
  transition: width 0.3s ease;
}

.program-card:hover .card-link::after {
  width: 100%;
}

/* ============================================
   8. Lab / Dashboard
   ============================================ */
.lab {
  background: linear-gradient(to bottom, var(--bg-surface), var(--bg-deep));
}

.dashboard {
  margin-bottom: 48px;
  padding: 32px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.dashboard-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-unit {
  font-size: 1rem;
  color: var(--neon-blue);
}

.stat-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--neon-blue));
  border-radius: 2px;
  width: 0;
}

.stat-bar-fill.animate {
  animation: fillBar 1.5s ease forwards;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  padding: 28px;
  cursor: pointer;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.project-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: var(--neon-blue-dim);
}

.project-id {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.project-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #22c55e;
}

.project-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.project-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  border-radius: 2px;
}

/* ============================================
   9. Contacts
   ============================================ */
.contacts {
  background: var(--bg-surface);
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.contact-card {
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.contact-card:hover {
  transform: translateY(-4px);
}

.contact-icon {
  width: 56px;
  height: 56px;
  color: var(--neon-blue);
  background: rgba(0, 240, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 4px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.08);
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-card h3 {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.contact-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.contact-action {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--neon-blue);
  margin-top: 8px;
}

/* ============================================
   10. Footer
   ============================================ */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg-deep);
  padding: 32px 0;
  text-align: center;
}

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

/* ============================================
   11. Animations
   ============================================ */
@keyframes scrollWheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes pulseUnit {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes fillBar {
  from { width: 0%; }
  to { width: var(--target); }
}

/* ============================================
   12. 3D Tilt Helpers
   ============================================ */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ============================================
   13. Responsive
   ============================================ */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-visual {
    order: -1;
  }
  .hologram-card {
    min-height: 280px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 72px 0;
  }
  .mobile-toggle {
    display: block;
  }
  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 100%;
    height: calc(100vh - var(--header-height));
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    background: rgba(5, 5, 8, 0.97);
    backdrop-filter: blur(16px);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  .nav-links.active {
    right: 0;
  }
  .nav-link {
    font-size: 1.1rem;
  }
  .programs-grid,
  .projects-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .hero-badge {
    font-size: 0.65rem;
  }
  .btn-neon {
    padding: 14px 28px;
    font-size: 0.8rem;
  }
}