:root {
  --script-pattern: IntersectionObserver focus states;
  --abyss: #07131C;
  --lagoon: #0B3A46;
  --kelp: #12656F;
  --mint: #48D6B5;
  --cyan: #A7F3E5;
  --brass: #B18A4A;
  --violet: #1B1730;
  --body: "Nunito", sans-serif;
  --display: "M PLUS Rounded 1c", sans-serif;
  --mono: "Sono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--body);
  color: rgba(167, 243, 229, 0.88);
  background:
    radial-gradient(circle at 18% 8%, rgba(27, 23, 48, 0.72), transparent 36rem),
    radial-gradient(circle at 85% 18%, rgba(18, 101, 111, 0.34), transparent 30rem),
    linear-gradient(180deg, #07131C 0%, #081923 34%, #061018 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(167, 243, 229, 0.16) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(72, 214, 181, 0.09) 0 1px, transparent 2px);
  background-size: 82px 126px, 143px 191px;
  opacity: 0.32;
  mix-blend-mode: screen;
}

.lagoon-backdrop,
.caustic,
.margin-fish {
  position: fixed;
  pointer-events: none;
}

.lagoon-backdrop { inset: 0; overflow: hidden; z-index: 0; }

.caustic {
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(42px);
  opacity: 0.28;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}

.caustic-one { left: -18vw; top: 12vh; background: radial-gradient(circle, rgba(72, 214, 181, 0.34), transparent 65%); animation: floatOne 18s ease-in-out infinite; }
.caustic-two { right: -16vw; top: 35vh; background: radial-gradient(circle, rgba(27, 23, 48, 0.8), transparent 66%); animation: floatTwo 22s ease-in-out infinite; }
.caustic-three { left: 36vw; bottom: -25vw; background: radial-gradient(circle, rgba(18, 101, 111, 0.48), transparent 68%); animation: floatThree 26s ease-in-out infinite; }

.margin-fish {
  z-index: 1;
  top: 0;
  width: min(28vw, 430px);
  height: 100vh;
  opacity: 0.62;
  filter: blur(1.2px);
}

.margin-fish-left { left: 0; }
.margin-fish-right { right: 0; }

.fish-path {
  fill: rgba(72, 214, 181, 0.16);
  stroke: rgba(167, 243, 229, 0.1);
  transform-box: fill-box;
  transform-origin: center;
  animation: fishDrift 16s ease-in-out infinite;
}

.fish-b, .fish-e { fill: rgba(27, 23, 48, 0.5); animation-duration: 21s; }
.fish-c, .fish-f { fill: rgba(18, 101, 111, 0.24); animation-duration: 24s; }
.fish-d { animation-duration: 19s; }

.descent-channel {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 34px));
  margin: 0 auto;
}

.dive-cord {
  position: absolute;
  left: 26px;
  top: 42vh;
  bottom: 35vh;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(180deg, transparent, rgba(177, 138, 74, 0.72), rgba(72, 214, 181, 0.36), rgba(177, 138, 74, 0.52), transparent);
  box-shadow: 0 0 18px rgba(72, 214, 181, 0.2), inset 1px 0 rgba(167, 243, 229, 0.35);
}

.lagoon-plate {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 9vh 0;
  filter: blur(18px) brightness(0.6);
  transform: translateY(28px) scale(0.985);
  opacity: 0.54;
  transition: filter 900ms ease, transform 900ms ease, opacity 900ms ease;
}

.lagoon-plate.is-focused {
  filter: blur(0) brightness(1);
  transform: translateY(0) scale(1);
  opacity: 1;
}

.charm {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 5;
  transform: translate(-12px, -50%) rotate(-4deg);
  padding: 8px 13px;
  border: 1px solid rgba(177, 138, 74, 0.78);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #A7F3E5;
  background: linear-gradient(145deg, rgba(177, 138, 74, 0.9), rgba(92, 63, 29, 0.84));
  box-shadow: inset 1px 1px 1px rgba(255,255,255,0.34), inset -3px -5px 8px rgba(7,19,28,0.55), 0 12px 20px rgba(0,0,0,0.36);
}

