/* ── Creator profile pages ──────────────────────────────────────────────────
   Extends style.css. Every token here comes from the parent stylesheet, so a
   palette change on the main site flows through automatically.
   --accent / --accent-ink are set per creator on <body> by creators.js.
   ────────────────────────────────────────────────────────────────────────── */

.creator-page {
  --accent: var(--green);
  --accent-ink: #101010;
  background: var(--bg);
}

.creator-page main { min-height: 70vh; padding-top: 68px }

/* A class-level display rule outranks the [hidden] attribute's UA style, which
   would otherwise leave all four states stacked on top of each other. */
.creator-page [hidden] { display: none !important }

/* ── Loading / empty states ───────────────────────────────────────────────── */
.state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.1rem; text-align: center;
  min-height: 55vh;
  padding: 3rem var(--gutter);
}
.state h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; letter-spacing: -.02em }
.state p  { color: var(--text-dim); max-width: 46ch }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--green);
  animation: spin 800ms linear infinite;
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s } }

/* ── Banner ───────────────────────────────────────────────────────────────── */
.profile-banner {
  position: relative;
  height: clamp(150px, 22vw, 240px);
  background: var(--grad);
  background-size: cover; background-position: center;
  overflow: hidden;
}
/* Fades the banner into the page background so any uploaded image blends
   rather than ending on a hard edge. */
.banner-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,22,22,.25) 0%, rgba(22,22,22,.75) 62%, var(--bg) 100%);
}

.profile-inner { padding-bottom: clamp(3rem, 7vw, 5rem) }

.back-link {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.4rem;
  color: var(--text-dim); text-decoration: none;
  font-size: .92rem; font-weight: 500;
  transition: color .18s;
}
.back-link:hover { color: var(--green) }
.back-link svg { width: 17px; height: 17px }

/* ── Header ───────────────────────────────────────────────────────────────── */
/* Only the avatar rises into the banner. Lifting the whole block instead
   dragged it up into the back-link. */
.profile-head {
  display: flex; align-items: flex-end; gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: 1.25rem; margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.profile-pfp {
  width: clamp(116px, 16vw, 168px);
  margin-top: clamp(-84px, -6vw, -56px);
  aspect-ratio: 1; flex-shrink: 0;
  border-radius: 50%; overflow: hidden;
  border: 4px solid var(--bg);
  outline: 2px solid var(--accent);
  background: var(--surface-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
.profile-pfp img { width: 100%; height: 100%; object-fit: cover; display: block }

.profile-id { flex: 1; min-width: 240px; padding-bottom: .35rem }
.profile-id .card-badge { font-size: .74rem; margin-bottom: .55rem }

.profile-id h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.9rem);
  font-weight: 700; letter-spacing: -.03em;
  line-height: 1.08; margin-bottom: .25rem;
}
.profile-realname { color: var(--text-dim); font-size: 1rem; margin-bottom: .6rem }
.profile-tagline {
  color: var(--text-dim); font-size: 1rem;
  line-height: 1.65; max-width: 62ch; margin-bottom: 1.2rem;
}

.profile-links { display: flex; gap: .6rem; flex-wrap: wrap }
.profile-links .card-link-btn { padding: .5rem .95rem; font-size: .85rem }

/* ── Stats strip ──────────────────────────────────────────────────────────── */
.profile-stats {
  display: flex; flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: 1.4rem 0;
  border-block: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.profile-stats .stat-val { font-size: 1.7rem; color: var(--accent) }

/* ── Body ─────────────────────────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.profile-grid h2 {
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 1rem;
}

.profile-bio p {
  color: var(--text-dim); line-height: 1.8;
  max-width: 70ch; margin-bottom: 1rem;
}
.profile-bio p:last-child { margin-bottom: 0 }

/* Placeholder for a creator whose bio has not been written yet. Set apart
   from real copy so it reads as absent content, not as the bio itself. */
.bio-empty {
  font-style: italic;
  color: #6f6f6f;
  padding: .9rem 1.1rem;
  border-left: 2px solid var(--line-strong);
  background: rgba(255, 255, 255, .02);
  border-radius: 0 6px 6px 0;
}

.profile-highlights { margin-top: 2.5rem }
.profile-highlights ul { list-style: none; display: flex; flex-direction: column; gap: .6rem }
.profile-highlights li {
  display: flex; gap: .75rem; align-items: baseline;
  color: var(--text-dim); line-height: 1.6;
}
.profile-highlights li::before {
  content: ""; flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); transform: translateY(-2px);
}
.profile-highlights a { color: var(--text); text-decoration: none }
.profile-highlights a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px }

/* ── Facts panel ──────────────────────────────────────────────────────────── */
.profile-facts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky; top: 92px;
}
/* An even gap between every dt and dd makes each label look attached to the
   value above it. Space between pairs, not within them. */
.profile-facts dl { display: flex; flex-direction: column }
.profile-facts dt {
  font-size: .8rem; font-weight: 600;
  color: var(--text-dim);
  margin-top: 1.1rem; margin-bottom: .25rem;
  padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.profile-facts dt:first-of-type { margin-top: 0; padding-top: 0; border-top: none }
.profile-facts dd { font-size: .98rem; color: var(--text); font-weight: 500; line-height: 1.5 }
.profile-facts dd .age-note { color: var(--text-dim); font-weight: 400 }

/* N/D — absent or withheld data. Muted and unbolded so a panel with several
   of them still reads as a profile rather than a broken record. */
.nd {
  color: #6f6f6f;
  font-weight: 400;
  font-style: italic;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, .18);
  cursor: help;
}
.profile-realname .nd { font-size: inherit }

/* ── Sibling channels ─────────────────────────────────────────────────────── */
.profile-siblings { margin-top: clamp(3rem, 6vw, 4.5rem) }
.profile-siblings h2 {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 1.1rem; letter-spacing: -.01em;
}
.sibling-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
}
.sibling {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.sibling:hover { border-color: var(--sib-accent, var(--green)); transform: translateY(-2px) }
.sibling img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--sib-accent, var(--green));
}
.sibling span {
  font-size: .92rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .profile-grid { grid-template-columns: 1fr }
  .profile-facts { position: static }
}

@media (max-width: 640px) {
  .profile-head { align-items: flex-start }
  .profile-id { padding-bottom: 0 }
  .profile-stats { gap: 1.5rem 2rem }
  .profile-stats > div { min-width: 96px }
}
