/* ══════════════════════════════════════════════════════════
   Bio Page — public profile
   ══════════════════════════════════════════════════════════ */
:root {
  --accent: #8b5cf6;
  --accent2: #ec4899;
  --accent-rgb: 139, 92, 246;
  --accent2-rgb: 236, 72, 153;

  --bg: #07070d;
  --surface: rgba(14, 14, 22, 0.62);
  --surface-solid: #0f0f17;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f7;
  --text-2: rgba(244, 244, 247, 0.66);
  --text-3: rgba(244, 244, 247, 0.42);

  --radius: 24px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
img, video { display: block; max-width: 100%; -webkit-user-drag: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), .9); outline-offset: 3px; border-radius: 10px; }

/* ─── Background ─── */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-gradient {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 20% 20%, rgba(var(--accent-rgb), .22), transparent 70%),
    radial-gradient(35% 30% at 85% 80%, rgba(var(--accent2-rgb), .16), transparent 70%),
    radial-gradient(60% 50% at 50% 50%, rgba(var(--accent-rgb), .05), transparent 80%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(3%, -2%, 0) rotate(6deg); } }
.bg-image, .bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(var(--bg-scale, 1)) translateZ(0);
  filter: blur(var(--bg-blur, 0px)) var(--bg-filter, none);
  backface-visibility: hidden;
}
.bg-overlay { position: absolute; inset: 0; background: rgba(4, 4, 8, .55); }
.bg-noise {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#fx-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ─── Splash ─── */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(5, 5, 9, .72);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  cursor: pointer;
  transition: opacity .7s var(--ease), visibility .7s;
}
.splash.out { opacity: 0; visibility: hidden; }
.splash-inner { display: grid; justify-items: center; gap: 14px; }
.splash-title {
  font-size: 15px; font-weight: 500; letter-spacing: .32em; text-transform: lowercase;
  color: var(--text-2);
  animation: breathe 2.6s ease-in-out infinite;
}
.splash-line {
  width: 44px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: grow 2.6s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .45; } }
@keyframes grow { 50% { width: 88px; } }

/* ─── Stage / Card ─── */
.stage {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 48px 16px;
  perspective: 1200px;
}
.card {
  position: relative;
  width: 100%; max-width: 440px;
  background: rgba(14, 14, 22, var(--card-alpha, .62));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--card-blur, 28px)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--card-blur, 28px)) saturate(160%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .06) inset,
    0 30px 80px -20px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(0, 0, 0, .3);
  padding: 0 0 18px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease);
  will-change: transform;
}
.card-edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  padding: 1px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .55), transparent 35%, transparent 65%, rgba(var(--accent2-rgb), .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .7;
}
body.theme-solid .card { background: var(--surface-solid); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.theme-minimal .card { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.theme-minimal .card-edge { display: none; }

body.is-loading .card { opacity: 0; }
.card.enter { animation: card-in .9s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.985); } }

/* ─── Banner ─── */
.banner {
  position: relative; height: 150px; overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .45), rgba(var(--accent2-rgb), .35));
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 16, .55));
}
.banner.empty { height: 96px; }
body.theme-minimal .banner { display: none; }

