/* ============================================================
   BluePlanet — Life Below Water | SDG 14
   style.css — Ocean-inspired design system
   ============================================================ */

/* ===== CSS VARIABLES & RESET ===== */
:root {
  /* Colors — Dark Theme (default) */
  --bg-primary: #020d1a;
  --bg-secondary: #041525;
  --bg-tertiary: #071f35;
  --surface: rgba(4, 30, 58, 0.7);
  --surface-solid: #04182e;
  --border: rgba(0, 180, 216, 0.18);
  --border-glow: rgba(0, 180, 216, 0.4);

  /* Ocean Palette */
  --ocean-deep: #0d1b2a;
  --ocean-mid: #0c3d6b;
  --ocean-light: #1565C0;
  --teal: #00b4d8;
  --teal-glow: rgba(0, 180, 216, 0.25);
  --cyan: #00d4ff;
  --aqua: #48cae4;
  --seafoam: #90e0ef;
  --coral-accent: #ff6b6b;
  --gold: #ffd166;
  --lime: #06d6a0;

  /* Text */
  --text-primary: #e8f4fd;
  --text-secondary: #90c4d8;
  --text-muted: #5a8fa8;

  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Spacing */
  --section-pad: 100px;
  --container-max: 1280px;

  /* Effects */
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 180, 216, 0.1);
  --shadow-glow: 0 0 30px rgba(0, 180, 216, 0.2);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #e8f4fd;
  --bg-secondary: #d0ecf9;
  --bg-tertiary: #b8e2f4;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --border: rgba(21, 101, 192, 0.2);
  --border-glow: rgba(21, 101, 192, 0.5);
  --ocean-deep: #0d47a1;
  --teal: #0077b6;
  --cyan: #023e8a;
  --seafoam: #0096c7;
  --text-primary: #0a1628;
  --text-secondary: #1a4a6b;
  --text-muted: #2d7ab5;
  --shadow-card: 0 8px 40px rgba(0, 50, 120, 0.15), 0 0 0 1px rgba(21, 101, 192, 0.1);
  --shadow-glow: 0 0 30px rgba(21, 101, 192, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ===== LOADER ===== */
#loader {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { text-align: center; }

.wave-loader {
  width: 200px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 12px var(--teal));
}

.wave-path {
  fill: var(--teal);
  animation: waveFloat 1.8s ease-in-out infinite;
}

@keyframes waveFloat {
  0%, 100% { d: path("M0,30 C50,10 100,50 150,30 C175,20 190,35 200,30 L200,60 L0,60 Z"); }
  50% { d: path("M0,30 C50,50 100,10 150,30 C175,40 190,25 200,30 L200,60 L0,60 Z"); }
}

