/* eCard — luxury responsive namecard
   Palette: obsidian + champagne gold (L'Or Blanc = white gold) */

:root {
  --gold-1: #f6e7b8;
  --gold-2: #d8b65f;
  --gold-3: #b8893f;
  --gold-grad: linear-gradient(135deg, #f6e7b8 0%, #d8b65f 45%, #b8893f 100%);
  --font-serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Dark (default) */
[data-theme="dark"] {
  --bg: #0a0b0e;
  --bg-2: #111319;
  --card: rgba(20,22,28,.72);
  --card-border: rgba(216,182,95,.22);
  --text: #f3f1ea;
  --muted: #a7a499;
  --chip: rgba(255,255,255,.05);
  --chip-border: rgba(255,255,255,.10);
  --shadow: 0 30px 80px -30px rgba(0,0,0,.85);
}
/* Light (ivory + gold) */
[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-2: #ece6da;
  --card: rgba(255,253,248,.82);
  --card-border: rgba(184,137,63,.32);
  --text: #2a2620;
  --muted: #6d6658;
  --chip: rgba(184,137,63,.08);
  --chip-border: rgba(184,137,63,.20);
  --shadow: 0 30px 70px -30px rgba(120,90,40,.45);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
  overflow-x: hidden;
  position: relative;
  transition: background .6s var(--ease), color .4s var(--ease);
}

/* ---------- Animated background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-mesh {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(216,182,95,.10), transparent 60%),
    radial-gradient(45% 40% at 85% 80%, rgba(184,137,63,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.bg-glow {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  background: var(--gold-grad);
  animation: drift 18s ease-in-out infinite;
}
.glow-1 { width: 320px; height: 320px; top: -60px; left: -40px; }
.glow-2 { width: 380px; height: 380px; bottom: -80px; right: -60px; animation-delay: -9s; }
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(30px,40px) scale(1.12); }
}
.particles span {
  position: absolute; bottom: -10px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-1); opacity: 0;
  box-shadow: 0 0 8px rgba(246,231,184,.7);
  animation: rise linear infinite;
}
.particles span:nth-child(1){left:8%;  animation-duration:14s; animation-delay:0s;}
.particles span:nth-child(2){left:18%; animation-duration:18s; animation-delay:3s;}
.particles span:nth-child(3){left:28%; animation-duration:12s; animation-delay:1s;}
.particles span:nth-child(4){left:40%; animation-duration:20s; animation-delay:6s;}
.particles span:nth-child(5){left:52%; animation-duration:15s; animation-delay:2s;}
.particles span:nth-child(6){left:60%; animation-duration:22s; animation-delay:8s;}
.particles span:nth-child(7){left:70%; animation-duration:13s; animation-delay:4s;}
.particles span:nth-child(8){left:78%; animation-duration:17s; animation-delay:7s;}
.particles span:nth-child(9){left:86%; animation-duration:19s; animation-delay:1.5s;}
.particles span:nth-child(10){left:92%;animation-duration:16s; animation-delay:5s;}
.particles span:nth-child(11){left:34%;animation-duration:21s; animation-delay:9s;}
.particles span:nth-child(12){left:66%;animation-duration:14s; animation-delay:11s;}
@keyframes rise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .6; }
  100% { transform: translateY(-105dvh) scale(1); opacity: 0; }
}

/* ---------- Card ---------- */
.card {
  position: relative; z-index: 1;
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
  padding-bottom: 26px;
}
.card::before { /* gold hairline top accent */
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold-grad); opacity: .9;
}

/* ---------- Cover ---------- */
.cover { position: relative; height: 124px; }
.cover-art { position: absolute; inset: 0; opacity: .75; }
.cover-art svg { width: 100%; height: 100%; }
.brand {
  position: absolute; top: 16px; left: 20px;
  display: flex; align-items: center; gap: 9px;
}
.brand-mark { width: 34px; height: 34px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 13px; letter-spacing: 3px; font-weight: 600;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Avatar ---------- */
.avatar-wrap {
  position: relative; width: 132px; height: 132px;
  margin: -66px auto 0; z-index: 2;
}
.avatar {
  width: 100%; height: 100%;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.45));
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
.avatar-status {
  position: absolute; right: 8px; bottom: 8px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-2);
  border: 1.5px solid var(--gold-2); color: var(--gold-1); font-size: 13px;
}

/* ---------- Identity ---------- */
.identity { text-align: center; padding: 16px 24px 4px; }
.name {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(26px, 7vw, 32px); line-height: 1.12; letter-spacing: .2px;
}
.role {
  margin-top: 8px; font-size: 14px; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.company { margin-top: 3px; font-size: 15px; color: var(--text); font-weight: 500; }
.tagline { margin-top: 10px; font-size: 12.5px; color: var(--muted); font-style: italic; }

/* ---------- Actions ---------- */
.actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 18px 22px 6px;
}
.actions .btn-gold { grid-column: 1 / -1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  padding: 13px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--chip-border); background: var(--chip); color: var(--text);
  transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { transform: translateY(-2px); border-color: var(--gold-2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-gold {
  background: var(--gold-grad); color: #2a1f08; border: none; font-weight: 600;
  box-shadow: 0 10px 26px -10px rgba(216,182,95,.7);
  position: relative; overflow: hidden;
}
.btn-gold svg { fill: #2a1f08; }
.btn-gold::after { /* shimmer sweep */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%); animation: sweep 4.5s ease-in-out infinite;
}
@keyframes sweep { 0%,55%{transform:translateX(-120%)} 80%,100%{transform:translateX(120%)} }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(216,182,95,.85); }

/* ---------- Bio ---------- */
.bio { padding: 14px 26px 4px; text-align: center; }
.bio p { font-size: 14px; line-height: 1.7; color: var(--muted); }

/* ---------- Fields / expertise ---------- */
.fields {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px 22px 4px;
}
.field {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 13px; border-radius: 14px;
  background: var(--chip); border: 1px solid var(--chip-border);
  transition: border-color .25s, transform .2s var(--ease);
}
.field:hover { border-color: var(--gold-2); transform: translateY(-2px); }
.field-ic {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: var(--gold-grad);
}
.field-ic svg { width: 20px; height: 20px; fill: #2a1f08; }
.field-txt { display: flex; flex-direction: column; min-width: 0; }
.field-txt strong { font-size: 13px; font-weight: 600; line-height: 1.2; }
.field-txt small { margin-top: 2px; font-size: 11px; color: var(--muted); letter-spacing: .3px; }

/* ---------- Details ---------- */
.details { padding: 14px 22px 4px; display: grid; gap: 10px; }
.detail {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--chip); border: 1px solid var(--chip-border); color: var(--text);
  transition: border-color .25s, transform .2s var(--ease);
}
.detail:hover { border-color: var(--gold-2); transform: translateY(-1px); }
.detail-ic {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(216,182,95,.12);
}
.detail-ic svg { width: 18px; height: 18px; fill: var(--gold-2); }
.detail-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.detail-txt small { font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.detail-txt strong { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-copy { flex: none; font-size: 11px; color: var(--gold-2); opacity: .7; }

/* ---------- QR ---------- */
.qr { text-align: center; padding: 22px 22px 6px; }
.qr-frame {
  display: inline-block; padding: 12px; border-radius: 18px; background: #fff;
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.5);
  position: relative;
}
.qr-frame::before {
  content: ""; position: absolute; inset: -2px; border-radius: 20px; z-index: -1;
  background: var(--gold-grad);
}
.qr-frame img { display: block; border-radius: 8px; }
.qr-cap { margin-top: 12px; font-size: 12px; color: var(--muted); letter-spacing: .3px; }

/* ---------- Footer ---------- */
.foot {
  margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--muted);
  display: flex; gap: 8px; justify-content: center; align-items: center;
}
.foot .dot { color: var(--gold-2); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); color: var(--gold-2);
  transition: transform .3s var(--ease), border-color .25s;
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--gold-2); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="light"] .ico-moon { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 80px);
  background: #1a1c22; color: var(--gold-1); border: 1px solid var(--gold-3);
  padding: 11px 20px; border-radius: 30px; font-size: 13px; z-index: 10;
  box-shadow: 0 14px 34px -10px rgba(0,0,0,.6); opacity: 0;
  transition: transform .4s var(--ease), opacity .4s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Reveal on scroll/load ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .avatar, .bg-glow, .particles span, .btn-gold::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
