/* Blue Tang Interactive Website - Palette: #092816, #1E7748, #53BCF2, #2B8EE8, #002E89 */
:root {
  --abyss-green: #092816;
  --kelp-green: #1E7748;
  --reef-cyan: #53BCF2;
  --ocean-blue: #2B8EE8;
  --deep-royal: #002E89;
  --text-light: #e8f7ff;
  --text-muted: #b3ddf5;
  --card-bg: rgba(0, 46, 137, 0.42);
  --card-border: rgba(83, 188, 242, 0.35);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #002E89 0%, #092816 58%, #05180d 100%);
  color: var(--text-light);
  min-height: 100vh;
  line-height: 1.68;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(83, 188, 242, 0.16), transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(43, 142, 232, 0.15), transparent 50%),
    radial-gradient(circle at 50% 88%, rgba(30, 119, 72, 0.22), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(9, 40, 22, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--reef-cyan);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--reef-cyan), var(--ocean-blue));
  box-shadow: 0 0 12px var(--reef-cyan);
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-light);
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

nav a:hover {
  background: rgba(43, 142, 232, 0.25);
  border-color: var(--reef-cyan);
  color: #fff;
}

nav a.active {
  background: linear-gradient(135deg, var(--ocean-blue), var(--deep-royal));
  border-color: var(--reef-cyan);
  box-shadow: 0 4px 16px rgba(83, 188, 242, 0.35);
}

main {
  position: relative;
  z-index: 10;
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 9rem;
}

.hero {
  background: linear-gradient(145deg, rgba(0, 46, 137, 0.72), rgba(9, 40, 22, 0.85));
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 2.3rem;
  margin-bottom: 2.2rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.badge {
  display: inline-block;
  background: rgba(30, 119, 72, 0.55);
  border: 1px solid var(--reef-cyan);
  color: var(--reef-cyan);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.2;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

h1 span {
  color: var(--reef-cyan);
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.3rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.stat-box {
  background: rgba(9, 40, 22, 0.72);
  border: 1px solid rgba(30, 119, 72, 0.8);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.stat-box strong {
  display: block;
  color: var(--reef-cyan);
  font-size: 1.15rem;
}

.stat-box span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

section.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.8rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

h2 {
  color: var(--reef-cyan);
  font-size: 1.55rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h3 {
  color: #ffffff;
  font-size: 1.18rem;
  margin: 1.2rem 0 0.45rem;
}

p + p {
  margin-top: 0.9rem;
}

.closeup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
  margin-top: 1.3rem;
}

.closeup-card {
  background: rgba(9, 40, 22, 0.8);
  border: 1px solid rgba(83, 188, 242, 0.3);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.closeup-visual {
  background: radial-gradient(circle at center, #002E89, #092816);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(83, 188, 242, 0.25);
  min-height: 170px;
}

.closeup-visual svg {
  width: 100%;
  max-width: 210px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.closeup-body {
  padding: 1.1rem;
}

.closeup-body h4 {
  color: var(--reef-cyan);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.closeup-body p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.info-list {
  list-style: none;
  margin-top: 0.8rem;
  display: grid;
  gap: 0.7rem;
}

.info-list li {
  background: rgba(9, 40, 22, 0.65);
  border-left: 4px solid var(--kelp-green);
  padding: 0.8rem 1rem;
  border-radius: 0 12px 12px 0;
}

.info-list li strong {
  color: var(--reef-cyan);
}

.page-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--kelp-green), var(--ocean-blue));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1.4rem;
  border-radius: 12px;
  border: 1px solid var(--reef-cyan);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(83, 188, 242, 0.35);
}

footer {
  position: relative;
  z-index: 15;
  text-align: center;
  padding: 1.5rem 1rem 5.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(83, 188, 242, 0.2);
  background: rgba(9, 40, 22, 0.85);
}

/* Interactive 2D Blue Tang & Coral Shelter */
#blue-tang-companion {
  position: fixed;
  top: 0;
  left: 0;
  width: 118px;
  height: 76px;
  z-index: 25;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: center center;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

#blue-tang-companion svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tang-tail {
  transform-origin: 36px 40px;
  animation: tailSwim 1.1s ease-in-out infinite alternate;
}

.tang-fin {
  transform-origin: 68px 46px;
  animation: finFlutter 0.85s ease-in-out infinite alternate;
}

#blue-tang-companion.fleeing .tang-tail {
  animation-duration: 0.16s;
}

@keyframes tailSwim {
  from { transform: rotate(-10deg) scaleX(0.95); }
  to { transform: rotate(10deg) scaleX(1.03); }
}

@keyframes finFlutter {
  from { transform: rotate(-8deg); }
  to { transform: rotate(14deg); }
}

/* Foreground Coral Reef Layer (hides the fish when z-index drops below 30) */
.coral-foreground {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 125px;
  pointer-events: none;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 1.2rem;
}

.coral-cluster {
  width: 240px;
  max-width: 34vw;
  height: 125px;
}

.coral-cluster svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 -4px 14px rgba(0, 0, 0, 0.5));
}

@media (max-width: 980px) {
  #blue-tang-companion {
    width: 92px;
    height: 60px;
  }
}
