/* =====================================================
   TABLE OF CONTENTS
   1. CSS Variables / Theme
   2. Base & Reset
   3. Utility Classes
   4. Header & Navigation
   5. Hero Section
   6. Systems (About) Section
   7. Programs Section
   8. Eco Lab Section
   9. Contact Section
   10. Footer
   11. Keyframes & Animations
   12. Scroll Reveal
   13. Responsive Media Queries
   ===================================================== */

/* =====================================================
   1. CSS Variables / Theme
   ===================================================== */
:root {
  --midnight: #020c1b;
  --midnight-light: #0a192f;
  --midnight-glass: rgba(2, 12, 27, 0.7);
  --emerald: #00ff9d;
  --emerald-dim: rgba(0, 255, 157, 0.12);
  --emerald-glow: rgba(0, 255, 157, 0.25);
  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.12);
  --cyan-glow: rgba(0, 240, 255, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(0, 240, 255, 0.12);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background-color: var(--midnight);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* =====================================================
   3. Utility Classes
   ===================================================== */
.container {
  width: 92%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

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

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

/* =====================================================
   4. Header & Navigation
   ===================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--midnight-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.site-header.scrolled {
  background: rgba(2, 12, 27, 0.95);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.logo-q {
  color: var(--emerald);
}

.logo-accent {
  color: var(--cyan);
  margin-left: 2px;
}

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

.nav-links a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-primary);
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--cyan);
}

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

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cyan);
  position: absolute;
  left: 50%;
  transition: all 0.3s ease;
}

.hamburger {
  top: 50%;
  transform: translate(-50%, -50%);
}

.hamburger::before {
  content: '';
  top: -7px;
  transform: translateX(-50%);
}

.hamburger::after {
  content: '';
  top: 7px;
  transform: translateX(-50%);
}

.mobile-menu-btn.active .hamburger {
  background: transparent;
}

.mobile-menu-btn.active .hamburger::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.mobile-menu-btn.active .hamburger::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

/* =====================================================
   5. Hero Section
   ===================================================== */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0f2e2e 0%, var(--midnight) 70%);
}

#heroCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

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

.hero-tagline {
  font-family: var(--font-display);
  color: var(--cyan);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--emerald) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.2));
}

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

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 2.5rem;
  background: var(--emerald-dim);
  border: 1px solid var(--emerald);
  color: var(--emerald);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 4px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.hero-cta:hover {
  background: var(--emerald);
  color: var(--midnight);
  box-shadow: 0 0 40px var(--emerald-glow);
  transform: translateY(-2px);
}

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

.mouse {
  display: block;
  width: 20px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  position: relative;
}

.mouse::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--cyan);
  border-radius: 50%;
  animation: scrollWheel 2s infinite;
}

/* =====================================================
   6. Systems (About) Section
   ===================================================== */
.systems-section {
  padding: 7rem 0;
  position: relative;
}

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

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: #ffffff;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.info-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-8px);
  border-color: var(--emerald);
  box-shadow: 0 10px 40px var(--emerald-dim);
}

.card-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--cyan-dim);
  color: var(--cyan);
}

.info-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.stats-container {
  display: flex;
  justify-content: center;
  gap: 5rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--emerald);
  text-shadow: 0 0 20px var(--emerald-glow);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  display: block;
}

/* =====================================================
   7. Programs Section
   ===================================================== */
.programs-section {
  padding: 7rem 0;
  background: linear-gradient(180deg, var(--midnight) 0%, var(--midnight-light) 100%);
}

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

.program-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

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

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

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

.program-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: #ffffff;
}

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

.program-tag {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
  background: var(--cyan-dim);
}

/* =====================================================
   8. Eco Lab Section
   ===================================================== */
.eco-lab-section {
  padding: 7rem 0;
  position: relative;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--midnight-light);
}

