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

:root {
  /* Hintergrund-Preset (Defaults: dunkel) */
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --bg-surface: #f8f8fa;
  --bg-surface2: #eff0f3;
  --border: rgba(26, 26, 46, 0.1);
  /* Akzentfarben */
  --accent: #3b82f6;
  --accent-text: #295cae;
  --accent2: #8b5cf6;
  --accent3: #8b5cf6;
  --prompt: #10b981;
  /* Text */
  --text: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.55);
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  /* Geometrie */
  --radius: calc(var(--border-radius) * 0.75);
  --border-radius: 16px;
  --contact-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  /* Typografie */
  --font-family: 'Inter', sans-serif;
  --font-weight-heading: 400;
  --font-display: var(--font-family);
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: var(--font-family);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .4;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gridDrift {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: rgba(59, 130, 246, .08);
  top: -150px;
  left: -100px;
  animation-duration: 14s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(139, 92, 246, .06);
  bottom: -100px;
  right: -80px;
  animation-duration: 11s;
  animation-delay: -4s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.08); }
}

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  animation: cardIn .7s cubic-bezier(.16, 1, .3, 1) both;
  box-shadow: 0 32px 64px rgba(0, 0, 0, .5), 0 0 0 1px rgba(59, 130, 246, .05);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(32px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cover {
  height: 100px;
  background: linear-gradient(135deg, #0f1825 0%, #1a2540 40%, #0f1520 100%);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, .18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(139, 92, 246, .12) 0%, transparent 50%);
}

.cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.cover-tag {
  position: absolute;
  top: 12px;
  right: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: .58rem;
  color: rgba(100, 163, 246, .7);
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.avatar-wrap {
  display: flex;
  justify-content: center;
  margin-top: -40px;
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: calc(var(--border-radius) * 1.25);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-text);
  animation: avatarGlow 4s ease-in-out infinite;
  overflow: hidden;
}

.avatar-initials {
  background: linear-gradient(135deg, #1e3a5f, #2d4a7a);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

@keyframes avatarGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, .5), 0 0 0 0 rgba(59, 130, 246, .0);
  }
  50% {
    box-shadow: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, .5), 0 0 0 8px rgba(59, 130, 246, .08);
  }
}

.profile {
  text-align: center;
  padding: 0 24px 20px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: var(--font-weight-heading);
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
  word-break: break-word;
  animation: fadeUp .5s .2s both;
}

.profile-role {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--accent-text);
  letter-spacing: .08em;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: fadeUp .5s .3s both;
}

.profile-company {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(59, 130, 246, .07);
  border: 1px solid rgba(59, 130, 246, .14);
  border-radius: calc(var(--border-radius) * 1.25);
  padding: 5px 14px;
  font-size: .75rem;
  color: var(--text-dim);
  max-width: 100%;
  overflow: hidden;
  animation: fadeUp .5s .38s both;
}

.profile-company span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--prompt);
  flex-shrink: 0;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

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

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 24px 18px;
}

.contacts {
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--contact-shadow);
  text-decoration: none;
  transition: all .25s ease;
  animation: fadeUp .5s both;
}

.contact-row:hover {
  border-color: rgba(59, 130, 246, .28);
  background: rgba(59, 130, 246, .05);
  transform: translateX(4px);
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: calc(var(--border-radius) * 0.6);
  background: var(--bg-surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
  transition: all .25s;
}

.contact-row:hover .contact-icon {
  border-color: rgba(59, 130, 246, .28);
  background: rgba(59, 130, 246, .08);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: var(--text-secondary);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-val {
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.contact-arrow {
  font-size: .75rem;
  color: var(--text-secondary);
  transition: all .25s;
  opacity: 0;
  flex-shrink: 0;
}

.contact-row:hover .contact-arrow {
  opacity: 1;
  color: var(--accent-text);
  transform: translateX(2px);
}

.qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 14px 18px;
}

.qr-section p {
  font-family: var(--font-mono);
  font-size: .6rem;
  color: var(--text-secondary);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.qr-section img {
  width: 140px;
  height: 140px;
  border-radius: calc(var(--border-radius) * 0.75);
  border: 2px solid var(--border);
  padding: 6px;
  background: #fff;
}

.save-wrap {
  padding: 0 14px 18px;
}

.vcard-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  transition: all .25s;
  animation: fadeUp .5s .75s both;
  box-shadow: 0 4px 16px rgba(59, 130, 246, .25);
}

.vcard-btn:hover {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, .35);
}

.vcard-btn:active {
  transform: scale(.98);
}

.card-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .01);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: .63rem;
  color: var(--text-secondary);
}

.footer-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 2.5s ease-in-out infinite;
}

.footer-links {
  display: flex;
  gap: 12px;
  font-size: .63rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--accent-text);
}

/* ── Desktop ── */
@media (min-width: 1024px) {
  .card { max-width: 460px; }
}

/* ── Tablet ── */
@media (max-width: 768px) {
  body { padding: 20px; }
  .card { max-width: 420px; }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  body { padding: 12px; align-items: flex-start; padding-top: 24px; }
  .cover { height: 88px; }
  .profile { padding: 0 16px 16px; }
  .profile-name { font-size: 1.2rem; }
  .profile-role { font-size: .62rem; }
  .profile-company { font-size: .72rem; padding: 4px 12px; }
  .contacts { padding: 0 10px; gap: 6px; margin-bottom: 14px; }
  .contact-row { padding: 12px 11px; gap: 10px; }
  .contact-icon { width: 40px; height: 40px; }
  .contact-val { font-size: .8rem; }
  .qr-section { padding: 0 10px 14px; }
  .qr-section img { width: 130px; height: 130px; }
  .save-wrap { padding: 0 10px 14px; }
  .vcard-btn { min-height: 48px; font-size: .88rem; padding: 14px 20px; }
  .card-footer { padding: 11px 14px; }
}

/* ── Sehr kleine Screens (iPhone SE, 320px) ── */
@media (max-width: 360px) {
  body { padding: 8px; padding-top: 16px; }
  .profile-name { font-size: 1.1rem; }
  .qr-section img { width: 110px; height: 110px; }
}
