/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
  --color-bg: #070b14;
  --color-surface: rgba(255, 255, 255, 0.03);
  --color-surface-hover: rgba(255, 255, 255, 0.06);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-accent: rgba(0, 240, 255, 0.25);
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-accent: #00f0ff;
  --color-accent-dim: rgba(0, 240, 255, 0.15);
  --color-blue: #3b82f6;
  --gradient-hero: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #0a1628 100%);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --shadow-neon: 0 0 20px rgba(0, 240, 255, 0.12);
}

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

html {
  scroll-behavior: smooth;
}

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

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

address {
  font-style: normal;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

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

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

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #ffffff 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* =========================================
   3. Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(90deg, var(--color-blue), var(--color-accent));
  color: #000;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.2);
  border-color: rgba(0, 240, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35);
}

/* =========================================
   4. Glassmorphism Cards
   ========================================= */
.glass-card {
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-border-accent);
  box-shadow: var(--shadow-neon);
  background: var(--color-surface-hover);
}

.glass-card:hover::before {
  opacity: 1;
}

/* =========================================
   5. Scroll Reveal Base
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* =========================================
   6. Navigation
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 0;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.logo-accent {
  color: var(--color-accent);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-link {
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s ease;
  box-shadow: 0 0 6px var(--color-accent);
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  position: absolute;
  left: 4px;
  transition: all 0.3s ease;
}

.hamburger {
  top: 15px;
}

.hamburger::before {
  content: "";
  top: -8px;
}

.hamburger::after {
  content: "";
  top: 8px;
}

.mobile-toggle.active .hamburger {
  background: transparent;
}

.mobile-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.mobile-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

/* =========================================
   7. Hero Section
   ========================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-hero);
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(7,11,20,0.8) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 900px;
  padding-top: 80px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   8. About Section
   ========================================= */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.about-card h3 {
  font-size: 1.25rem;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.about-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* =========================================
   9. Programs Section
   ========================================= */
.programs {
  background: linear-gradient(180deg, var(--color-bg) 0%, #0d1424 100%);
}

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

.program-card {
  text-align: center;
}

.program-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-bg);
  background: linear-gradient(135deg, var(--color-accent), var(--color-blue));
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.program-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

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

/* =========================================
   10. Lab Section
   ========================================= */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.lab-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(0, 240, 255, 0.12);
  margin-bottom: 12px;
  transition: color 0.4s ease;
}

.lab-card:hover .lab-number {
  color: var(--color-accent);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

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

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

/* =========================================
   11. Contacts Section
   ========================================= */
.contacts {
  background: linear-gradient(180deg, #0d1424 0%, var(--color-bg) 100%);
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.contact-card h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.contact-card a,
.contact-card address {
  font-size: 1.05rem;
  color: var(--color-text);
  line-height: 1.8;
  transition: color 0.3s ease;
}

.contact-card a:hover {
  color: var(--color-accent);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* =========================================
   12. Footer
   ========================================= */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
}

/* =========================================
   13. Responsive Design
   ========================================= */
@media (max-width: 1024px) {
  .programs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: rgba(7, 11, 20, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 40px;
    gap: 24px;
    transition: right 0.3s ease;
    border-left: 1px solid var(--color-border);
    z-index: 999;
  }
  .nav-menu.active {
    right: 0;
  }
  .mobile-toggle {
    display: block;
    z-index: 1001;
  }
  .about-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }
  .programs-grid {
    grid-template-columns: 1fr;
  }
  .lab-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 60px 0;
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
  }
  .glass-card {
    padding: 24px;
  }
  .hero-content {
    padding-top: 100px;
  }
}