:root {
  color-scheme: dark;
  --background: #0c0a16;
  --text: #f8f6fc;
  --muted: #b7afc8;
  --accent: #d1adff;
  --line: rgb(222 206 255 / 12%);
  --backdrop-image: url("assets/night-lake.png");
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 280px;
  background: var(--background);
  color: var(--text);
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #a277d4; color: #fff; }

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.scene {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background-color: #141124;
  background-image: var(--backdrop-image);
  background-size: cover;
  background-position: center;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, transparent 15%, rgb(4 3 10 / 55%) 100%),
    linear-gradient(180deg, rgb(10 8 20 / 15%), rgb(8 7 16 / 53%));
}

.skip-link {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: #20172e;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.music-dock {
  position: fixed;
  z-index: 4;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(360px, calc(100% - 32px - env(safe-area-inset-right) - env(safe-area-inset-left)));
  border-radius: 13px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 45%);
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 48px 24px 128px;
}

.profile-card {
  width: min(100%, 600px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(211 173 255 / 29%);
  border-radius: 26px;
  background: rgb(17 14 26 / 95%);
  box-shadow:
    0 28px 100px rgb(0 0 0 / 45%),
    0 0 60px rgb(123 68 182 / 10%),
    inset 0 0 0 1px rgb(255 255 255 / 3%);
  animation: arrive .6s ease both;
}

@supports ((backdrop-filter: blur(22px)) or (-webkit-backdrop-filter: blur(22px))) {
  .profile-card {
    background: rgb(17 14 26 / 70%);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
  }
}

.profile-banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 145px;
  padding: 17px 22px;
  border-bottom: 1px solid rgb(219 194 252 / 14%);
  background-color: #242037;
  background-image:
    linear-gradient(180deg, rgb(15 11 26 / 25%), rgb(15 11 26 / 8%) 40%, rgb(17 14 26 / 72%)),
    var(--backdrop-image);
  background-size: cover;
  background-position: center 37%;
}

.banner-monogram {
  display: grid;
  grid-auto-flow: column;
  align-items: baseline;
  min-height: 36px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -2px;
  text-shadow: 0 0 15px rgb(242 226 255 / 35%);
}

.banner-monogram > span { color: var(--accent); }

.banner-shortcut {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 12px;
  background: rgb(18 14 29 / 35%);
  color: #f7ecff;
  transition: background .2s ease, border-color .2s ease;
}

.banner-shortcut .icon { width: 17px; height: 17px; }

.banner-shortcut:hover {
  border-color: rgb(223 192 255 / 50%);
  background: rgb(177 121 230 / 22%);
}

.profile-intro {
  position: relative;
  padding: 0 28px 23px;
  text-align: center;
}

.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin: -54px auto 0;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 5px solid #1d1728;
  border-radius: 50%;
  background: #241a34;
  box-shadow: 0 0 0 1px rgb(221 184 255 / 44%), 0 0 35px rgb(173 105 231 / 24%);
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 15px 0 0;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.3px;
  text-shadow: 0 0 19px rgb(255 255 255 / 28%);
}

.name-spark {
  color: #dfc8ff;
  font-size: 19px;
  text-shadow: 0 0 14px rgb(199 149 255 / 65%);
}

.handle {
  margin: 8px 0 15px;
  color: var(--muted);
  font: 10px/1.6 var(--mono);
  letter-spacing: .5px;
  overflow-wrap: anywhere;
}

.bio {
  margin: 0 auto;
  color: #e0d9eb;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 19px;
}

.socials > a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #f7f2ff;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.socials .icon {
  width: 25px;
  height: 25px;
  filter: drop-shadow(0 0 5px rgb(243 222 255 / 36%));
}

.socials > a:hover {
  transform: translateY(-3px);
  border-color: rgb(205 161 255 / 25%);
  background: rgb(185 132 242 / 12%);
}

.profile-content { padding: 0 28px 25px; }

.profile-content > section + section { margin-top: 24px; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin: 0;
  color: #c2b8d1;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .5px;
}

.section-heading h2 .icon { width: 13px; height: 13px; color: var(--accent); }

.section-line { flex: 1; height: 1px; background: var(--line); }

