/* ============================================================
   LINK-IN-BIO · style.css
   Dark Luxury · Glassmorphism · Aurora Aesthetic
   ============================================================ */

/* ── CSS CUSTOM PROPERTIES (set by app.js from config) ────── */
:root {
  --accent:        #f59e0b;
  --accent-soft:   #fbbf24;
  --accent-glow:   rgba(245, 158, 11, 0.35);
  --card-bg:       rgba(255, 255, 255, 0.04);
  --card-border:   rgba(255, 255, 255, 0.10);
  --text-primary:  #f8fafc;
  --text-muted:    #94a3b8;
  --text-subtle:   rgba(148, 163, 184, 0.55);
  --radius-sm:     12px;
  --radius-md:     18px;
  --radius-lg:     28px;
  --radius-xl:     40px;
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --transition:    all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --card-shadow:   0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--card-border);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  background: #070714;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 64px;
}

body.loading #card {
  opacity: 0;
  transform: translateY(24px);
}

body.loaded #card {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── BACKGROUND LAYER ─────────────────────────────────────── */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#bg-overlay {
  position: absolute;
  inset: 0;
}

#bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* ── GRAIN OVERLAY ────────────────────────────────────────── */
#grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-drift 8s steps(1) infinite;
}

@keyframes grain-drift {
  0%   { transform: translate(0, 0) }
  10%  { transform: translate(-2%, -3%) }
  20%  { transform: translate(3%, 2%) }
  30%  { transform: translate(-1%, 4%) }
  40%  { transform: translate(4%, -1%) }
  50%  { transform: translate(-3%, 2%) }
  60%  { transform: translate(2%, 3%) }
  70%  { transform: translate(-4%, -2%) }
  80%  { transform: translate(1%, -4%) }
  90%  { transform: translate(3%, 1%) }
  100% { transform: translate(0, 0) }
}

/* ── CURSOR GLOW ──────────────────────────────────────────── */
#cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

body:hover #cursor-glow {
  opacity: 1;
}

/* ── MAIN CARD ────────────────────────────────────────────── */
#card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── PROFILE SECTION ──────────────────────────────────────── */
.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 32px 32px;
  background: var(--card-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  text-align: center;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-wrap img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.08);
}

.avatar-wrap.circle img    { border-radius: 50%; }
.avatar-wrap.rounded img   { border-radius: var(--radius-md); }
.avatar-wrap.square img    { border-radius: var(--radius-sm); }

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    var(--accent-soft),
    transparent 40%,
    var(--accent) 60%,
    var(--accent-soft),
    var(--accent)
  );
  z-index: 1;
  animation: ring-spin 4s linear infinite;
}

.avatar-wrap.circle  .avatar-ring { border-radius: 50%; }
.avatar-wrap.rounded .avatar-ring { border-radius: calc(var(--radius-md) + 3px); }
.avatar-wrap.square  .avatar-ring { border-radius: calc(var(--radius-sm) + 3px); }

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* Profile text */
.profile-name {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #1d9bf0;
  border-radius: 50%;
  flex-shrink: 0;
}

.verified-badge svg {
  width: 13px;
  height: 13px;
  fill: white;
}

.profile-username {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.profile-bio {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 320px;
  white-space: pre-line;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-xl);
  font-size: 0.8125rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
}

.status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-green 2s ease infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #22c55e; }
  50%       { opacity: 0.7; box-shadow: 0 0 16px #22c55e; }
}

/* ── STATS BAR ────────────────────────────────────────────── */
.stats-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 12px;
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: var(--transition);
}

.stat-item:hover {
  background: rgba(255,255,255,0.07);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── SOCIAL ICONS ─────────────────────────────────────────── */
.socials-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 24px;
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.social-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.social-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.social-btn:hover::before {
  opacity: 1;
}

.social-btn svg, .social-btn i {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
}

/* ── FEATURED MEDIA ───────────────────────────────────────── */
.featured-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: var(--transition);
}