.loader-text {
  font-family: var(--font-mono);
  color: var(--teal);
  letter-spacing: 4px;
  font-size: 14px;
  animation: pulse 1.2s ease infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

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

/* ===== NAVIGATION ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, padding 0.3s ease;
}

#navbar.scrolled {
  background: rgba(2, 13, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] #navbar.scrolled {
  background: rgba(232, 244, 253, 0.92);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 20px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}

.logo-icon { font-size: 24px; animation: logoFloat 3s ease-in-out infinite; }
@keyframes logoFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-link {
  padding: 8px 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--teal);
  background: var(--teal-glow);
}

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--teal); transform: rotate(20deg); }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  padding: 8px; margin-left: auto;
}

.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--teal);
  transition: all var(--transition);
  border-radius: 2px;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== HERO ===== */
.hero {
  position: relative; height: 100vh; min-height: 700px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.hero-ocean {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(160deg, #020d1a 0%, #041f3d 35%, #063459 55%, #0a4a7d 75%, #0d6399 100%);
}

.hero-layer {
  position: absolute; bottom: 0; left: -10%; right: -10%;
  border-radius: 50% 50% 0 0 / 20px;
}

.layer1 {
  height: 35%;
  background: linear-gradient(transparent, rgba(0, 50, 100, 0.4));
  animation: waveSway 6s ease-in-out infinite;
}

.layer2 {
  height: 25%;
  background: linear-gradient(transparent, rgba(0, 100, 160, 0.3));
  animation: waveSway 8s ease-in-out infinite reverse;
}

.layer3 {
  height: 15%;
  background: linear-gradient(transparent, rgba(0, 150, 200, 0.2));
  animation: waveSway 4s ease-in-out infinite;
}

@keyframes waveSway {
  0%, 100% { transform: translateX(0) scaleX(1); }
  50% { transform: translateX(3%) scaleX(0.97); }
}

/* Bubbles */
.bubbles { position: absolute; inset: 0; pointer-events: none; }

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 180, 216, 0.4);
  background: rgba(0, 180, 216, 0.08);
  animation: bubbleRise calc(8s + var(--i) * 2s) ease-in infinite;
  bottom: -100px;
  left: calc(var(--i) * 12%);
  width: calc(15px + var(--i) * 8px);
  height: calc(15px + var(--i) * 8px);
  animation-delay: calc(var(--i) * 1.2s);
}

@keyframes bubbleRise {
  0% { transform: translateY(0) scale(1); opacity: 0.7; }
  50% { opacity: 0.5; }
  100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}

.fish-school { position: absolute; inset: 0; pointer-events: none; }

.fish {
  position: absolute;
  font-size: calc(20px + var(--i) * 5px);
  animation: fishSwim calc(12s + var(--i) * 3s) linear infinite;
  top: calc(20% + var(--i) * 10%);
  animation-delay: calc(var(--i) * 2s);
  filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.5));
}

@keyframes fishSwim {
  0% { transform: translateX(-150px) scaleX(-1); }
  49% { transform: translateX(calc(100vw + 150px)) scaleX(-1); }
  50% { transform: translateX(calc(100vw + 150px)) scaleX(1); }
  100% { transform: translateX(-150px) scaleX(1); }
}

/* Hero Content */
.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 0 24px;
  max-width: 900px;
}

.fade-in-hero > * {
  opacity: 0; transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-hero > *:nth-child(1) { animation-delay: 0.3s; }
.fade-in-hero > *:nth-child(2) { animation-delay: 0.5s; }
.fade-in-hero > *:nth-child(3) { animation-delay: 0.7s; }
.fade-in-hero > *:nth-child(4) { animation-delay: 0.9s; }
.fade-in-hero > *:nth-child(5) { animation-delay: 1.1s; }

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.sdg-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(0, 180, 216, 0.15);
  border: 1px solid var(--teal);
  border-radius: 50px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 100px);
  font-weight: 900;
  line-height: 1.0;
  margin-bottom: 20px;
}

.title-line { display: block; }
.title-line.accent {
  color: transparent;
  -webkit-text-stroke: 2px var(--teal);
  text-shadow: 0 0 40px rgba(0, 180, 216, 0.4);
}

.hero-tagline {
  font-size: clamp(15px, 2.5vw, 19px);
  color: var(--text-secondary);
  max-width: 600px; margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex; gap: 16px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 60px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600; font-size: 15px;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--ocean-mid));
  color: white;
  box-shadow: 0 4px 24px rgba(0, 180, 216, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 180, 216, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}

.btn-outline:hover {
  background: var(--teal-glow);
  transform: translateY(-3px);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 20px; font-size: 13px; }

