:root {
  /* Compliance echoes: IBM Plex Mono** in 400/500 for coordinate strings; Space Grotesk coordinates flickering near the edges. On scroll Space Grotesk** in 400/500/700 for crisp futuristic reading. */
  --abyss: #03111F;
  --pressure: #062A3F;
  --current: #0B5A66;
  --cyan: #54F2D2;
  --plankton: #A8FF9E;
  --foam: #DDF7F0;
  --rust: #C46A3A;
  --violet: #291B4F;
  --depth: 0;
  --glow: rgba(84, 242, 210, 0.58);
  --pressure-blur: 0px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--abyss);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foam);
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  background: linear-gradient(180deg, #03111F 0%, #062A3F 48%, #03111F 100%);
  overflow-x: hidden;
}

a { color: inherit; }

.design-echo {
  position: fixed;
  left: -100vw;
  top: -100vh;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.water-field,
.grain,
.pressure-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.water-field {
  z-index: 0;
  background:
    radial-gradient(circle at calc(20% + var(--depth) * 7%) 18%, rgba(84, 242, 210, 0.12), transparent 25vw),
    radial-gradient(circle at 72% calc(64% - var(--depth) * 3%), rgba(196, 106, 58, 0.10), transparent 24vw),
    linear-gradient(180deg, #03111F, #062A3F 46%, #03111F);
  filter: blur(var(--pressure-blur));
}

.grain {
  opacity: 0.16;
  background-image:
    repeating-radial-gradient(circle at 17% 31%, rgba(221, 247, 240, 0.2) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(115deg, transparent 0 11px, rgba(84, 242, 210, 0.05) 12px, transparent 13px 28px);
  mix-blend-mode: screen;
}

.pressure-vignette {
  box-shadow: inset 0 0 12vw 4vw #03111F;
}

main,
.depth-nav { position: relative; z-index: 2; }

.depth-nav {
  position: fixed;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  z-index: 12;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(0.58rem, 0.75vw, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.depth-nav a {
  position: relative;
  width: max-content;
  text-decoration: none;
  opacity: 0.48;
  transform: translateX(0);
  transition: opacity 400ms ease, transform 400ms ease, color 400ms ease;
}

.depth-nav a::before {
  content: attr(data-depth);
  margin-right: 0.45rem;
  color: var(--cyan);
}

.depth-nav a.active {
  color: var(--plankton);
  opacity: 1;
  transform: translateX(-0.7rem) rotate(-1deg);
}

.depth-plate {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1.2rem, 3vw, 4rem);
}

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
}

.coordinate,
.kicker,
.edge-stamp,
.final-stamp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: rgba(221, 247, 240, 0.68);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(0.62rem, 0.8vw, 0.82rem);
}

.coord-a { position: absolute; left: 3rem; top: 2rem; animation: flicker 5s infinite; }
.coord-b { position: absolute; right: 13rem; bottom: 2.2rem; animation: flicker 7s infinite reverse; }

.morph-stage {
  position: absolute;
  left: 18%;
  top: 7%;
  width: min(62vw, 760px);
  aspect-ratio: 1;
  transform: translate3d(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -10px), 0);
  transition: transform 300ms ease-out;
}

.morph-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0.92;
}

#morphPath {
  fill: rgba(11, 90, 102, 0.34);
  stroke: var(--cyan);
  stroke-width: 3;
  transition: d 1300ms cubic-bezier(0.48, 0.02, 0.14, 1), fill 900ms ease;
}

.morph-vein {
  fill: none;
  stroke: rgba(168, 255, 158, 0.72);
  stroke-width: 2;
  stroke-dasharray: 12 18;
  animation: currentTrace 18s linear infinite;
}

.vein-two { stroke: rgba(196, 106, 58, 0.66); animation-duration: 23s; }

.sonar-ring {
  position: absolute;
  border: 1px solid rgba(84, 242, 210, 0.25);
  border-radius: 50%;
  inset: 15%;
  animation: sonar 8s ease-in-out infinite;
}

.ring-two { inset: 4%; animation-delay: -3s; border-color: rgba(168, 255, 158, 0.16); }

.masthead {
  grid-column: 1 / 6;
  align-self: end;
  font-family: Kalam, cursive;
  font-size: clamp(6rem, 20vw, 17rem);
  font-weight: 700;
  line-height: 0.68;
  color: var(--foam);
  text-shadow: 0 0 22px rgba(84, 242, 210, 0.28);
  transform: rotate(-3deg);
}

.mark-letter { display: inline-block; text-decoration: underline 0.04em rgba(84, 242, 210, 0.62); }
.mark-letter.nine { transform: rotate(5deg) translateY(0.04em); color: var(--cyan); }
.mark-tag { font-family: Caveat, cursive; font-size: 0.32em; color: var(--rust); margin-left: 0.08em; }

