:root {
    /* color variables */
    --black: #1D201F;
    --white: #fff;
    --offwhite: #d2d2d2;
    --light-gray: #f2f2f2;
    --dark-gray: #333;
    --gray: #5a5a5a;
    --red: #cd5242;
    --blue: #0000ff;
    --yellow: #ffff00;
    --green: #8eb38e;
    --purple: #915691;

    /* breakpoints */
    --desktop: 1024px;
    --tablet: 768px;
    --mobile: 480px;

    /* easing */
    --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

/* basic button animation */

.animated-button {
    transition: 0.4s var(--ease-in-out);
}
.animated-button:hover {
    transform: scale(1.03);
}
.animated-button:active {
    transform: scale(0.97);
}

body {
    margin: 0 auto;
    box-sizing: border-box;
    background-color: var(--dark-gray);
    overflow-x: hidden;
    * {
        font-family: 'Satoshi', sans-serif;
        color: var(--black);
        box-sizing: border-box;
        font-size: 18px;
        -webkit-tap-highlight-color: transparent;
        @media (max-width: 480px) {
            font-size: 16px;
        }
    }
}

main {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

/* Loader */

@keyframes show-img {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes shrink-img {
    from {
        width: 150px;
        height: 150px;
    }
    to {
        width: 40px;
        height: 40px;
        opacity: 0;
        pointer-events: none;
    }
}

@keyframes move-bg {
    from {
        top: 0;
    }
    to {
        top: -100vh;
        pointer-events: none;
    }
}

@keyframes move-img {
  0% {
    transform: translate(0, 0);
  }
  30% {
    transform: translate(0, -20px) rotate(6deg);
  }
  65% {
    transform: translate(0, 10px) rotate(-3deg);
  }
  100% {
    transform: translate(0, 0)
  }
}

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    .loader-bg {
        position: absolute;
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        background-color: var(--dark-gray);
        animation: move-bg 1s var(--ease-out) 2.8s forwards;
    }
    .loader-image {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        img {
            width: 150px;
            height: 150px;
            opacity: 0;
            border-radius: 100%;
            background-color: var(--white);
            animation: show-img 0.4s var(--ease-in-out) 0.4s forwards, shrink-img 0.6s var(--ease-in-out) 2s forwards, move-img 1.2s var(--ease-out) 0.5s forwards;
        }
    }
}
#loader.aos-animate {
    pointer-events: none;
}

/* Background Grid */

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(100vw + 90px);
    height: calc(100vh + 90px);
    display: grid;
    grid-template-columns: repeat(auto-fill, 30px);
    grid-template-rows: repeat(auto-fill, 30px);
    z-index: -1; /* behind all content */
    background-color: var(--light-gray);
}

.grid-bg::before {
    content: "";
    display: contents;
}

.grid-bg > * {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05); /* subtle grid */
    box-sizing: border-box;
}

/* Linktree */

.linktree {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 460px;
}

.avatar {
    position: relative;
    img {
        width: 140px;
        height: 140px;
        object-fit: cover;
        border-radius: 100%;
        border: 2px solid var(--black);
        background-color: var(--green);
        cursor: pointer;
        user-select: none;
        -webkit-user-drag: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
    @media (max-width: 480px) {
        img {
            width: 120px;
            height: 120px;
        }
    }
}

/* hidden after the poof, restored later by JS */
.avatar img.poofed {
    opacity: 0;
    pointer-events: none;
}

.poof-burst {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.poof-particle {
    position: absolute;
    left: 0;
    top: 0;
    width: 14px;
    height: 14px;
    border-radius: 100%;
    border: 2px solid var(--black);
}

.poof-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140px;
    height: 140px;
    border-radius: 100%;
    border: 4px solid var(--black);
    pointer-events: none;
    opacity: 0;
}

@media (max-width: 480px) {
    .poof-ring {
        width: 120px;
        height: 120px;
    }
}

.name {
    font-size: 2rem;
    margin: 24px 0 8px;
    text-align: center;
}

.bio {
    margin: 0 0 32px;
    color: var(--gray);
    text-align: center;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 20px;
    background: var(--light-gray);
    border: 2px solid var(--black);
    border-radius: 12px;
    box-shadow: 0 4px 0 var(--black);
    text-decoration: none;
    cursor: pointer;
    i {
        font-size: 22px;
        width: 26px;
        text-align: center;
        color: var(--black);
    }
    span {
        font-weight: 600;
    }
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--black);
}

.link-card:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--black);
}

.email-row {
    display: flex;
    gap: 10px;
    width: 100%;
    .link-card {
        flex: 1;
    }
}

.copy-email {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 16px;
    background: var(--light-gray);
    border: 2px solid var(--black);
    border-radius: 12px;
    box-shadow: 0 4px 0 var(--black);
    cursor: pointer;
    font: inherit;
    .copy-icons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        height: 22px;
        overflow: hidden;
    }
    i {
        flex: 0 0 auto;
        height: 22px;
        font-size: 22px;
        line-height: 22px;
        width: 26px;
        text-align: center;
        color: var(--black);
        transition: transform 0.4s var(--ease-in-out);
    }
    &:hover, &:active {
        transform: unset !important;
        box-shadow: 0 4px 0 var(--black) !important;
    }
}

.copy-email.copied i {
    transform: translateY(-32px);
}

.copy-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--black);
}

.copy-email:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--black);
}

.copy-email.copied {
    background: var(--green);
}

.link-divider {
    width: 100%;
    height: 2px;
    margin: 14px 0;
    background-color: var(--black);
    position: relative;
}

.link-divider::after {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        content: '';
        height: 5px;
        aspect-ratio: 1;
        background: black;
        border-radius: 100%;
        border: 5px solid var(--light-gray);
    }