/* Hero Stats */
.hero-stats {
  display: flex; gap: 40px; justify-content: center;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  padding: 16px 24px;
  background: rgba(0, 180, 216, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 32px; font-weight: 700;
  color: var(--teal);
}

.hero-stat span:not(.stat-num):not(.stat-label) {
  font-size: 20px; color: var(--teal);
}

.stat-label {
  display: block;
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; letter-spacing: 1px;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute; bottom: 30px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-dot {
  width: 24px; height: 40px;
  border: 2px solid rgba(0, 180, 216, 0.5);
  border-radius: 12px;
  position: relative;
}

.scroll-dot::after {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px;
  background: var(--teal);
  border-radius: 2px;
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { top: 6px; opacity: 1; }
  50% { top: 18px; opacity: 0.3; }
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-header { text-align: center; margin-bottom: 64px; }

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
  padding: 4px 14px;
  background: rgba(0, 180, 216, 0.1);
  border-radius: 50px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
}

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

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px;
  transition: all var(--transition);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow), var(--shadow-card);
  transform: translateY(-4px);
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== ABOUT SECTION ===== */
.about-section { background: var(--bg-secondary); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px; align-items: center;
}

.about-text { display: flex; flex-direction: column; gap: 20px; }

.about-card {
  padding: 24px; border-radius: var(--radius);
}

.about-icon {
  font-size: 32px; margin-bottom: 12px;
  display: block;
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 20px; margin-bottom: 10px;
  color: var(--text-primary);
}

.about-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.about-card strong { color: var(--teal); }

/* Importance Wheel */
.importance-wheel {
  position: relative; width: 380px; height: 380px;
  margin: 0 auto;
}

.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: var(--surface);
  border: 2px solid var(--teal);
  border-radius: 50%;
  width: 110px; height: 110px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 30px rgba(0, 180, 216, 0.3);
}

.wheel-center p { font-size: 10px; color: var(--teal); letter-spacing: 1px; }

.wheel-item {
  position: absolute;
  text-align: center;
  width: 80px;
  transform: translate(-50%, -50%);
}

.wi1 { top: 10%; left: 50%; }
.wi2 { top: 30%; left: 88%; }
.wi3 { top: 75%; left: 80%; }
.wi4 { top: 75%; left: 20%; }
.wi5 { top: 30%; left: 12%; }

.wi-icon {
  width: 52px; height: 52px;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 6px;
  transition: all var(--transition);
  box-shadow: 0 0 16px rgba(0, 180, 216, 0.15);
}

.wheel-item:hover .wi-icon {
  transform: scale(1.15);
  border-color: var(--teal);
  box-shadow: 0 0 24px rgba(0, 180, 216, 0.35);
}

.wheel-item p { font-size: 11px; color: var(--text-muted); line-height: 1.3; }

