/* =========================================================
   bio profile — profile.css
   ========================================================= */
:root {
  --accent: #7c5cff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 24px;
  --blur: 12px;
  --shade: 0.45;
  --bg-base: #0b0b13;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 20px 104px;
  font-family: var(--font);
  color: #f5f7ff;
  background: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- background ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--bg-base);
}

.backdrop__media {
  position: absolute;
  inset: -2%;
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.backdrop__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(4, 4, 10, 0) 0%, rgba(4, 4, 10, var(--shade)) 100%),
    linear-gradient(to bottom, rgba(4, 4, 10, calc(var(--shade) * 0.35)), rgba(4, 4, 10, calc(var(--shade) * 0.9)));
}

.backdrop__glow {
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.32;
  background: radial-gradient(circle, var(--accent) 0%, transparent 66%);
  animation: drift 24s ease-in-out infinite alternate;
}

.backdrop__glow--a { top: -16%; left: -12%; }
.backdrop__glow--b { bottom: -22%; right: -12%; animation-delay: -10s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(50px, 40px, 0) scale(1.15); }
}

.fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- profile card ---------- */
.stage {
  width: 100%;
  display: grid;
  place-items: center;
}

.profile {
  position: relative;
  width: min(430px, 100%);
  padding: 32px 26px 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 12, 20, 0.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(130%);
  backdrop-filter: blur(var(--blur)) saturate(130%);
  box-shadow:
    0 34px 80px -34px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  animation: enter 0.9s var(--ease) 0.04s both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.avatar {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--accent), rgba(255, 255, 255, 0.22));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 0 6px rgba(255, 255, 255, 0.045),
    0 20px 44px -20px var(--accent);
}

.avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

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

.avatar__initial {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgba(9, 9, 16, 0.86);
  text-transform: lowercase;
}

.profile__name {
  margin: 0;
  font-size: clamp(26px, 6.4vw, 33px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.022em;
  overflow-wrap: anywhere;
}

.profile__handle {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: rgba(240, 243, 255, 0.52);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.profile__handle.is-empty { display: none; }

.profile__bio {
  margin: 15px auto 0;
  max-width: 36ch;
  font-size: 15px;
  line-height: 1.68;
  color: rgba(240, 243, 255, 0.78);
  overflow-wrap: anywhere;
  min-height: 1.68em;
}

.profile__bio.is-empty { display: none; }

.profile__bio.typing::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 1.05em;
  margin-inline-start: 2px;
  vertical-align: -0.14em;
  background: currentColor;
  animation: caret 1s steps(1, end) infinite;
}

@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- discord connect ---------- */
.connect {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  max-width: 100%;
  margin: 16px auto 0;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  text-align: start;
  transition: border-color 0.25s, background-color 0.25s;
}

.connect[hidden] { display: none; }
.connect:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.07); }

.connect__main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.connect__logo {
  width: 16px;
  height: 16px;
  flex: none;
  color: #8b95ff;
}

.connect__name {
  font-weight: 600;
  color: #f2f5ff;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connect__state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(240, 243, 255, 0.55);
  white-space: nowrap;
}

.connect__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #80848e;
  transition: background-color 0.25s, box-shadow 0.25s;
}

.connect[data-status="online"] .connect__dot { background: #23a55a; box-shadow: 0 0 8px rgba(35, 165, 90, 0.9); }
.connect[data-status="idle"] .connect__dot { background: #f0b232; box-shadow: 0 0 8px rgba(240, 178, 50, 0.85); }
.connect[data-status="dnd"] .connect__dot { background: #f23f43; box-shadow: 0 0 8px rgba(242, 63, 67, 0.85); }

.connect__activity {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: rgba(240, 243, 255, 0.62);
}

.connect__activity[hidden] { display: none; }

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

.connect__art {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  object-fit: cover;
}

/* ---------- social icons ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.socials:empty { display: none; }

.social {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: rgba(245, 247, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  transition:
    transform 0.28s var(--ease),
    background-color 0.28s,
    border-color 0.28s,
    color 0.28s,
    box-shadow 0.28s;
}

.social svg { width: 19px; height: 19px; fill: currentColor; }

.social:hover {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -14px var(--accent);
}

/* ---------- dock ---------- */
.dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5, 5, 10, 0.5), transparent);
  pointer-events: none;
}

.dock > * { pointer-events: auto; }
.dock__side { display: flex; align-items: center; min-width: 0; }
.dock__side--start { justify-self: start; }
.dock__side--end { justify-self: end; }

.player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 14, 22, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  max-width: min(260px, 55vw);
}

.player[hidden] { display: none; }

.player__toggle {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #0a0a12;
  transition: transform 0.2s var(--ease);
}

.player__toggle:active { transform: scale(0.92); }

.player__icon { width: 15px; height: 15px; }
.player__icon--pause { display: none; }
.player.is-playing .player__icon--play { display: none; }
.player.is-playing .player__icon--pause { display: block; }

.player__meta { min-width: 0; text-align: start; }

.player__title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 155px;
}

.player__eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 9px;
  margin-top: 1px;
  opacity: 0.45;
}

.player__eq i {
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: var(--accent);
}

.player.is-playing .player__eq { opacity: 0.95; }
.player.is-playing .player__eq i { animation: eq 0.9s ease-in-out infinite; }
.player.is-playing .player__eq i:nth-child(2) { animation-delay: -0.35s; }
.player.is-playing .player__eq i:nth-child(3) { animation-delay: -0.6s; }
.player.is-playing .player__eq i:nth-child(4) { animation-delay: -0.15s; }

@keyframes eq {
  0%, 100% { height: 3px; }
  50% { height: 9px; }
}

.views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 10, 16, 0.38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  color: rgba(240, 243, 255, 0.55);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.views[hidden] { display: none; }
.views svg { width: 15px; height: 15px; opacity: 0.75; }
.views__label { opacity: 0.75; }

.gear {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 14, 22, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: rgba(240, 243, 255, 0.62);
  transition:
    transform 0.35s var(--ease),
    color 0.25s,
    background-color 0.25s,
    border-color 0.25s;
}

.gear svg { width: 19px; height: 19px; }

.gear:hover {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  transform: rotate(35deg);
}

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  body { padding: 28px 14px 96px; }
  .profile { padding: 28px 20px 22px; }
  .avatar { width: 92px; height: 92px; margin-bottom: 16px; }
  .avatar__initial { font-size: 40px; }
  .social { width: 44px; height: 44px; border-radius: 13px; }
  .dock { padding-inline: 12px; gap: 8px; }
  .player { max-width: 50vw; padding-inline-end: 10px; }
  .player__title { max-width: 92px; font-size: 11.5px; }
  .player__eq { display: none; }
  .views { font-size: 11.5px; padding: 5px 9px; }
  .views__label { display: none; }
  .gear { width: 42px; height: 42px; }
}

@media (max-height: 680px) {
  body { padding-top: 20px; }
  .profile { padding-top: 24px; padding-bottom: 20px; }
  .avatar { width: 82px; height: 82px; margin-bottom: 12px; }
  .avatar__initial { font-size: 34px; }
  .profile__bio { margin-top: 10px; }
  .socials { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .profile { animation: none; }
  .profile__bio.typing::after { animation: none; }
}
