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

:root {
  --surface-blue: #64d2ff;
  --sun-blue: #1089d4;
  --twilight-blue: #064d78;
  --midnight-blue: #05243d;
  --abyss-blue: #031222;
  --trench: #020711;
  --ink: #e8f7ff;
  --muted: #a8c7d9;
  --line: rgba(210, 242, 255, 0.28);
  --panel: rgba(3, 14, 27, 0.72);
  --accent: #f8d36b;
  --coral: #ff7a6b;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--trench);
}

.back-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 0.7rem 1.5rem;
  background: rgba(2, 7, 17, 0.48);
  border-bottom: 1px solid rgba(210, 242, 255, 0.16);
  backdrop-filter: blur(10px);
}

.back-link,
.restart-link {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover,
.restart-link:hover {
  color: var(--ink);
}

.depth-panel {
  position: fixed;
  right: 1.25rem;
  top: 4.2rem;
  z-index: 20;
  width: min(13rem, calc(100vw - 2rem));
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid rgba(210, 242, 255, 0.16);
  border-radius: 0.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.depth-panel__label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.depth-panel__value {
  margin-top: 0.2rem;
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.depth-panel__zone {
  margin-top: 0.35rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
}

.depth-meter {
  height: 6px;
  margin-top: 0.8rem;
  overflow: hidden;
  background: rgba(232, 247, 255, 0.12);
  border-radius: 999px;
}

.depth-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--surface-blue), var(--accent), var(--coral));
  border-radius: inherit;
}

.sea-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 7rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(100, 210, 255, 0.86) 8%, rgba(16, 137, 212, 0.95) 48%, rgba(6, 77, 120, 0.98) 100%);
}

.sea-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.36), transparent 16rem),
    radial-gradient(circle at 78% 26%, rgba(248, 211, 107, 0.24), transparent 13rem);
  pointer-events: none;
}

.wave-line {
  position: absolute;
  top: 5rem;
  left: 0;
  right: 0;
  height: 36px;
  opacity: 0.42;
  background:
    radial-gradient(80px 28px at 40px 34px, transparent 36px, rgba(255, 255, 255, 0.9) 37px, transparent 39px) repeat-x;
  background-size: 80px 36px;
}

.eyebrow {
  position: relative;
  color: #06334d;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sea-hero h1 {
  position: relative;
  color: #021827;
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
}

.sea-hero p {
  position: relative;
  max-width: 620px;
  color: #08314a;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 650;
  line-height: 1.55;
}

.scroll-cue {
  position: relative;
  margin-top: 1rem;
  color: #08314a;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ocean {
  position: relative;
  min-height: 10200px;
  padding: 4rem 1rem 7rem;
  background:
    linear-gradient(180deg,
      var(--sun-blue) 0%,
      var(--twilight-blue) 10%,
      var(--midnight-blue) 28%,
      var(--abyss-blue) 58%,
      var(--trench) 100%);
}

.ocean::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 8%, rgba(255, 255, 255, 0.08), transparent 22rem),
    radial-gradient(circle at 70% 34%, rgba(100, 210, 255, 0.07), transparent 28rem),
    radial-gradient(circle at 38% 70%, rgba(248, 211, 107, 0.04), transparent 22rem);
  pointer-events: none;
}

.depth-line {
  position: sticky;
  top: 0;
  width: 2px;
  height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  pointer-events: none;
}

.creature-list {
  position: absolute;
  inset: 0;
  max-width: 1080px;
  margin: 0 auto;
  left: 50%;
  width: min(100%, 1080px);
  transform: translateX(-50%);
}

.zone-marker,
.creature {
  position: absolute;
  left: 1rem;
  right: 1rem;
}

.zone-marker {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(232, 247, 255, 0.76);
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zone-marker::before,
.zone-marker::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(232, 247, 255, 0.18);
}

.creature {
  display: grid;
  grid-template-columns: 11rem minmax(0, 22rem);
  gap: 1rem;
  width: min(100% - 2rem, 36rem);
  align-items: center;
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.creature.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.creature:nth-of-type(even) {
  margin-left: auto;
  grid-template-columns: minmax(0, 22rem) 11rem;
}

.creature:nth-of-type(even) .creature-art {
  order: 2;
}

.creature-card {
  padding: 0.9rem 1rem;
  background: rgba(2, 12, 24, 0.58);
  border: 1px solid rgba(210, 242, 255, 0.14);
  border-radius: 0.5rem;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.creature-depth {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.creature-card h2 {
  margin-top: 0.2rem;
  font-size: clamp(1.15rem, 4vw, 1.65rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.creature-card p {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.creature-art {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.28));
}

.creature-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bubble {
  position: absolute;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(232, 247, 255, 0.28);
  animation: bubble 7s linear infinite;
}

@keyframes bubble {
  from { transform: translateY(2rem); opacity: 0; }
  18% { opacity: 0.65; }
  to { transform: translateY(-8rem); opacity: 0; }
}

.trench {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  padding: 5rem 1.5rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 110%, rgba(255, 122, 107, 0.14), transparent 26rem),
    linear-gradient(180deg, var(--trench), #000);
}

.trench__mark {
  color: var(--coral);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trench h2 {
  font-size: clamp(2.4rem, 9vw, 5.6rem);
  line-height: 0.95;
}

.trench p {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .depth-panel {
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    width: calc(100vw - 1.5rem);
  }

  .ocean {
    min-height: 11200px;
  }

  .creature,
  .creature:nth-of-type(even) {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    width: calc(100% - 1rem);
  }

  .creature:nth-of-type(even) .creature-art {
    order: 0;
  }

  .creature-card {
    padding: 0.75rem;
  }

  .creature-card p {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .creature,
  .back-link,
  .restart-link {
    transition: none;
  }

  .bubble {
    animation: none;
  }
}
