/* A broad shaft through the water, with finer streaks refracted by the surface. */
.ocean-sunlight {
    --sun-x: 53%;
    --sun-y: -12%;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    contain: strict;
    background:
        radial-gradient(ellipse 32% 32% at var(--sun-x) -7%, rgba(201, 230, 207, .19), transparent 92%),
        radial-gradient(ellipse 62% 62% at 45% -15%, rgba(69, 154, 165, .16), transparent 90%);
}

.site-atmosphere > .ocean-sunlight {
    --sun-x: 76%;
    position: absolute;
    z-index: 0;
}

.ocean-sunlight::before,
.ocean-sunlight::after {
    content: "";
    position: absolute;
    inset: -2% -5% -5%;
    transform-origin: var(--sun-x) var(--sun-y);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .9) 22%, rgba(0, 0, 0, .5) 55%, transparent 98%);
}

.ocean-sunlight::before {
    background: conic-gradient(at var(--sun-x) var(--sun-y),
        transparent 185deg,
        rgba(110, 211, 210, .08) 191deg,
        rgba(180, 229, 217, .21) 195deg,
        rgba(146, 211, 201, .09) 199deg,
        rgba(198, 234, 213, .24) 203deg,
        rgba(135, 205, 200, .12) 208deg,
        rgba(118, 195, 199, .16) 214deg,
        transparent 222deg);
}

.ocean-sunlight::after {
    background: conic-gradient(at var(--sun-x) var(--sun-y),
        transparent 192deg, rgba(204, 235, 219, .18) 194deg, transparent 198deg,
        transparent 201deg, rgba(183, 226, 212, .22) 204deg, transparent 207deg,
        transparent 209deg, rgba(156, 217, 211, .13) 212deg, transparent 215deg,
        transparent 218deg, rgba(150, 214, 208, .09) 220deg, transparent 224deg);
}

@media (max-width: 700px) {
    .ocean-sunlight, .site-atmosphere > .ocean-sunlight { --sun-x: 82%; }
}

@media (prefers-reduced-motion: no-preference) {
    .ocean-sunlight::before { animation: ocean-shaft-drift 9s ease-in-out -2s infinite alternate; }
    .ocean-sunlight::after { animation: ocean-surface-refraction 6.7s ease-in-out -3s infinite alternate; }
}

body[data-motion="paused"] .ocean-sunlight::before,
body[data-motion="paused"] .ocean-sunlight::after,
body[data-ocean-paused="true"] .ocean-sunlight::before,
body[data-ocean-paused="true"] .ocean-sunlight::after,
body.menu-open .ocean-sunlight::before,
body.menu-open .ocean-sunlight::after {
    animation-play-state: paused;
}

@keyframes ocean-shaft-drift {
    from { transform: rotate(-4deg) scaleX(.94); opacity: .78; }
    to { transform: rotate(4deg) scaleX(1.05); opacity: 1; }
}

@keyframes ocean-surface-refraction {
    from { transform: translateX(-1.6%) rotate(2deg) scaleX(.89); opacity: .5; }
    to { transform: translateX(1.2%) rotate(-3deg) scaleX(1.08); opacity: .95; }
}