.spotify-player {
  overflow: hidden;
  border: 1px solid rgb(233 214 255 / 12%);
  border-radius: 13px;
  background: #17151d;
  box-shadow: 0 5px 18px rgb(0 0 0 / 10%);
}

.spotify-player iframe {
  display: block;
  width: 100%;
  height: 80px;
  border: 0;
  border-radius: 12px;
}

.links { display: grid; gap: 9px; }

.profile-link {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 69px;
  padding: 11px 15px;
  border: 1px solid rgb(232 218 255 / 13%);
  border-radius: 14px;
  background: linear-gradient(110deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 3%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%);
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.link-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 6%);
  border-radius: 11px;
  background: rgb(255 255 255 / 5%);
  color: #f2e8ff;
}

.link-icon .icon { width: 23px; height: 23px; }

.link-copy { display: grid; gap: 4px; min-width: 0; }

.link-copy strong {
  color: #f5f0fb;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.link-copy > span {
  color: #b8afc6;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.link-arrow {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: #a99abb;
}

.discord-link {
  border-color: rgb(186 141 243 / 27%);
  background: linear-gradient(110deg, rgb(140 92 211 / 17%), rgb(165 115 232 / 5%));
}

.discord-link .link-icon { background: rgb(155 107 225 / 18%); color: #e0c7ff; }

.profile-link:hover {
  transform: translateY(-2px);
  border-color: rgb(210 170 255 / 45%);
  background: rgb(190 145 245 / 12%);
  box-shadow: 0 5px 20px rgb(0 0 0 / 13%);
}

.playlist-cover {
  display: block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 9px;
}

.discord-actions { display: flex; align-items: center; gap: 10px; }

.discord-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  color: var(--muted);
  font: 9px var(--mono);
}

.discord-open .icon { width: 11px; height: 11px; }
.discord-open:hover { color: var(--text); }

.discord-refresh {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgb(255 255 255 / 3%);
  color: var(--muted);
  cursor: pointer;
}

.discord-refresh .icon { width: 14px; height: 14px; }
.discord-refresh:hover { color: var(--text); border-color: rgb(210 170 255 / 45%); }
.discord-refresh:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.discord-refresh:disabled { opacity: .45; cursor: wait; }

