varying vec2 vUv;
uniform float uTime;
uniform vec3 uOuterColor;

void main() {
    // UV mapping like fragCoord
    vec2 uv = vUv;
    vec2 p = uv * 2.0 - 1.0;
    float t = uTime * 0.3;

    // Flow direction and movement
    vec2 flowDir = normalize(vec2(-0.7, -1.0));
    float flowSpeed = 2.0;
    float flow = dot(p, flowDir) * flowSpeed + t;

    // Ripples
    float rippleX = sin(p.x * 12.0 + t * 1.5) * cos(p.y * 8.0 + t * 2.0) * 0.3;
    float rippleY = cos(p.y * 10.0 - t * 1.2) * sin(p.x * 7.0 + t * 0.8) * 0.4;
    float distort = rippleX + rippleY;

    // Gradient to drive stripes
    float gradient = fract(flow + distort * 0.5);

    // Smooth liquid band
    float band = smoothstep(0.2, 0.6, gradient) - smoothstep(0.6, 0.9, gradient);

    // Darker zone color
    vec3 darkColor = uOuterColor * 0.4;

    // Mix between dark and bright zone color
    vec3 col = mix(darkColor, uOuterColor, band);

    // Vertical fade
    float verticalFade = 1.0 - vUv.y;

    gl_FragColor = vec4(col * verticalFade, verticalFade);
}
