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

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0d0d1a, #0f1e3d, #0a2850, #16133a, #0d0d1a);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 32px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Profile */

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 14px;
  object-fit: cover;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease 0.05s forwards;
}

.name {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease 0.12s forwards;
}

.sub-count {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
  margin-bottom: 6px;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease 0.16s forwards;
}

.sub-count:empty {
  display: none;
}

.bio {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 28px;
  max-width: 320px;
  line-height: 1.5;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease 0.2s forwards;
}

/* Links */

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.section-label {
  width: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 6px;
  opacity: 0;
  animation: fadeSlideIn 0.4s ease var(--delay, 0s) forwards;
}

.link-btn {
  --brand-rgb: 255, 255, 255;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: rgba(var(--brand-rgb), 0.07);
  border: 1px solid rgba(var(--brand-rgb), 0.2);
  border-radius: 28px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  animation: fadeSlideIn 0.4s ease var(--delay, 0s) forwards;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-btn:hover {
  background: rgba(var(--brand-rgb), 0.16);
  border-color: rgba(var(--brand-rgb), 0.42);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(var(--brand-rgb), 0.15);
}

.link-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.link-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.link-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Share button */

.share-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 24px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.28);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 20px;
  transition: color 0.2s, background 0.2s;
}

.share-btn:hover {
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.06);
}

/* QR modal */

.qr-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.qr-modal[hidden] { display: none; }

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.qr-card {
  position: relative;
  background: rgba(15, 30, 61, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeSlideIn 0.2s ease forwards;
}

.qr-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.qr-card img {
  border-radius: 10px;
  display: block;
}

.qr-url {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

.qr-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 20px;
  padding: 8px 24px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.qr-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Footer */

.footer {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.8rem;
}