.porthole-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 680px);
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 7vw, 74px);
  border-radius: 44px;
  overflow: hidden;
  border: 12px solid rgba(8, 24, 31, 0.9);
  background:
    radial-gradient(circle at calc(50% + var(--tilt-x, 0px)) calc(18% + var(--tilt-y, 0px)), rgba(167, 243, 229, 0.2), transparent 21rem),
    linear-gradient(145deg, rgba(11, 58, 70, 0.88), rgba(7, 19, 28, 0.94) 58%, rgba(27, 23, 48, 0.84));
  box-shadow:
    0 34px 80px rgba(0,0,0,0.56),
    0 0 0 2px rgba(177, 138, 74, 0.74),
    0 0 0 7px rgba(18, 101, 111, 0.34),
    inset 9px 10px 18px rgba(167, 243, 229, 0.13),
    inset -22px -28px 42px rgba(0,0,0,0.58);
  backdrop-filter: blur(16px);
}

.porthole-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border-radius: 31px;
  border: 1px solid rgba(167, 243, 229, 0.18);
  background:
    radial-gradient(circle at 22% 24%, rgba(167, 243, 229, 0.18), transparent 11rem),
    radial-gradient(circle at 82% 70%, rgba(72, 214, 181, 0.11), transparent 13rem),
    repeating-radial-gradient(ellipse at center, transparent 0 18px, rgba(167, 243, 229, 0.025) 19px 21px);
  filter: blur(0.1px);
}

.porthole-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(112deg, transparent 0 16%, rgba(167, 243, 229, 0.12) 20%, transparent 27% 100%),
    radial-gradient(circle at 76% 19%, rgba(255,255,255,0.18), transparent 2.5rem),
    radial-gradient(circle at 64% 34%, rgba(167, 243, 229, 0.11), transparent 1.4rem);
  opacity: 0.72;
  mix-blend-mode: screen;
}

.annotation {
  display: inline-block;
  width: fit-content;
  margin-bottom: 18px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid rgba(177, 138, 74, 0.44);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(167, 243, 229, 0.76);
  background: rgba(7, 19, 28, 0.42);
  box-shadow: inset 2px 2px 7px rgba(0,0,0,0.38), 0 1px rgba(255,255,255,0.12);
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  line-height: 0.98;
  color: #A7F3E5;
  text-shadow: 0 0 18px rgba(72, 214, 181, 0.22), 0 3px 0 rgba(7,19,28,0.54);
}

h1 { font-size: clamp(4.3rem, 14vw, 8.8rem); letter-spacing: -0.08em; filter: blur(3px); animation: titleFocus 4s ease forwards; }
h2 { max-width: 12ch; font-size: clamp(2.7rem, 8vw, 5.2rem); letter-spacing: -0.055em; }

p {
  max-width: 58ch;
  margin: 24px 0 0;
  color: rgba(207, 255, 246, 0.76);
  font-size: clamp(1.06rem, 2.25vw, 1.32rem);
  line-height: 1.72;
}

.lead { max-width: 48ch; font-size: clamp(1.18rem, 2.4vw, 1.55rem); }
.note { font-family: var(--mono); font-size: 0.88rem; color: rgba(72, 214, 181, 0.88); }