/* Connecting lines via pseudo-element on container */
.importance-wheel::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 260px; height: 260px;
  border: 1px dashed rgba(0, 180, 216, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* ===== ECOSYSTEMS ===== */
.ecosystems-section { background: var(--bg-primary); }

.ecosystem-tabs { position: relative; }

.tab-nav {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 22px;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: rgba(0, 180, 216, 0.08);
}

.tab-content.hidden { display: none; }

.eco-card {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: start;
}

.eco-visual {
  border-radius: var(--radius);
  height: 320px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.coral-bg { background: linear-gradient(135deg, #1a0533, #3d0d6e, #0a3d6b, #006994); }
.deep-bg { background: linear-gradient(180deg, #020810 0%, #040c1a 30%, #020508 100%); }
.coastal-bg { background: linear-gradient(135deg, #0a3d0f, #155a3a, #0a4a6b, #006994); }
.fresh-bg { background: linear-gradient(135deg, #0a2e3d, #1a5c6e, #1a8c6e, #1aad7e); }

.eco-emoji-scene {
  font-size: 40px; letter-spacing: 4px;
  filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
  animation: sceneFloat 4s ease-in-out infinite;
  text-align: center; padding: 20px;
}

@keyframes sceneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.eco-info { padding: 20px 0; }

.eco-info h3 {
  font-family: var(--font-display);
  font-size: 28px; margin-bottom: 16px;
  color: var(--text-primary);
}

.eco-info p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 30px; }
.eco-info strong { color: var(--teal); }

.eco-facts { display: flex; gap: 20px; flex-wrap: wrap; }

.eco-fact {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  flex: 1; min-width: 100px;
}

.fact-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px; color: var(--teal);
  font-weight: 700;
}

.fact-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

/* ===== BIODIVERSITY ===== */
.biodiversity-section { background: var(--bg-secondary); }

.bio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.bio-card {
  height: 300px;
  position: relative;
  border-radius: var(--radius);
  cursor: pointer;
  perspective: 1000px;
}

.bio-card-front, .bio-card-back {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  padding: 30px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  backface-visibility: hidden;
  transition: transform 0.6s ease;
  border: 1px solid var(--border);
  overflow: hidden;
}

.bio-card-front {
  background: linear-gradient(160deg, var(--surface-solid), var(--bg-tertiary));
}

.bio-card-back {
  background: linear-gradient(160deg, var(--ocean-mid), var(--bg-tertiary));
  transform: rotateY(180deg);
  border-color: var(--teal);
}

.bio-card:hover .bio-card-front { transform: rotateY(-180deg); }
.bio-card:hover .bio-card-back { transform: rotateY(0deg); }
.bio-card:focus .bio-card-front { transform: rotateY(-180deg); }
.bio-card:focus .bio-card-back { transform: rotateY(0deg); }

.bio-emoji { font-size: 56px; margin-bottom: 14px; }

.bio-card-front h3 {
  font-family: var(--font-display);
  font-size: 20px; margin-bottom: 8px;
}

.bio-count { font-size: 13px; color: var(--teal); font-family: var(--font-mono); }

.bio-wave {
  position: absolute; bottom: 0; left: -10%; right: -10%;
  height: 50px;
  background: linear-gradient(transparent, rgba(0,180,216,0.12));
  border-radius: 50%;
  animation: waveSway 4s ease-in-out infinite;
}

.bio-card-back h3 {
  font-family: var(--font-display);
  font-size: 18px; margin-bottom: 12px; color: var(--teal);
}

.bio-card-back p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }

.bio-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tag {
  padding: 3px 10px;
  background: rgba(0, 180, 216, 0.15);
  border: 1px solid rgba(0, 180, 216, 0.3);
  border-radius: 50px;
  font-size: 11px; color: var(--teal);
}

/* ===== THREATS ===== */
.threats-section {
  background: var(--bg-primary);
  position: relative;
}

.threats-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255, 50, 50, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

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

.threat-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.threat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--coral-accent), transparent);
  opacity: 0; transition: opacity var(--transition);
}

.threat-card:hover::before { opacity: 1; }
.threat-card:hover { transform: translateY(-6px); border-color: rgba(255,107,107,0.3); }

.threat-icon-wrap {
  position: relative; display: inline-block;
  margin-bottom: 16px;
}

.threat-icon { font-size: 40px; display: block; }

.threat-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 107, 0.3);
  animation: threatPulse 2s ease-in-out infinite;
}

@keyframes threatPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0; }
}

.threat-card h3 {
  font-family: var(--font-display);
  font-size: 20px; margin-bottom: 12px;
}

.threat-card p {
  color: var(--text-secondary); font-size: 14px;
  line-height: 1.7; margin-bottom: 20px;
}

.threat-stat-bar { position: relative; }

.bar-fill {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--coral-accent), var(--gold));
  width: 0; transition: width 1.2s ease;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.4);
}

.threat-card.visible .bar-fill { width: var(--pct); }

.bar-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; display: block; }

/* ===== CONSERVATION ===== */
.conservation-section { background: var(--bg-secondary); }

.conservation-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px; margin-bottom: 60px;
}

.cons-card-large .cons-icon {
  font-size: 36px; margin-bottom: 14px; display: block;
}

.cons-card-large h3 {
  font-family: var(--font-display);
  font-size: 22px; margin-bottom: 12px;
}

.cons-card-large p {
  color: var(--text-secondary); font-size: 14px;
  line-height: 1.8; margin-bottom: 16px;
}

.cons-card-large strong { color: var(--lime); }

.cons-progress { margin-top: 12px; }

.cp-bar {
  height: 8px; background: rgba(255,255,255,0.1);
  border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}

.cp-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  border-radius: 4px;
  transition: width 1.5s ease;
  box-shadow: 0 0 10px rgba(6, 214, 160, 0.4);
}