.right-notes {
  position: absolute;
  right: clamp(4.8rem, 8vw, 8rem);
  top: 11%;
  width: min(18rem, 26vw);
  font-family: Kalam, cursive;
  color: var(--foam);
  font-size: clamp(1rem, 1.6vw, 1.55rem);
  line-height: 1.25;
}

.right-notes p {
  margin: 0 0 1.7rem;
  padding-left: 1.1rem;
  border-left: 2px solid rgba(84, 242, 210, 0.52);
  transform: rotate(var(--note-tilt, -1deg));
}

.right-notes p:nth-child(2) { --note-tilt: 1.4deg; color: var(--plankton); }
.right-notes .caveat { font-family: Caveat, cursive; color: var(--rust); font-size: 1.35em; }

.floating-note,
.annotation,
.scrap {
  position: absolute;
  font-family: Caveat, cursive;
  font-weight: 700;
  color: var(--plankton);
  font-size: clamp(1.1rem, 2vw, 2rem);
  transform: translate3d(calc(var(--mx, 0) * 18px), calc(var(--my, 0) * 12px), 0) rotate(-4deg);
  transition: transform 450ms ease-out;
}

.buoy { animation: buoy 7s ease-in-out infinite; }
.one { left: 10%; top: 23%; }
.two { left: 54%; bottom: 15%; animation-delay: -2s; color: var(--cyan); }
.three { right: 18%; bottom: 13%; color: var(--foam); }

.spread {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, 1fr);
  gap: 1.2rem;
  background: linear-gradient(180deg, rgba(3, 17, 31, 0.1), rgba(6, 42, 63, 0.42));
}

.plate-title {
  position: absolute;
  left: -0.6rem;
  top: 1.4rem;
  font-family: Kalam, cursive;
  line-height: 0.78;
  color: rgba(221, 247, 240, 0.14);
  font-size: clamp(5rem, 16vw, 16rem);
  pointer-events: none;
}

.plate-title span,
.plate-title strong { display: block; }
.plate-title strong { color: rgba(84, 242, 210, 0.18); transform: translateX(1.2em) rotate(-2deg); }
.plate-title.huge { font-size: clamp(5rem, 14vw, 14rem); }

.narrative-column {
  grid-column: 2 / 6;
  grid-row: 3 / 6;
  align-self: center;
  z-index: 3;
  max-width: 34rem;
}

.narrative-column h1 {
  margin: 0.25rem 0 1rem;
  font-family: Kalam, cursive;
  font-size: clamp(2.6rem, 6vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--foam);
}

.narrative-column p:not(.kicker) {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.55;
  color: rgba(221, 247, 240, 0.78);
}

.kicker { color: var(--cyan); }

.photo-slit {
  grid-column: 7 / 11;
  grid-row: 1 / 7;
  margin: 8vh 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(3, 17, 31, 0.1), rgba(84, 242, 210, 0.26), rgba(196, 106, 58, 0.2)),
    repeating-linear-gradient(170deg, rgba(221, 247, 240, 0.06) 0 1px, transparent 2px 18px),
    radial-gradient(circle at 45% 30%, #54F2D2, #0B5A66 28%, #03111F 70%);
  box-shadow: inset 0 0 0 2px rgba(84, 242, 210, 0.28), 0 0 70px rgba(84, 242, 210, 0.17);
  transform: rotate(3deg);
  overflow: hidden;
}

.scanlines,
.bathymetry {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(0deg, transparent 0 10px, rgba(221, 247, 240, 0.08) 11px 12px);
  mix-blend-mode: screen;
}

.arrow-a { left: 53%; top: 20%; color: var(--rust); }
.edge-stamp { position: absolute; left: 6%; bottom: 6%; }

.inverted { background: linear-gradient(180deg, rgba(6, 42, 63, 0.36), rgba(3, 17, 31, 0.3)); }
.narrow-right { grid-column: 8 / 12; grid-row: 2 / 5; }

