/* ============================================================
   MIND MATTER — Artist Profiles
   Profile page, editor, open calls, artwork grid
   ============================================================ */

/* ---------- Profile Container ---------- */
.profile {
  --profile-accent: var(--gold);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---------- Cover ---------- */
.profile-cover {
  position: relative;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--ink2), #16223a);
  background-size: cover;
  background-position: center;
}
.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--ink) 0%, transparent 60%);
}

/* ---------- Header ---------- */
.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-top: -48px;
  position: relative;
  z-index: 2;
  padding: 0 8px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--profile-accent);
  background: var(--ink2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar span {
  font-size: 2rem;
  color: var(--profile-accent);
}
.profile-id {
  flex: 1;
  padding-bottom: 6px;
}
.profile-name {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ivory);
  letter-spacing: 0.02em;
}
.profile-bio {
  color: var(--ivory-dim);
  font-size: 0.9rem;
  margin-top: 4px;
  max-width: 540px;
}
.profile-edit-btn {
  margin-bottom: 10px;
}
.profile-walk-btn {
  margin-bottom: 10px;
  border-color: var(--profile-accent);
  color: var(--profile-accent);
}
.profile-walk-btn:hover,
.profile-closet-btn:hover,
.profile-closet-edit-btn:hover {
  background: var(--profile-accent);
  color: var(--ink);
}

/* ---------- Socials ---------- */
.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding: 0 8px;
}
.profile-socials a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--profile-accent);
  border: 1px solid color-mix(in srgb, var(--profile-accent) 40%, transparent);
  padding: 5px 12px;
  border-radius: 20px;
  transition: var(--transition);
}
.profile-socials a:hover {
  background: var(--profile-accent);
  color: var(--ink);
}

/* ---------- Sections (Lore / History / Training) ---------- */
.profile-sections {
  display: grid;
  gap: 24px;
  margin-top: 40px;
  padding: 0 8px;
}
.profile-section {
  border-left: 2px solid var(--profile-accent);
  padding-left: 20px;
}
.profile-section h3 {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--profile-accent);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.profile-section p {
  color: var(--ivory-dim);
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ---------- Originals ---------- */
.profile-originals {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--panel);
}
.profile-originals h3 {
  font-family: var(--serif);
  color: var(--gold);
  margin-bottom: 8px;
}
.profile-originals p {
  color: var(--ivory-dim);
  font-size: 0.88rem;
  margin-bottom: 12px;
}
.profile-originals .fine {
  font-size: 0.72rem;
  color: var(--ivory-dim);
  opacity: 0.7;
  margin-top: 12px;
  margin-bottom: 0;
}

/* ---------- Open Calls ---------- */
.profile-calls {
  margin-top: 40px;
  padding: 0 8px;
}
.profile-calls h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ivory);
  margin-bottom: 16px;
}
.call-card {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  background: var(--panel);
  transition: var(--transition);
}
.call-card:hover {
  border-color: var(--profile-accent);
}
.call-card h4 {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ivory);
  margin-bottom: 6px;
}
.call-card p {
  color: var(--ivory-dim);
  font-size: 0.85rem;
}
.call-deadline {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ember);
  letter-spacing: 0.04em;
}

/* ---------- Artworks Grid ---------- */
.profile-works {
  margin-top: 48px;
  padding: 0 8px;
}
.profile-works h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ivory);
  margin-bottom: 20px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.profile-work-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hair);
  background: var(--ink2);
  transition: var(--transition);
}
.profile-work-card:hover {
  border-color: var(--profile-accent);
  transform: translateY(-3px);
}
.profile-work-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.pwc-info {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pwc-info strong {
  font-size: 0.82rem;
  color: var(--ivory);
}
.pwc-info span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--profile-accent);
}
.pwc-original {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--ink);
  padding: 3px 8px;
  border-radius: 3px;
}

/* ---------- Profile Editor Overlay ---------- */
.profile-editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 13, 24, 0.85);
  z-index: 9998;
}
.profile-editor {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--ink2);
  border: 1px solid var(--hair-strong);
  border-radius: 8px;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: #2a3a55 rgba(7, 12, 23, 0.85);
}
.profile-editor::-webkit-scrollbar { width: 8px; }
.profile-editor::-webkit-scrollbar-track { background: rgba(7, 12, 23, 0.85); }
.profile-editor::-webkit-scrollbar-thumb {
  background: #243248;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.profile-editor::-webkit-scrollbar-corner { background: transparent; }
.profile-editor h3 {
  font-family: var(--serif);
  color: var(--gold);
  margin-bottom: 20px;
}
.profile-editor .field {
  margin-bottom: 14px;
}
.profile-editor .field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-bottom: 5px;
}
.profile-editor .field input,
.profile-editor .field textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--ink);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 0.88rem;
  transition: var(--transition);
}
.profile-editor .field input:focus,
.profile-editor .field textarea:focus {
  border-color: var(--gold);
  outline: none;
}
.profile-editor .field input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

/* ---------- Artists Section (listing on main page) ---------- */
.artists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.artist-card {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
  text-align: center;
  transition: var(--transition);
}
.artist-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}
.artist-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: var(--ink2);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.artist-card-avatar span {
  color: var(--gold);
  font-size: 1.4rem;
}
.artist-card h4 {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ivory);
}
.artist-card p {
  font-size: 0.78rem;
  color: var(--ivory-dim);
  margin-top: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .profile-cover { height: 180px; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .profile-editor { padding: 20px; }
}

/* Demo / missing profile states */
.profile-demo-banner {
  position: sticky; top: 0; z-index: 5;
  padding: 10px 18px; text-align: center;
  font: 400 0.8rem 'Space Mono', monospace; letter-spacing: 0.06em;
  color: #070d18; background: #ff2d6f;
}
.profile-demo-banner a { color: #070d18; font-weight: 700; }
.profile-missing { max-width: 640px; margin: 0 auto; padding: 140px 24px 120px; text-align: center; }
.profile-missing h1 { font: 700 clamp(2rem, 5vw, 3.2rem) 'Cinzel', serif; color: var(--ivory, #eae3d2); margin: 14px 0 12px; }
.profile-missing p { color: rgba(234,227,210,0.7); line-height: 1.6; }
.profile-missing code { color: #ff2d6f; }
.profile-missing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