.cons-card-large.visible .cp-fill { width: var(--w); }
.cons-progress span { font-size: 12px; color: var(--text-muted); }

.cons-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.ctag {
  padding: 5px 12px;
  background: rgba(6, 214, 160, 0.1);
  border: 1px solid rgba(6, 214, 160, 0.3);
  border-radius: 50px; font-size: 12px; color: var(--lime);
}

/* Action Tips */
.action-tips {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  border-left: 4px solid var(--teal);
}

.tips-heading {
  font-family: var(--font-display);
  font-size: 24px; margin-bottom: 28px; color: var(--text-primary);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tip-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px;
  background: rgba(0, 180, 216, 0.05);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.tip-item:hover { background: rgba(0, 180, 216, 0.12); }

.tip-num {
  font-family: var(--font-mono);
  font-size: 22px; color: var(--teal);
  flex-shrink: 0; line-height: 1;
}

.tip-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ===== DATA SECTION ===== */
.data-section { background: var(--bg-primary); }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.chart-card h3 {
  font-family: var(--font-display);
  font-size: 17px; margin-bottom: 20px;
  color: var(--text-primary);
}

.chart-card canvas { max-height: 260px; }

/* ===== QUIZ ===== */
.quiz-section {
  background: var(--bg-secondary);
  position: relative; overflow: hidden;
}

.quiz-section::before {
  content: '';
  position: absolute; top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,180,216,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.quiz-container {
  max-width: 680px; margin: 0 auto 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 36px;
}

.quiz-progress-bar {
  height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden; margin-bottom: 20px;
}

.qpb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  width: 0; border-radius: 2px;
  transition: width 0.5s ease;
}

.quiz-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-muted); margin-bottom: 24px;
}

.quiz-question {
  font-family: var(--font-display);
  font-size: 22px; line-height: 1.4;
  color: var(--text-primary); margin-bottom: 24px;
}

.quiz-options {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 20px;
}

.quiz-option {
  width: 100%; text-align: left; padding: 14px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 15px;
  transition: all var(--transition); cursor: pointer;
  font-family: var(--font-body);
}

.quiz-option:hover:not(:disabled) {
  background: var(--teal-glow); border-color: var(--teal);
  color: var(--text-primary);
}

.quiz-option.correct {
  background: rgba(6, 214, 160, 0.15);
  border-color: var(--lime); color: var(--lime);
}

.quiz-option.wrong {
  background: rgba(255, 107, 107, 0.15);
  border-color: var(--coral-accent); color: var(--coral-accent);
}

.quiz-option:disabled { cursor: not-allowed; }

.quiz-feedback {
  font-size: 14px; min-height: 24px;
  color: var(--text-muted); margin-bottom: 12px;
  font-style: italic;
}

.quiz-result {
  text-align: center; padding: 20px;
}

.quiz-result.hidden { display: none; }
.quiz-screen.hidden { display: none; }

.result-icon { font-size: 64px; margin-bottom: 16px; }
.result-title { font-family: var(--font-display); font-size: 28px; margin-bottom: 8px; }
.result-score { font-family: var(--font-mono); font-size: 40px; color: var(--teal); margin-bottom: 12px; }
#result-message { color: var(--text-secondary); font-size: 16px; margin-bottom: 24px; }

/* Fun Facts */
.fun-facts {
  max-width: 680px; margin: 0 auto; text-align: center;
}

.fun-facts h3 {
  font-family: var(--font-display);
  font-size: 24px; margin-bottom: 24px;
}

.fact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px; margin-bottom: 20px;
  min-height: 80px; display: flex;
  align-items: center; justify-content: center;
  border-left: 4px solid var(--teal);
  transition: all var(--transition);
}

.fact-box p {
  font-size: 17px; color: var(--text-secondary);
  line-height: 1.7; font-style: italic;
}

/* ===== COUNTERS ===== */
.counter-section {
  background: linear-gradient(135deg, var(--ocean-deep), var(--ocean-mid));
  padding: 80px 0; position: relative; overflow: hidden;
}