.featured-media:hover {
  transform: translateY(-4px);
  box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px var(--accent);
}

.featured-media img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.featured-media-info {
  padding: 16px 20px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.featured-media-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.featured-media-caption {
  font-size: 0.8125rem;
  color: var(--accent);
}

/* ── NOW PLAYING ──────────────────────────────────────────── */
.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.np-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #1db954;
  border-radius: 10px;
  flex-shrink: 0;
  animation: np-pulse 2s ease infinite;
}

@keyframes np-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,185,84,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(29,185,84,0); }
}

.np-icon svg { width: 20px; height: 20px; color: white; }

.np-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  flex-shrink: 0;
}

.np-bar {
  width: 3px;
  background: #1db954;
  border-radius: 2px;
  animation: np-bar 1.2s ease infinite alternate;
}

.np-bar:nth-child(1) { animation-delay: 0s;    height: 60%; }
.np-bar:nth-child(2) { animation-delay: 0.2s;  height: 100%; }
.np-bar:nth-child(3) { animation-delay: 0.4s;  height: 40%; }
.np-bar:nth-child(4) { animation-delay: 0.6s;  height: 80%; }

@keyframes np-bar {
  from { transform: scaleY(0.3); }
  to   { transform: scaleY(1); }
}

.np-info { flex: 1; min-width: 0; }

.np-label {
  font-size: 0.7rem;
  color: var(--text-subtle);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.np-track {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── LINK BUTTONS ─────────────────────────────────────────── */
.links-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 17px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid transparent;
  text-align: center;
}

/* Badge */
.link-badge {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--accent);
  color: #000;
  line-height: 1;
}

/* Style: featured */
.link-btn.featured {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
  color: #000;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 8px 32px var(--accent-glow), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.link-btn.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 1;
}

.link-btn.featured.glow-pulse {
  animation: glow-pulse 3s ease infinite;
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 8px 32px var(--accent-glow), 0 1px 0 rgba(255,255,255,0.2) inset; }
  50%       { box-shadow: 0 8px 52px var(--accent-glow), 0 0 0 6px rgba(245,158,11,0.08), 0 1px 0 rgba(255,255,255,0.2) inset; }
}

.link-btn.featured:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 16px 48px var(--accent-glow);
}

/* Style: default */
.link-btn.default {
  background: var(--card-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-color: var(--card-border);
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
}

.link-btn.default:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent);
}

/* Style: outline */
.link-btn.outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.link-btn.outline:hover {
  background: var(--accent-glow);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

/* Style: ghost */
.link-btn.ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.10);
  color: var(--text-muted);
}

.link-btn.ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.20);
  transform: translateY(-2px);
}

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: ripple-out 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple-out {
  to { transform: scale(4); opacity: 0; }
}

/* Staggered link entrance */
.link-btn {
  opacity: 0;
  transform: translateY(16px);
}

body.loaded .link-btn {
  animation: link-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes link-enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ── FOOTER ───────────────────────────────────────────────── */
.footer-section {
  text-align: center;
  padding: 8px 0;
}

.footer-section p {
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.8;
}

.footer-section a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-section a:hover {
  opacity: 1;
}

/* ── SOCIAL ICON SVGs (inline fallback) ───────────────────── */
.icon-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; font-style:normal; }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── FOCUS VISIBLE ────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 520px) {
  body {
    padding: 16px 12px 48px;
  }

  .profile-section {
    padding: 28px 20px 24px;
    gap: 12px;
  }

  .avatar-wrap img {
    width: 84px;
    height: 84px;
  }

  .profile-name {
    font-size: 1.625rem;
  }

  .profile-bio {
    font-size: 0.875rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .link-btn {
    padding: 15px 20px;
    font-size: 0.875rem;
  }

  .socials-section {
    gap: 8px;
    padding: 16px;
  }

  .social-btn {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
