:root {
  --bg: #000000;
  --surface: #0a0a0c;
  --surface-2: #101014;
  --line: #1c1c22;
  --line-soft: #16161b;
  --text: #ededf2;
  --muted: #8a8a95;
  --accent: #3b6dff;
  --accent-soft: rgba(59, 109, 255, 0.14);
  --online: #23a55a;
  --idle: #f0b232;
  --dnd: #f23f43;
  --offline: #80848e;
  --radius: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: -60px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 72% 58% at 50% 26%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 58% at 50% 26%, #000, transparent 78%);
  animation: grid-drift 42s linear infinite;
}

@keyframes grid-drift {
  to { transform: translate(46px, 46px); }
}

.bg-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.bg-aurora.a1 {
  width: 640px;
  height: 640px;
  top: -260px;
  left: 50%;
  margin-left: -440px;
  background: radial-gradient(circle, rgba(59, 109, 255, 0.30), transparent 68%);
  animation: aurora-1 30s ease-in-out infinite alternate;
}

.bg-aurora.a2 {
  width: 520px;
  height: 520px;
  top: 60px;
  left: 50%;
  margin-left: 30px;
  background: radial-gradient(circle, rgba(96, 62, 224, 0.22), transparent 70%);
  animation: aurora-2 26s ease-in-out infinite alternate;
}

@keyframes aurora-1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(90px, 60px) scale(1.14); }
}

@keyframes aurora-2 {
  from { transform: translate(0, 0) scale(1.06); }
  to { transform: translate(-110px, 40px) scale(0.92); }
}

#bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

.wrap {
  position: relative;
  z-index: 1;
  isolation: isolate;
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  position: relative;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.35s ease;
}
.card:hover { border-color: #24242e; }

.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.75s ease,
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal:not(.in) .bar span { width: 0 !important; }

.card h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card p { margin: 12px 0 0; color: #c4c4cd; }
.card p.lead { color: var(--text); }
.card strong { color: #fff; font-weight: 600; }

.section-note {
  margin: 6px 0 20px !important;
  font-size: 14px;
  color: var(--muted);
}

.profile { padding: 0; overflow: hidden; }

.banner {
  height: 168px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(10, 10, 12, 0.9) 100%),
    linear-gradient(135deg, #16204a 0%, #0b0d18 55%, #0a0a0c 100%);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line-soft);
}

.profile-body { padding: 0 28px 28px; }

.avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: -46px;
}

.avatar-shell { position: relative; width: 96px; height: 96px; }

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 5px solid var(--surface);
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.avatar-shell:hover .avatar { transform: scale(1.04); }

.avatar-shell::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 109, 255, 0.28), transparent 68%);
  opacity: 0;
  z-index: -1;
  animation: halo 5s ease-in-out infinite;
}

@keyframes halo {
  0%, 100% { opacity: 0.35; transform: scale(0.94); }
  50% { opacity: 0.75; transform: scale(1.06); }
}

.dot {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: var(--offline);
  transition: background 0.25s ease;
}
.dot[data-status="online"] {
  background: var(--online);
  animation: dot-ring 2.6s ease-out infinite;
}

@keyframes dot-ring {
  0% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(35, 165, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 165, 90, 0); }
}
.dot[data-status="idle"] { background: var(--idle); }
.dot[data-status="dnd"] { background: var(--dnd); }

.identity { margin-top: 16px; }

.name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.guild-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  background: #17171d;
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c4c4cd;
}
.guild-tag img { width: 15px; height: 15px; border-radius: 3px; }

