/* ============================================================================
   DagM8 · views/profile.css — screen-specific styles for the Profile screen.
   Reuses the dagm8.css token + component layer (.card, .avatar, .ava-sq, .btn,
   .post, .feed-heading, .rail*, .ico). Only the profile-specific composition
   lives here, all under the .profile- prefix. The desktop port of the Figma
   "PROFILE — Ryan Domínguez" card: a cover band, a large online avatar
   overlapping it, a centred identity block, and a communities / posts / friends
   stats row, followed by a community grid and the user's posts.
   ========================================================================= */

/* ---- header card --------------------------------------------------------- */
.profile-card {
  overflow: hidden;
  margin-bottom: var(--s6);
}

/* the brand cover band the avatar overlaps (cyan → coral, on-brand) */
.profile-cover {
  height: 124px;
  background:
    radial-gradient(120% 180% at 16% 0%, rgba(255, 255, 255, .35), transparent 55%),
    linear-gradient(118deg, var(--cyan) 0%, #5fd0d9 28%, #ff9c8a 76%, var(--coral) 116%);
}

.profile-head {
  text-align: center;
  padding: 0 var(--s5) var(--s5);
}

/* large avatar, white-ringed, pulled up to straddle the cover edge */
.profile-avatar {
  width: max-content;
  margin: -52px auto var(--s3);
}
.profile-avatar .avatar {
  width: 104px;
  height: 104px;
  font-size: 34px;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-card);
}
/* scale the online dot to the larger avatar */
.profile-avatar .avatar--on::after {
  width: 18px;
  height: 18px;
  right: 6px;
  bottom: 6px;
  border-width: 3px;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}
.profile-handle {
  margin: var(--s1) 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cyan-700);
}
.profile-handle .profile-dot { color: var(--muted-2); margin: 0 2px; }
.profile-bio {
  margin: var(--s3) auto 0;
  max-width: 46ch;
  font-size: 14px;
  color: var(--ink-2);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s3);
  margin-top: var(--s4);
}

/* communities / posts / friends */
.profile-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid var(--line);
}
.profile-stat {
  flex: 1 1 0;
  min-width: 96px;
  text-align: center;
  padding: var(--s4) var(--s3);
}
.profile-stat + .profile-stat { border-left: 1px solid var(--line); }
.profile-stat__n {
  display: block;
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  line-height: 1.1;
}
.profile-stat__l {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- communities grid ---------------------------------------------------- */
.profile-communities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s6);
}
.profile-community {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: background var(--t), border-color var(--t), transform var(--t);
}
.profile-community:hover {
  background: var(--field);
  border-color: var(--muted-2);
  transform: translateY(-1px);
}
.profile-community__body { min-width: 0; }
.profile-community__name {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-community__sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- "About" rail -------------------------------------------------------- */
.profile-about { margin: 0; }
.profile-about__row {
  display: flex;
  gap: var(--s3);
  padding: 8px 0;
  font-size: 13px;
}
.profile-about__row + .profile-about__row { border-top: 1px solid var(--line-2); }
.profile-about dt {
  flex: none;
  width: 56px;
  color: var(--muted);
  font-weight: 600;
}
.profile-about dd {
  margin: 0;
  min-width: 0;
  color: var(--ink-2);
}

.profile-mutuals { display: flex; flex-direction: column; }
.profile-mutual {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) 0;
  color: var(--ink);
}
.profile-mutuals li + li .profile-mutual { border-top: 1px solid var(--line-2); }
.profile-mutual__body { min-width: 0; flex: 1; }
.profile-mutual__name {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-mutual__sub {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- responsive: tidy collapse to 400px ---------------------------------- */
@media (max-width: 560px) {
  .profile-head { padding-left: var(--s4); padding-right: var(--s4); }
}
@media (max-width: 400px) {
  .profile-avatar .avatar { width: 92px; height: 92px; font-size: 30px; }
  .profile-name { font-size: 20px; }
  .profile-communities { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