/* ─── Head ─── */
.head { position: relative; display: flex; align-items: flex-end; gap: 16px; padding: 0 22px; margin-top: -46px; z-index: 2; }
body.theme-minimal .head { margin-top: 26px; flex-direction: column; align-items: center; text-align: center; }
.avatar { position: relative; flex: 0 0 auto; width: 96px; height: 96px; }
.avatar img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  background: #15151f;
  border: 4px solid rgba(12, 12, 18, .95);
  box-shadow: 0 0 0 1px var(--line-strong), 0 12px 30px -8px rgba(var(--accent-rgb), .5);
}
.avatar-status {
  position: absolute; right: 6px; bottom: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: #22c55e; border: 3px solid #0d0d14;
}
.identity { min-width: 0; padding-bottom: 6px; }
.name { display: flex; align-items: center; gap: 6px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
body.theme-minimal .name { justify-content: center; }
.name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.verified { width: 20px; height: 20px; flex: 0 0 auto; fill: var(--accent); filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .6)); }
.verified .check { stroke: #fff; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
body.theme-minimal .meta { justify-content: center; }
.badge {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  padding: 4px 10px; border-radius: 99px;
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .35), rgba(var(--accent2-rgb), .3));
  border: 1px solid rgba(var(--accent-rgb), .45);
}
.location { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.location svg { width: 13px; height: 13px; }

/* ─── Bio & tags ─── */
.bio {
  padding: 16px 22px 0; font-size: 14.5px; line-height: 1.65; color: var(--text-2);
  min-height: 1.65em; white-space: pre-line; unicode-bidi: plaintext;
}
body.theme-minimal .bio { text-align: center; }
.bio.typing::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-inline-start: 2px; vertical-align: -2px; background: var(--accent); animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 22px 0; }
body.theme-minimal .tags { justify-content: center; }
.tags li {
  font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 5px 11px; border-radius: 99px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.tags:empty { display: none; }

/* ─── Links ─── */
.links { display: grid; gap: 8px; padding: 20px 16px 0; }
.links:empty { display: none; }
body.layout-grid .links { grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 20px 22px 0; }
.link {
  --c: 139, 92, 246;
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), background .25s, border-color .25s, box-shadow .25s;
  overflow: hidden;
  isolation: isolate;
}
.link::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: linear-gradient(90deg, rgba(var(--c), .18), transparent 70%);
}
.link:hover, .link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(var(--c), .45);
  box-shadow: 0 10px 24px -12px rgba(var(--c), .55);
}
.link:hover::before, .link:focus-visible::before { opacity: 1; }
.link:active { transform: translateY(0) scale(.99); }
.link-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; overflow: hidden;
  display: grid; place-items: center;
  background: rgba(var(--c), .16); color: rgb(var(--c));
  font-weight: 700; font-size: 15px; text-transform: uppercase;
}
.link-icon img { width: 100%; height: 100%; object-fit: cover; }
.link-text { min-width: 0; flex: 1; display: grid; gap: 1px; }
.link-platform { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.link-label { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-go { width: 18px; height: 18px; color: var(--text-3); transition: transform .25s var(--ease), color .25s; }
.link:hover .link-go { transform: translate(2px, -2px); color: rgb(var(--c)); }

body.layout-grid .link { flex-direction: column; justify-content: center; padding: 12px 6px; gap: 6px; aspect-ratio: 1; }
body.layout-grid .link-text, body.layout-grid .link-go { display: none; }
body.layout-grid .link-icon { width: 42px; height: 42px; }

/* ─── Player ─── */
.player {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  margin: 18px 16px 0; padding: 10px 12px 10px 10px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
}
.player-cover { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, rgba(var(--accent-rgb), .5), rgba(var(--accent2-rgb), .4)); }
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.player-body { min-width: 0; display: grid; gap: 6px; }
.player-top { display: flex; align-items: center; gap: 8px; }
.player-title { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 3px; border-radius: 1px; background: var(--accent); transition: height .2s; }
.player.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.player.playing .eq i:nth-child(2) { animation-delay: .2s; }
.player.playing .eq i:nth-child(3) { animation-delay: .4s; }
.player.playing .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.player-progress { position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); cursor: pointer; touch-action: none; }
.player-progress::before { content: ''; position: absolute; inset: -8px 0; }
.player-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.player-fill::after { content: ''; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: #fff; transform: translateY(-50%) scale(0); transition: transform .2s; }
.player-progress:hover .player-fill::after { transform: translateY(-50%) scale(1); }
.player-times { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.player-controls { display: flex; align-items: center; gap: 2px; }
.pc { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); transition: color .2s, background .2s, transform .15s; }
.pc:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.pc:active { transform: scale(.92); }
.pc svg { width: 16px; height: 16px; fill: currentColor; }
.pc-main { width: 38px; height: 38px; background: #fff; color: #0a0a0f; }
.pc-main:hover { background: #fff; color: #000; transform: scale(1.05); }
.pc-main svg { width: 18px; height: 18px; }
.pc .i-pause, .player.playing .pc .i-play { display: none; }
.player.playing .pc .i-pause { display: block; }
.pc .i-muted, .player.muted .pc .i-vol { display: none; }
.player.muted .pc .i-muted { display: block; }

/* ─── Footer ─── */
.foot { display: flex; justify-content: center; padding: 16px 22px 0; }
.foot:has(> [hidden]:only-child) { display: none; }
.views { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.views svg { width: 14px; height: 14px; }

/* ─── Toast ─── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500;
  background: rgba(20, 20, 30, .92); border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── Cursor FX ─── */
.cursor-glow {
  position: fixed; z-index: 1; pointer-events: none; width: 420px; height: 420px; border-radius: 50%;
  left: 0; top: 0; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb), .12), transparent 65%);
  transition: opacity .4s;
}
.trail { position: fixed; z-index: 3; pointer-events: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); transform: translate(-50%, -50%); animation: trail .7s ease-out forwards; }
@keyframes trail { to { opacity: 0; transform: translate(-50%, -50%) scale(.2); } }

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .stage { padding: 20px 12px; align-items: start; }
  .card { margin-top: 12px; }
  .banner { height: 120px; }
  .head { padding: 0 18px; margin-top: -40px; gap: 12px; }
  .avatar { width: 84px; height: 84px; }
  .name { font-size: 21px; }
  .bio, .tags { padding-inline: 18px; }
  .links { padding-inline: 12px; }
  body.layout-grid .links { padding-inline: 16px; gap: 8px; }
  .player { margin-inline: 12px; grid-template-columns: 44px 1fr auto; }
  .player-cover { width: 44px; height: 44px; }
  .pc-vol { display: none; }
}
@media (hover: none) { .cursor-glow { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ══════════ Style options ══════════ */
/* fonts */
body.font-grotesk { --font: 'Space Grotesk', 'IBM Plex Sans Arabic', system-ui, sans-serif; }
body.font-mono    { --font: 'JetBrains Mono', 'IBM Plex Sans Arabic', ui-monospace, monospace; }
body.font-serif   { --font: 'Playfair Display', 'IBM Plex Sans Arabic', Georgia, serif; }

/* name effects */
body.name-gradient .name span {
  background: linear-gradient(120deg, #fff 10%, rgb(var(--accent-rgb)) 55%, rgb(var(--accent2-rgb)) 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
body.name-glow .name span { text-shadow: 0 0 18px rgba(var(--accent-rgb), .85), 0 0 42px rgba(var(--accent-rgb), .45); }
body.name-shine .name span {
  background: linear-gradient(100deg, #fff 0%, #fff 40%, rgb(var(--accent-rgb)) 50%, #fff 60%, #fff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 3.2s linear infinite;
}
@keyframes shine { from { background-position: 125% 0; } to { background-position: -125% 0; } }
body.name-rainbow .name span {
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #47e891, #3ec6ff, #a46bff, #ff5f6d);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: rainbow 6s linear infinite;
}
@keyframes rainbow { to { background-position: 300% 0; } }

/* avatar shape */
body.shape-rounded .avatar img { border-radius: 26%; }
body.shape-square  .avatar img { border-radius: 14px; }
body.shape-rounded .avatar::before, body.shape-rounded .avatar::after { border-radius: 30% !important; }
body.shape-square  .avatar::before, body.shape-square  .avatar::after { border-radius: 18px !important; }

/* avatar ring */
.avatar img { position: relative; z-index: 1; }
.avatar-status { z-index: 2; }
body.ring-none .avatar img { box-shadow: 0 0 0 1px var(--line-strong); }
body.ring-glow .avatar img { box-shadow: 0 0 0 1px var(--line-strong), 0 0 28px -2px rgba(var(--accent-rgb), .75); }
body.ring-spin .avatar::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg, rgb(var(--accent-rgb)), rgb(var(--accent2-rgb)), transparent 60%, rgb(var(--accent-rgb)));
  animation: spin 3s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body.ring-pulse .avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; z-index: 0;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .7);
  animation: ring-pulse 2.2s ease-out infinite;
}
@keyframes ring-pulse { to { box-shadow: 0 0 0 16px rgba(var(--accent-rgb), 0); } }

/* player when it uses the background video's sound */
.player.video-mode #btn-prev, .player.video-mode #btn-next, .player.video-mode .pc-vol { display: none; }
.player.video-mode .player-cover { position: relative; }
.player.video-mode .player-cover::after {
  content: ''; position: absolute; right: 4px; bottom: 4px; width: 14px; height: 10px; border-radius: 2px;
  background: rgba(0,0,0,.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/8px no-repeat;
}
