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

:root {
  --bg: #09090b;
  --bg-card: rgba(255,255,255,0.03);
  --text: #fafafa;
  --text-mid: #a1a1aa;
  --text-dim: #52525b;
  --accent: #e4e4e7;
  --border: rgba(255,255,255,0.08);
  --border-s: rgba(255,255,255,0.15);
  --btn-bg: rgba(255,255,255,0.05);
  --btn-hover: rgba(255,255,255,0.10);
  --save-bg: #fafafa;
  --save-text: #09090b;
  --logo-filter: brightness(0) invert(1);
  --font-body: 'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  --font-mono: 'JetBrains Mono',monospace;
}

html[data-theme="light"] {
  --bg: #fafafa;
  --bg-card: rgba(0,0,0,0.025);
  --text: #09090b;
  --text-mid: #52525b;
  --text-dim: #a1a1aa;
  --accent: #18181b;
  --border: rgba(0,0,0,0.08);
  --border-s: rgba(0,0,0,0.18);
  --btn-bg: rgba(0,0,0,0.04);
  --btn-hover: rgba(0,0,0,0.08);
  --save-bg: #09090b;
  --save-text: #fafafa;
  --logo-filter: none;
}

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  min-height: 540px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Ambient background ─────────────────────────── */
.bg-noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
.bg-glow {
  position: fixed; z-index: 0; pointer-events: none;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.025) 0%, transparent 70%);
  top: -280px; right: -180px; filter: blur(80px);
  animation: drift 30s ease-in-out infinite;
}
@keyframes drift { 0%,100%{transform:translate(0,0)} 50%{transform:translate(30px,25px)} }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  position: relative; z-index: 10; flex-shrink: 0;
  width: 100%; max-width: 608px;
  padding: 16px 24px 0;
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
}

.lang-wrap { position: relative; display: flex; align-items: center; }
.lang-wrap select {
  appearance: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: 11px;
  height: 32px;
  padding: 0 28px 0 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  touch-action: manipulation;
}
.lang-wrap select:hover, .lang-wrap select:focus { border-color: var(--border-s); color: var(--text); }
.lang-wrap::after {
  content: ""; position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 4px solid var(--text-dim); pointer-events: none;
}

.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card); color: var(--text-dim); cursor: pointer; padding: 0;
  flex-shrink: 0; transition: border-color 0.2s, color 0.2s, background 0.2s;
  touch-action: manipulation; user-select: none;
}
.icon-btn:hover { border-color: var(--border-s); color: var(--text-mid); background: var(--btn-hover); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

/* ── Card container ─────────────────────────────── */
.card {
  position: relative; z-index: 2;
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: 560px;
  padding: 0 24px;
  display: flex; flex-direction: column;
  align-items: center;
}

/* ── Card body — centered content ───────────────── */
.card-body {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  width: 100%;
  padding-top: 20px;
  min-height: 0;
}

.avatar {
  width: clamp(80px, 24vw, 96px); height: clamp(80px, 24vw, 96px);
  border-radius: 50%; overflow: hidden;
  border: 1px solid var(--border-s); flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

h1 {
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.05;
}

.role {
  font-size: clamp(0.78rem, 3.5vw, 0.88rem);
  font-weight: 500;
  color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.06em;
}

.company-logo { line-height: 0; }
.company-logo img {
  height: 26px; width: auto; display: block;
  filter: var(--logo-filter); opacity: 0.88;
  transition: opacity 0.2s;
}

.location {
  font-size: clamp(0.75rem, 3vw, 0.85rem);
  color: var(--text-dim); letter-spacing: 0.03em;
}

.bio {
  font-size: clamp(0.85rem, 4vw, 1rem);
  color: var(--text-dim); line-height: 1.6;
  max-width: 460px;
}

/* ── Social links 2×2 grid ──────────────────────── */
.social-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
}
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--btn-bg); color: var(--text-mid);
  font-size: clamp(0.78rem, 3.2vw, 0.85rem); font-weight: 500;
  text-decoration: none; white-space: nowrap;
  touch-action: manipulation;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.social-btn:hover { border-color: var(--border-s); color: var(--text); background: var(--btn-hover); }
.social-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-btn .icon { width: 12px; height: 12px; }

/* ── QR block — below centered content ──────────── */
.qr-block {
  display: none;
  flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0;
  padding: 14px 0 max(20px, env(safe-area-inset-bottom));
}
.qr-inner {
  width: 150px; height: 150px; padding: 10px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; display: grid; place-items: center;
}
.qr-inner svg { width: 100%; height: 100%; display: block; }
.qr-label {
  font-size: clamp(0.65rem, 2.5vw, 0.72rem);
  color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Mobile save (fixed) ────────────────────────── */
.mobile-save {
  position: fixed; inset-inline: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30; min-height: 54px; display: none;
  align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: none;
  background: var(--save-bg); color: var(--save-text);
  font-size: 0.98rem; font-weight: 600;
  text-decoration: none; box-shadow: 0 8px 40px rgba(0,0,0,0.55);
  letter-spacing: -0.01em; touch-action: manipulation;
}
.mobile-save:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mobile-save .icon { width: 15px; height: 15px; }

/* ── Animations ─────────────────────────────────── */
.fade-up { opacity: 0; animation: fadeUp 0.8s cubic-bezier(0.16,1,0.3,1) forwards; }
.card-body > *:nth-child(1) { animation-delay: 0.05s; }
.card-body > *:nth-child(2) { animation-delay: 0.13s; }
.card-body > *:nth-child(3) { animation-delay: 0.20s; }
.card-body > *:nth-child(4) { animation-delay: 0.27s; }
.card-body > *:nth-child(5) { animation-delay: 0.34s; }
.card-body > *:nth-child(6) { animation-delay: 0.41s; }
.card-body > *:nth-child(7) { animation-delay: 0.48s; }
@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration:1ms !important; transition-duration:1ms !important; } }

/* ── Responsive ─────────────────────────────────── */
@media (min-width: 640px) {
  .qr-block { display: flex; }
  .avatar { width: 112px; height: 112px; }
}
@media (max-width: 639px) {
  .card-body { padding-bottom: 80px; }
  .mobile-save { display: flex; }
}
@media (max-height: 640px) and (max-width: 639px) {
  .card-body { gap: 8px; }
  .avatar { width: 72px; height: 72px; }
}
@media (max-height: 540px) and (max-width: 639px) {
  .bio { display: none; }
  h1 { font-size: 1.8rem; }
}
@media (max-height: 800px) and (min-width: 640px) {
  .card-body { gap: 10px; }
  .avatar { width: 88px; height: 88px; }
  .qr-inner { width: 110px; height: 110px; }
}
@media (max-height: 700px) and (min-width: 640px) {
  .card-body { gap: 8px; }
  .avatar { width: 72px; height: 72px; }
  .qr-inner { width: 90px; height: 90px; }
}
