/*
 * Profile header system: the identity block at the top of every profile (and,
 * on a desktop, in the column on the left that stays in view).
 *
 * Header styles (header.id[data-header]):
 *   portrait  a full-bleed photo with the name on a scrim that keeps it legible on any photo
 *   cover     a business banner (its cover picture, or the skin's colours) with the name on the same scrim
 *   compact   no portrait photo: a banner in the skin's colours with the avatar (or initials) in the flow above the name
 *   centered  a centred identity: a properly sized avatar, the name, then the meta line
 *   plain     text first: a large name with a small avatar beside it, never in a corner
 *   masthead  an editorial masthead: ruled lines round the name, the avatar small and centred
 *
 * Nothing important sits in the top-left corner (template galleries put their label there),
 * names are sized by length (data-size s/m/l/xl, set by the page), and a skin can scale
 * every name with --name-k and set its leading with --name-lh.
 * Loaded after profile-signature.css and profile-structures.css.
 */

/* ── Name: size by length, balanced wrapping, never clipped ── */
.id .profile-name{display:inline;line-height:var(--name-lh,1.02);letter-spacing:-.03em;text-wrap:balance;overflow-wrap:break-word;hyphens:manual}
.id h1{text-wrap:balance;max-width:100%;line-height:0}
.id h1 .profile-name{line-height:var(--name-lh,1.02)}
.id .profile-name[data-size=s]{font-size:calc(var(--name-k,1) * clamp(40px,12.4vw,58px))}
.id .profile-name[data-size=m]{font-size:calc(var(--name-k,1) * clamp(34px,10.4vw,50px))}
.id .profile-name[data-size=l]{font-size:calc(var(--name-k,1) * clamp(30px,8.8vw,42px))}
.id .profile-name[data-size=xl]{font-size:calc(var(--name-k,1) * clamp(26px,7.4vw,34px))}
@media (min-width:1024px){
  .id .profile-name[data-size=s]{font-size:calc(var(--name-k,1) * 56px)}
  .id .profile-name[data-size=m]{font-size:calc(var(--name-k,1) * 48px)}
  .id .profile-name[data-size=l]{font-size:calc(var(--name-k,1) * 40px)}
  .id .profile-name[data-size=xl]{font-size:calc(var(--name-k,1) * 32px)}
}
.id .verified{width:.46em;height:.46em;vertical-align:.32em}

/* ── Meta lines: one system everywhere. What they do, then where; the handle and rating quieter ── */
.id .id-role{font-family:var(--fb);font-size:14.5px;line-height:1.35;letter-spacing:0;text-transform:none;gap:2px 8px;margin-top:12px}
.id .id-role .profile-title{font-weight:600}
.id .id-role .sep{opacity:.5}
.id .id-role .loc{opacity:.86}
.id .id-handle{font-family:var(--fb);font-size:13px;letter-spacing:0;margin-top:6px;opacity:1;color:var(--ink-3)}
.id .id-rating{font-size:14px;margin-top:10px}
.id .id-top .chip{text-transform:none;letter-spacing:.01em;font-weight:600;font-size:12px}

