@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ================================
   CSS VARIABLES
   ================================ */
:root {
  --color-bg: #0a0c10;
  --color-surface: #11131a;
  --color-surface-glass: rgba(17, 24, 39, 0.55);
  --color-primary: #00bfff;
  --color-accent: #00f3ff;
  --color-electric: #2563eb;
  --color-neon: #0af;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 1rem;
  --transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ================================
   RESET & BASE
   ================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

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;
}

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

address {
  font-style: normal;
}

.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ================================
   UTILITIES
   ================================ */
.glass {
  background: var(--color-surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 0.5px rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.divider {
  width: 64px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-electric));
  border-radius: 2px;
  margin: 0.75rem auto 0;
  position: relative;
  overflow: hidden;
}

.divider::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: shimmer 2.5s infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

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

/* ================================
   NAVIGATION
   ================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.2rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  padding: 0.9rem 0;
}

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

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.logo span {
  color: var(--color-accent);
}

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

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

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

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

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

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.mobile-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--color-text);
  transition: var(--transition);
}

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

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

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

body.menu-open {
  overflow: hidden;
}

/* ================================
   HERO SECTION
   ================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2,6,23,0.2) 0%, rgba(2,6,23,0.6) 100%);
  z-index: 2;
}

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

.hero-title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 0%, var(--color-primary) 50%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0,200,255,0.25));
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  border-radius: 3rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-electric), var(--color-primary));
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.35), 0 0 60px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.55), 0 0 80px rgba(37, 99, 235, 0.25);
}

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

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

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

.scroll-indicator span {
  display: block;
  width: 24px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  position: relative;
}

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

/* ================================
   ABOUT SECTION
   ================================ */
.about {
  background: linear-gradient(180deg, var(--color-bg) 0%, #0f1420 100%);
}

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

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-card {
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s var(--transition), box-shadow 0.3s var(--transition);
}

.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 200, 255, 0.12);
}

.stat-number {
  font-size: 2.6rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ================================
   PROGRAMS SECTION
   ================================ */
.programs {
  background: radial-gradient(circle at 10% 20%, #0a0f1e 0%, var(--color-bg) 70%);
}

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

.program-card {
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: var(--transition);
  will-change: transform;
}

.program-card:hover {
  box-shadow: 0 0 0 1px rgba(0, 243, 255, 0.15), 0 20px 60px rgba(0, 0, 0, 0.4);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  background-size: 200% 100%;
  opacity: 0.8;
  animation: flowLine 3s linear infinite;
}

.program-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

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

.card-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-accent);
  transition: var(--transition);
  position: relative;
}

.card-link::after {
  content: '→';
  margin-left: 0.4rem;
  transition: transform 0.3s ease;
}

.card-link:hover::after {
  transform: translateX(4px);
}

/* ================================
   GRID LAB SECTION
   ================================ */
.gridlab {
  background: linear-gradient(180deg, #0f1420 0%, var(--color-bg) 100%);
}

.gridlab .section-header p {
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

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

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition), filter 0.6s var(--transition);
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(2,6,23,0.9) 100%);
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

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

.gallery-item:hover::before {
  opacity: 0.9;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  z-index: 2;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.4s var(--transition);
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
  opacity: 1;
}

.gallery-overlay h4 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.25rem;
}

.gallery-overlay span {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* ================================
   CONTACTS SECTION
   ================================ */
.contacts {
  background: radial-gradient(circle at 90% 10%, #0a1220 0%, var(--color-bg) 60%);
}

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

.contact-card {
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition);
}

.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px rgba(0, 191, 255, 0.15), 0 16px 48px rgba(0,0,0,0.35);
}

.contact-card h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.contact-card a,
.contact-card address {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  transition: color 0.3s ease;
}

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

/* ================================
   FOOTER
   ================================ */
.footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #07080a;
}

.footer p {
  color: #475569;
  font-size: 0.9rem;
}

/* ================================
   ANIMATIONS
   ================================ */
@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes scrollPulse {
  0% { opacity: 1; top: 6px; }
  50% { opacity: 0.4; top: 16px; }
  100% { opacity: 1; top: 6px; }
}

@keyframes flowLine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0,191,255,0.2); }
  50% { box-shadow: 0 0 40px rgba(0,191,255,0.4); }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  .section {
    padding: 4rem 0;
  }
  .mobile-toggle {
    display: flex;
  }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: 6rem 2rem 2rem;
    background: rgba(10, 12, 16, 0.96);
    backdrop-filter: blur(16px);
    gap: 1.25rem;
    transition: right 0.4s var(--transition);
  }
  .nav-menu.active {
    right: 0;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.9rem;
  }
}