/* The fish's canvas over the whole window; it ignores the pointer. */
.fish-stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* The anchor's canvas, likewise. */
.anchor-stage {
    position: fixed;
    inset: 0;
    z-index: var(--z-anchor);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Stacking places fish.js switches between (data-layer). */
.fish-stage,
.fish-stage[data-layer="behind-water"] {
    z-index: var(--z-fish-behind-water);
}

.fish-stage[data-layer="in-water"] {
    z-index: var(--z-fish-in-water);
}

.fish-stage[data-layer="front"] {
    z-index: var(--z-fish-front);
}

.fish-stage[data-layer="hooked"] {
    z-index: var(--z-fish-hooked);
}

/* "Back to top", placed by fish.js once the fish settles (is-shown). */
.fish-label {
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fish-label);
    padding: 0.3em 0.6em;
    border: 0;
    background: none;
    font-size: clamp(13px, 1.2vw, 20px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -100%);
    transition:
        opacity 0.3s ease,
        visibility 0.3s,
        scale 0.35s cubic-bezier(0.3, 1.8, 0.5, 1);
}

.fish-label.is-shown {
    opacity: 1;
    visibility: visible;
}

.fish-label:hover,
.fish-label:focus-visible {
    scale: 1.12;
}

.fish-label:active {
    scale: 0.95;
}

.fish-label:focus-visible {
    outline: 3px solid #ffd54a;
    outline-offset: 2px;
    border-radius: 999px;
}

.fish-label-arrow {
    width: 0.5em;
    height: 0.5em;
    margin: 0.25em 0.1em 0;
    border-top: 0.16em solid #fff;
    border-left: 0.16em solid #fff;
    filter: drop-shadow(0 0 0.06em #16263d) drop-shadow(0 0 0.06em #16263d) drop-shadow(0 0 0.04em #16263d);
    transform: rotate(45deg);
    animation: fish-label-nudge 1.2s ease-in-out infinite;
}

@keyframes fish-label-nudge {
    50% {
        translate: 0 -0.2em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fish-label,
    .fish-label-arrow {
        transition: none;
        animation: none;
    }
}

html.is-over-fish {
    cursor: pointer;
}

/* The splash layer: the video frame's size, moving with fg1 (data-depth 0.04). */
.hero-splash-layer {
    z-index: var(--z-splash);
}

.hero-splash {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

/* Upright phones: no anchor (layout.js). */
@media (orientation: portrait) and (max-width: 820px) {
    .anchor-stage {
        display: none;
    }
}
