/* Homepage surfer (surf-ride.js). No track is drawn: he rides his own patch of ocean. */
.surf-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 900;                       /* above sections, below the fixed header */
    --surf-w: 92px;                     /* surfer image width */
}
.surf-layer.is-gaps { --surf-w: 74px; }
.surf-rider {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}
.surf-layer.is-gaps .surf-rider { opacity: 0; transition: opacity 0.35s ease; }
.surf-layer.is-gaps .surf-rider.is-on { opacity: 1; }
/* The rider's anchor (0,0) is where the board meets the water. */
.surf-rider__inner {
    position: absolute;
    left: calc(var(--surf-w) * -0.62);  /* board centre sits over the anchor */
    bottom: 0;
    width: var(--surf-w);
    height: calc(var(--surf-w) * 0.758);
    transform-origin: 62% 100%;
}
.surf-rider__img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 6px 6px rgba(1, 40, 55, 0.18));
}
/* A soft light halo under the water so he reads on dark sections too. */
.surf-ocean { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.55)); }
.surf-ocean {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: calc(var(--surf-w) * -0.2);
    width: calc(var(--surf-w) * 1.55);
    height: calc(var(--surf-w) * 0.38);
    margin-left: calc(var(--surf-w) * -0.775 + var(--surf-w) * 0.12);
    overflow: visible;
    -webkit-mask-image: radial-gradient(ellipse 50% 70% at 50% 45%, #000 55%, transparent 100%);
    mask-image: radial-gradient(ellipse 50% 70% at 50% 45%, #000 55%, transparent 100%);
}
.surf-ocean__back { animation: surf-roll 3.2s linear infinite; opacity: 0.85; }
.surf-ocean__front { animation: surf-roll 1.7s linear infinite; }
@keyframes surf-roll { from { transform: translateX(0); } to { transform: translateX(-100px); } }

.surf-spray {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff 35%, #a9d2dc 75%);
    box-shadow: 0 0 0 1px rgba(77, 148, 168, 0.25);
    opacity: 0;
}
.surf-spray.is-on { animation: surf-spray 0.85s ease-out forwards; }
@keyframes surf-spray {
    0% { opacity: 0.95; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--drift-x), var(--drift-y)) scale(0.3); }
}
@media (prefers-reduced-motion: reduce) {
    .surf-ocean__back,
    .surf-ocean__front { animation: none; }
}
@media print { .surf-layer { display: none; } }
