:root {
  --deep-blue: #0b1426;
  --ocean-blue: #1e3a5f;
  --sea-foam: #88ccca;
  --sand: #c2b280;
  --graphite: #1f2937;
  --light-foam: #e0f2f1;
  --glass: rgba(30, 58, 95, 0.55);
  --glass-border: rgba(136, 204, 202, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--deep-blue);
  color: var(--light-foam);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: 300;
  letter-spacing: 0.05em;
}

a {
  color: inherit;
}

.section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}

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

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--sea-foam);
}

.section-header p {
  color: rgba(224, 242, 241, 0.7);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.main-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(11, 20, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo {
  font-size: 1.25rem;
  color: var(--sea-foam);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.main-nav a {
  color: var(--light-foam);
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--sea-foam);
  transition: width 0.3s;
}

.main-nav a:hover {
  color: var(--sea-foam);
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--sea-foam);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: url('https://images.unsplash.com/photo-1468581264429-2548ef9eb732?auto=format&fit=crop&w=1920&q=80') center / cover no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 20, 38, 0.5), rgba(11, 20, 38, 0.92));
  z-index: 1;
}

.underwater-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

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

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: var(--light-foam);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  color: var(--sea-foam);
  opacity: 0.95;
}

.cta-btn {
  display: inline-block;
  padding: 1rem 2.75rem;
  background: transparent;
  color: var(--sea-foam);
  border: 1px solid var(--sea-foam);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.06em;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
  border-radius: 2px;
}

.cta-btn:hover {
  background: var(--sea-foam);
  color: var(--deep-blue);
}

.bubble {
  position: absolute;
  bottom: -30px;
  background: rgba(136, 204, 202, 0.1);
  border-radius: 50%;
  animation: rise 14s infinite ease-in;
  pointer-events: none;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-110vh) scale(1.4);
    opacity: 0;
  }
}

/* Research */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.research-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

.research-text p {
  margin-bottom: 1.25rem;
  color: rgba(224, 242, 241, 0.9);
  font-size: 1.05rem;
}

/* Programs */
.programs {
  background: linear-gradient(to bottom, var(--deep-blue), var(--ocean-blue));
}

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

.program-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 2.5rem 2rem;
  border-radius: 4px;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  backdrop-filter: blur(10px);
}

.program-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  border-color: rgba(136, 204, 202, 0.45);
}

.program-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.5rem;
  color: var(--sea-foam);
}

.program-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
}

.program-card h3 {
  color: var(--sea-foam);
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.program-card p {
  font-size: 0.95rem;
  color: rgba(224, 242, 241, 0.8);
  line-height: 1.6;
}

/* Station */
.station {
  background: var(--graphite);
}

.visualization-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
}

.map-container,
.current-container {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.map-container h3,
.current-container h3 {
  color: var(--sea-foam);
  margin-bottom: 0.75rem;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.map-canvas,
.current-canvas {
  display: block;
  width: 100%;
  height: 300px;
  background: rgba(11, 20, 38, 0.5);
  border-radius: 2px;
}

.map-canvas {
  cursor: crosshair;
}

.depth-readout {
  font-family: 'Courier New', Courier, monospace;
  color: var(--sand);
  font-size: 0.9rem;
}

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

.project-card {
  background: rgba(11, 20, 38, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.project-card:hover {
  border-color: rgba(136, 204, 202, 0.4);
}

.project-header {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.project-header h4 {
  color: var(--sea-foam);
  font-size: 1.1rem;
  font-weight: 400;
}

.toggle-icon {
  color: var(--sand);
  font-size: 1.25rem;
  transition: transform 0.3s;
  font-weight: 300;
}

.project-card.expanded .toggle-icon {
  transform: rotate(45deg);
}

.project-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
  padding: 0 1.5rem;
}

.project-card.expanded .project-body {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem;
}

.project-body p {
  color: rgba(224, 242, 241, 0.85);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.project-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--sand);
  font-family: 'Courier New', Courier, monospace;
}

.station-subheader {
  margin-top: 4rem;
}

/* Species */
.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.species-card-wrapper {
  perspective: 1000px;
  height: 280px;
}

.species-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
  border-radius: 4px;
}

.species-card.flipped {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
}

.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 20, 38, 0.95), transparent 60%);
}

.card-title {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: var(--sea-foam);
  font-size: 1.1rem;
  z-index: 2;
  font-weight: 400;
}

.card-back {
  background: var(--ocean-blue);
  transform: rotateY(180deg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--glass-border);
}

.card-back h4 {
  color: var(--sea-foam);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.card-back p {
  font-size: 0.9rem;
  color: rgba(224, 242, 241, 0.9);
  line-height: 1.5;
}

/* Contact */
.contact {
  background: linear-gradient(to top, var(--deep-blue), var(--ocean-blue));
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.contact-item {
  padding: 2.5rem 2rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s, border-color 0.3s;
}

.contact-item:hover {
  transform: translateY(-4px);
  border-color: rgba(136, 204, 202, 0.4);
}

.contact-item h3 {
  color: var(--sea-foam);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 400;
}

.contact-item p,
.contact-item a {
  color: rgba(224, 242, 241, 0.9);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s;
}

.contact-item a:hover {
  color: var(--sea-foam);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer */
footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--glass-border);
  color: rgba(224, 242, 241, 0.45);
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.75rem 1.25rem;
  }

  .main-nav ul {
    position: fixed;
    top: 56px;
    right: -100%;
    flex-direction: column;
    background: rgba(11, 20, 38, 0.98);
    width: 100%;
    padding: 2rem;
    transition: right 0.3s;
    gap: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
  }

  .main-nav ul.active {
    right: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .research-grid,
  .visualization-container {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .section {
    padding: 4rem 1.25rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}