/* ==========================================================================
   friends / 与神明连结的人
   ========================================================================== */

.friends {
    overflow: hidden;
    border-top: 1px solid var(--gold-line);
}

.friends::before {
    background:
        radial-gradient(46% 44% at 50% 12%, rgba(214, 179, 122, .07) 0%, transparent 72%),
        radial-gradient(32% 34% at 7% 82%, rgba(200, 68, 47, .045) 0%, transparent 72%),
        radial-gradient(30% 30% at 94% 72%, rgba(214, 179, 122, .035) 0%, transparent 72%);
}

.friends .sec-head {
    margin-bottom: clamp(38px, 4.8vw, 60px);
}

.friends-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    counter-reset: friend-card;
}

.friend-card {
    counter-increment: friend-card;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    min-height: 196px;
    padding: 22px 20px 17px;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    background:
        linear-gradient(155deg, rgba(214, 179, 122, .055) 0%, rgba(214, 179, 122, .012) 42%, rgba(4, 7, 13, .2) 100%),
        rgba(8, 13, 23, .46);
    transition: border-color .35s var(--ease), background-color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}

.friend-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--gold), transparent);
    opacity: .4;
    transition: opacity .35s var(--ease);
}

.friend-card:hover {
    border-color: var(--gold-line-strong);
    background:
        linear-gradient(155deg, rgba(214, 179, 122, .085) 0%, rgba(214, 179, 122, .02) 42%, rgba(4, 7, 13, .16) 100%),
        rgba(10, 16, 29, .58);
    transform: translateY(-3px);
    box-shadow: 0 22px 44px rgba(0, 0, 0, .26);
}

.friend-card:hover::before {
    opacity: .9;
}

.friend-card::after {
    content: counter(friend-card, decimal-leading-zero);
    position: absolute;
    top: 16px;
    right: 18px;
    color: var(--faint);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1;
    letter-spacing: .2em;
    opacity: .78;
    pointer-events: none;
}

.friend-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding-right: 24px;
}

.friend-avatar {
    position: relative;
    display: block;
    width: 64px;
    height: 64px;
    flex: none;
    padding: 3px;
    border: 1px solid var(--gold-line-strong);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 28%, rgba(246, 228, 184, .15), rgba(4, 7, 13, .8) 72%);
    box-shadow: 0 0 0 3px rgba(214, 179, 122, .035), 0 10px 22px rgba(0, 0, 0, .28);
}

.friend-avatar::before {
    content: "";
    position: absolute;
    inset: -6px;
    border: 1px solid rgba(214, 179, 122, .14);
    border-radius: 50%;
    pointer-events: none;
}

.friend-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: transform .45s var(--ease), filter .45s var(--ease);
}

.friend-card:hover .friend-avatar img {
    transform: scale(1.045);
    filter: brightness(1.06);
}

.friend-ident {
    min-width: 0;
}

.friend-name {
    margin: 0;
    color: var(--cream);
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: .04em;
    overflow-wrap: anywhere;
}

.friend-sub {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
    letter-spacing: .045em;
    overflow-wrap: anywhere;
}

.friend-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--gold-line);
    color: var(--gold);
    transition: color .3s var(--ease), border-color .3s var(--ease);
}

.friend-link:hover {
    color: var(--gold-bright);
    border-color: var(--gold-line-strong);
}

.friend-link-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: none;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    background: rgba(214, 179, 122, .045);
    color: var(--gold);
    font-size: 13px;
    transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}

.friend-link:hover .friend-link-icon {
    border-color: var(--gold-line-strong);
    background: rgba(214, 179, 122, .13);
    color: var(--gold-bright);
}

.friend-platform {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .13em;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .3s var(--ease);
}

.friend-link:hover .friend-platform {
    color: var(--gold-bright);
}

.friend-arrow {
    margin-left: auto;
    flex: none;
    color: var(--faint);
    font-size: 12px;
    transition: color .3s var(--ease), transform .3s var(--ease);
}

.friend-link:hover .friend-arrow {
    color: var(--gold);
    transform: translate(1px, -1px);
}

.friends-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: clamp(22px, 3vw, 34px) 0 0;
    color: var(--faint);
    font-size: 12px;
    line-height: 1.8;
    letter-spacing: .08em;
    text-align: center;
}

.friends-note i {
    color: var(--gold);
    font-size: 12px;
}

.friends-note a {
    color: var(--gold);
    border-bottom: 1px solid var(--gold-line-strong);
    transition: color .25s var(--ease), border-color .25s var(--ease);
}

.friends-note a:hover {
    color: var(--gold-bright);
    border-color: var(--gold);
}

@media (max-width: 1100px) {
    .friends-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .friends-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .friend-card {
        min-height: 0;
        padding: 18px 16px 14px;
        gap: 16px;
    }

    .friend-head {
        padding-right: 20px;
    }

    .friend-avatar {
        width: 58px;
        height: 58px;
    }

    .friend-name {
        font-size: 18px;
    }

    .friends-note {
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 380px) {
    .friend-avatar {
        width: 52px;
        height: 52px;
    }

    .friend-head {
        gap: 12px;
    }

    .friend-name {
        font-size: 17px;
    }

    .friend-platform {
        letter-spacing: .08em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .friend-card,
    .friend-card::before,
    .friend-avatar img,
    .friend-link,
    .friend-link-icon,
    .friend-arrow {
        transition: none;
    }

    .friend-card:hover {
        transform: none;
    }

    .friend-card:hover .friend-avatar img {
        transform: none;
    }
}
