/* ========== Variables ========== */
:root {
  --deep-navy: #000b1f;
  --ocean-blue: #001f3f;
  --teal-deep: #00334e;
  --neon-cyan: #00e5ff;
  --neon-turquoise: #00f0c8;
  --text-primary: #e0f7fa;
  --text-secondary: #a0c8d8;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(0, 229, 255, 0.12);
  --glass-border-hover: rgba(0, 229, 255, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.15);
  --transition-base: 0.3s ease;
  --container-max: 1200px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(ellipse at 50% 0%, #001d3d 0%, #000b1f 50%, #00050a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* ========== Layout ========== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Header & Navigation ========== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: var(--header-height);
  transition: background var(--transition-base), box-shadow var(--transition-base);
  border-bottom: 1px solid transparent;
}

.main-header.scrolled {
  background: rgba(0, 11, 31, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(0, 229, 255, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-primary);
  position: relative;
  z-index: 1001;
}

.logo span {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.main-nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-list a {
  position: relative;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: color var(--transition-base);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

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

.nav-list a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--neon-cyan);
  transition: width var(--transition-base);
}

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

/* Mobile Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.menu-toggle .bar {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--neon-cyan);
  border-radius: 2px;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px var(--neon-cyan);
}

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

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

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

/* ========== Hero Section ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(var(--header-height) + 40px) 24px 60px;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 11, 31, 0.2) 0%, rgba(0, 11, 31, 0.6) 100%);
  z-index: 1;
}

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

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.15;
  margin-bottom: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 16px 36px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.08);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(0, 229, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:hover {
  background: var(--neon-cyan);
  color: var(--deep-navy);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.4), var(--shadow-glow);
  transform: translateY(-2px);
}

/* ========== Scroll Indicator ========== */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.8;
}

.mouse {
  width: 20px;
  height: 32px;
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

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

@keyframes scrollWheel {
  0% {
    top: 6px;
    opacity: 1;
  }
  100% {
    top: 18px;
    opacity: 0;
  }
}

/* ========== Sections General ========== */
.section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  font-weight: 800;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--neon-cyan);
  border-radius: 3px;
  margin: 16px auto 0;
  box-shadow: 0 0 10px var(--neon-cyan);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-top: -40px;
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* ========== Glassmorphism Utilities ========== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.glass:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px rgba(0, 229, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* ========== About Section ========== */
.about-card {
  padding: 60px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

/* ========== Systems Section ========== */
.systems .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.systems .card {
  padding: 40px 30px;
  text-align: center;
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

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

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

.program-card {
  padding: 40px 30px;
  position: relative;
  overflow: hidden;
}

.program-number {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 3rem;
  font-weight: 900;
  color: rgba(0, 229, 255, 0.08);
  line-height: 1;
  user-select: none;
}

.program-card h3 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  color: var(--neon-cyan);
  position: relative;
  z-index: 1;
}

.program-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

/* ========== Ocean Lab Section ========== */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.lab-item {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lab-visual {
  height: 220px;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s ease;
}

.lab-item:hover .lab-visual {
  transform: scale(1.05);
}

.lab-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 11, 31, 0.8), transparent);
}

.lab-info {
  padding: 30px;
  position: relative;
  z-index: 1;
}

.lab-info h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.lab-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Unique gradients for lab items */
.lab-grad-1 { background: linear-gradient(135deg, #001f3f 0%, #004e92 100%); }
.lab-grad-2 { background: linear-gradient(135deg, #00334e 0%, #00e5ff 100%); }
.lab-grad-3 { background: linear-gradient(135deg, #0a001f 0%, #2a004e 100%); }
.lab-grad-4 { background: linear-gradient(135deg, #002b36 0%, #005f6b 100%); }
.lab-grad-5 { background: linear-gradient(135deg, #1a0033 0%, #00556b 100%); }
.lab-grad-6 { background: linear-gradient(135deg, #000b1f 0%, #003366 100%); }

/* ========== Contacts Section ========== */
.contacts .glass {
  padding: 60px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.contact-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.5));
}

.contact-item a {
  color: var(--text-primary);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition-base), color var(--transition-base);
}

.contact-item a:hover {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

.contact-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ========== Footer ========== */
.main-footer {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid rgba(0, 229, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========== Reveal Animations ========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

/* ========== Neon Text ========== */
.neon-text {
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4), 0 0 30px rgba(0, 229, 255, 0.15);
}

/* ========== Media Queries ========== */
@media (max-width: 1024px) {
  .about-card {
    padding: 40px;
  }
}

@media (max-width: 768px) {
  .nav-list {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    background: rgba(0, 11, 31, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform 0.4s ease;
  }

  .main-nav.open .nav-list {
    transform: translateX(0);
  }

  .menu-toggle {
    display: flex;
  }

  .section {
    padding: 60px 0;
  }

  .about-card,
  .contacts .glass {
    padding: 30px;
  }

  .hero {
    padding-top: calc(var(--header-height) + 20px);
  }

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

@media (max-width: 480px) {
  :root {
    --header-height: 64px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .card,
  .program-card {
    padding: 30px 20px;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}