:root {
  --bg: #0b1020;
  --card: #0f162f;
  --muted: #9aa3b2;
  --text: #e7ecf3;
  --primary: #6ea8fe;
  --accent: #8fd3ff;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
}

.light-mode {
  --bg: #f5f8ff;
  --card: #ffffff;
  --muted: #6e7a8e;
  --text: #1a202c;
  --primary: #3b82f6;
  --accent: #1e40af;
  --shadow: 0 18px 40px rgba(0, 0, 0, .15);
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, Segoe UI, Roboto, Arial;
  background: linear-gradient(180deg, #0f1724 0%, #071022 100%);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: background-color .3s, color .3s;
}

.light-mode body {
  background: linear-gradient(180deg, #e2e8f0 0%, #f7fafc 100%);
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
  padding-bottom: 18px;
  transition: background-color .3s, box-shadow .3s;
}

.banner {
  height: 120px;
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
}

.profile {
  padding: 0 22px 22px;
  position: relative;
}

/* Avatar */
.avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  margin-top: -56px;
  margin-inline: auto;
  position: relative;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  display: flex;
  place-items: center;
  border: 4px solid var(--card);
  transition: border-color .3s;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: none;
  /* JS will show on successful load */
}

#avatarInitials {
  font-weight: 700;
  font-size: 34px;
  color: white;
  user-select: none;
}

/* texts */
.name {
  margin: 14px 0 4px;
  font-size: 22px;
  font-weight: 800;
  text-align: center
}

.role {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  transition: color .3s;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 10px
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: background-color .3s, color .3s;
}

.light-mode .chip {
  background: rgba(0, 0, 0, 0.05);
}

/* rest */
.bio {
  line-height: 1.6;
  font-size: 14px;
  color: rgba(231, 236, 243, 0.9);
  max-height: 4.5em;
  overflow: hidden;
  text-align: center;
  transition: color .3s;
}

.light-mode .bio {
  color: rgba(26, 32, 44, 0.9);
}

.toggle-bio {
  all: unset;
  cursor: pointer;
  color: var(--primary);
  display: block;
  margin: 8px auto;
  font-size: 13px;
  transition: color .3s;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
  padding: 0 12px
}

.stat {
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: background-color .3s;
}

.light-mode .stat {
  background: rgba(0, 0, 0, 0.03);
}

.actions {
  display: flex;
  gap: 10px;
  padding: 0 12px;
  margin-top: 10px
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: none;
  cursor: pointer;
  transition: background-color .3s, color .3s;
}

.light-mode .btn {
  background: rgba(0, 0, 0, 0.04);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff
}

.links {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px
}

.icon-btn {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  transition: background-color .3s, color .3s;
}

.light-mode .icon-btn {
  background: rgba(0, 0, 0, 0.03);
}

/* rows */
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px
}

.row label {
  font-size: 12px;
  color: var(--muted);
  transition: color .3s;
}

.row .value {
  font-weight: 600
}

.copy {
  all: unset;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: bold;
  transition: background-color .3s, color .3s;
}

.light-mode .copy {
  background: rgba(0, 0, 0, 0.04);
}

.theme-toggle {
  all: unset;
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
  transition: color .3s;
}

/* small screens */
@media(max-width:480px) {
  .avatar {
    width: 96px;
    height: 96px;
    margin-top: -48px
  }

  .card {
    max-width: 340px
  }
}