/* ── Photo headers (portrait, cover, compact): text on a scrim that holds contrast on any photo ── */
.id:not(.centered):not(.plain) .id-photo::after{background:linear-gradient(180deg,rgba(0,0,0,.34) 0%,rgba(0,0,0,0) 18%,rgba(0,0,0,0) 36%,rgba(0,0,0,.5) 56%,rgba(0,0,0,.82) 78%,rgba(0,0,0,.9) 100%)}
.id:not(.centered):not(.plain) .id-name{text-shadow:0 1px 2px rgba(0,0,0,.4),0 4px 24px rgba(0,0,0,.35)}
.id:not(.centered):not(.plain) .id-role,.id:not(.centered):not(.plain) .id-rating{color:#fff}
.id:not(.centered):not(.plain) .id-handle{color:rgba(255,255,255,.8)}
.id:not(.centered):not(.plain) .profile-title,[data-skin] .id:not(.centered):not(.plain) .profile-title{color:#fff;opacity:1}
/* Chips sit top right, clear of anything a gallery lays over the top-left corner. */
.id:not(.centered):not(.plain) .id-top{justify-content:flex-end;gap:8px}
.id:not(.centered):not(.plain) .id-top>span:empty{display:none}
.id .avatar{object-position:50% 22%}
@media (max-width:1023px){
  /* The photo is a card with breathing room: all four corners rounded (user rule). */
  .id:not(.centered):not(.plain) .id-photo{border-radius:24px}
}

/* No photo of their own: initials in the page's colours. */
.avatar.mono{display:grid;place-items:center;font-family:var(--fd);font-weight:700;letter-spacing:-.02em;line-height:1;color:var(--pop-ink);background:linear-gradient(135deg,var(--accent),var(--accent-2));font-size:34px;text-shadow:none}

/* A cover with no picture: large initials over the skin's colours, the name below them on the scrim. */
.id.cover .avatar.mono{width:100%;height:100%;align-items:start;padding-top:14%;font-size:clamp(72px,24vw,132px);opacity:.92}

/* Compact: a banner in the skin's colours, the avatar in the flow above the name, so a long name never runs into it. */
.id.compact .id-photo{aspect-ratio:auto;height:auto;min-height:250px;display:flex;flex-direction:column;justify-content:flex-end;padding:calc(64px + env(safe-area-inset-top,0px)) 16px 20px}
.id.compact .avatar{position:relative;z-index:2;left:auto;bottom:auto;width:88px;height:88px;flex:none;margin-bottom:14px;border:4px solid color-mix(in srgb,var(--bg) 70%,transparent)}
.id.compact .id-name{position:relative;left:auto;right:auto;bottom:auto;z-index:2}
.id.compact .id-top{position:absolute}

/* ── Centred ── */
.id.centered .id-photo{padding-top:calc(44px + env(safe-area-inset-top,0px))}
.id.centered .id-top{justify-content:center;gap:8px;margin-bottom:20px}
.id.centered .id-top>span:empty{display:none}
.id.centered .avatar{width:112px;height:112px;flex:none}
.id.centered .avatar.mono{font-size:40px}
.id.centered .id-name{margin-top:18px}
.id.centered h1{margin:0 auto}

/* ── Text first: the name leads, a small avatar beside it on the right ── */
.id.plain .id-photo{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"top top" "name av";column-gap:16px;align-items:start;padding:calc(56px + env(safe-area-inset-top,0px)) 16px 0}
.id.plain .id-top{grid-area:top;margin-bottom:18px;gap:8px;justify-content:flex-start}
.id.plain .id-top>span:empty{display:none}
.id.plain .avatar{grid-area:av;width:72px;height:72px;margin-top:2px}
.id.plain .avatar.mono{font-size:26px}
.id.plain .id-name{grid-area:name;margin-top:0;min-width:0}

/* ── Masthead ── */
.id.masthead .id-photo{padding-top:calc(48px + env(safe-area-inset-top,0px))}
.id.masthead .avatar.mono{font-size:22px}
.id.masthead .id-name{text-align:center}

/* ── Body of the header: bio, actions, follow, socials ── */
.id .id-body{padding-top:20px}
.id .profile-bio{font-size:16px;line-height:1.55;max-width:62ch}
.id .cta-row,.id .store-actions{margin-top:18px}
.id .store-actions .btn:not(.pop){background:transparent;font-weight:600}
.id .cta-row .btn.pop,.id .store-actions .btn.pop{font-weight:700}
/* Follow and follower counts sit with the actions, aligned with them. */
.id .ibf{margin:16px 0 0;padding:0;max-width:none}
.id.centered .ibf-row,.id.centered .ibf-counts,.id.centered .ibf-ctx{justify-content:center}
/* Social accounts: small, light, wrapping; only the accounts the owner has. */
.id .social-row{flex-wrap:nowrap;gap:6px;margin-top:16px;overflow-x:auto;scrollbar-width:none;padding:1px}
.id .social-row::-webkit-scrollbar{display:none}
.id .social-icon{flex:0 0 auto;width:36px;height:36px;border-radius:50%;background:transparent;border:1px solid var(--line-2)}
.id .social-icon svg{width:16px;height:16px;fill:var(--ink-2)}
.id .social-icon:hover svg{fill:var(--ink)}
.id.centered .social-row{justify-content:center}
@media (hover:none) and (pointer:coarse){.id .social-icon{width:40px;height:40px;min-height:40px;min-width:40px}}

/* ── Desktop: the header lives in the column on the left ── */
@media (min-width:1024px){
  .id.plain .id-photo,.id.centered .id-photo,.id.masthead .id-photo{padding-left:0;padding-right:0}
  .id.plain .id-photo{padding-top:8px}
  .id.centered .id-photo,.id.masthead .id-photo{padding-top:12px}
  .id.compact .id-photo{border-radius:28px;min-height:300px;padding:64px 24px 24px}
  .id .id-body{padding-left:2px;padding-right:2px}
}
