figure {
    margin: 1em 0;
    padding: 0;
}
.animation-container {
    background-color: black;
    color: lightgrey;
    width: 400px;
    height: 400px;
    position: relative;
    border: 1px solid grey;
    overflow: hidden;
}
.stellar-body {
    border-radius: 50%;
    position: absolute;
}
.stars {
    height: 566px; /* 400 * sqrt(2) */
    left: -83px; /* (400 - 566) / 2 */
    position: absolute;
    top: -83px;
    transform-origin: center;
    width: 566px;
}
.stars .star {
    background-color: grey;
}
.sun {
    width: 20px;
    height: 20px;
    left: 93px;
    top: 273px;
    background-image: radial-gradient(white, white, transparent);
}
.twinkle {
    animation-name: twinkle;
    animation-duration: 0.5s;
    animation-iteration-count: 1;
    animation-timing-function: linear;
}
.atmosphere {
    width: 240px;
    height: 240px;
    left: 80px;
    top: 80px;
    background-image: radial-gradient(#4444ff, #4444ff, #4444ff, transparent, transparent);
}
.earth-night {
    background-color: darkgreen;
    width: 200px;
    height: 200px;
    left: 100px;
    top: 100px;
}
.earth-day {
    background-color: lightgreen;
    width: 200px;
    height: 200px;
    left: 100px;
    top: 100px;
    clip-path: inset(0px 100px 0px 0px);
}
.indicator {
    position: absolute;
    width: 6px;
    height: 40px;
    background-color: lightgrey;
    left: 197px;
    top: 60px;
}
.shadow {
    position: absolute;
    width: 40px;
    height: 6px;
    background-color: black;
    left: 160px;
    top: 97px;
    transform-origin: right center;
    animation-name: shadow-sweep;
    animation-duration: 20s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}
.label {
    position: absolute;
    animation-duration: 20s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}
.clock {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border: 3px solid black;
    background-color: white;
    position: absolute;
    left: 150px;
    top: 50px;
}
.clock-indicator {
    width: 10px;
    height: 10px;
    position: absolute;
    background-color: red;
    rotate: 45deg;
    left: 45px;
    top: 95px;
}
.hand-hours {
    width: 4px;
    height: 48px;
    position: absolute;
    background-color: black;
    left: 48px;
    top: 2px;
    border-radius: 2px;
    animation-name: rotation;
    animation-duration: 20s;
    animation-delay: -15s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    transform-origin: bottom;
}
@keyframes twinkle {
    from { background-color: grey }
    75% { background-color: white }
    to { background-color: grey }
}
@keyframes rotation {
    from { transform: rotate(0deg) }
    to { transform: rotate(360deg) }
}
@keyframes anti-rotation {
    from { transform: rotate(0deg) }
    to { transform: rotate(-360deg) }
}
@keyframes phases-dark-left {
    from { transform: scaleX(0); }
    75% { transform: scaleX(0); }
    to {  transform: scaleX(1); }
}
@keyframes phases-light-left {
    from { transform: scaleX(0); }
    25% { transform: scaleX(0); }
    50% { transform: scaleX(1); }
    to { transform: scaleX(1); }
}
@keyframes phases-dark-right {
    from { transform: scaleX(1); }
    25% { transform: scaleX(0); }
    to {  transform: scaleX(0);  }
}
@keyframes phases-light-right {
    from { transform: scaleX(1); }
    50% { transform: scaleX(1); }
    75% { transform: scaleX(0); }
    to {  transform: scaleX(0);  }
}
@keyframes shadow-sweep {
    from { transform: rotate(180deg) scaleX(2); opacity: 0; }
    0.5% { opacity: 1; }
    25% { transform: rotate(270deg) scaleX(0.25); opacity: 1; }
    49.5% { opacity: 1; }
    50% { transform: rotate(360deg) scaleX(2); opacity: 0; }
    to { transform: rotate(180deg) scaleX(2); opacity: 0; }
}
