/* ============================
   VARIABLES & RESET
   ============================ */
:root {
  --bg-deep: #02040a;
  --bg-purple: #0a0612;
  --accent-cyan: #00f0ff;
  --accent-purple: #bc13fe;
  --accent-blue: #2d5af5;
  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-heading: 'Jura', sans-serif;
  --font-body: 'Exo 2', sans-serif;
  --radius: 16px;
  --transition: 0.3s ease;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* ============================
   BASE & TYPOGRAPHY
   ============================ */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

p {
  color: var(--text-secondary);
}

section {
  padding: 6rem 2rem;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.mt-1 {
  margin-top: 1rem;
}

/* ============================
   UTILITIES
   ============================ */
.text-gradient {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-border {
  border: 1px solid var(--glass-border);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
  transition: var(--transition);
}

.glow-border:hover {
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   NAVIGATION
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 2rem;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
  background: rgba(2, 4, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo span {
  font-weight: 300;
  opacity: 0.9;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* ============================
   HERO SECTION
   ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #02040a 100%);
}

#circuit-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 2rem;
}

.hero h1 {
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #02040a;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.45);
}

/* ============================
   GLASSMORPHISM COMPONENTS
   ============================ */
.glass-panel,
.glass-card {
  background: linear-gradient(135deg, var(--glass-bg), rgba(255,255,255,0.02));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

.glass-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  transform: translateY(-8px);
  border-color: rgba(188, 19, 254, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(188, 19, 254, 0.1);
}

/* ============================
   ABOUT SECTION
   ============================ */
.about {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-purple) 50%, var(--bg-deep) 100%);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.about-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.about-image-wrapper:hover img {
  transform: scale(1.05);
}

.about-image-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius);
  z-index: 1;
  pointer-events: none;
}

/* ============================
   PROGRAMS SECTION
   ============================ */
.programs {
  background: radial-gradient(circle at 80% 20%, rgba(45, 90, 245, 0.08) 0%, transparent 50%),
              var(--bg-deep);
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.program-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
}

.program-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
}

/* ============================
   LAB SECTION
   ============================ */
.lab {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #080514 100%);
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.lab-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}

.lab-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 255, 0.2);
}

.lab-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.lab-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.lab-card:hover .lab-image img {
  transform: scale(1.08);
}

.lab-meta {
  padding: 1.25rem;
}

.lab-meta h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.lab-meta p {
  font-size: 0.9rem;
  color: var(--accent-purple);
}

/* ============================
   CONTACTS SECTION
   ============================ */
.contacts {
  background: radial-gradient(circle at 20% 80%, rgba(188, 19, 254, 0.06) 0%, transparent 50%),
              var(--bg-deep);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
}

.contact-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.contact-item a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.contact-item a:hover {
  color: var(--accent-cyan);
}

.contact-text {
  color: var(--text-secondary);
}

.map-panel {
  padding: 0;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 10;
}

.map-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.map-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(2, 4, 10, 0.9), transparent);
}

.map-title {
  color: var(--text-primary);
  font-weight: 600;
}

.map-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================
   FOOTER
   ============================ */
.footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  background: #010205;
}

.footer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================
   ANIMATIONS & KEYFRAMES
   ============================ */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.25); }
  50% { box-shadow: 0 0 40px rgba(0, 240, 255, 0.45); }
}

/* ============================
   RESPONSIVE DESIGN
   ============================ */
@media (max-width: 1024px) {
  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  section {
    padding: 4rem 1.5rem;
  }

  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    padding: 6rem 2rem 2rem;
    background: rgba(2, 4, 10, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid var(--glass-border);
    transition: right 0.4s ease;
    gap: 1.5rem;
  }

  .nav-menu.open {
    right: 0;
  }

  .about-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .lab-grid {
    grid-template-columns: 1fr;
  }

  .btn-primary {
    width: 100%;
    text-align: center;
  }
}