/* =============================
   1. CSS Variables & Design Tokens
   ============================= */
:root {
  --bg-deep: #02050e;
  --bg-panel: rgba(10, 20, 40, 0.65);
  --accent: #00f0ff;
  --accent-dim: rgba(0, 240, 255, 0.15);
  --text-main: #e6f7ff;
  --text-dim: #8aaedf;
  --glass-border: rgba(0, 240, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --radius: 16px;
}

/* =============================
   2. Reset & Base
   ============================= */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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

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

img {
  max-width: 100%;
  display: block;
}

address {
  font-style: normal;
}

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

/* =============================
   4. Glassmorphism Component
   ============================= */
.glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), 0 0 20px var(--accent-dim);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--glass-shadow), 0 0 40px rgba(0, 240, 255, 0.25);
  border-color: rgba(0, 240, 255, 0.4);
}

/* =============================
   5. Header & Navigation
   ============================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(2, 5, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.85;
}

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

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-main);
}

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

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

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  position: absolute;
  left: 6px;
  transition: all var(--transition);
  box-shadow: 0 0 6px var(--accent);
}

.hamburger {
  top: 19px;
}

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

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

/* Active hamburger (X) */
.nav-toggle.active .hamburger {
  background: transparent;
  box-shadow: none;
}

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

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

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

#starfield {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInUp 1s ease-out both;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #00f0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.2);
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%);
  color: #02050e;
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 40px rgba(0, 210, 255, 0.7), 0 6px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

/* =============================
   7. Section General Styles
   ============================= */
.section {
  padding: 6rem 0;
  position: relative;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-main);
  position: relative;
  display: block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 0.8rem auto 0;
  border-radius: 3px;
  box-shadow: 0 0 10px var(--accent);
}

/* =============================
   8. About Section
   ============================= */
.about {
  background: linear-gradient(180deg, #02050e 0%, #081026 100%);
}

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

.about-card {
  padding: 2.5rem;
  font-size: 1.05rem;
  color: var(--text-dim);
}

.about-visual {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hologram {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.2), transparent 60%),
    conic-gradient(from 0deg, transparent 0%, var(--accent) 20%, transparent 40%, var(--accent) 60%, transparent 80%);
  animation: rotateHologram 10s linear infinite;
  filter: blur(2px);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.3);
}

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

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

.program-card {
  padding: 2.2rem 1.8rem;
  text-align: center;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1.2rem;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
}

.program-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
  color: var(--text-main);
}

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

/* =============================
   10. Lab Gallery Section
   ============================= */
.lab {
  background: linear-gradient(180deg, #0a142e 0%, #050a18 100%);
}

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

.lab-item {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.lab-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition), filter var(--transition);
  filter: brightness(0.8) contrast(1.1);
}

.lab-item:hover img {
  transform: scale(1.08);
  filter: brightness(1) contrast(1.1);
}

.lab-item span {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(0deg, rgba(2, 5, 14, 0.95) 0%, rgba(2, 5, 14, 0.4) 50%, transparent 100%);
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.05rem;
  transform: translateY(100%);
  transition: transform var(--transition);
  pointer-events: none;
}

.lab-item:hover span {
  transform: translateY(0);
}

/* =============================
   11. Contacts Section
   ============================= */
.contacts {
  background: linear-gradient(180deg, #050a18 0%, #02050e 100%);
}

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

.contact-card {
  padding: 2rem;
  text-align: center;
}

.contact-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.contact-card a,
.contact-card address {
  font-size: 1.1rem;
  color: var(--text-main);
  transition: color var(--transition);
}

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

/* =============================
   12. Footer
   ============================= */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 0.9rem;
  background: #010309;
}

/* =============================
   13. Scroll Reveal Utility
   ============================= */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* =============================
   14. Keyframes
   ============================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateHologram {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* =============================
   15. Responsive Breakpoints
   ============================= */
@media (max-width: 992px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: calc(100vh - 70px);
    background: rgba(2, 5, 14, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    padding: 3rem 0;
    gap: 2.5rem;
    transition: right var(--transition);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

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

  .nav-toggle {
    display: block;
  }

  .hero-content {
    padding: 2rem 1.5rem;
  }

  .section {
    padding: 4rem 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}