html, body {
    height: 100%;
    margin: 0;
}

@keyframes square1 {
    0% {right: 300px; top: 200px;}
    100% {right: 300px; top: 250px;}

}

@keyframes square2 {
    0% {left: 200px; bottom: 200px;}
    100% {left: 200px; bottom: 250px;}

}

div.square1 {
    --playstate: running;
    --size: 100px;
    border-radius: 5px;
    position: fixed;
    width: var(--size);
    background-color: white;
    aspect-ratio: 1;
    animation-name: square1;
    animation-play-state: var(--playstate);
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

div.square2 {
    --playstate: running;
    --size: 100px;
    border-radius: 5%;
    position: fixed;
    width: var(--size);
    background-color: white;
    aspect-ratio: 1;
    animation-name: square2;
    animation-play-state: var(--playstate);
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    overflow: hidden;

    /* Base gradient layer: background -> purple -> background */
    --bg: #0b0b12; /* fallback background color */
    background: linear-gradient(135deg, var(--bg) 0%, rgba(128, 90, 213, 0.2) 50%, var(--bg) 100%);
}

/* Animated gradient overlay using ::before */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.2) 0%,   /* primary-ish */
        rgba(168, 85, 247, 0.1) 50%,  /* secondary-ish */
        rgba(16, 185, 129, 0.2) 100%  /* accent-ish */
    );
    background-size: 200% 200%;
    animation: gradient-shift 8s linear infinite;
}

h1 {
    font-size: 80px;
    text-align: center;
    margin: 0;
    color: var(--color, #000);
    transition: color 400ms linear;
    position: relative; /* stay above overlay */
    z-index: 1;
}

@keyframes gradient-shift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}
