:root {
  /* Compliance text: Interaction Implementation* Implementation:* Implementation: Implementation:** Intersection Observer detect their custom property (`--wave-energy` IntersectionObserver` boundary Grotesk's geometric DNA. (Google */
  --abyssal-teal: #0E1C26;
  --weathered-aqua: #6B98A8;
  --ocean-slate: #3D5A6E;
  --resurgence-cyan: #5CC4D0;
  --spring-mineral: #4A8B7F;
  --tidal-blue: #1B2D3A;
  --bubble-white: #D4E8ED;
  --foam: #EBF3F6;
  --font-display: "Space Grotesk", Inter, sans-serif;
  --font-body: "DM Sans", Inter, sans-serif;
  --font-accent: "Caveat", cursive;
  --ease-aquatic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --mx: 0px;
  --my: 0px;
  --wave-energy: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--tidal-blue);
  color: var(--ocean-slate);
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.65;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  background:
    radial-gradient(circle at 18% 82%, rgba(92, 196, 208, 0.08), transparent 34vw),
    radial-gradient(circle at 78% 18%, rgba(212, 232, 237, 0.05), transparent 28vw);
  mix-blend-mode: screen;
}

#observatory { position: relative; overflow: hidden; }

.act {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-auto-rows: minmax(8px, auto);
  isolation: isolate;
}

.surface {
  background: radial-gradient(circle at 42% 70%, #0E1C26 0%, #1B2D3A 72%);
}

.depth {
  min-height: 112vh;
  padding: clamp(5.5rem, 9vw, 8.5rem) 0;
  background: radial-gradient(circle at 35% 76%, #0E1C26 0%, #1B2D3A 100%);
}

.current {
  min-height: 108vh;
  align-content: center;
  background: radial-gradient(circle at 62% 50%, #0E1C26 0%, #1B2D3A 88%);
}

.clarity {
  align-content: center;
  background: radial-gradient(circle at 32% 72%, #0E1C26 0%, #1B2D3A 100%);
}

.resurface {
  align-content: start;
  padding-top: clamp(2rem, 7vw, 6rem);
  background: radial-gradient(circle at 50% 12%, #EBF3F6 0%, #D4E8ED 60%, #6B98A8 150%);
}

.depth-lines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.52;
  background:
    linear-gradient(to bottom, transparent 0 12vh, rgba(61, 90, 110, 0.18) 12.05vh, transparent 12.15vh),
    linear-gradient(to bottom, transparent 0 34vh, rgba(61, 90, 110, 0.12) 34.04vh, transparent 34.12vh),
    linear-gradient(to bottom, transparent 0 68vh, rgba(61, 90, 110, 0.16) 68.05vh, transparent 68.13vh),
    linear-gradient(to bottom, transparent 0 89vh, rgba(61, 90, 110, 0.10) 89.04vh, transparent 89.1vh);
}

.accent-note {
  font-family: var(--font-accent);
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  font-weight: 400;
  color: var(--weathered-aqua);
  margin: 0 0 0.8rem;
}

.surface-mark {
  position: absolute;
  left: 8vw;
  top: 13vh;
  transform: rotate(-4deg);
  opacity: 0;
  animation: driftIn 1.4s var(--ease-aquatic) 0.2s forwards;
}

.surface-copy {
  grid-column: 3 / 16;
  align-self: center;
  justify-self: start;
  z-index: 3;
  transform: translate3d(calc(var(--mag-x, 0px) * -0.22), calc(var(--mag-y, 0px) * -0.08), 0);
}

.display-title,
.resurface-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 0.86;
  font-weight: 300;
  letter-spacing: -0.04em;
}

.display-title {
  color: var(--bubble-white);
  text-indent: -0.06em;
  transform: rotate(-2deg) translateY(18px);
  opacity: 0;
  animation: displayRise 1.5s var(--ease-aquatic) forwards;
}

.surface-line {
  width: min(44ch, 50vw);
  margin: clamp(1.6rem, 3vw, 2.6rem) 7vw 0 auto;
  color: var(--weathered-aqua);
  text-align: right;
  opacity: 0;
  transform: translate(35px, 16px);
  animation: sentenceIn 1.25s var(--ease-aquatic) 0.4s forwards;
}

.bubble-field {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.bubble {
  position: absolute;
  left: var(--x);
  bottom: -70px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  opacity: var(--o);
  transform: translate3d(calc(var(--pull-x, 0px) + var(--wobble, 0px)), var(--rise, 0px), 0);
  animation: rise var(--d) linear infinite, wobble var(--w) ease-in-out infinite;
  animation-delay: var(--delay), calc(var(--delay) * -0.45);
}

.bubble.small { background: radial-gradient(circle at 30% 30%, rgba(92, 196, 208, 0.4), rgba(92, 196, 208, 0.05)); }
.bubble.medium { background: radial-gradient(circle at 35% 25%, rgba(212, 232, 237, 0.5), rgba(107, 152, 168, 0.08)); }
.bubble.large { background: radial-gradient(circle at 30% 20%, rgba(235, 243, 246, 0.3), transparent 70%); box-shadow: inset 0 -4px 12px rgba(14, 28, 38, 0.15); }

@keyframes rise {
  0% { --rise: 12vh; opacity: 0; }
  14% { opacity: var(--o); }
  82% { opacity: var(--o); }
  100% { --rise: -118vh; opacity: 0; }
}

@keyframes wobble {
  0%, 100% { --wobble: -15px; }
  50% { --wobble: 15px; }
}

.depth-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  align-self: center;
  z-index: 3;
}

.panel,
.current-panel,
.clarity-column {
  position: relative;
  border: 1px solid rgba(107, 152, 168, 0.18);
  background: rgba(27, 45, 58, 0.72);
  box-shadow: 0 40px 90px rgba(14, 28, 38, 0.28);
  backdrop-filter: blur(10px);
}

.panel {
  padding: clamp(2rem, 4vw, 4rem);
  opacity: 0;
  animation: panelSurface 1.2s var(--ease-aquatic) forwards;
}

.observatory-panel {
  grid-column: 2 / 8;
  grid-row: 1 / 4;
  transform: rotate(-2.4deg);
}

.reduction-panel {
  grid-column: 9 / 15;
  grid-row: 3 / 6;
  margin-left: -8vw;
  margin-top: clamp(3rem, 6vw, 5rem);
  transform: rotate(1.7deg);
  animation-delay: 0.18s;
}

.glass-volume {
  grid-column: 8 / 17;
  grid-row: 1 / 5;
  min-height: clamp(320px, 45vw, 560px);
  margin-right: -120px;
  background:
    radial-gradient(circle at 38% 44%, rgba(92, 196, 208, 0.20), transparent 28%),
    radial-gradient(circle at 72% 18%, rgba(212, 232, 237, 0.12), transparent 32%),
    rgba(14, 28, 38, 0.22);
  border: 1px solid rgba(212, 232, 237, 0.10);
  overflow: hidden;
}

.glass-volume span {
  position: absolute;
  height: 1px;
  width: 130%;
  left: -10%;
  background: rgba(212, 232, 237, 0.16);
  transform: rotate(-18deg);
}

.glass-volume span:nth-child(1) { top: 28%; }
.glass-volume span:nth-child(2) { top: 52%; opacity: 0.7; }
.glass-volume span:nth-child(3) { top: 76%; opacity: 0.45; }

.panel h2,
.panel h3,
.current-panel h2,
.clarity-column h2 {
  margin: 0 0 1.4rem;
  color: var(--bubble-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.panel h3 { font-size: clamp(1.9rem, 3.2vw, 3.8rem); }
.panel p,
.current-panel p { color: var(--weathered-aqua); margin: 0; }
.panel p + p { margin-top: 1rem; }

.wave-separator {
  display: block;
  width: 100vw;
  height: clamp(92px, 13vw, 190px);
  margin: -1px 0;
  background: var(--abyssal-teal);
  overflow: visible;
}

.wave-line {
  fill: none;
  stroke: var(--weathered-aqua);
  stroke-width: calc(1px + (var(--wave-energy) * 1.5px));
  stroke-linecap: round;
  opacity: calc(0.26 + (var(--wave-energy) * 0.36));
  stroke-dasharray: 10 18;
  animation: waveFlow 4.5s linear infinite;
}

.single-crest .wave-line { stroke-width: 2px; opacity: 0.4; }
.double-interference .wave-a { stroke: var(--resurgence-cyan); stroke-width: 1.5px; opacity: 0.3; }
.double-interference .wave-b { stroke: var(--spring-mineral); stroke-width: 1.5px; opacity: 0.25; animation-duration: 6s; }
.turbulent .wave-line { stroke-width: 1px; }
.turbulent .t1, .turbulent .t3 { stroke: var(--resurgence-cyan); opacity: 0.30; }
.turbulent .t2, .turbulent .t4 { stroke: var(--weathered-aqua); opacity: 0.26; animation-duration: 3.8s; }
.turbulent .t5 { stroke: var(--spring-mineral); opacity: 0.22; animation-duration: 5.8s; }
.final-wave { background: linear-gradient(to bottom, #0E1C26, #D4E8ED); }

.current-track {
  grid-column: 1 / -1;
  z-index: 3;
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 12vh 10vw 14vh;
}

.current-panel {
  flex: 0 0 min(68vw, 820px);
  min-height: 54vh;
  scroll-snap-align: center;
  padding: clamp(2rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translate3d(calc(var(--mag-x, 0px) * 0.15), calc(var(--mag-y, 0px) * 0.04), 0);
}

.current-panel:nth-child(1) { margin-left: 7vw; transform: rotate(-2.2deg); }
.current-panel:nth-child(2) { margin-top: 11vh; transform: rotate(1.2deg); }
.current-panel:nth-child(3) { margin-right: 12vw; margin-top: -5vh; transform: rotate(-1.4deg); }

.caustics {
  position: absolute;
  inset: -15%;
  z-index: 1;
  background:
    radial-gradient(ellipse at 25% 45%, rgba(212, 232, 237, 0.08), transparent 32%),
    radial-gradient(ellipse at 70% 28%, rgba(92, 196, 208, 0.06), transparent 28%),
    radial-gradient(ellipse at 58% 76%, rgba(212, 232, 237, 0.05), transparent 30%);
  animation: causticDrift 12s var(--ease-aquatic) infinite alternate;
}

.clarity-column {
  grid-column: 5 / 13;
  z-index: 3;
  padding: clamp(2.4rem, 5vw, 5.5rem);
  background: rgba(235, 243, 246, 0.05);
  transform: translate3d(calc(var(--mag-x, 0px) * -0.07), calc(var(--mag-y, 0px) * 0.04), 0);
}

.clarity-column h2 { font-size: clamp(3.5rem, 10vw, 8rem); font-weight: 300; }
.clarity-column p { color: var(--bubble-white); margin: 0 0 1.4rem; }
.clarity-column p:last-child { margin-bottom: 0; color: var(--weathered-aqua); }

.resurface-copy {
  grid-column: 2 / 16;
  z-index: 3;
  align-self: start;
  text-align: center;
  transform: translateY(calc(-34px + var(--resurface-lift, 0px)));
}

.resurface-copy h2 {
  color: var(--tidal-blue);
  transform: rotate(-1.8deg);
}

.resurface-copy > p:last-child {
  margin: 2rem auto 0;
  max-width: 38ch;
  color: var(--ocean-slate);
}

.ripple-target { overflow: hidden; }
.ripple-target::after {
  content: "";
  position: absolute;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: 16px;
  height: 16px;
  border: 1px solid rgba(92, 196, 208, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}
.ripple-target.is-rippling::after { animation: ripple 1.2s var(--ease-aquatic); }

@keyframes displayRise { to { opacity: 1; transform: rotate(-2deg) translateY(0); } }
@keyframes sentenceIn { to { opacity: 1; transform: translate(0, 0); } }
@keyframes driftIn { to { opacity: 1; transform: rotate(-4deg) translateY(8px); } }
@keyframes panelSurface { to { opacity: 1; } }
@keyframes waveFlow { to { stroke-dashoffset: -112; } }
@keyframes causticDrift { to { transform: translate3d(5vw, -3vh, 0) scale(1.08); opacity: 0.72; } }
@keyframes ripple { 0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.2); box-shadow: 0 0 0 0 rgba(92, 196, 208, 0.25), 0 0 0 0 rgba(92, 196, 208, 0.15); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(15); box-shadow: 0 0 0 14px rgba(92, 196, 208, 0), 0 0 0 28px rgba(92, 196, 208, 0); } }

@media (max-width: 768px) {
  .act { display: block; min-height: auto; padding: 18vh 1.25rem; }
  .surface { min-height: 100vh; display: grid; padding: 0 1.25rem; }
  .surface-copy, .depth-grid, .clarity-column, .resurface-copy { display: block; width: 100%; }
  .surface-line { width: auto; max-width: 30ch; margin-left: 0; margin-right: 0; text-align: left; }
  .depth-grid { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
  .observatory-panel, .reduction-panel, .glass-volume, .clarity-column { grid-column: auto; grid-row: auto; margin: 0; transform: none; }
  .glass-volume { min-height: 260px; margin-right: 0; }
  .current-track { padding: 10vh 1.25rem; gap: 1rem; }
  .current-panel { flex-basis: 82vw; min-height: 62vh; }
  .current-panel:nth-child(n) { margin: 0; transform: none; }
  .clarity-column { padding: 2rem; }
  .resurface-copy { transform: none; }
}
