header {
    --header-height: 3rem;
    position: fixed;
    display: flex;
    top: 0;
    left: 0;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: var(--header-height);
    padding: 0.5rem 1rem;
    translate: 0 -100%;
    z-index: 1000;
    backdrop-filter: blur(16px);
    transition: translate var(--time-m) ease-in-out;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--header-bg);
        opacity: .9;
        transition: background-color var(--time-m) ease;
        z-index: -1;
    }

    & .logo {
        height: 100%;
        padding: 0.25rem;

        & path {
            fill: var(--name-path-color);
            transition: fill var(--time-m) ease;
        }
    }
}

section {
    display: flex;
    justify-content: center;
    contain: content;
    padding: 2rem 1rem;
}

.hero {
    background-color: var(--hero-bg);
    min-height: 100vh !important;
    padding-bottom: 0.5rem;
    transition: background-color var(--time-m) ease;

    & .container {
        padding: 4rem 0;
        display: grid;
        place-items: center;
    }

    & h1,
    p {
        width: 100%;
    }

    & .name {
        display: block;
        padding: 0.25rem 0;
        max-width: 20rem;
        line-height: 0rem;

        & path {
            fill: var(--name-path-color);
            stroke: var(--name-path-color);
            stroke-width: 2;

            @media (prefers-reduced-motion: none) {
                fill-opacity: 0;
                stroke-dasharray: 1000;
                stroke-dashoffset: 1000;
                transition: stroke var(--time-m) ease,
                    fill var(--time-m) ease;
                animation: drawName 750ms 250ms ease forwards;
            }

            @media (prefers-reduced-motion: reduce) {
                fill-opacity: 1;
                stroke-dasharray: 0;
                stroke-dashoffset: 0;
                animation: none;
            }
        }
    }
}

.container {
    position: relative;
    width: 100%;
    max-width: 80ch;
    transition: opacity var(--time-l) ease,
        transform var(--time-l) ease;

    @starting-style {
        opacity: 0;
        transform: translateY(16px);
    }
}

.section__title {
    text-align: center;
}

.pill {
    display: flex;
    padding: 0.75rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    color: var(--pill-color);
    border-radius: 999px;
    background-color: var(--pill-bg);
    box-shadow: var(--shadow-1);
    transition: background-color var(--time-m) ease;

    & .icon {
        aspect-ratio: 1/1;
        width: 1em;
        height: 1em;
    }
}

.pill--s {
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    font-size: 1rem;
    background-color: var(--tinted);

    & .icon {
        width: 100%;
        height: 100%;
    }
}

.card {
    display: block;
    width: min(520px, 100%);
    padding: 2rem 3rem;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-radius: 48px;
    box-shadow: var(--shadow-1);
    transition: background-color var(--time-m) ease;

    & a:has(.icon) {
        display: flex;
        transition: color var(--time-m) ease,
            transform var(--time-s) ease;

        & .icon {
            height: 44px;
            width: 44px;
            aspect-ratio: 1/1;
            fill: currentColor;
        }
    }
}

.card__item {
    width: 100%;
    padding: 1.5rem 2rem;
    background-color: var(--item-bg);
    border-radius: 32px;
    transition: background-color var(--time-m) ease;

    &:has(.icon--doc) {
        padding-bottom: 1rem;
    }

    & a:has(.icon--doc) {
        display: flex;
        padding: 0.75rem;
        margin-left: 1rem;
        background-color: currentColor;
        border-radius: 999px;
        transition: color var(--time-m) ease,
            transform var(--time-s) ease;

        & .icon--doc {
            height: 20px;
            width: 20px;
            aspect-ratio: 1/1;
            fill: var(--icon);
        }
    }
}

footer {
    background-color: var(--footer-bg);
    transition: background-color var(--time-m) ease;
}

.contact-menu {
    position: relative;
    padding: 0 1rem 1rem;

    & li {
        display: flex;
        width: 3rem;
        height: 3rem;

        & a {
            display: block;
            padding: 0.5rem;
            background-color: currentColor;
            border-radius: 999px;

            & .icon {
                width: 100%;
                height: 100%;
                aspect-ratio: 1/1;
                transition: stroke var(--time-m) ease,
                    fill var(--time-m) ease;

                &:is(.linkedin, .codepen) {
                    fill: var(--icon);
                    stroke-width: 0;
                }

                &:is(.email, .github) {
                    stroke: var(--icon);
                }
            }
        }
    }
}

/* tooltip */
[class*='tooltip'] {
    position: relative;

    &:not([data-clicked]) {
        @media (hover: hover) {
            &:is(:hover, :focus-visible)::after {
                /* default: tooltip-top */
                --translatex: -50%;
                --translatey: -100%;
                content: attr(data-title) / "";
                position: absolute;
                top: -1.25rem;
                left: 50%;
                transform: translateY(-100%) translateX(var(--translatex)) scale(1);
                padding: 1rem;
                line-height: 1.2;
                font-size: 0.9rem;
                font-weight: 500;
                text-align: center;
                color: var(--tooltip-color);
                background-color: var(--tooltip-bg);
                border-radius: 1rem;
                box-shadow: var(--shadow-fix), var(--shadow-1);
                pointer-events: none;
                opacity: 0;
                animation: tooltip 8s 300ms ease;

                @media (prefers-reduced-motion: reduce) {
                    animation-timing-function: steps(1, start);
                }
            }

            &[class*='left']::after {
                --translatex: 0%;
                left: unset;
                right: 0;
            }

            &[class*='right']::after {
                --translatex: 0%;
                left: 0%;
            }

            &[class*='bottom']::after {
                --translatey: 100%;
                top: unset;
                bottom: -1.25rem;
            }
        }
    }
}

@keyframes drawName {
    0% {
        fill-opacity: 0;
        stroke-dashoffset: 1000;
    }

    100% {
        fill-opacity: 1;
        stroke-dashoffset: 0;
    }
}

@keyframes tooltip {
    0% {
        opacity: 0;
        transform: translateY(var(--translatey)) translateX(var(--translatex)) scale(0.75);
        visibility: hidden;
    }

    1%,
    99% {
        opacity: 1;
        transform: translateY(var(--translatey)) translateX(var(--translatex)) scale(1);
        visibility: visible;
    }

    100% {
        opacity: 0;
        transform: translateY(var(--translatey)) translateX(var(--translatex)) scale(0.75);
        visibility: hidden;
    }
}