/* ============================
   1. VARIABLES & RESET
   ============================ */
:root {
  --color-bg: #020c1b;
  --color-bg-alt: #0a192f;
  --color-primary: #00f0ff;
  --color-secondary: #0077b6;
  --color-accent: #00bfa5;
  --color-text: #e6f1ff;
  --color-text-muted: #8892b0;
  
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(16, 42, 67, 0.55);
  --glass-border: rgba(0, 240, 255, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  color: var(--color-text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

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

address {
  font-style: normal;
}

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

/* ============================
   2. UTILITIES & GLASSMORPHISM
   ============================ */
.glass-panel,
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
}

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

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

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

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }

/* ============================
   3. BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: #001f3f;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.6);
}

/* ============================
   4. HEADER & NAVIGATION
   ============================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 22px 0;
  transition: var(--transition);
}

.header.scrolled {
  background: rgba(2, 12, 27, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  padding: 14px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--color-text);
}

.logo-icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

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

.nav-list {
  display: flex;
  align-items: center;
  gap: 42px;
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  border-radius: 2px;
}

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

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

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================
   5. SECTIONS COMMON
   ============================ */
.section {
  padding: 120px 0;
  position: relative;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 1.15rem;
  margin-top: -2.5rem;
  margin-bottom: 3rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  margin: 1rem auto 0;
  border-radius: 2px;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(2, 12, 27, 0.2), rgba(2, 12, 27, 0.85));
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 840px;
  padding: 60px 48px;
  animation: fadeInUp 1s ease-out both;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 24px;
  color: #fff;
  text-shadow: 0 0 50px rgba(0, 240, 255, 0.25);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================
   7. ABOUT SECTION
   ============================ */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.about-card {
  padding: 48px 32px;
  text-align: center;
  transition: var(--transition);
}

.about-card:hover {
  transform: translateY(-10px);
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), inset 0 0 24px rgba(0, 240, 255, 0.04);
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  color: var(--color-primary);
}

.about-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 14px;
  color: #fff;
}

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

/* ============================
   8. PROGRAMS SECTION
   ============================ */
.programs {
  background: linear-gradient(180deg, var(--color-bg) 0%, rgba(0, 119, 182, 0.06) 50%, var(--color-bg) 100%);
}

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

.program-card {
  padding: 42px 32px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

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

.program-card:hover::before {
  left: 100%;
}

.program-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.18);
}

.program-icon {
  color: var(--color-primary);
  margin-bottom: 22px;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

.program-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

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

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.link-arrow:hover {
  gap: 14px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* ============================
   9. WATER LAB GALLERY
   ============================ */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.lab-item {
  padding: 0;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.lab-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.6s ease;
}

.lab-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
}

.lab-item h4 {
  padding: 24px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--color-text);
}

.lab-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 30px rgba(0, 191, 165, 0.2);
}

.lab-item:hover .lab-image {
  transform: scale(1.08);
}

/* ============================
   10. CONTACTS SECTION
   ============================ */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.contact-info {
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  justify-content: center;
  height: 100%;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact-item small {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

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

.contact-item a:hover {
  color: var(--color-primary);
}

.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(0, 240, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  transition: var(--transition);
}

.contact-item:hover .contact-icon {
  background: rgba(0, 240, 255, 0.18);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.2);
}

.contact-form-wrapper {
  padding: 48px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(136, 146, 176, 0.7);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* ============================
   11. FOOTER
   ============================ */
.footer {
  padding: 36px 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  background: rgba(2, 12, 27, 0.6);
}

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

/* ============================
   13. RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 320px;
    height: 100vh;
    background: rgba(2, 12, 27, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 80px 32px;
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
  }

  .nav.open {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }

  .nav-link {
    font-size: 1.2rem;
    color: var(--color-text);
  }

  .menu-toggle {
    display: flex;
  }

  .section {
    padding: 80px 0;
  }

  .hero-content {
    padding: 40px 24px;
  }

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

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

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

  .contact-info,
  .contact-form-wrapper {
    padding: 32px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .btn {
    width: 100%;
  }
}