.toggle {
    background-color: #1e1e1e;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 0 30px 8px rgba(0, 0, 0, 0.15);
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.light-mode .toggle {
    background-color: #f1f5f9;
    border-color: rgba(203, 213, 225, 0.5);
    box-shadow: 0 0 20px 5px rgba(0, 0, 0, 0.06);
}

.input {
    display: none;
}

.icon {
    grid-column: 1 / 1;
    grid-row: 1 / 1;
    transition: transform 500ms;
    line-height: 0.1;
}

.icon--moon {
    transition-delay: 200ms;
}

.icon--sun {
    transform: scale(0);
}

#switch:checked+.icon--moon {
    transform: rotate(360deg) scale(0);
}

#switch:checked~.icon--sun {
    transition-delay: 200ms;
    transform: scale(1) rotate(360deg);
}