:root {
    background-image: linear-gradient(to bottom, rgb(10, 10, 10), rgb(15, 15, 15));
    background-attachment: fixed;
    color: white;
    font-family: "Josefin Sans", Arial, Helvetica, sans-serif;
    color-scheme: dark;
    scroll-behavior: smooth;
    --simple-background: url("thumbnail.webp");
    --dots-background: var(--simple-background),
    radial-gradient(circle, black 1%, transparent 2%),
    radial-gradient(circle, rgb(163, 163, 163) 0%, transparent 1%),
    radial-gradient(circle, white 0%, transparent 1%),
    radial-gradient(circle, rgb(128, 0, 128) 0%, transparent 1%);
}

body {
    --current-background: var(--simple-background);
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 1.5em;
    line-height: 1.3;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: var(--current-background);
    background-repeat: no-repeat, repeat, repeat, repeat, repeat;
    background-size: 100% auto, 10rem 40rem, 10rem 40rem, 10rem 40rem, 10rem 40rem;
    background-position-y: 0, 0, 10rem, 20rem, 30rem;
    background-attachment: scroll, fixed, fixed, fixed, fixed;
    animation: background 60s linear infinite;
    opacity: 0.3;
}

body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-attachment: fixed;
    background-size: 50% 50%;
}

main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 1rem;
    gap: 10rem;
}

h2 {
    margin-bottom: 0.5em;
}

a {
    color: rgb(50, 150, 255);
}

a:visited {
    color: rgb(150, 100, 255);
}

#greeting {
    margin-top: 10rem;
}

#toolsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1rem;
    margin: 0 10rem;
}

.gray {
    color: rgb(150, 150, 150);
    font-size: 0.8em;
}

.card {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 0.5rem;
    display: grid;
    grid-template-rows: auto 1fr auto;
    place-items: center;
    gap: 1rem;
}

.card h3 {
    margin: 0.5em 0;
}

.card p {
    margin: 0;
}

.arrow-right {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 0.3em solid transparent;
    border-bottom: 0.3em solid transparent;
    border-left: 0.5em solid currentColor;
}

#socials {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#socialsContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.social-card {
    background-color: black;
    padding: 1rem;
    border-radius: 0.5rem;
    display: grid;
    grid-template-rows: 1fr auto;
    place-items: center;
}

.social-card h3 {
    margin-bottom: 0;
}

.social-banner {
    position: relative;
    transition: transform 0.2s;
}

.social-card:hover .social-banner {
    transform: translateY(-0.5rem);
}

.social-banner__brand {
    position: absolute;
    right: 0;
    bottom: 0;
}

.hover-background {
    position: relative;
    white-space: nowrap;
}

a.hover-background::before, .social-card .hover-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% + 0.75rem);
    height: calc(100% + 0.75rem);
    transform: translate(-0.375rem, -0.375rem);
    background-color: rgb(100, 100, 100);
    border-radius: 0.5rem;
    transition: opacity 0.2s;
    opacity: 0;
}

a.hover-background:hover::before, .social-card:hover .hover-background::before {
    opacity: 0.3;
}

.horizontal-margin {
    margin: 0 10%;
}

#boopContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    animation: rainbow 10s linear infinite;
    font-weight: bold;
}

#boopDisplay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 1.5em;
}

#boop {
    transition: transform 50ms;
    user-select: none;
}

#boop.boop:active {
    transform: scale(0.95);
}

.ace-logo {
    background-image: linear-gradient(to bottom, black 25%, rgb(163, 163, 163) 25.1%, rgb(163, 163, 163) 50%, white 50.1%, white 75%, rgb(128, 0, 128) 75.1%);
    display: inline-block;
    width: 1.5em;
    height: 1em;
    transform: translateY(0.15em);
}

#footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

#animatedBackground {
    position: relative;
    font-size: 1rem;
    display: grid;
    align-items: center;
    grid-template-columns: repeat(3, 1.5em);
    border: none;
    border-radius: 0.5rem;
    padding: 0 0 0.3em;
    --offset: 0;
    --color: black;
}

#animatedBackground::after {
    content: "";
    position: absolute;
    width: 1.5em;
    height: 100%;
    background-color: var(--color);
    border-radius: 0.5rem;
    animation: background 60s linear infinite;
    opacity: 0.3;
    transform: translateX(calc(1.5em * var(--offset)));
    pointer-events: none;
}

@media (max-width: 768px) {
    #greeting {
        margin-top: 2rem;
    }

    h1, #toolsGrid, .horizontal-margin {
        margin: 0;
    }

    main {
        gap: 5rem;
    }
}

@supports (max-width: calc(1px + 1rem)) {
    @media (max-width: calc(calc(128px + 4rem) * 3 + 2rem)) {
        #socialsContainer {
            grid-template-columns: unset;
            grid-template-rows: repeat(auto-fit, 1fr);
        }
    }
}

@supports (not (max-width: calc(1px + 1rem))) {
    @media (max-width: 650px) {
        #socialsContainer {
            grid-template-columns: unset;
            grid-template-rows: repeat(auto-fit, 1fr);
        }
    }
}

@media (pointer: fine) {
    body {
        --current-background: var(--dots-background);
        --preferred-high-res-background: true;
    }
}

@media (prefers-reduced-motion: reduce) {
    body {
        --current-background: var(--simple-background);
        --preferred-high-res-background: false;
    }
}

@keyframes rainbow {
    0% {
        color: hsl(0, 100%, 50%);
    }
    16% {
        color: hsl(60, 100%, 50%);
    }
    33% {
        color: hsl(120, 100%, 50%);
    }
    50% {
        color: hsl(180, 100%, 50%);
    }
    66% {
        color: hsl(240, 100%, 80%);
    }
    83% {
        color: hsl(300, 100%, 60%);
    }
    100% {
        color: hsl(360, 100%, 50%);
    }
}

@keyframes background {
    0% {
        background-position-x: 0, 0, 10rem, 20rem, 30rem;
    }
    50% {
        background-position-y: 0, 5rem, 15rem, 25rem, 35rem;
    }
    100% {
        background-position-x: 0, 40rem, 50rem, 60rem, 70rem;
    }
}
