@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    font-family: 'Montserrat', sans-serif;
    --ink: #f4f7ff;
    --ink-dim: #b9c4ee;
    --glass: rgb(255 255 255 / 0.12);
    --glass-edge: rgb(255 255 255 / 0.28);
    --accent: #ffd166;
    --accent-2: #ff6b9d;
    --glass-hover: rgb(255 255 255 / 0.1);
    --glass-blur: blur(1em);
    --backdrop: linear-gradient(170deg, #1a1a1a, #4a4a4a 55%, #2b2b2b);
    --shadow: 0 0.6em 2.5em rgb(10 5 60 / 0.3);
    --width: 45em;
    --round: 24px;
}

body {
    min-height: 100vh;
    padding: 2em 1em;

    color: var(--ink);
    background-image: var(--backdrop);
    background-attachment: fixed;

    > :first-child {
        margin-block-start: 0;
    }

    > p {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75em;
        align-items: center;
        max-width: var(--width);
        margin-inline: auto;
        padding: 1em 1.25em;

        background-color: var(--glass);
        border: 1px solid var(--glass-edge);
        border-radius: 100vw;
        backdrop-filter: var(--glass-blur);
        box-shadow: 0 0.6em 2.5em rgb(10 5 60 / 0.35);

        @media (max-width: 30em) {
            border-radius: 1.75em;
        }

        label {
            font-size: 0.75em;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--ink-dim);
        }

        input {
            flex: 1;
            min-width: 6em;
            padding: 0.7em 1.1em;

            font: inherit;
            font-weight: 600;
            letter-spacing: 0.2em;
            color: var(--ink);

            background-color: var(--glass-hover);
            border: 1px solid transparent;
            border-radius: 100vw;
            transition: border-color 0.2s, box-shadow 0.2s;

            &:focus {
                border-color: var(--accent);
                box-shadow: 0 0 0 0.25em rgb(255 209 102 / 0.25);
            }
        }

        button {
            padding: 0.7em 1.6em;

            font: inherit;
            font-weight: 700;
            color: #2a1363;

            background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
            border: none;
            border-radius: 100vw;
            box-shadow: 0 0.4em 1.1em rgb(255 107 157 / 0.45);
            transition: transform 0.15s, box-shadow 0.15s;

            &:hover {
                transform: translateY(-0.15em) scale(1.04);
                box-shadow: 0 0.6em 1.6em rgb(255 107 157 / 0.6);
            }

            &:active {
                transform: scale(0.97);
            }
        }
    }
}

#forecast {
    display: grid;
    gap: 1.25em;
    max-width: var(--width);
    margin-inline: auto;

    > * {
        @supports (animation-delay: calc(sibling-index() * 1s)) {
            animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
            animation-delay: calc((sibling-index() - 1) / sibling-count() * 0.4s);
        }
    }

    h1 {
        margin-block: 0;
        text-align: center;

        background-image: linear-gradient(90deg, #fff, var(--accent) 60%, var(--accent-2));
        background-clip: text;
        color: transparent;
    }

    ul {
        margin-block: 0;
        padding: 0.5em 1.5em 0.5em 5em;

        background-color: var(--glass);
        border: 1px solid var(--glass-edge);
        border-radius: 1.5em;
        backdrop-filter: var(--glass-blur);
        box-shadow: var(--shadow);

        @media (max-width: 30em) {
            padding-left: 4.5em;
        }

        li {
            position: relative;
            padding-block: 0.9em;
            font-size: 1.25em;
            font-weight: 600;

            &::marker {
                content: "";
            }

            &::before {
                content: '';

                position: absolute;
                right: calc(100% + 0.4em);
                top: 50%;

                height: 3.2em;
                aspect-ratio: 1;

                background-size: cover;
                background-position: center;
                background-repeat: no-repeat;

                filter: drop-shadow(0 0.2em 0.4em rgb(0 0 0 / 0.4));
                translate: 0 -50%;
                animation: bob 3s ease-in-out infinite;
            }
        }
    }

    table {
        display: grid;
        border: 1px solid var(--glass-edge);
        border-width: 0;
        border-spacing: 0;

        caption {
            padding: 0.6em;
            font-size: 0.8em;
            font-weight: 800;
            letter-spacing: 0.25em;
            text-transform: uppercase;
            color: var(--accent);
        }

        > :not(caption) {
            display: table;
            width: 100%;
            table-layout: fixed;
            background-color: var(--glass);
            backdrop-filter: var(--glass-blur);
            box-shadow: var(--shadow);
            overflow: clip;

            &:not(:last-child) {
                border-radius: var(--round) var(--round) 0 0;

                tr:first-child {
                    border-radius: inherit;

                    > :first-child {
                        border-top-left-radius: inherit;
                        border-bottom-left-radius: inherit;
                    }

                    > :last-child {
                        border-top-right-radius: inherit;
                        border-bottom-right-radius: inherit;
                    }
                }
            }

            &:last-child {
                border-radius: 0 0 var(--round) var(--round);

                tr:last-child {
                    border-radius: inherit;

                    > :first-child {
                        border-top-left-radius: inherit;
                        border-bottom-left-radius: inherit;
                    }

                    > :last-child {
                        border-top-right-radius: inherit;
                        border-bottom-right-radius: inherit;
                    }
                }
            }

            th, td {
                padding: 0.6em 0.75em;
            }

            th {
                font-size: 0.65em;
                letter-spacing: 0.12em;
                text-transform: uppercase;
                color: var(--ink-dim);
            }

            td {
                font-size: 1.4em;
                font-weight: 800;
                text-align: center;
                transition: background-color 0.2s;

                &:hover {
                    background-color: var(--glass-hover);
                }
            }
        }
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(1.5em);
    }
}

@keyframes bob {
    50% {
        translate: 0 -60%;
    }
}
