.home-pool {
  position: relative;
  z-index: 2;
}

.home-pool .pool-desktop {
  --pool-height: clamp(26rem, 70vh, 62rem);
  position: relative;
  display: none;
  height: var(--pool-height);
  overflow: hidden;
  isolation: isolate;
  background: #108d92 url("./pool.webp") center / cover no-repeat;
}

@supports (height: 1svh) {
  .home-pool .pool-desktop {
    --pool-height: clamp(26rem, 70svh, 62rem);
  }
}

.home-pool .pool-stage {
  position: relative;
  width: min(100%, var(--pool-height) * 16 / 9);
  aspect-ratio: 16 / 9;
}

.home-pool :is(.pool-water, .pool-canvas, .pool-posters, .pool-links) {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-pool .pool-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.home-pool :is(.pool-shadow, .pool-ripple, .pool-poster, .pool-link) {
  position: absolute;
  translate: -50% -50%;
}

.home-pool .pool-shadow {
  background: radial-gradient(ellipse, rgba(9,51,62,.51) 0%, rgba(9,64,72,.34) 39%, rgba(9,65,73,.13) 62%, transparent 73%);
  mix-blend-mode: multiply;
}

.home-pool .pool-ripple {
  border-radius: 50%;
  background: radial-gradient(ellipse, transparent 52%, rgba(226,255,245,.44) 60%, transparent 63%, rgba(5,93,101,.29) 66%, transparent 69%, rgba(237,255,247,.29) 73%, transparent 77%);
  mix-blend-mode: screen;
}

.home-pool .pool-poster {
  display: block;
  object-fit: contain;
}
.home-pool .pool-poster:not([src]) { visibility: hidden; }

/* Match the service viewers: fade the full-colour image over a rendered canvas. */
.home-pool [data-renderer="webgl"] .pool-posters {
  transition: opacity 400ms ease;
}
.home-pool [data-renderer="webgl"] .pool-posters { opacity: 0; }

.home-pool .pool-link {
  border-radius: 50%;
  pointer-events: auto;
  color: #fff;
  text-decoration: none;
  outline-offset: 2px;
}

.home-pool .pool-link:focus-visible {
  outline: 3px solid var(--citron);
}

.home-pool .pool-link::after {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  box-shadow: 0 0 20px 4px #e5ff393b;
  opacity: 0;
  transition: opacity 180ms ease;
}

.home-pool .pool-service-name {
  position: absolute;
  z-index: 1;
  top: calc(100% + 2px);
  left: 50%;
  translate: clamp(calc(0px - var(--label-left, 50vw)), -50%, calc(var(--label-right, 50vw) - 100%)) 0;
  padding: 9px 15px;
  border-radius: 8px;
  background: #147fa3;
  color: #fff;
  box-shadow: 0 2px 8px rgb(9 51 62 / 24%);
  font: 600 1rem / 1.2 Outfit, system-ui, sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.home-pool .pool-link[data-label-above] .pool-service-name {
  top: auto;
  bottom: calc(100% + 2px);
}

/* Only the animal's outline receives pointer events as two floats meet. */
.home-pool .pool-link[data-shaped-target] { pointer-events: none; }
.home-pool .pool-hit {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  pointer-events: auto;
}
.home-pool .pool-link:is(:hover, :focus-visible)::after,
.home-pool .pool-link:is(:hover, :focus-visible) .pool-service-name { opacity: 1; }

.home-pool .pool-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-pool .pool-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 1.5rem 0;
  margin-block: 0;
  list-style: none;
}

.home-pool .pool-gallery a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 11px;
  border-radius: 8px;
  background: #44363e;
  color: var(--citron);
  text-decoration: none;
}

.home-pool .pool-gallery a:is(:hover, :focus-visible) {
  background: #514049;
  outline: 2px solid var(--citron);
  outline-offset: 3px;
}

.home-pool .pool-gallery img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
}

.home-pool .pool-gallery span {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 9px 3px 5px;
  font-size: clamp(1rem, 3.6vw, 1.1rem);
  line-height: 1.15;
  font-weight: 500;
}

@media (min-width: 801px) and (any-hover: hover) and (any-pointer: fine) {
  .home-pool {
    padding-block-start: clamp(60px, 5.6vw, 96px);
    background: #382d33;
  }
  .home-pool .pool-desktop {
    display: grid;
    place-items: center;
  }
  .home-pool:not([data-pool-failed]) .pool-gallery { display: none; }
  .home-pool[data-pool-failed] .pool-desktop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-pool [data-renderer="webgl"] .pool-posters,
  .home-pool .pool-service-name,
  .home-pool .pool-link::after { transition: none; }
}
