/* ============================
   1. CSS Variables & Reset
   ============================ */
:root {
  --color-bg: #020617;
  --color-bg-alt: #0b1120;
  --color-surface: rgba(15, 23, 42, 0.6);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-accent: #22d3ee;
  --color-accent-2: #8b5cf6;
  --color-accent-3: #3b82f6;
  --font-heading: 'Exo 2', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #ffffff;
}

/* ============================
   2. Base & Typography
   ============================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================
   3. Layout & Navigation
   ============================ */
.nav-glass {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
}

.logo-icon {
  color: var(--color-accent);
  font-size: 1.5rem;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 0.25rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
  transition: width 0.3s ease;
}

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

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* ============================
   4. Hero Section
   ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.orbital-system {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring-1 {
  width: 300px;
  height: 300px;
  animation: spin 14s linear infinite;
}

.orbit-ring-2 {
  width: 460px;
  height: 460px;
  border-color: rgba(139, 92, 246, 0.12);
  animation: spin-reverse 20s linear infinite;
}

.orbit-ring-3 {
  width: 620px;
  height: 620px;
  border-color: rgba(59, 130, 246, 0.12);
  animation: spin 28s linear infinite;
}

.satellite {
  position: absolute;
  top: -6px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--color-accent), 0 0 30px rgba(34, 211, 238, 0.3);
}

.orbit-ring-2 .satellite {
  background: var(--color-accent-2);
  box-shadow: 0 0 15px var(--color-accent-2), 0 0 30px rgba(139, 92, 246, 0.3);
}

.orbit-ring-3 .satellite {
  background: var(--color-accent-3);
  box-shadow: 0 0 15px var(--color-accent-3), 0 0 30px rgba(59, 130, 246, 0.3);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 840px;
  padding: 0 1.5rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  min-height: 1.7em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-3));
  color: #020617;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.35), 0 4px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(34, 211, 238, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.55), 0 8px 30px rgba(0, 0, 0, 0.5);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-indicator {
  display: block;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  position: relative;
}

.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 2px;
  animation: scroll-move 2s infinite;
}

/* ============================
   5. About Section
   ============================ */
.section {
  position: relative;
  padding: 7rem 0;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

.about {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
}

.section-header {
  max-width: 720px;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-heading);
  color: var(--color-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 1.25rem;
  line-height: 1.2;
  text-wrap: balance;
}

.section-desc {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  line-height: 1.7;
}

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

.stat-card {
  padding: 2.25rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ============================
   6. Programs Section
   ============================ */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.program-card {
  padding: 2.5rem 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.program-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
  transition: left 0.7s;
}

.program-card:hover::before {
  left: 100%;
}

.program-card:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 211, 238, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 25px rgba(34, 211, 238, 0.08);
}

.program-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  color: var(--color-accent);
}

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

.program-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

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

/* ============================
   7. Laboratory Section
   ============================ */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.lab-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}

.lab-visual {
  height: 200px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--color-border);
}

.lab-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.lab-visual svg {
  width: 56px;
  height: 56px;
  color: var(--color-accent);
  z-index: 1;
  opacity: 0.9;
}

.lab-content {
  padding: 1.5rem;
  flex: 1 1 auto;
}

.lab-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.lab-content p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.lab-item:hover {
  transform: scale(1.02);
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 25px rgba(139, 92, 246, 0.06);
}

/* ============================
   8. Contact Section
   ============================ */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-info {
  padding: 2.5rem;
}

.contact-item {
  margin-bottom: 2rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.contact-item a,
.contact-item address {
  color: var(--color-text);
  text-decoration: none;
  font-style: normal;
  font-size: 1.125rem;
  transition: color 0.3s;
}

.contact-item a:hover {
  color: var(--color-accent);
}

.contact-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  position: relative;
}

.orbit-map {
  position: relative;
  width: 260px;
  height: 260px;
}

.planet {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 35% 35%, #60a5fa, #020617);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.35);
}

.orbit-map .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: 50%;
}

.orbit-map .ring-1 {
  width: 180px;
  height: 180px;
  animation: spin 10s linear infinite;
}

.orbit-map .ring-2 {
  width: 260px;
  height: 260px;
  animation: spin-reverse 16s linear infinite;
  border-color: rgba(139, 92, 246, 0.12);
}

/* ============================
   9. Footer
   ============================ */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4));
}

/* ============================
   10. Utilities & Glass
   ============================ */
.glass {
  background: var(--color-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
}

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

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

/* ============================
   11. Animations & Keyframes
   ============================ */
@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes spin-reverse {
  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes scroll-move {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

/* ============================
   12. Responsive Design
   ============================ */
@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

@media (max-width: 1024px) {
  .orbit-ring-3 {
    width: 500px;
    height: 500px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: calc(100vh - 72px);
    background: rgba(2, 6, 23, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    padding: 2.5rem 2rem;
    gap: 1.75rem;
    transition: right 0.35s ease;
    z-index: 99;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  }

  .nav-menu.open {
    right: 0;
  }

  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .orbit-ring-1 {
    width: 220px;
    height: 220px;
  }

  .orbit-ring-2 {
    width: 340px;
    height: 340px;
  }

  .orbit-ring-3 {
    width: 460px;
    height: 460px;
  }

  .section {
    padding: 5rem 0;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-visual {
    order: -1;
  }

  .lab-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .orbit-ring-1 {
    width: 180px;
    height: 180px;
  }

  .orbit-ring-2 {
    width: 260px;
    height: 260px;
  }

  .orbit-ring-3 {
    width: 340px;
    height: 340px;
  }

  .hero-title {
    line-height: 1.25;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .programs-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 4rem 0;
  }
}