/* Same visual language as paymonzo.com and RadBytes: greys only, condensed
   uppercase name, serif prose, mono labels, hairline rules, film grain. */

:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --ink: #e8e8e6;
  --ink-2: #a3a3a0;   /* 8.0:1 on bg */
  --ink-3: #75756f;   /* 4.5:1 on bg — labels and hairline buttons */
  --line: #262628;
  --plate: #ffffff;   /* QR background: always pure white for scanning */
  --grain: 0.09;

  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

/* The public page follows the visitor's phone; "My card" stays dark. */
@media (prefers-color-scheme: light) {
  :root:not(.always-dark) {
    --bg: #ecebe8;
    --bg-2: #e2e1dd;
    --ink: #141414;
    --ink-2: #4c4c4a;
    --ink-3: #6b6b68;
    --line: #cdccc8;
    --grain: 0.07;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* Film grain, as on both sites. Purely decorative. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.ic { width: 20px; height: 20px; flex: none; }

.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(56px, calc(env(safe-area-inset-top) + 40px)) 16px max(32px, env(safe-area-inset-bottom));
}

.label {
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

/* ── Name block (shared) ─────────────────────────────── */

.name {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-weight: 800;
  font-variation-settings: "wdth" 62;
  text-transform: uppercase;
  line-height: 0.84;
  letter-spacing: -0.01em;
  font-size: clamp(56px, 19vw, 92px);
}
.name span:last-child { font-size: 0.62em; letter-spacing: 0.01em; }

.role { margin-top: 18px; display: grid; gap: 4px; }
.role span { display: block; }

/* ── Public profile ──────────────────────────────────── */

.hero { display: grid; gap: 28px; }

.portrait {
  width: 104px;
  height: 104px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mono { font: 400 44px/1 var(--serif); color: var(--ink-2); }

.bio {
  margin: 0;
  font: 400 clamp(28px, 8.4vw, 36px)/1.08 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.section { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
.section .label { margin-bottom: 18px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0 22px;
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { border-color: var(--ink); }
.btn-solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-solid:hover { opacity: .9; }

.links { list-style: none; margin: 22px 0 0; padding: 0; }
.links li { border-bottom: 1px solid var(--line); }
.links li:first-child { border-top: 1px solid var(--line); }
.links a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 2px;
  text-decoration: none;
  transition: padding .2s;
}
.links a:hover { padding-left: 10px; }
.links .ic { color: var(--ink-2); }
.links .text { display: grid; min-width: 0; }
.links .label-text { font-size: 1.0625rem; font-weight: 500; }
.links .detail {
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.links .chev { width: 16px; height: 16px; color: var(--ink-3); margin-left: auto; flex: none; }

.foot {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.btn-small {
  width: auto;
  min-height: 48px;
  padding: 0 18px;
  font-size: 12px;
}

/* ── My card (always dark, QR on a white plate) ──────── */

.card .wrap {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: max(68px, calc(env(safe-area-inset-top) + 52px));
}

.corner {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}

.card .name { font-size: clamp(48px, 15vw, 76px); }
.card .role { margin-top: 14px; }

.plate {
  margin: 28px auto 0;
  width: min(100%, 380px);
  background: var(--plate);
  padding: 12px;
  border-radius: 6px;
}
.plate svg { display: block; width: 100%; height: auto; }
.plate-empty {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: #3a3a38;
  font: 400 13px/1.6 var(--mono);
}

.scan-hint { text-align: center; margin-top: 16px; }

.card-actions {
  margin-top: auto;
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.status { margin-top: 16px; text-align: center; color: var(--ink-2); }
.status[hidden] { display: none; }

.setup {
  margin-top: 20px;
  padding: 14px 0 0;
  border-top: 1px dashed var(--ink-3);
}
.setup ul { margin: 8px 0 0; padding: 0; list-style: none; font: 400 12px/1.7 var(--mono); color: var(--ink-2); }
.setup li::before { content: "— "; color: var(--ink-3); }

/* ── Toast ───────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
