:root {
  --accent: #0a84ff;
  --accent-ink: #ffffff;
  --bg: #eef0f4;
  --card-bg: #ffffff;
  --ink: #15161a;
  --ink-2: #6c6e76;
  --hair: rgba(0, 0, 0, 0.08);
  --tile: color-mix(in srgb, var(--accent) 9%, var(--card-bg));
  --chip: color-mix(in srgb, var(--accent) 14%, var(--card-bg));
  --radius: 26px;
  --shadow: 0 18px 50px rgba(20, 22, 30, 0.12), 0 4px 12px rgba(20, 22, 30, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07080a;
    --card-bg: #18191c;
    --ink: #f5f6f8;
    --ink-2: #9a9ca5;
    --hair: rgba(255, 255, 255, 0.09);
    --tile: color-mix(in srgb, var(--accent) 16%, var(--card-bg));
    --chip: color-mix(in srgb, var(--accent) 22%, var(--card-bg));
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.card {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding-bottom: 26px;
  animation: rise 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Cover / brand banner ------------------------------------------------ */
.cover {
  position: relative;
  height: 132px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}

.brand-wordmark {
  position: absolute;
  top: 18px;
  left: 22px;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}
.brand-wordmark--img {
  height: 26px;
  width: auto;
  letter-spacing: 0;
  text-shadow: none;
}

/* ---- Avatar -------------------------------------------------------------- */
.avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: -62px;
}

.avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card-bg);
  border: 4px solid var(--card-bg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.avatar__initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}

.avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar__img[hidden] { display: none; }

/* ---- Identity ------------------------------------------------------------ */
.identity {
  text-align: center;
  padding: 16px 26px 0;
}

.identity h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.title {
  margin: 7px auto 0;
  max-width: 30ch;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--ink-2);
  font-weight: 500;
}

.tagline {
  margin: 10px auto 0;
  max-width: 32ch;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.45;
}

/* ---- Buttons ------------------------------------------------------------- */
.primary-actions { padding: 22px 26px 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: none;
  border-radius: 15px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.2s ease, opacity 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 38%, transparent);
}
.btn--primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 46%, transparent); }

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--hair);
}

.btn .icon { width: 20px; height: 20px; }
.icon { fill: none; stroke: currentColor; }

/* ---- Quick actions ------------------------------------------------------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 26px 6px;
}
.quick-actions:empty { display: none; }

.qa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 4px;
  border-radius: 16px;
  background: var(--tile);
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.qa:hover { filter: brightness(1.04); }
.qa:active { transform: scale(0.94); }
.qa .icon { width: 23px; height: 23px; }
.qa span { color: var(--ink-2); }

/* ---- Detail rows --------------------------------------------------------- */
.details { padding: 20px 18px 4px; }
.details:empty { display: none; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 8px;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  transition: background 0.15s ease;
}
.row:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
/* hairline divider that starts after the icon, not full-bleed */
.row + .row { position: relative; }
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 60px;
  right: 8px;
  height: 1px;
  background: var(--hair);
}

.row .icon-box {
  flex: 0 0 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--chip);
  color: var(--accent);
}
.row .icon-box .icon { width: 20px; height: 20px; }
.row .meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .meta .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.row .meta .value { font-size: 15.5px; font-weight: 500; word-break: break-word; }

/* ---- Socials ------------------------------------------------------------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 26px 4px;
  justify-content: center;
}
.socials:empty { display: none; }

.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--hair);
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}
.social:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.social:active { transform: scale(0.96); }
.social .icon { width: 18px; height: 18px; stroke: var(--accent); }

/* ---- QR ------------------------------------------------------------------ */
.qr-section { padding: 22px 26px 0; text-align: center; }
.qr-box {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: rise 0.3s ease;
}
.qr-img {
  width: 208px;
  height: 208px;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.qr-hint { font-size: 13px; color: var(--ink-2); margin: 0; }

/* ---- Footer -------------------------------------------------------------- */
.foot {
  text-align: center;
  padding: 26px 26px 0;
  font-size: 12px;
  color: var(--ink-2);
}
.foot::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--hair);
  margin: 0 auto 16px;
}

/* ---- Toast --------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--card-bg);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