.counter-ocean {
  position: absolute; inset: 0; pointer-events: none;
}

.co-wave {
  position: absolute; left: -10%; right: -10%; bottom: 0;
  border-radius: 50% 50% 0 0;
  opacity: 0.15;
}

.co-wave.w1 { height: 60%; background: rgba(0,180,216,0.4); animation: waveSway 7s ease-in-out infinite; }
.co-wave.w2 { height: 40%; background: rgba(0,180,216,0.2); animation: waveSway 5s ease-in-out infinite reverse; }

.counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px; position: relative; z-index: 1;
}

.counter-item {
  text-align: center; padding: 30px 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: transform var(--transition);
}

.counter-item:hover { transform: translateY(-6px); }

.counter-emoji { font-size: 36px; margin-bottom: 14px; }

.counter-num {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 700;
  color: var(--teal); margin-bottom: 8px;
}

.counter-label { font-size: 13px; color: rgba(255,255,255,0.7); }

/* ===== GALLERY ===== */
.gallery-section { background: var(--bg-primary); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 16px;
}

.gi-large { grid-column: span 2; }

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden; position: relative;
  cursor: pointer;
  transition: transform var(--transition);
}

.gallery-item:hover { transform: scale(1.02); z-index: 1; }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-item:focus { outline: 2px solid var(--teal); outline-offset: 4px; }

.gallery-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img { transform: scale(1.08); }