.enamel-chip {
  width: fit-content;
  margin-top: 32px;
  border: 1px solid rgba(167, 243, 229, 0.32);
  border-radius: 999px;
  padding: 13px 20px;
  font-family: var(--body);
  font-weight: 800;
  color: #07131C;
  background: linear-gradient(145deg, #A7F3E5, #48D6B5 48%, #B18A4A 145%);
  box-shadow: inset 2px 2px 3px rgba(255,255,255,0.56), inset -4px -5px 9px rgba(18,101,111,0.42), 0 13px 26px rgba(0,0,0,0.32), 0 0 18px rgba(72,214,181,0.22);
  cursor: pointer;
  transition: transform 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

.enamel-chip:hover { filter: brightness(1.08); transform: translateY(-2px); }
.enamel-chip:active { transform: translateY(2px) scale(0.98); box-shadow: inset 4px 5px 10px rgba(7,19,28,0.28), 0 7px 14px rgba(0,0,0,0.34); }
.small-chip { color: #A7F3E5; background: linear-gradient(145deg, #12656F, #0B3A46); }

.glass-fish {
  position: absolute;
  right: -150px;
  top: 28%;
  width: 310px;
  height: 146px;
  opacity: 0.45;
  background: rgba(72, 214, 181, 0.26);
  clip-path: polygon(0 50%, 18% 16%, 58% 7%, 84% 31%, 100% 8%, 94% 50%, 100% 92%, 84% 69%, 57% 92%, 18% 84%);
  filter: blur(1px) drop-shadow(0 0 22px rgba(72, 214, 181, 0.38));
  animation: crossGlass 7.5s ease-in-out infinite;
}

.artifact {
  position: relative;
  margin-top: 34px;
  width: 100%;
  min-height: 250px;
  border-radius: 32px;
  border: 1px solid rgba(177, 138, 74, 0.42);
  background: rgba(7, 19, 28, 0.34);
  box-shadow: inset 12px 14px 28px rgba(0,0,0,0.42), inset -8px -8px 18px rgba(167,243,229,0.06);
  overflow: hidden;
}

.map-artifact svg { width: 100%; height: 100%; min-height: 250px; }
.route-line { fill: none; stroke: #48D6B5; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 14; filter: drop-shadow(0 0 8px rgba(72,214,181,0.75)); animation: routePulse 7s linear infinite; }
.route-line-soft { stroke: #12656F; stroke-width: 2; opacity: 0.75; animation-duration: 10s; }
.route-token { fill: #B18A4A; stroke: #A7F3E5; stroke-width: 2; filter: drop-shadow(0 0 8px rgba(72,214,181,0.9)); }

.compass-artifact { display: grid; place-items: center; min-height: 310px; }
.compass-ring {
  position: relative;
  width: min(300px, 78%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 16px solid rgba(177, 138, 74, 0.82);
  background:
    radial-gradient(circle, rgba(167,243,229,0.14), transparent 31%),
    conic-gradient(from 20deg, rgba(72,214,181,0.24), rgba(27,23,48,0.56), rgba(18,101,111,0.48), rgba(72,214,181,0.24));
  box-shadow: inset 8px 9px 18px rgba(255,255,255,0.11), inset -18px -20px 34px rgba(0,0,0,0.5), 0 20px 44px rgba(0,0,0,0.38);
}
.compass-ring::before { content: "N   E   S   W"; position: absolute; inset: 18px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); color: rgba(167,243,229,0.45); letter-spacing: 0.55em; font-size: 0.78rem; }
.compass-needle { position: absolute; left: 50%; top: 50%; width: 42%; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #48D6B5, #B18A4A); transform-origin: left center; transform: rotate(var(--compass, -32deg)); box-shadow: 0 0 14px rgba(72,214,181,0.52); transition: transform 500ms ease; }
.pearl-dot { position: absolute; left: calc(50% - 11px); top: calc(50% - 11px); width: 22px; height: 22px; border-radius: 50%; background: #A7F3E5; box-shadow: inset -4px -5px 8px rgba(18,101,111,0.35), 0 0 18px rgba(167,243,229,0.78); }

.school-artifact { min-height: 330px; }
.glyph-fish { position: absolute; width: 112px; height: 58px; clip-path: polygon(0 50%, 18% 20%, 60% 10%, 88% 50%, 60% 90%, 18% 80%); background: rgba(72,214,181,0.36); filter: blur(0.4px) drop-shadow(0 0 18px rgba(72,214,181,0.55)); animation: glyphSwim 8s ease-in-out infinite; }
.g1 { left: 8%; top: 24%; animation-delay: -1s; }
.g2 { left: 37%; top: 48%; width: 86px; opacity: 0.6; animation-delay: -3s; }
.g3 { left: 64%; top: 22%; width: 128px; transform: scaleX(-1); animation-delay: -4s; }
.g4 { left: 18%; top: 68%; width: 74px; opacity: 0.48; animation-delay: -6s; }
.g5 { left: 70%; top: 66%; width: 92px; opacity: 0.72; animation-delay: -2s; }

.sky-artifact { min-height: 330px; background: radial-gradient(circle at 55% 48%, rgba(27,23,48,0.82), rgba(7,19,28,0.2) 70%); }
.star { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #A7F3E5; box-shadow: 0 0 16px #48D6B5; animation: starWobble 5s ease-in-out infinite; }
.s1 { left: 22%; top: 24%; }.s2 { left: 68%; top: 18%; animation-delay: -1s; }.s3 { left: 49%; top: 47%; animation-delay: -2s; }.s4 { left: 28%; top: 72%; animation-delay: -3s; }.s5 { left: 78%; top: 66%; animation-delay: -4s; }
.lens-orbit { position: absolute; inset: 42px 72px; border: 1px solid rgba(72,214,181,0.36); border-radius: 50%; transform: rotate(-12deg); box-shadow: 0 0 24px rgba(72,214,181,0.12), inset 0 0 28px rgba(167,243,229,0.07); }

.pearl-marker { width: min(300px, 72vw); aspect-ratio: 1; margin: 42px auto 6px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 34% 28%, rgba(167,243,229,0.82), rgba(72,214,181,0.22) 32%, rgba(18,101,111,0.18) 58%, transparent 68%); box-shadow: inset -24px -34px 55px rgba(7,19,28,0.44), 0 0 66px rgba(72,214,181,0.34); }
.pearl-marker span { width: 40%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 25%, white, #A7F3E5 38%, #48D6B5 78%); box-shadow: inset -12px -16px 20px rgba(18,101,111,0.32), 0 0 42px rgba(167,243,229,0.84); animation: pearlBreathe 4.4s ease-in-out infinite; }

.depth-gauge {
  position: fixed;
  z-index: 8;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid rgba(177,138,74,0.72);
  background: linear-gradient(145deg, rgba(177,138,74,0.72), rgba(7,19,28,0.86));
  box-shadow: inset 2px 2px 4px rgba(255,255,255,0.18), inset -5px -7px 13px rgba(0,0,0,0.48), 0 16px 32px rgba(0,0,0,0.42);
}
.gauge-label, .gauge-readout { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #A7F3E5; }
.gauge-glass { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 5px solid rgba(7,19,28,0.8); background: radial-gradient(circle, rgba(11,58,70,0.96), #07131C); box-shadow: inset 5px 5px 10px rgba(255,255,255,0.08), inset -8px -9px 14px rgba(0,0,0,0.54); }
.gauge-glass span { position: absolute; left: 50%; top: 50%; width: 23px; height: 4px; border-radius: 99px; background: #48D6B5; transform-origin: left center; transform: rotate(var(--gauge-angle, -90deg)); box-shadow: 0 0 12px rgba(72,214,181,0.72); }

@keyframes titleFocus { 0%, 32% { filter: blur(7px); opacity: 0.62; } 72%, 100% { filter: blur(0); opacity: 1; } }
@keyframes crossGlass { 0% { transform: translateX(0) scaleX(1); opacity: 0; } 15%, 70% { opacity: 0.48; } 100% { transform: translateX(-780px) scaleX(1); opacity: 0; } }
@keyframes floatOne { 50% { transform: translate(10vw, 18vh) scale(1.2); } }
@keyframes floatTwo { 50% { transform: translate(-9vw, -12vh) scale(0.86); } }
@keyframes floatThree { 50% { transform: translate(4vw, -18vh) scale(1.15); } }
@keyframes fishDrift { 50% { transform: translate(28px, -44px) rotate(5deg); opacity: 0.9; } }
@keyframes routePulse { to { stroke-dashoffset: -96; } }
@keyframes glyphSwim { 0%,100% { transform: translate(0,0); filter: blur(1px) drop-shadow(0 0 12px rgba(72,214,181,0.25)); } 50% { transform: translate(26px,-18px); filter: blur(0) drop-shadow(0 0 26px rgba(72,214,181,0.78)); } }
@keyframes starWobble { 50% { transform: translate(8px, -10px) scale(1.4); opacity: 0.55; } }
@keyframes pearlBreathe { 50% { transform: scale(1.07); box-shadow: inset -12px -16px 20px rgba(18,101,111,0.28), 0 0 70px rgba(167,243,229,1); } }

@media (max-width: 760px) {
  .margin-fish { opacity: 0.22; width: 42vw; }
  .dive-cord { left: 15px; }
  .charm { left: 6px; top: 12vh; transform: rotate(-4deg); }
  .porthole-card { min-height: 76vh; border-width: 8px; border-radius: 32px; padding: 34px 26px; }
  .depth-gauge { right: 12px; bottom: 12px; transform: scale(0.88); transform-origin: right bottom; }
}
