/**
 * Water-surface overlay when circular nav is fully hidden (serenity state).
 */
.soulfy-water-serenity {
    position: fixed;
    inset: 0;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* Above page panels (1041) so ripples are actually seen */
body.water-serenity-active .soulfy-water-serenity {
    opacity: 1;
    visibility: visible;
    z-index: 1050;
}

/* Glassy water veil */
.soulfy-water-surface {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 120% 80% at 50% 15%, rgba(255, 255, 255, 0.2) 0%, transparent 55%),
        linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(140, 200, 225, 0.16) 40%,
            rgba(70, 140, 180, 0.12) 100%
        );
    backdrop-filter: blur(1px) saturate(1.2);
    -webkit-backdrop-filter: blur(1px) saturate(1.2);
}

.soulfy-water-surface::before {
    content: "";
    position: absolute;
    inset: -30%;
    background: linear-gradient(
        100deg,
        transparent 40%,
        rgba(255, 255, 255, 0.04) 48%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.04) 52%,
        transparent 60%
    );
    animation: soulfy-water-shimmer 12s ease-in-out infinite;
}

@keyframes soulfy-water-shimmer {
    0%, 100% {
        transform: translate(-10%, 0);
    }
    50% {
        transform: translate(10%, 1%);
    }
}

/* Ripples sit above the glass surface */
.soulfy-water-ripples-field {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: visible;
}

.soulfy-water-ripple-site {
    position: absolute;
    width: 0;
    height: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.soulfy-water-ripple {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.65);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(180, 220, 245, 0.18) 40%,
        rgba(80, 150, 190, 0.08) 65%,
        transparent 72%
    );
    box-shadow:
        0 0 0 1px rgba(60, 130, 170, 0.35),
        0 0 24px rgba(140, 200, 255, 0.45),
        inset 0 0 18px rgba(255, 255, 255, 0.25);
    opacity: 0;
    animation-name: soulfy-water-pulse;
    animation-duration: 4.5s;
    animation-timing-function: ease-out;
    animation-iteration-count: infinite;
    animation-fill-mode: backwards;
    will-change: transform, opacity;
}

.soulfy-water-ripple--alt {
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.4);
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 70%
    );
}

@keyframes soulfy-water-pulse {
    0% {
        transform: scale(0.35);
        opacity: 0.85;
    }
    55% {
        transform: scale(2.2);
        opacity: 0.35;
    }
    100% {
        transform: scale(4.5);
        opacity: 0;
    }
}

.soulfy-water-ripple-burst {
    position: absolute;
    z-index: 3;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    box-shadow: 0 0 32px rgba(150, 210, 255, 0.55);
    pointer-events: none;
    animation: soulfy-water-burst 1.2s ease-out forwards;
}

@keyframes soulfy-water-burst {
    0% {
        transform: scale(0.35);
        opacity: 0.9;
    }
    100% {
        transform: scale(5);
        opacity: 0;
    }
}

/* Logo click target stays above the water layer */
body.water-serenity-active .selector.profile-hidden {
    z-index: 1060;
}

.selector.profile-hidden #profile_image {
    z-index: 1061;
}

@media (prefers-reduced-motion: reduce) {
    .soulfy-water-surface::before {
        animation-duration: 24s;
    }

    .soulfy-water-ripples-field .soulfy-water-ripple {
        animation-duration: 8s;
    }
}