.discord-user-card {
  overflow: hidden;
  border: 1px solid rgb(201 171 245 / 23%);
  border-radius: 15px;
  background: linear-gradient(130deg, rgb(48 35 68 / 54%), rgb(21 19 31 / 75%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%);
}

.discord-card-banner {
  height: 64px;
  border-bottom: 1px solid rgb(231 210 255 / 7%);
  background-color: #3b2f54;
  background-image: radial-gradient(ellipse at 85% 20%, #9474bd55, transparent 65%), linear-gradient(120deg, #504267, #28263e);
  background-size: cover;
  background-position: center;
}

.discord-card-banner[data-has-banner="true"] { height: auto; aspect-ratio: 5 / 2; }

.discord-card-content { padding: 0 19px 17px; }
.discord-user-heading { position: relative; display: flex; align-items: flex-start; gap: 16px; margin-top: -22px; }
.discord-avatar-wrap { position: relative; flex: 0 0 64px; width: 64px; height: 64px; }

.discord-avatar, .discord-avatar-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 4px solid #211b2f;
  border-radius: 50%;
  background: #594b7c;
}

.discord-avatar-placeholder .icon { width: 31px; height: 31px; color: #e8ddff; }
.discord-avatar-decoration { position: absolute; z-index: 1; top: -8px; left: -8px; width: 80px; height: 80px; object-fit: contain; pointer-events: none; }
.discord-identity { flex: 1; min-width: 0; padding-top: 32px; }
.discord-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.discord-name-row h3 { min-width: 0; max-width: 100%; margin: 0; color: #faf7ff; font-size: 20px; line-height: 1.2; font-weight: 600; letter-spacing: -.3px; overflow-wrap: anywhere; }
.discord-username { margin: 5px 0 0; color: #c1b4d3; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.discord-guild-tag { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; padding: 4px 6px; border: 1px solid rgb(238 221 255 / 16%); border-radius: 6px; background: rgb(255 255 255 / 5%); color: #eee7f7; font: 9px var(--mono); }
.discord-guild-tag img { display: block; width: 16px; height: 16px; object-fit: contain; }
.discord-status { display: flex; align-items: center; gap: 6px; margin: 9px 0 0; color: #beb2ce; font-size: 11px; line-height: 1.5; }
.discord-status-dot { position: relative; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: #90909a; }
.discord-status[data-status="online"] .discord-status-dot { background: #6dd39a; box-shadow: 0 0 9px #6dd39a30; }
.discord-status[data-status="idle"] .discord-status-dot { background: #f0ba65; }
.discord-status[data-status="dnd"] .discord-status-dot { background: #f27883; }
.discord-status[data-status="dnd"] .discord-status-dot::after { content: ""; position: absolute; top: 3px; left: 2px; width: 4px; height: 2px; background: #211b2f; }
.discord-status[data-status="unknown"] .discord-status-dot { display: none; }
.discord-user-card[data-state="unavailable"] .discord-avatar-decoration { opacity: .65; }
.discord-badges-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); color: #c9bbda; font: 10px var(--mono); }
.discord-badges-heading > span:last-child { color: #a894be; }
.discord-badges { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 440px; margin: 0; padding: 0; list-style: none; }
.discord-badge { min-width: 0; }
.discord-badge-button { display: grid; place-items: center; width: 100%; min-height: 40px; aspect-ratio: 1; padding: 6px; border: 1px solid rgb(233 217 255 / 11%); border-radius: 10px; background: rgb(255 255 255 / 5%); color: #f5edff; font: inherit; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.discord-badge-button:hover, .discord-badge-button[aria-pressed="true"] { border-color: #cba6fa; background: rgb(187 135 245 / 12%); }
.discord-badge-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.discord-badge img { display: block; width: 26px; height: 26px; max-width: 100%; object-fit: contain; }
.discord-badge-text { padding: 5px; font-size: 8px; line-height: 1.3; overflow-wrap: anywhere; }
.discord-badge-detail { margin: 10px 0 0; color: #e6d6f7; font-size: 11px; line-height: 1.6; }
.discord-sync-status { margin: 13px 0 0; color: #bcaccb; font: 10px/1.7 var(--mono); }
.discord-sync-status[data-state="synced"] { color: #a5d8ba; }
.discord-sync-status[data-state="stale"] { color: #e5c28e; }
.discord-note { margin: 15px 0 0; color: #b7a9c7; font-size: 10px; line-height: 1.7; }

.profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 51px;
  margin: 0 28px;
  border-top: 1px solid var(--line);
  color: #a89cb9;
  font: 9px/1.7 var(--mono);
  letter-spacing: .2px;
}

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

@media (max-width: 600px) {
  .page-shell { padding: 28px 16px 128px; }
  .profile-card { border-radius: 22px; }
  .profile-banner { height: 132px; padding: 15px 19px; }
  .profile-intro { padding-right: 20px; padding-left: 20px; }
  .profile-content { padding-right: 20px; padding-left: 20px; }
  .profile-footer { margin-right: 20px; margin-left: 20px; }
}

@media (max-width: 480px) {
  .discord-badges { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 216px; }
}

@media (max-width: 380px) {
  .page-shell { padding: 18px 12px 128px; }
  .profile-card { border-radius: 20px; }
  .profile-banner { height: 122px; }
  .profile-intro { padding-right: 15px; padding-left: 15px; }
  .avatar-wrap { width: 96px; height: 96px; margin-top: -48px; }
  h1 { font-size: 34px; }
  .bio { font-size: 13px; }
  .socials { gap: 8px; }
  .socials > a { width: 34px; height: 38px; }
  .socials .icon { width: 23px; height: 23px; }
  .profile-content { padding-right: 15px; padding-left: 15px; }
  .profile-link { gap: 10px; padding: 11px; }
  .link-icon { width: 36px; height: 36px; }
  .link-copy strong { font-size: 13px; }
  .link-copy > span { font-size: 10px; }
  .profile-footer { margin-right: 15px; margin-left: 15px; font-size: 8px; }
  .discord-card-content { padding-right: 13px; padding-left: 13px; }
  .discord-user-heading { gap: 13px; }
  .discord-name-row h3 { font-size: 18px; }
  .discord-actions { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .profile-card { animation: none; }
  .profile-link, .socials > a, .banner-shortcut, .discord-badge-button { transition: none; }
  .profile-link:hover, .socials > a:hover { transform: none; }
}
