.tapli-profile-header {
    --tph-line: rgba(15, 23, 42, 0.16);
    --tph-line-strong: rgba(15, 23, 42, 0.24);
    --tph-soft: rgba(255, 255, 255, 0.82);
    --tph-soft-solid: var(--link-block-bg-color, #ffffff);
    --tph-muted: rgba(15, 23, 42, 0.68);
    --tph-shadow: 0 0.75rem 2.25rem rgba(15, 23, 42, 0.08);
    position: relative;
    width: calc(100% - 2.5rem);
    max-width: 38.75rem;
    margin: 0 auto 1.25rem;
    container-name: tapli-profile-header;
    container-type: inline-size;
    isolation: isolate;
}

@supports (color: color-mix(in srgb, black, transparent)) {
    .tapli-profile-header {
        --tph-line: color-mix(in srgb, currentColor 16%, transparent);
        --tph-line-strong: color-mix(in srgb, currentColor 24%, transparent);
        --tph-soft: color-mix(in srgb, var(--link-block-bg-color, #ffffff) 90%, transparent);
        --tph-muted: color-mix(in srgb, currentColor 68%, transparent);
    }
}

@media (min-width: 48rem) {
    .tapli-profile-header {
        width: calc(100% - 5rem);
    }
}

.tapli-profile-header,
.tapli-profile-header *,
.tapli-profile-header *::before,
.tapli-profile-header *::after {
    box-sizing: border-box;
}

.tapli-profile-header .tph-frame,
.tapli-profile-header .tph-copy {
    min-width: 0;
}

.tapli-profile-header .tph-frame {
    width: 100%;
}

.tapli-profile-header .tph-avatar-wrap,
.tapli-profile-header .tph-halo-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.tapli-profile-header .tph-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border: 0.1875rem solid #ffffff;
    background: var(--link-block-bg-color, #ffffff);
    object-fit: cover;
}

@supports (color: color-mix(in srgb, black, transparent)) {
    .tapli-profile-header .tph-avatar {
        border-color: color-mix(in srgb, var(--link-block-bg-color, #ffffff) 92%, transparent);
    }
}

.tapli-profile-header.is-corners-straight .tph-frame { border-radius: 0; }
.tapli-profile-header.is-corners-round .tph-frame { border-radius: 1.125rem; }
.tapli-profile-header.is-corners-rounded .tph-frame { border-radius: 2rem; }

.tapli-profile-header.is-corners-straight .tph-avatar { border-radius: 0.25rem; }
.tapli-profile-header.is-corners-round .tph-avatar { border-radius: 0.875rem; }
.tapli-profile-header.is-corners-rounded .tph-avatar { border-radius: 999rem; }

.tapli-profile-header .tph-name {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.5rem;
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
    text-wrap: balance;
}

.tapli-profile-header .tph-name > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.tapli-profile-header .tph-handle,
.tapli-profile-header .tph-bio {
    overflow-wrap: anywhere;
}

.tapli-profile-header .tph-handle {
    margin: 0.35rem 0 0;
    color: var(--tph-muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.35;
}

.tapli-profile-header .tph-bio {
    max-width: 32rem;
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    text-wrap: pretty;
}

.tapli-profile-header .tph-verified {
    display: block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
}

.tapli-profile-header .tph-verified--avatar {
    position: absolute;
    right: -0.12rem;
    bottom: -0.12rem;
    z-index: 4;
    width: 1.15rem;
    height: 1.15rem;
}

/* Editorial split: a compact editorial panel with a full-cover-safe media treatment. */
.tph-editorial-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--tph-line);
    background: var(--tph-soft-solid);
    box-shadow: var(--tph-shadow);
}

.tph-editorial-media {
    position: relative;
    min-width: 0;
    aspect-ratio: 8 / 3;
    overflow: hidden;
    border-bottom: 1px solid var(--tph-line);
    background: #dfe5ea;
}

.tph-editorial-media-backdrop,
.tph-editorial-media-image,
.tph-editorial-media-fallback {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.tph-editorial-media-backdrop {
    transform: scale(1.12);
    filter: blur(1rem) saturate(0.9);
    object-fit: cover;
    opacity: 0.46;
}

.tph-editorial-media-image {
    z-index: 1;
    object-fit: contain;
}

.tph-editorial-media-fallback {
    background:
        radial-gradient(circle at 26% 28%, rgba(15, 23, 42, 0.15) 0 1.5rem, transparent 1.6rem),
        linear-gradient(145deg, #eef2f3, #d8e0e3 56%, #eef1ee);
}

.tph-editorial-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
}

.tph-editorial-content .tph-avatar-wrap {
    width: 4rem;
    height: 4rem;
}

.tph-editorial-content .tph-name {
    font-size: 1.35rem;
}

/* Centered halo: intentionally compact, without an artificial hero-height. */
.tph-halo-frame {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 1.35rem 1rem 1.5rem;
    text-align: center;
}

.tph-centered-halo .tph-halo-avatar-wrap {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0.55rem 0 1.15rem;
}

.tph-centered-halo .tph-halo {
    position: absolute;
    inset: -0.55rem;
    border: 1px solid var(--tph-line-strong);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.tph-centered-halo .tph-halo::after {
    position: absolute;
    inset: -0.38rem;
    border: 1px solid var(--tph-line);
    border-radius: inherit;
    content: "";
    opacity: 0.65;
}

.tapli-profile-header.tph-centered-halo .tph-avatar {
    border-radius: 50%;
}

.tph-centered-halo .tph-name {
    justify-content: center;
    font-size: 1.65rem;
}

.tph-centered-halo .tph-bio {
    max-width: 27rem;
}

/* Compact rail: one aligned identity row with a restrained accent. */
.tph-rail-frame {
    display: grid;
    grid-template-columns: 0.25rem 3.75rem minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 0.25rem;
    border-top: 1px solid var(--tph-line);
    border-bottom: 1px solid var(--tph-line);
}

.tph-compact-rail .tph-rail {
    align-self: stretch;
    border-radius: 999rem;
    background: currentColor;
    opacity: 0.72;
}

.tph-compact-rail .tph-avatar-wrap {
    width: 3.75rem;
    height: 3.75rem;
}

.tph-compact-rail .tph-name {
    font-size: 1.3rem;
}

.tph-compact-rail .tph-bio {
    margin-top: 0.42rem;
    font-size: 0.82rem;
    line-height: 1.42;
}

/* Cover overlap: the overlap stays inside the card so carousels cannot clip it. */
.tph-overlap-frame {
    overflow: hidden;
    border: 1px solid var(--tph-line);
    background: var(--tph-soft-solid);
    box-shadow: var(--tph-shadow);
}

.tph-overlap-cover {
    position: relative;
    aspect-ratio: 8 / 3;
    overflow: hidden;
    background: #dfe5e8;
}

.tph-overlap-cover img,
.tph-overlap-cover-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tph-overlap-cover-fallback {
    background:
        radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.28), transparent 32%),
        linear-gradient(135deg, #dce5e1, #b9c8c2 58%, #edf1ed);
}

.tph-overlap-identity {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.9rem;
    margin-top: -1.9rem;
    padding: 0 1rem 1.05rem;
}

.tph-overlap-identity .tph-avatar-wrap {
    width: 4.5rem;
    height: 4.5rem;
}

.tph-overlap-identity .tph-copy {
    margin-top: 1.9rem;
    padding-bottom: 0.05rem;
}

.tph-overlap-identity .tph-name {
    font-size: 1.35rem;
}

/* Poster: shallow on wide screens and a clear media-plus-copy stack on phones. */
.tph-poster-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #151918;
    color: #ffffff;
    box-shadow: var(--tph-shadow);
}

.tph-poster-media {
    position: relative;
    aspect-ratio: 8 / 3;
    overflow: hidden;
}

.tph-poster-media img,
.tph-poster-media-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tph-poster-media-fallback {
    background:
        radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.16), transparent 32%),
        linear-gradient(145deg, #48534e, #171a19 72%);
}

.tph-poster-shade {
    display: none;
}

.tph-poster-content {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    background: #151918;
}

.tph-poster-topline {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.tph-poster .tph-avatar-wrap {
    width: 3rem;
    height: 3rem;
}

.tph-poster .tph-avatar {
    border-color: rgba(255, 255, 255, 0.88);
}

.tph-poster .tph-handle {
    margin: 0;
    color: #ffffff;
    opacity: 0.86;
}

.tph-poster .tph-name {
    color: #ffffff;
    font-size: 1.65rem;
    line-height: 1;
}

.tph-poster .tph-bio {
    max-width: 28rem;
    margin-top: 0.5rem;
    color: #ffffff;
    opacity: 0.9;
}

@container tapli-profile-header (min-width: 30rem) {
    .tph-editorial-frame {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
        min-height: 13.5rem;
    }

    .tph-editorial-media {
        min-height: 13.5rem;
        aspect-ratio: auto;
        border-right: 1px solid var(--tph-line);
        border-bottom: 0;
    }

    .tph-editorial-content {
        display: flex;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        padding: 1.35rem;
    }

    .tph-editorial-content .tph-avatar-wrap {
        width: 4.75rem;
        height: 4.75rem;
    }

    .tph-editorial-content .tph-name {
        font-size: 1.65rem;
    }

    .tph-rail-frame {
        grid-template-columns: 0.3rem 4.25rem minmax(0, 1fr);
        gap: 1rem;
        padding: 1rem 0.35rem;
    }

    .tph-compact-rail .tph-avatar-wrap {
        width: 4.25rem;
        height: 4.25rem;
    }

    .tph-compact-rail .tph-name {
        font-size: 1.45rem;
    }

    .tph-overlap-cover {
        max-height: 14rem;
    }

    .tph-overlap-identity {
        gap: 1.15rem;
        margin-top: -2.75rem;
        padding: 0 1.4rem 1.3rem;
    }

    .tph-overlap-identity .tph-avatar-wrap {
        width: 6.25rem;
        height: 6.25rem;
    }

    .tph-overlap-identity .tph-name {
        font-size: 1.7rem;
    }

    .tph-overlap-identity .tph-copy {
        margin-top: 2.75rem;
    }
}

@container tapli-profile-header (min-width: 34rem) {
    .tph-poster-frame {
        height: 15.5rem;
    }

    .tph-poster-media,
    .tph-poster-media img,
    .tph-poster-media-fallback,
    .tph-poster-shade {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .tph-poster-shade {
        z-index: 1;
        display: block;
        background: linear-gradient(180deg, rgba(8, 10, 9, 0.08), rgba(8, 10, 9, 0.2) 40%, rgba(8, 10, 9, 0.88));
    }

    .tph-poster-content {
        position: absolute;
        inset: 0;
        justify-content: space-between;
        padding: 1.25rem 1.4rem;
        background: transparent;
    }

    .tph-poster .tph-avatar-wrap {
        width: 3.5rem;
        height: 3.5rem;
    }

    .tph-poster .tph-name {
        font-size: 2.35rem;
        text-shadow: 0 0.125rem 0.9rem rgba(0, 0, 0, 0.24);
    }
}

@container tapli-profile-header (max-width: 20rem) {
    .tapli-profile-header .tph-name {
        font-size: 1.2rem;
    }

    .tph-editorial-content,
    .tph-overlap-identity {
        gap: 0.7rem;
        padding-right: 0.8rem;
        padding-left: 0.8rem;
    }

    .tph-editorial-content .tph-avatar-wrap,
    .tph-overlap-identity .tph-avatar-wrap {
        width: 3.6rem;
        height: 3.6rem;
    }

    .tph-rail-frame {
        grid-template-columns: 0.2rem 3.25rem minmax(0, 1fr);
        gap: 0.65rem;
    }

    .tph-compact-rail .tph-avatar-wrap {
        width: 3.25rem;
        height: 3.25rem;
    }
}

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