/* Meereshintergrund: Wasser, Lichtstrahlen, Riff in drei Ebenen, Fische und Kaustik.
   Die Ebenen baut ocean.js; diese Datei nutzen Startseite und Inhaltsseiten gemeinsam. */
html { background: #072E47; }

.layer { position: fixed; pointer-events: none; }

.sea { inset: 0; background: linear-gradient(180deg, #2A86A8 0%, #15628A 34%, #0B4467 68%, #072E47 100%); }

/* Lichtstrahlen von der Wasseroberfläche */
.rays { inset: 0; overflow: hidden; }
.rays span {
  position: absolute;
  top: -15%;
  height: 85%;
  background: linear-gradient(to bottom, rgba(215, 246, 255, .2), rgba(215, 246, 255, 0) 85%);
  filter: blur(10px);
  transform: skewX(-12deg);
  animation: ray ease-in-out infinite alternate;
}
.rays span:nth-child(1) { left: 12%; width: 9vw;  animation-duration: 11s; }
.rays span:nth-child(2) { left: 34%; width: 14vw; animation-duration: 14s; animation-delay: -4s; }
.rays span:nth-child(3) { left: 58%; width: 7vw;  animation-duration: 9s;  animation-delay: -7s; }
.rays span:nth-child(4) { left: 76%; width: 12vw; animation-duration: 13s; animation-delay: -2s; }
@keyframes ray {
  from { opacity: .2;  transform: skewX(-12deg) translateX(-1.5vw); }
  to   { opacity: .85; transform: skewX(-9deg)  translateX(1.5vw); }
}

.reef { left: 0; bottom: 0; width: 100%; height: 58vh; }
.coral path { fill: none; stroke-linecap: round; }

/* Tiefenstaffelung: Fische schwimmen zwischen den Riff-Ebenen.
   Lücke bei 5 für den Schriftzug der Startseite, ab 10 liegt der Seiteninhalt. */
.sea           { z-index: -1; }
.rays          { z-index: 0; }
.fish-layer.d0 { z-index: 1; }
.reef-back     { z-index: 2; }
.fish-layer.d1 { z-index: 3; }
.reef-mid      { z-index: 4; }
.fish-layer.d2 { z-index: 6; }
.reef-front    { z-index: 7; }
.caustics      { z-index: 8; }
.fish-layer.d3 { z-index: 9; }

.fish-layer { inset: 0; overflow: hidden; }
.fish {
  position: absolute;
  left: 0;
  top: 0;
  height: auto;
  will-change: transform;
  animation: fish-in 1.2s ease-out both;
}
/* Je weiter hinten, desto blasser und unschärfer – wie im trüben Wasser */
.d0 .fish { opacity: .38; filter: blur(1.5px) saturate(.45); }
.d1 .fish { opacity: .62; filter: blur(.6px) saturate(.7); }
.d2 .fish { opacity: .9; }
.d3 .fish { filter: drop-shadow(0 .4rem 1rem rgba(4, 30, 48, .45)); }
.fish.gone { opacity: 0; transition: opacity 1.5s; }
@keyframes fish-in { from { opacity: 0; } }

.bubble {
  position: absolute;
  left: 0;
  top: 0;
  border: 1.5px solid rgba(220, 250, 255, .7);
  border-radius: 50%;
  animation: bubble 3.6s ease-in forwards;
}
@keyframes bubble {
  from { transform: translate(var(--x), var(--y)); }
  to   { transform: translate(calc(var(--x) + var(--dx)), calc(var(--y) - 9rem)); opacity: 0; }
}

/* Flimmerndes Licht (Kaustik) über Wasser und Korallen */
.caustics {
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: .42;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,.25) 45%, rgba(0,0,0,.9));
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,.25) 45%, rgba(0,0,0,.9));
}

@media (prefers-reduced-motion: reduce) {
  .rays span { animation: none; }
}