.gi-coral { background: linear-gradient(135deg, #1a0533, #2d085e, #0a3d6b); }
.gi-whale { background: linear-gradient(160deg, #020a1a, #042050, #0a3d8a); }
.gi-turtle { background: linear-gradient(135deg, #0a2a0a, #145214, #0a4d3a); }
.gi-deep { background: linear-gradient(180deg, #02020a 0%, #060520 50%, #0a0520 100%); }
.gi-dolphin { background: linear-gradient(135deg, #ff6b3520, #1a4a7a, #0a6d96); }
.gi-mangrove { background: linear-gradient(160deg, #061a06, #0f3520, #0a3d3a); }
.gi-shark { background: linear-gradient(160deg, #040a1a, #0a1f50, #0a0a30); }
.gi-arctic { background: linear-gradient(160deg, #0a1a3a, #1a3a6a, #2a5a8a); }

.gallery-scene {
  font-size: 32px; letter-spacing: 6px;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.7));
  display: flex; align-items: flex-end;
  padding: 16px;
  opacity: 0; transition: opacity var(--transition);
}

.gallery-overlay span {
  color: white; font-weight: 600;
  font-size: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.lightbox.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.lb-close {
  position: absolute; top: 20px; right: 28px;
  font-size: 36px; color: white; cursor: pointer;
  background: rgba(255,255,255,0.1);
  border-radius: 50%; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}

.lb-close:hover { background: rgba(255,255,255,0.2); }

.lb-content { text-align: center; }

.lb-image {
  width: 500px; height: 360px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; letter-spacing: 8px;
  margin: 0 auto 20px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}

.lb-caption { color: rgba(255,255,255,0.8); font-size: 16px; }

/* ===== BLOG ===== */
.blog-section { background: var(--bg-secondary); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card { position: relative; }

.blog-badge {
  display: inline-block;
  padding: 3px 12px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  background: rgba(0, 180, 216, 0.15);
  color: var(--teal);
  border-radius: 50px; margin-bottom: 12px;
}

.blog-icon { font-size: 36px; margin-bottom: 12px; }

.blog-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }

.blog-card h3 {
  font-family: var(--font-display);
  font-size: 20px; margin-bottom: 12px;
  line-height: 1.3;
}

.blog-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }

.blog-link {
  font-size: 13px; font-weight: 600; color: var(--teal);
  transition: letter-spacing var(--transition);
}

.blog-link:hover { letter-spacing: 1px; }

/* ===== CONTACT ===== */
.contact-section { background: var(--bg-primary); }

.contact-layout {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 50px;
  align-items: start;
}

.ci-item {
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 28px;
}

.ci-icon { font-size: 28px; flex-shrink: 0; margin-top: 4px; }

.ci-item h4 {
  font-family: var(--font-display);
  font-size: 16px; margin-bottom: 6px;
}

.ci-item p { font-size: 14px; color: var(--text-secondary); }

.social-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.social-btn {
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary);
  transition: all var(--transition);
}

.social-btn:hover {
  background: var(--teal-glow);
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-3px);
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(0, 180, 216, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-group input.error,
.form-group textarea.error { border-color: var(--coral-accent); }

.form-error { display: block; font-size: 12px; color: var(--coral-accent); margin-top: 6px; }

.form-group select option { background: var(--surface-solid); }

.form-success {
  margin-top: 16px; padding: 14px;
  background: rgba(6, 214, 160, 0.12);
  border: 1px solid rgba(6, 214, 160, 0.3);
  border-radius: var(--radius-sm);
  color: var(--lime); font-size: 14px;
  text-align: center;
}

.form-success.hidden { display: none; }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  padding: 80px 0 30px;
  position: relative; overflow: hidden;
}

.footer-ocean {
  position: absolute; top: 0; left: 0; right: 0;
  pointer-events: none;
}

.fo-wave {
  position: absolute; top: 0; left: -10%; right: -10%;
  height: 40px; border-radius: 0 0 50% 50%;
}

.fo-wave.w1 { background: var(--bg-primary); }
.fo-wave.w2 { background: var(--bg-primary); opacity: 0.5; transform: scaleX(0.95) translateY(10px); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px; margin-bottom: 48px;
  margin-top: 20px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--teal); margin-bottom: 14px;
}

.footer-brand p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; }

.footer-social { display: flex; gap: 10px; }

.footer-nav h4 {
  font-family: var(--font-display);
  font-size: 16px; margin-bottom: 16px; color: var(--text-primary);
}

.footer-nav nav {
  display: flex; flex-direction: column; gap: 10px;
}

.footer-nav a {
  font-size: 14px; color: var(--text-muted);
  transition: color var(--transition);
}

.footer-nav a:hover { color: var(--teal); }

.footer-pledge h4 {
  font-family: var(--font-display);
  font-size: 16px; margin-bottom: 10px;
}

.footer-pledge p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

.pledge-count {
  margin-top: 14px; font-size: 13px;
  color: var(--text-muted);
}

#pledge-num { font-family: var(--font-mono); color: var(--teal); font-weight: 700; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px; text-align: center;
}

.footer-bottom p {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 6px;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  background: var(--teal);
  color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; z-index: 99;
  box-shadow: 0 4px 20px rgba(0, 180, 216, 0.5);
  transition: all var(--transition);
}

.back-to-top:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,180,216,0.6); }
.back-to-top.hidden { opacity: 0; visibility: hidden; transform: translateY(20px); }

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] .hero-ocean {
  background: linear-gradient(160deg, #0d3d6b 0%, #155a8a 35%, #1a7ab5 55%, #2294cc 75%, #3aa8d8 100%);
}

[data-theme="light"] .counter-section {
  background: linear-gradient(135deg, #0d3d6b, #1565C0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --section-pad: 70px; }
  .nav-links { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-primary); flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-link { font-size: 18px; }
  .hamburger { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .importance-wheel { width: 300px; height: 300px; }
  .eco-card { grid-template-columns: 1fr; }
  .conservation-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hero-stats { flex-direction: column; align-items: center; gap: 12px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gi-large { grid-column: span 2; }
  .threats-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-grid { grid-template-columns: 1fr; }
  .lb-image { width: 300px; height: 220px; }
  .hero-cta-group { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gi-large { grid-column: span 1; }
  .nav-container { padding: 0 16px; }
  .container { padding: 0 16px; }
}

/* ===== PRINT ===== */
@media print {
  #navbar, .back-to-top, #loader { display: none; }
  .hero { height: auto; padding: 40px 0; }
  .section { break-inside: avoid; }
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(0, 180, 216, 0.3);
  color: var(--text-primary);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }