/* Colours and font are injected from the `themes` table as CSS variables (see card.js). */
:root {
  --bg: #f5f5f7; --card: #fff; --ink: #1c1c2b; --ink-soft: #6e6e78; --line: #e5e5ea;
  --accent: #1c1c2b; --accent-ink: #fff; --font: "Space Grotesk", sans-serif;
  --radius: 28px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.10);
  padding: 36px 28px 28px;
  position: relative;
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- header ---------- */
.header { text-align: center; }
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line); text-align: left; }
.logo { height: 44px; max-width: 120px; object-fit: contain; flex: none; }
.brand-name { font-size: 13px; font-weight: 600; letter-spacing: .2px; line-height: 1.25; color: var(--ink); }
.photo-wrap {
  width: 112px; height: 112px; margin: 0 auto 18px; border-radius: 50%; padding: 3px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0,0,0,.10);
}
.photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.name { font-size: 30px; line-height: 1.12; letter-spacing: -.8px; font-weight: 700; text-wrap: balance; }
.name-last { font-weight: 300; color: var(--ink-soft); }
.role {
  margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  color: var(--ink-soft); text-wrap: balance;
}
.company { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.credentials { margin-top: 8px; font-size: 11px; letter-spacing: .6px; color: var(--ink-soft); }
.credentials:empty, .company:empty, .role:empty { display: none; }
.bio { margin-top: 20px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); text-align: center; text-wrap: pretty; }
.bio.center { margin: 0; }

/* ---------- quick actions ---------- */
.quick { display: flex; justify-content: center; gap: 14px; margin: 26px 0 8px; flex-wrap: wrap; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 64px;
  color: var(--ink); text-decoration: none; font-size: 11px; font-weight: 500; letter-spacing: .3px;
}
.quick .ico {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 8%, transparent); transition: transform .15s, background .15s;
}
.quick a:hover .ico { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.quick a:active .ico { transform: scale(.92); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- detail rows ---------- */
.details { margin-top: 18px; border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none;
  padding: 14px 4px; min-height: 56px; border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.row:active { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.row svg { color: var(--ink-soft); }
.row .text { min-width: 0; }
.row .label { display: block; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 500; color: var(--ink-soft); margin-bottom: 2px; }
.row .value { display: block; font-size: 14px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }

.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.socials a {
  font-size: 12px; font-weight: 600; letter-spacing: .3px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; transition: background .15s;
}
.socials a:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ---------- actions ---------- */
.cta { margin-top: 22px; display: grid; gap: 10px; }
.cta-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-decoration: none; cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 14px; min-height: 54px; }
.btn.primary:hover { opacity: .92; background: var(--accent); }
.btn svg { width: 18px; height: 18px; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- QR ---------- */
.qr { margin-top: 18px; text-align: center; animation: rise .35s both; }
.qr img { background: #fff; padding: 12px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.qr-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- loading skeleton ---------- */
.skeleton { display: grid; gap: 14px; justify-items: center; }
.sk { background: linear-gradient(90deg, var(--line), transparent, var(--line)); background-size: 200% 100%; border-radius: 10px; animation: shimmer 1.2s infinite; height: 16px; width: 100%; }
.sk-photo { width: 112px; height: 112px; border-radius: 50%; }
.sk.w60 { width: 60%; height: 26px; } .sk.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 420px) {
  body { padding: 16px 14px; align-items: flex-start; }
  .card { padding: 30px 22px 24px; }
  .name { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