.project-visual {
  height: 220px;
  width: 100%;
  background: linear-gradient(135deg, #0f2e2e 0%, #0a192f 100%);
  position: relative;
  overflow: hidden;
}

.project-visual svg {
  width: 100%;
  height: 100%;
  opacity: 0.6;
  transition: transform 0.6s ease;
}

.gallery-item:hover .project-visual svg {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 12, 27, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--emerald);
  margin-bottom: 0.5rem;
}

.project-meta {
  font-size: 0.75rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  display: block;
}

.gallery-overlay p {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* =====================================================
   9. Contact Section
   ===================================================== */
.contact-section {
  padding: 7rem 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 10% 20%, #0f2e2e 0%, var(--midnight) 50%);
}

.contact-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--emerald);
  top: -100px;
  right: -100px;
  animation: floatOrb 12s infinite ease-in-out alternate;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--cyan);
  bottom: -50px;
  left: -50px;
  animation: floatOrb 15s infinite ease-in-out alternate-reverse;
}

.dashboard-hologram {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 1.5rem;
  opacity: 0.5;
  animation: floatOrb 8s infinite ease-in-out;
}

.holo-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.holo-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--cyan);
  width: 36px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.holo-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
}

.holo-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  border-radius: 2px;
  animation: holoPulse 3s infinite ease-in-out;
}

.holo-row:nth-child(1) .holo-fill { width: 68%; }
.holo-row:nth-child(2) .holo-fill { width: 45%; }
.holo-row:nth-child(3) .holo-fill { width: 82%; }
.holo-row:nth-child(4) .holo-fill { width: 55%; }
.holo-row:nth-child(5) .holo-fill { width: 93%; }
.holo-row:nth-child(6) .holo-fill { width: 77%; }

.contact-container {
  position: relative;
  z-index: 2;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-form {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 3rem;
}

.form-group {
  margin-bottom: 2rem;
  position: relative;
}

.form-group label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0;
  outline: none;
  transition: var(--transition);
  resize: vertical;
  border-radius: 0;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-bottom-color: var(--cyan);
}

.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: var(--emerald-dim);
  border: 1px solid var(--emerald);
  color: var(--emerald);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 4px;
  transition: var(--transition);
  margin-top: 0.5rem;
}

.form-submit:hover:not(:disabled) {
  background: var(--emerald);
  color: var(--midnight);
  box-shadow: 0 0 30px var(--emerald-glow);
}

.form-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.contact-info {
  padding-top: 2rem;
}

.info-block {
  margin-bottom: 2.5rem;
}

.info-block h4 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.info-block a,
.info-block address {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-style: normal;
  line-height: 1.6;
  transition: color 0.3s;
}

.info-block a:hover {
  color: var(--cyan);
}

.contact-decoration {
  margin-top: 3rem;
  position: relative;
  width: 100px;
  height: 100px;
}

.pulse-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid var(--emerald);
  opacity: 0;
  animation: pulseRing 3s infinite linear;
}

.pulse-ring::after {
  animation-delay: 1.5s;
}

/* =====================================================
   10. Footer
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 4rem 0 2rem;
  background: rgba(2, 12, 27, 0.5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-links h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.3s;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--emerald);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: #475569;
  font-size: 0.85rem;
}

/* =====================================================
   11. Keyframes & Animations
   ===================================================== */
@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(30px, 50px);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes holoPulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
    filter: brightness(1.3);
  }
}

/* =====================================================
   12. Scroll Reveal Stagger
   ===================================================== */
.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

/* =====================================================
   13. Responsive Media Queries
   ===================================================== */
@media (max-width: 1024px) {
  .stats-container {
    gap: 3rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-hologram {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 70%;
    height: calc(100vh - 80px);
    background: rgba(2, 12, 27, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    padding-top: 4rem;
    gap: 2.5rem;
    transition: right 0.4s ease;
    border-left: 1px solid var(--glass-border);
  }

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

  .mobile-menu-btn {
    display: flex;
  }

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

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

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

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

@media (max-width: 480px) {
  .systems-section,
  .programs-section,
  .eco-lab-section,
  .contact-section {
    padding: 5rem 0;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .stats-container {
    gap: 2rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }
}