.identity h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.handle {
  margin: 4px 0 0 !important;
  font-size: 14px;
  color: var(--muted) !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.handle .sep { opacity: 0.4; }
.status-label { color: #b9b9c4; }

.custom-status {
  margin-top: 12px !important;
  font-size: 14px;
  color: #c4c4cd !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-status img { width: 18px; height: 18px; }

.activities {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.activity {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  transition: border-color 0.25s ease;
  animation: activity-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.activity:hover { border-color: #2a2a35; }

@keyframes activity-in {
  from { opacity: 0; transform: translateY(8px); }
}

.activity-art img { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.activity:hover .activity-art img { transform: scale(1.05); }

.activity-art {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
}

.activity-art img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a1a20;
  display: block;
}

.activity-art .small {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}

.activity-art.placeholder {
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 20px;
}

.activity-text { min-width: 0; }

.activity-kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.activity-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-line {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time { font-family: var(--mono); font-size: 12px; color: #9c9caa; }

.live-hint {
  margin-top: 18px !important;
  font-size: 12px;
  color: var(--muted) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}
.live-hint[data-live="false"] { opacity: 0.5; }

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(59, 109, 255, 0.6);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(59, 109, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 109, 255, 0); }
}

.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }

.skill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.skill-name { font-family: var(--mono); font-size: 15px; font-weight: 500; color: #fff; }

.skill-tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.skill-tag.muted { color: var(--muted); }

.skill-tag.strong {
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #2b52d6, var(--accent));
}

.skill[data-level="4"] .bar span {
  background: linear-gradient(90deg, #2b52d6, var(--accent), #6d92ff);
  box-shadow: 0 0 12px rgba(59, 109, 255, 0.45);
}

.bar {
  margin-top: 8px;
  height: 4px;
  border-radius: 999px;
  background: #17171d;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b52d6, var(--accent));
  width: 0;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill[data-level="4"] .bar span { width: 86%; }
.skill[data-level="3"] .bar span { width: 62%; }
.skill[data-level="1"] .bar span { width: 22%; background: #33333d; }

.skill:nth-child(1) .bar span { transition-delay: 0.05s; }
.skill:nth-child(2) .bar span { transition-delay: 0.12s; }
.skill:nth-child(3) .bar span { transition-delay: 0.19s; }
.skill:nth-child(4) .bar span { transition-delay: 0.26s; }
.skill:nth-child(5) .bar span { transition-delay: 0.33s; }
.skill:nth-child(6) .bar span { transition-delay: 0.40s; }

.skill-note { margin: 8px 0 0 !important; font-size: 13.5px; color: var(--muted) !important; }

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

.tile {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.tile:hover {
  border-color: #2a3a6b;
  transform: translateY(-3px);
  background: #12121a;
}

.tile h3::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  margin-top: 7px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.45;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.tile:hover h3::after { width: 34px; opacity: 1; }

.tile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tile-tag {
  flex: none;
  margin-top: 1px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #17171d;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.tile:hover .tile-tag { color: var(--accent); border-color: #2f4bb0; }

.tile h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.tile p { margin: 6px 0 0 !important; font-size: 13.5px; color: var(--muted) !important; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { border-color: #303040; background: #16161c; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: #2f5ce0; border-color: #2f5ce0; }

.btn.ghost.copied { border-color: var(--online); color: var(--online); }

.contact-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.contact-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

.contact-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease;
}

.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-card:hover {
  border-color: #2f4bb0;
  transform: translateY(-3px);
}
.contact-card:hover::before { opacity: 1; }

.contact-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-card > * { position: relative; }

.contact-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #17171d;
  color: var(--muted);
  transition: color 0.25s ease, background 0.25s ease, transform 0.35s ease;
}
.contact-icon svg { width: 20px; height: 20px; }

.contact-card:hover .contact-icon {
  color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.06);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.contact-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-value {
  font-family: var(--mono);
  font-size: 14px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-action {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.contact-card:hover .contact-action { color: var(--accent); }

.contact-action .arrow {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.contact-card:hover .contact-action .arrow { transform: translateX(4px); }

.contact-card.copied { border-color: var(--online); }
.contact-card.copied .contact-action { color: var(--online); }
.contact-card.copied .contact-icon { color: var(--online); background: rgba(35, 165, 90, 0.14); }
.contact-card.copied .contact-action .arrow { transform: none; }

footer {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #55555f;
  display: flex;
  justify-content: center;
  gap: 8px;
}
footer .sep { opacity: 0.5; }

@media (max-width: 560px) {
  .wrap { padding: 20px 14px 48px; }
  .card { padding: 22px; }
  .profile-body { padding: 0 22px 22px; }
  .banner { height: 128px; }
  .identity h1 { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .reveal:not(.in) .skill[data-level="4"] .bar span { width: 86% !important; }
  .reveal:not(.in) .skill[data-level="3"] .bar span { width: 62% !important; }
  .reveal:not(.in) .skill[data-level="1"] .bar span { width: 22% !important; }
  #bgCanvas { display: none; }
}
