/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Design tokens ────────────────────────────────────────── */
:root {
  /* Light — desaturated slate-blue/teal */
  --bg-start: #eef2f7;
  --bg-end:   #e8f0ee;

  --orb-1: rgba(99, 130, 160, 0.20);
  --orb-2: rgba(80, 150, 140, 0.16);
  --orb-3: rgba(110, 155, 175, 0.13);

  --card-bg:     rgba(255, 255, 255, 0.62);
  --card-border: rgba(255, 255, 255, 0.85);
  --card-shadow: 0 8px 48px rgba(80, 110, 140, 0.08), 0 1px 0 rgba(255,255,255,0.9) inset;

  --text-primary:   #1a2330;
  --text-secondary: #4a5568;
  --text-muted:     #9aacb8;

  --link-bg:           rgba(255, 255, 255, 0.55);
  --link-border:       rgba(220, 230, 240, 0.90);
  --link-hover-bg:     rgba(255, 255, 255, 0.85);
  --link-hover-border: rgba(90, 150, 150, 0.30);
  --link-shadow:       0 2px 10px rgba(0, 0, 0, 0.04);
  --link-hover-shadow: 0 6px 20px rgba(80, 120, 140, 0.10);

  --accent:       #5b8fa8;   /* muted steel-blue */
  --accent-soft:  rgba(91, 143, 168, 0.09);
  --accent-hover: rgba(91, 143, 168, 0.16);

  --avatar-bg:    linear-gradient(135deg, #6a9db5, #5aab9e);
  --avatar-glow:  rgba(91, 143, 168, 0.22);
  --status-color: #22c55e; /* overridden by JS based on time */

  --toggle-bg:    rgba(255,255,255,0.70);
  --toggle-border: rgba(0,0,0,0.06);
  --toggle-color: #5b8fa8;

  --vcard-bg:     rgba(91, 143, 168, 0.09);
  --vcard-border: rgba(91, 143, 168, 0.20);
  --vcard-hover:  rgba(91, 143, 168, 0.16);
  --vcard-color:  #4a7d96;
}

[data-theme="dark"] {
  --bg-start: #0e1318;
  --bg-end:   #0d1614;

  --orb-1: rgba(80, 120, 150, 0.15);
  --orb-2: rgba(60, 130, 120, 0.12);
  --orb-3: rgba(90, 140, 160, 0.10);

  --card-bg:     rgba(18, 28, 38, 0.65);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-shadow: 0 8px 48px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255,255,255,0.03) inset;

  --text-primary:   #dde8f0;
  --text-secondary: #7f99ad;
  --text-muted:     #445566;

  --link-bg:           rgba(255, 255, 255, 0.04);
  --link-border:       rgba(255, 255, 255, 0.06);
  --link-hover-bg:     rgba(80, 130, 155, 0.10);
  --link-hover-border: rgba(80, 160, 150, 0.28);
  --link-shadow:       0 2px 10px rgba(0, 0, 0, 0.22);
  --link-hover-shadow: 0 6px 20px rgba(60, 110, 130, 0.14);

  --accent:       #7db5cc;   /* muted sky, lower saturation */
  --accent-soft:  rgba(125, 181, 204, 0.10);
  --accent-hover: rgba(125, 181, 204, 0.17);

  --avatar-bg:    linear-gradient(135deg, #5a8fa6, #4e9e92);
  --avatar-glow:  rgba(90, 143, 166, 0.22);
  --status-color: #22c55e; /* overridden by JS based on time */

  --toggle-bg:    rgba(255,255,255,0.05);
  --toggle-border: rgba(255,255,255,0.08);
  --toggle-color: #7db5cc;

  --vcard-bg:     rgba(125, 181, 204, 0.08);
  --vcard-border: rgba(125, 181, 204, 0.18);
  --vcard-hover:  rgba(125, 181, 204, 0.15);
  --vcard-color:  #7db5cc;
}

/* ─── Body ─────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
  padding: 2rem 1rem;
}

/* ─── Decorative orbs ──────────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  transition: background 0.4s ease;
}

.orb-1 {
  width: 520px; height: 520px;
  top: -140px; left: -110px;
  background: var(--orb-1);
  animation: drift 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 420px; height: 420px;
  bottom: -110px; right: -90px;
  background: var(--orb-2);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 300px; height: 300px;
  top: 50%; left: 62%;
  background: var(--orb-3);
  animation: drift 15s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.06); }
}

/* ─── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, border 0.3s, transform 0.2s;
  color: var(--toggle-color);
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle i {
  font-size: 1.25rem;
  line-height: 1;
}

/* show Sun in dark mode, Moon in light mode */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ─── Card wrapper ─────────────────────────────────────────── */
.card-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

/* ─── Card ─────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-radius: 28px;
  padding: 2.5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transition: background 0.4s, border 0.4s, box-shadow 0.4s;
  animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ─── Avatar ───────────────────────────────────────────────── */
.avatar-wrap {
  position: relative;
  display: inline-flex;
}

.avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 24px var(--avatar-glow);
}

.avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.avatar-initials {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  user-select: none;
}

.status-dot {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  background: var(--status-color);
  border-radius: 50%;
  border: 2.5px solid white;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--status-pulse); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

/* ─── Identity ─────────────────────────────────────────────── */
.identity {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-bottom: 0.5rem;
}

.name {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  transition: color 0.3s;
}

.role {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: color 0.3s;
}

.bio {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 300px;
  transition: color 0.3s;
}

/* ─── Links ────────────────────────────────────────────────── */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.links-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding-left: 0.25rem;
  margin-bottom: -0.1rem;
}

.links + .links {
  margin-top: 0.4rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: var(--link-bg);
  border: 1px solid var(--link-border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow: var(--link-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.22s ease;
}

.link-item:hover {
  background: var(--link-hover-bg);
  border-color: var(--link-hover-border);
  transform: translateY(-2px);
  box-shadow: var(--link-hover-shadow);
}

.link-item:active {
  transform: translateY(0);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
  font-size: 1.35rem;
  transition: background 0.2s;
}

.link-item:hover .link-icon {
  background: var(--accent-hover);
}

.link-label {
  flex: 1;
}

.phone-prefix {
  color: inherit;
}

.link-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  transition: transform 0.2s, color 0.2s;
}

.link-item:hover .link-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ─── vCard button ─────────────────────────────────────────── */
.vcard-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--vcard-bg);
  border: 1px solid var(--vcard-border);
  border-radius: 14px;
  color: var(--vcard-color);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    transform 0.18s ease;
}

.vcard-btn i {
  font-size: 1.3rem;
}

.vcard-btn:hover {
  background: var(--vcard-hover);
  transform: translateY(-1px);
}

.vcard-btn:active {
  transform: translateY(0);
}

/* ─── Footer ───────────────────────────────────────────────── */
.card-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

/* ─── Theme toggle — inside card ───────────────────────────── */
.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* show Sun in dark, Moon in light */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: none; }

/* ─── Responsive — mobile ──────────────────────────────────── */
@media (max-width: 500px) {
  body {
    padding: 1.25rem 0.75rem;
    align-items: flex-start;
  }

  .card-wrapper {
    max-width: 100%;
  }

  .card {
    padding: 2rem 1.25rem 1.75rem;
    border-radius: 22px;
    gap: 1.1rem;
  }

  .avatar {
    width: 76px; height: 76px;
  }

  .name {
    font-size: 1.3rem;
  }

  .link-item {
    padding: 0.7rem 0.85rem;
  }

  .link-icon {
    width: 36px; height: 36px;
    font-size: 1.2rem;
  }
}
