/* ===========================================
   INFINITY AI ENVIRONMENTAL INTELLIGENCE ACADEMY
   Основная таблица стилей
   =========================================== */

/* 1. Переменные и тема оформления
   --------------------------------------- */
:root {
  --color-bg: #020617;
  --color-bg-alt: #0b1221;
  --color-surface: rgba(15, 23, 42, 0.55);
  --color-emerald: #10b981;
  --color-emerald-glow: #34d399;
  --color-cyan: #06b6d4;
  --color-cyan-glow: #22d3ee;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.25);
  --radius: 1.25rem;
  --transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Exo 2', 'Inter', sans-serif;
}

/* 2. Сброс и базовые стили
   --------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

ul {
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--color-cyan-glow);
  outline-offset: 2px;
}

/* 3. Типографика и утилиты
   --------------------------------------- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.section {
  padding: 6rem 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  text-align: center;
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-emerald-glow), var(--color-cyan-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 4. Glassmorphism
   --------------------------------------- */
.glass {
  background: var(--color-surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-highlight);
  border-radius: var(--radius);
}

/* 5. Кнопки
   --------------------------------------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #020617;
  background: linear-gradient(135deg, var(--color-emerald), var(--color-cyan));
  border: none;
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 0 0 rgba(6, 182, 212, 0);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-emerald));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow), 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary span {
  position: relative;
  z-index: 2;
}

/* 6. Навигация
   --------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.2rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.8rem 0;
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-text);
}

.logo svg {
  width: 32px;
  height: 32px;
}

.nav-menu {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s ease;
}

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

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

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
}

.overlay {
  display: none;
}

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

.particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 20% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    linear-gradient(to bottom, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.9));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-glass {
  max-width: 900px;
  padding: clamp(2rem, 5vw, 3.5rem);
  margin-top: 4rem;
  animation: fadeInUp 1s ease-out both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 4rem);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

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

/* 8. Об академии
   --------------------------------------- */
.about {
  background: linear-gradient(to bottom, var(--color-bg), var(--color-bg-alt));
}

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

.about-card {
  padding: 2.5rem;
  transition: var(--transition);
}

.about-card:hover {
  transform: translateY(-6px);
  border-color: rgba(6, 182, 212, 0.4);
}

.about-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  color: var(--color-cyan-glow);
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

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

/* 9. Программы
   --------------------------------------- */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

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

.program-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-emerald), var(--color-cyan));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.program-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  border-color: rgba(34, 211, 238, 0.25);
}

.program-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--color-cyan-glow);
}

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

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  background: linear-gradient(90deg, var(--color-emerald-glow), var(--color-cyan-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 10. Eco Lab
   --------------------------------------- */
.eco-lab {
  background: var(--color-bg-alt);
}

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

.lab-card {
  overflow: hidden;
  transition: var(--transition);
}

.lab-card:hover {
  transform: scale(1.02);
  border-color: rgba(16, 185, 129, 0.35);
}

.lab-visual {
  position: relative;
  height: 220px;
  background: linear-gradient(45deg, #064e3b, #0c4a6e, #115e59, #064e3b);
  background-size: 300% 300%;
  animation: holoMove 6s ease infinite;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

@keyframes holoMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.lab-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px);
  pointer-events: none;
}

.lab-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.lab-card h3 {
  font-family: var(--font-display);
  padding: 1.5rem 1.5rem 0.5rem;
  font-size: 1.15rem;
}

.lab-card p {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* 11. Контакты
   --------------------------------------- */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

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

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.contact-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  color: var(--color-emerald-glow);
}

.contact-card h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.contact-card a,
.contact-card address {
  color: var(--color-text-muted);
  font-style: normal;
  transition: color 0.3s ease;
}

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

/* 12. Подвал
   --------------------------------------- */
.footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--glass-border);
  background: linear-gradient(to bottom, var(--color-bg-alt), var(--color-bg));
}

/* 13. Анимации
   --------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Stagger-задержки для сеток */
.programs-grid .reveal:nth-child(1) { transition-delay: 0.1s; }
.programs-grid .reveal:nth-child(2) { transition-delay: 0.2s; }
.programs-grid .reveal:nth-child(3) { transition-delay: 0.3s; }
.programs-grid .reveal:nth-child(4) { transition-delay: 0.4s; }

.lab-grid .reveal:nth-child(1) { transition-delay: 0.1s; }
.lab-grid .reveal:nth-child(2) { transition-delay: 0.15s; }
.lab-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.lab-grid .reveal:nth-child(4) { transition-delay: 0.25s; }
.lab-grid .reveal:nth-child(5) { transition-delay: 0.3s; }
.lab-grid .reveal:nth-child(6) { transition-delay: 0.35s; }

.about-grid .reveal:nth-child(1) { transition-delay: 0.1s; }
.about-grid .reveal:nth-child(2) { transition-delay: 0.2s; }
.about-grid .reveal:nth-child(3) { transition-delay: 0.3s; }

.contacts-grid .reveal:nth-child(1) { transition-delay: 0.1s; }
.contacts-grid .reveal:nth-child(2) { transition-delay: 0.2s; }
.contacts-grid .reveal:nth-child(3) { transition-delay: 0.3s; }

/* 14. Адаптив
   --------------------------------------- */
@media (max-width: 1024px) {
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .programs-grid { grid-template-columns: repeat(2, 1fr); }
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
  .contacts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 4rem 0; }

  .about-grid,
  .programs-grid,
  .lab-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(16px);
    border-left: 1px solid var(--glass-border);
    transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .mobile-toggle {
    display: block;
    z-index: 1001;
  }

  .overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
  }

  .overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .hero-glass {
    text-align: center;
    margin-top: 5rem;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
}