:root {
  --bg1: #faf5ff;
  --bg2: #eadcff;
  --bg3: #d9c2fb;
  --text: #2b1a4a;
  --muted: #5d4a86;
  --card: rgba(255, 255, 255, .72);
  --line: #8e6fd8;
  --acc1: #8e6fd8;
  --acc2: #d98fd0;
  --acc-text: #fff;
  --glow: #b394f066;
  --particle: #b394f0;
  --tab-active-bg: rgba(142, 111, 216, .15);
  --code: rgba(142, 111, 216, .16);
}

:root[data-theme="dark"] {
  --bg1: #1b0f33;
  --bg2: #2b1a4a;
  --bg3: #46308a;
  --text: #f3ebff;
  --muted: #c4b0ee;
  --card: rgba(43, 26, 74, .78);
  --line: #b394f0;
  --acc1: #8e6fd8;
  --acc2: #ffc9e6;
  --acc-text: #1b0f33;
  --glow: #b394f044;
  --particle: #8e6fd8;
  --tab-active-bg: rgba(179, 148, 240, .14);
  --code: rgba(179, 148, 240, .16);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg1: #1b0f33;
    --bg2: #2b1a4a;
    --bg3: #46308a;
    --text: #f3ebff;
    --muted: #c4b0ee;
    --card: rgba(43, 26, 74, .78);
    --line: #b394f0;
    --acc1: #8e6fd8;
    --acc2: #ffc9e6;
    --acc-text: #1b0f33;
    --glow: #b394f044;
    --particle: #8e6fd8;
    --tab-active-bg: rgba(179, 148, 240, .14);
    --code: rgba(179, 148, 240, .16);
  }
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg3);
}

body {
  min-height: 100dvh;
  font-family: "Pixelify Sans", monospace, sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 55%, var(--bg3) 100%) fixed;
  overflow-x: hidden;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.theme-btn {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 200;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  border-radius: 14px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px var(--glow);
}

.theme-btn:hover { border-color: var(--acc2); transform: scale(1.08); }
.theme-btn:focus-visible { outline: 3px solid var(--acc2); outline-offset: 3px; }

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 72px 20px 40px;
}

.narrow {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.wide {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.avatar-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin-top: 8px;
}

.avatar-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--acc1), var(--acc2), var(--acc1));
  animation: spin-ring 6s linear infinite;
  z-index: 0;
}

.avatar-wrap::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg2);
  z-index: 1;
}

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

.avatar-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  animation: float 5s ease-in-out infinite;
  display: block;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.profile-name {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .5px;
}

.profile-bio {
  color: var(--muted);
  font-size: 16px;
  text-align: center;
  max-width: 360px;
  line-height: 1.45;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--acc1);
  background: var(--card);
  backdrop-filter: blur(6px);
}

.divider {
  width: 100%;
  height: 2px;
  border: none;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  border-radius: 9999px;
}

.tabs {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.tab-btn {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: none;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.tab-btn:hover { background: var(--tab-active-bg); color: var(--text); }
.tab-btn.active {
  background: linear-gradient(100deg, var(--acc1), var(--acc2));
  color: var(--acc-text);
}
.tab-btn:focus-visible { outline: 3px solid var(--acc2); outline-offset: 2px; }

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

.section-label {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--muted);
  padding-left: 4px;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  border-radius: 18px;
  backdrop-filter: blur(8px);
  transition: border-color .18s, transform .14s, box-shadow .18s, filter .18s;
  box-shadow: 0 4px 14px var(--glow), 0 2px 0 rgba(0, 0, 0, .18);
  position: relative;
  overflow: hidden;
}

.link-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .12), transparent);
  transition: left .4s ease;
  pointer-events: none;
}

.link-btn:hover::before { left: 150%; }
.link-btn:hover {
  border-color: var(--acc2);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--glow), 0 4px 0 rgba(0, 0, 0, .15);
}
.link-btn:focus-visible { outline: 3px solid var(--acc2); outline-offset: 3px; }

.link-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  font-size: 20px;
  background: linear-gradient(135deg, var(--acc1), var(--acc2));
  color: var(--acc-text);
  border-radius: 12px;
}

.link-label { flex: 1; }
.link-arrow { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.link-btn:hover .link-arrow { transform: translateX(5px); }

.link-btn--accent {
  background: linear-gradient(100deg, var(--acc1), var(--acc2));
  border-color: transparent;
  color: var(--acc-text);
}
.link-btn--accent .link-icon { background: rgba(255, 255, 255, .22); }
.link-btn--accent .link-arrow { color: var(--acc-text); opacity: .75; }
.link-btn--accent:hover { border-color: transparent; filter: brightness(1.1); }

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px var(--glow);
}

.card h2, .card h3 {
  font-size: 22px;
  margin-bottom: 8px;
}

.card p + p { margin-top: 8px; }
.card ul, .card ol { margin: 8px 0 0 1.2em; }
.card li + li { margin-top: 4px; }

.lead { color: var(--muted); }

code, .cmd {
  font-family: inherit;
  font-weight: 700;
  background: var(--code);
  border-radius: 8px;
  padding: 0 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.rank {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.price {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card:has(table) { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { color: var(--muted); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }

.footer {
  margin-top: auto;
  padding-top: 36px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  width: 100%;
  max-width: 920px;
}

.footer a { color: var(--acc1); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.socials { display: flex; justify-content: center; gap: 14px; margin-bottom: 8px; font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
  .avatar-img, .avatar-wrap::before { animation: none; }
  html { scroll-behavior: auto; }
  .link-btn, .link-btn::before { transition: none; }
}