.porthole {
  grid-column: 2 / 7;
  grid-row: 2 / 6;
  width: min(46vw, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(84, 242, 210, 0.38);
  background:
    radial-gradient(circle at 58% 38%, rgba(168, 255, 158, 0.34), transparent 16%),
    radial-gradient(circle at 35% 64%, rgba(196, 106, 58, 0.28), transparent 28%),
    #03111F;
  overflow: hidden;
  box-shadow: inset 0 0 80px #03111F, 0 0 90px rgba(41, 27, 79, 0.5);
  transform: rotate(-2deg);
}

.bathymetry {
  background:
    repeating-radial-gradient(circle at 52% 48%, transparent 0 24px, rgba(84, 242, 210, 0.18) 25px 27px, transparent 28px 48px),
    linear-gradient(110deg, transparent, rgba(196, 106, 58, 0.18));
  animation: slowTurn 28s linear infinite;
}

.scrap {
  right: 12%;
  bottom: 25%;
  padding: 1rem 1.3rem;
  color: #03111F;
  background: rgba(196, 106, 58, 0.88);
  transform: rotate(5deg);
  box-shadow: 0 12px 40px rgba(3, 17, 31, 0.5);
}

.archive .film-strip {
  grid-column: 6 / 12;
  grid-row: 1 / 7;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  transform: rotate(-2deg) translateY(8vh);
}

.film-strip i {
  min-height: 72vh;
  border: 1px solid rgba(221, 247, 240, 0.16);
  background:
    linear-gradient(180deg, rgba(84, 242, 210, 0.2), rgba(3, 17, 31, 0.15), rgba(196, 106, 58, 0.23)),
    repeating-linear-gradient(90deg, transparent 0 17px, rgba(221, 247, 240, 0.05) 18px 20px),
    #062A3F;
  filter: saturate(1.25) contrast(1.08);
}

.film-strip i:nth-child(even) { transform: translateY(-7vh); background-color: #0B5A66; }
.left-low { grid-column: 2 / 6; grid-row: 4 / 7; }

.waveform {
  position: absolute;
  left: 9%;
  top: 18%;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.waveform span {
  width: 0.38rem;
  height: calc(2rem + var(--h, 1) * 1rem);
  background: var(--cyan);
  border-radius: 999px;
  animation: pulseWave 1.8s ease-in-out infinite;
}
.waveform span:nth-child(2) { --h: 3; animation-delay: -0.2s; }
.waveform span:nth-child(3) { --h: 6; animation-delay: -0.4s; background: var(--plankton); }
.waveform span:nth-child(4) { --h: 4; animation-delay: -0.6s; }
.waveform span:nth-child(5) { --h: 7; animation-delay: -0.8s; background: var(--rust); }
.waveform span:nth-child(6) { --h: 2; animation-delay: -1s; }
.arrow-b { right: 19%; top: 15%; }

.final {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  background:
    radial-gradient(circle at 73% 50%, rgba(84, 242, 210, 0.18), transparent 28vw),
    linear-gradient(180deg, rgba(3, 17, 31, 0.38), #03111F);
}

.final-copy { grid-column: 2 / 7; grid-row: auto; }
.surface-tag {
  display: inline-block;
  margin-top: 1.6rem;
  padding: 0.62rem 0.9rem;
  border: 1px solid rgba(84, 242, 210, 0.55);
  color: var(--cyan);
  text-decoration: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  transform: rotate(-1deg);
  transition: background 300ms ease, color 300ms ease, transform 300ms ease;
}
.surface-tag:hover { background: var(--cyan); color: var(--abyss); transform: rotate(1deg) translateY(-2px); }

.resurface-mark {
  grid-column: 8 / 12;
  font-family: Kalam, cursive;
  font-weight: 700;
  font-size: clamp(5rem, 13vw, 14rem);
  color: rgba(221, 247, 240, 0.86);
  text-shadow: 0 0 42px rgba(84, 242, 210, 0.32);
  transform: rotate(4deg);
}

.final-stamp { position: absolute; right: 7%; bottom: 7%; color: var(--plankton); }

@keyframes flicker {
  0%, 100% { opacity: 0.35; }
  10%, 12%, 72% { opacity: 1; }
  43% { opacity: 0.55; }
}

@keyframes currentTrace { to { stroke-dashoffset: -240; } }
@keyframes sonar { 0%, 100% { transform: scale(0.9); opacity: 0.2; } 50% { transform: scale(1.08); opacity: 0.72; } }
@keyframes buoy { 0%, 100% { translate: 0 0; } 50% { translate: 0 -1.2rem; } }
@keyframes slowTurn { to { transform: rotate(360deg); } }
@keyframes pulseWave { 0%, 100% { transform: scaleY(0.58); opacity: 0.5; } 50% { transform: scaleY(1.12); opacity: 1; } }

@media (max-width: 780px) {
  .depth-nav { right: 0.7rem; font-size: 0.56rem; }
  .hero, .spread, .final { display: block; padding-right: 3.2rem; }
  .morph-stage { left: -12%; top: 10%; width: 112vw; }
  .masthead { position: absolute; left: 1rem; bottom: 4rem; }
  .right-notes { right: 3.2rem; width: 44vw; font-size: 1rem; }
  .narrative-column, .narrow-right, .left-low, .final-copy { max-width: 82%; padding-top: 34vh; }
  .photo-slit, .porthole { position: absolute; inset: 12vh 20vw auto auto; width: 40vw; height: 76vh; }
  .porthole { height: auto; width: 68vw; left: 4vw; right: auto; }
  .archive .film-strip { position: absolute; inset: 10vh 4rem auto 28%; height: 75vh; }
  .plate-title { font-size: 24vw; }
  .resurface-mark { position: absolute; right: 2rem; bottom: 6rem; font-size: 22vw; }
}
