*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:       #0a0a0f;
  --surface:  rgba(180,185,210,0.05);
  --surface-h: rgba(200,205,225,0.11);
  --border:   rgba(180,185,210,0.14);
  --border-h: rgba(210,215,235,0.30);
  --text:     #cdd2e0;
  --text-dim: #7a7e8e;
  --glow:     rgba(170,180,210,0.15);
  --ring:     rgba(185,195,220,0.35);
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 20%, rgba(140,155,190,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 40% at 50% 80%, rgba(140,155,190,0.03) 0%, transparent 60%);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  letter-spacing: 0.2px;
}

.container {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; align-items: center;
  gap: 28px;
  padding: 40px 20px 48px;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar-wrap {
  position: relative;
  width: 108px; height: 108px;
  flex-shrink: 0;
}
.avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ring);
  box-shadow: 0 0 32px var(--glow), 0 0 64px rgba(140,155,190,0.06);
  transition: box-shadow 0.4s, border-color 0.4s;
}
.avatar-wrap:hover .avatar {
  box-shadow: 0 0 44px rgba(180,195,220,0.22), 0 0 80px rgba(140,155,190,0.10);
  border-color: rgba(210,220,240,0.50);
}
.avatar-fallback {
  display: none;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(180,185,210,0.08);
  border: 2px solid var(--ring);
  align-items: center; justify-content: center;
  font-size: 32px; color: var(--text-dim);
}
.avatar[src].error ~ .avatar-fallback,
.avatar:not([src]) ~ .avatar-fallback {
  display: flex;
}
.avatar.error { display: none; }
.avatar-ring {
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(185,195,220,0.15);
  animation: spin 20s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Name + subtitle ────────────────────────────────────────── */
.name {
  font-size: 26px; font-weight: 600; letter-spacing: 1.2px;
  background: linear-gradient(180deg, #e4e8f2 0%, #b0b8cc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  font-size: 13px; color: var(--text-dim);
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-top: -16px;
}

/* ── Bio ────────────────────────────────────────────────────── */
.bio {
  font-size: 14px; color: #8a8e9c;
  text-align: center; line-height: 1.6;
  max-width: 320px; margin-top: -8px;
}

/* ── Links ──────────────────────────────────────────────────── */
.links {
  width: 100%; display: flex; flex-direction: column; gap: 11px;
  margin-top: -4px;
}
.link {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.link::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at left center, rgba(190,200,225,0.06) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.link:hover {
  background: var(--surface-h);
  border-color: var(--border-h);
  box-shadow: 0 0 20px var(--glow), inset 0 0 20px rgba(180,190,210,0.03);
  transform: translateY(-1px);
}
.link:hover::before { opacity: 1; }
.link:active { transform: scale(0.985); }

.link-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.8;
}
.link-icon svg { width: 100%; height: 100%; fill: var(--text); }
.link-text { flex: 1; }
.link-arrow {
  opacity: 0.25; font-size: 16px; transition: opacity 0.25s, transform 0.25s;
}
.link:hover .link-arrow { opacity: 0.6; transform: translateX(2px); }

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180,190,215,0.25), transparent);
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  font-size: 12px; color: #4a4e5a;
  letter-spacing: 0.6px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
  color: #5a5e6e; text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: #9a9eae; }

/* ── Copy button ────────────────────────────────────────────── */
.copy-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px;
  padding: 6px 14px; border-radius: 20px;
  cursor: pointer; letter-spacing: 0.5px;
  transition: all 0.2s;
  margin-top: -8px;
}
.copy-btn:hover {
  border-color: var(--border-h);
  color: var(--text);
  background: var(--surface-h);
}
.copied { color: #8ab4a0 !important; border-color: rgba(138,180,160,0.4) !important; }

/* ── Modals ─────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: #12131c; border: 1px solid rgba(180,185,210,0.2);
  border-radius: 16px; padding: 32px; max-width: 360px; width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal h3 {
  font-size: 18px; margin-bottom: 12px;
  color: var(--text); letter-spacing: 0.5px;
}
.modal p {
  font-size: 13px; color: #7a7e8e; margin-bottom: 20px; line-height: 1.5;
}
.edit-area {
  width: 100%; padding: 10px 14px;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  outline: none; font-family: 'Consolas', monospace;
  resize: vertical; line-height: 1.5;
  transition: border-color 0.2s;
}
.edit-area:focus { border-color: var(--border-h); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.modal-actions button {
  padding: 8px 20px; border-radius: 8px; cursor: pointer;
  font-size: 13px; letter-spacing: 0.4px; transition: all 0.2s;
}
.btn-cancel {
  background: transparent; border: 1px solid var(--border); color: #8a8e9c;
}
.btn-cancel:hover { border-color: var(--border-h); color: var(--text); }
.btn-save {
  background: rgba(170,180,200,0.15); border: 1px solid var(--border-h);
  color: var(--text);
}
.btn-save:hover { background: rgba(190,200,220,0.22); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 440px) {
  .container { padding: 28px 12px 36px; gap: 22px; }
  .name { font-size: 22px; }
  .link { padding: 12px 16px; font-size: 14px; }
  .avatar-wrap { width: 88px; height: 88px; }
}
