:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #17132b;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    color: #fff;
    background: #17132b;
    overflow-x: hidden;
}

.page-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(180deg, rgba(18, 14, 35, .52), rgba(18, 14, 35, .9)),
        var(--background-image),
        linear-gradient(145deg, #352868, #17132b 58%, #0b8793);
    background-position: center;
    background-size: cover;
    animation: backgroundEntrance 1.1s ease-out both;
}

.page-background::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .16;
    background-image: radial-gradient(rgba(255, 255, 255, .8) .6px, transparent .6px);
    background-size: 5px 5px;
    mask-image: linear-gradient(to bottom, #000, transparent 68%);
}

.profile {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 560px);
    min-height: 100vh;
    min-height: 100svh;
    margin-inline: auto;
    padding:
        max(44px, env(safe-area-inset-top))
        max(24px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(24px, env(safe-area-inset-left));
}

.profile__header {
    text-align: center;
    margin-bottom: 30px;
    animation: headerEntrance .7s cubic-bezier(.22, 1, .36, 1) both;
}

.profile__avatar {
    display: block;
    width: 112px;
    height: 112px;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 255, 255, .82);
    border-radius: 32px;
    object-fit: cover;
    box-shadow: 0 18px 50px rgba(4, 3, 18, .36);
    animation: avatarEntrance .8s .08s cubic-bezier(.22, 1, .36, 1) both;
}

.profile__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 10px;
    color: rgba(255, 255, 255, .72);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.profile__eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #65f3ca;
    box-shadow: 0 0 0 5px rgba(101, 243, 202, .12);
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 3.15rem);
    line-height: 1.04;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.profile__description {
    max-width: 44ch;
    margin: 14px auto 0;
    color: rgba(255, 255, 255, .74);
    font-size: .98rem;
    line-height: 1.58;
    text-wrap: pretty;
}

.links {
    display: grid;
    width: 100%;
    gap: 12px;
}

.link-card {
    display: grid;
    grid-template-columns: 48px 1fr 34px;
    align-items: center;
    min-height: 68px;
    padding: 9px 12px 9px 10px;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 14px 38px rgba(4, 3, 18, .16);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
    will-change: transform, opacity;
    animation: buttonEntrance .62s cubic-bezier(.16, 1, .3, 1) both;
    animation-delay: calc(180ms + var(--delay));
}

.link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .38);
    background: rgba(255, 255, 255, .17);
    box-shadow: 0 20px 46px rgba(4, 3, 18, .24);
}

.link-card:active {
    transform: scale(.985);
}

.link-card:focus-visible {
    outline: 3px solid #65f3ca;
    outline-offset: 3px;
}

.link-card__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #17132b;
    background: #fff;
    font-size: 1.15rem;
    animation: iconEntrance .48s cubic-bezier(.34, 1.56, .64, 1) both;
    animation-delay: calc(330ms + var(--delay));
}

.link-card__label {
    padding-inline: 12px;
    overflow-wrap: anywhere;
    font-size: .98rem;
    font-weight: 750;
    letter-spacing: -.012em;
}

.link-card__arrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .16);
    transition: transform .2s ease;
}

.link-card:hover .link-card__arrow {
    transform: translate(2px, -2px);
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, .72);
    border: 1px dashed rgba(255, 255, 255, .25);
    border-radius: 20px;
}

.profile__footer {
    width: 100%;
    margin-top: auto;
    padding-top: 32px;
    text-align: center;
    color: rgba(255, 255, 255, .48);
    font-size: .75rem;
}

@keyframes backgroundEntrance {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes headerEntrance {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes avatarEntrance {
    from { opacity: 0; transform: translateY(-12px) scale(.82) rotate(-3deg); }
    to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes buttonEntrance {
    from { opacity: 0; transform: translateY(24px) scale(.96); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes iconEntrance {
    from { opacity: 0; transform: scale(.55) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 420px) {
    .profile {
        width: 100%;
        padding:
            max(34px, env(safe-area-inset-top))
            max(20px, env(safe-area-inset-right))
            max(18px, env(safe-area-inset-bottom))
            max(20px, env(safe-area-inset-left));
    }

    .profile__avatar {
        width: 96px;
        height: 96px;
        border-radius: 28px;
    }

    .link-card {
        grid-template-columns: 44px 1fr 32px;
        border-radius: 18px;
    }

    .link-card__icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
