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

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Regular.ttf');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Medium.ttf');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter_18pt-Bold.ttf');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple-100: #f3e8ff;
  --purple-300: #c084fc;
  --purple-400: #a855f7;
  --purple-500: #9333ea;
  --purple-600: #7e22ce;
  --purple-700: #6b21a8;
  --purple-900: #3b0764;

  --grey-50:  #f9fafb;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb;
  --grey-600: #4b5563;
  --grey-700: #374151;
  --grey-800: #1f2937;
  --grey-900: #111827;

  --bg:      var(--grey-900);
  --surface: rgba(255, 255, 255, 0.05);
  --border:  rgba(255, 255, 255, 0.08);
  --text:    var(--grey-100);
  --muted:   var(--grey-600);

  --radius:  14px;
  --max-w:   440px;
}

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
}

/* ── Background ─────────────────────────────────── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(126, 34, 206, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59, 7, 100, 0.3), transparent),
    var(--bg);
}

/* Subtle animated grain */
.bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

/* ── Circuit Traces ───────────────────────────────── */
.traces {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.trace-path {
  fill: none;
  stroke: var(--purple-900);
  stroke-width: 1.2;
  opacity: 0.6;
}

.trace-pulse {
  fill: none;
  stroke: var(--purple-500);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px var(--purple-400)) drop-shadow(0 0 6px rgba(147, 51, 234, 0.5));
  stroke-dasharray: 5 95;
  animation: traceFlow linear infinite;
}

.trace-node {
  fill: var(--purple-500);
  opacity: 0.35;
  animation: nodeGlow 3s ease-in-out infinite;
}

@keyframes traceFlow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -100; }
}

@keyframes nodeGlow {
  0%, 100% { opacity: 0.3; r: 2; }
  50%      { opacity: 0.7; r: 2.5; }
}


.trace:nth-child(1) .trace-pulse { animation-duration: 5s; animation-delay: 0s; }
.trace:nth-child(2) .trace-pulse { animation-duration: 6s; animation-delay: -1.5s; }
.trace:nth-child(3) .trace-pulse { animation-duration: 5.5s; animation-delay: -3s; }
.trace:nth-child(4) .trace-pulse { animation-duration: 6.5s; animation-delay: -0.8s; }
.trace:nth-child(5) .trace-pulse { animation-duration: 5s; animation-delay: -2.2s; }
.trace:nth-child(6) .trace-pulse { animation-duration: 6s; animation-delay: -4s; }


.trace:nth-of-type(1) .trace-node:nth-child(1) { animation-delay: 0s; }
.trace:nth-of-type(1) .trace-node:nth-child(2) { animation-delay: 0.4s; }
.trace:nth-of-type(1) .trace-node:nth-child(3) { animation-delay: 0.9s; }
.trace:nth-of-type(1) .trace-node:nth-child(4) { animation-delay: 1.5s; }
.trace:nth-of-type(1) .trace-node:nth-child(5) { animation-delay: 2s; }
.trace:nth-of-type(1) .trace-node:nth-child(6) { animation-delay: 2.5s; }
.trace:nth-of-type(1) .trace-node:nth-child(7) { animation-delay: 3s; }

.trace:nth-of-type(2) .trace-node:nth-child(1) { animation-delay: -0.3s; }
.trace:nth-of-type(2) .trace-node:nth-child(2) { animation-delay: 0.2s; }
.trace:nth-of-type(2) .trace-node:nth-child(3) { animation-delay: 0.7s; }
.trace:nth-of-type(2) .trace-node:nth-child(4) { animation-delay: 1.3s; }
.trace:nth-of-type(2) .trace-node:nth-child(5) { animation-delay: 1.8s; }
.trace:nth-of-type(2) .trace-node:nth-child(6) { animation-delay: 2.3s; }
.trace:nth-of-type(2) .trace-node:nth-child(7) { animation-delay: 2.8s; }

.trace:nth-of-type(3) .trace-node:nth-child(1) { animation-delay: -0.6s; }
.trace:nth-of-type(3) .trace-node:nth-child(2) { animation-delay: 0.5s; }
.trace:nth-of-type(3) .trace-node:nth-child(3) { animation-delay: 1.1s; }
.trace:nth-of-type(3) .trace-node:nth-child(4) { animation-delay: 1.7s; }
.trace:nth-of-type(3) .trace-node:nth-child(5) { animation-delay: 2.3s; }
.trace:nth-of-type(3) .trace-node:nth-child(6) { animation-delay: 2.9s; }
.trace:nth-of-type(3) .trace-node:nth-child(7) { animation-delay: 3.5s; }
.trace:nth-of-type(3) .trace-node:nth-child(8) { animation-delay: 4s; }

.trace:nth-of-type(4) .trace-node:nth-child(1) { animation-delay: -0.1s; }
.trace:nth-of-type(4) .trace-node:nth-child(2) { animation-delay: 0.3s; }
.trace:nth-of-type(4) .trace-node:nth-child(3) { animation-delay: 0.7s; }
.trace:nth-of-type(4) .trace-node:nth-child(4) { animation-delay: 1.1s; }
.trace:nth-of-type(4) .trace-node:nth-child(5) { animation-delay: 1.5s; }
.trace:nth-of-type(4) .trace-node:nth-child(6) { animation-delay: 1.9s; }
.trace:nth-of-type(4) .trace-node:nth-child(7) { animation-delay: 2.3s; }
.trace:nth-of-type(4) .trace-node:nth-child(8) { animation-delay: 2.7s; }

.trace:nth-of-type(5) .trace-node:nth-child(1) { animation-delay: -0.4s; }
.trace:nth-of-type(5) .trace-node:nth-child(2) { animation-delay: 0.0s; }
.trace:nth-of-type(5) .trace-node:nth-child(3) { animation-delay: 0.4s; }
.trace:nth-of-type(5) .trace-node:nth-child(4) { animation-delay: 0.9s; }
.trace:nth-of-type(5) .trace-node:nth-child(5) { animation-delay: 1.4s; }
.trace:nth-of-type(5) .trace-node:nth-child(6) { animation-delay: 1.9s; }
.trace:nth-of-type(5) .trace-node:nth-child(7) { animation-delay: 2.4s; }
.trace:nth-of-type(5) .trace-node:nth-child(8) { animation-delay: 2.9s; }

.trace:nth-of-type(6) .trace-node:nth-child(1) { animation-delay: -0.7s; }
.trace:nth-of-type(6) .trace-node:nth-child(2) { animation-delay: 0.4s; }
.trace:nth-of-type(6) .trace-node:nth-child(3) { animation-delay: 0.9s; }
.trace:nth-of-type(6) .trace-node:nth-child(4) { animation-delay: 1.5s; }
.trace:nth-of-type(6) .trace-node:nth-child(5) { animation-delay: 2.1s; }
.trace:nth-of-type(6) .trace-node:nth-child(6) { animation-delay: 2.7s; }


main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-w);
  padding: 3rem 1.25rem;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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


.profile {
  text-align: center;
  margin-bottom: 2rem;
}

.avatar {
  display: block;
  width: 114px;
  height: 114px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(148, 53, 247, 0.15), 0 8px 32px rgba(107, 33, 168, 0.35);
}

.username {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--purple-300), var(--purple-100));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bio {
  margin-top: 0.4rem;
  font-size: 0.925rem;
  color: var(--muted);
}



.links {
  display: flex;
  flex-direction: column;
  align-items: center;        
  gap: 0.75rem;
}

.link-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  will-change: transform, background;
  transform: translateZ(0);
  width: 85%;
}

.link-btn .link-inner {
  display: grid;
  grid-template-columns: 20px 1fr 20px;
  align-items: center;
  column-gap: 0.75rem;
  width: 13rem;
}

.link-btn .icon {
  grid-column: 1;
  justify-self: center;
  flex-shrink: 0;
}

.link-btn .link-inner span {
  grid-column: 2;
  text-align: center;
}


.link-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-300), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  opacity: 0;
}

.link-btn:hover::before,
.link-btn:focus-visible::before {
  opacity: 1;
  transform: scaleX(1);
}

.link-btn:hover,
.link-btn:focus-visible {
  background: rgba(148, 53, 247, 0.1);
  border-color: rgba(148, 53, 247, 0.3);
  box-shadow: 0 4px 24px rgba(126, 34, 206, 0.2);
}



.link-btn {
  animation: btnIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.link-btn:nth-child(1) { animation-delay: 0.10s; }
.link-btn:nth-child(2) { animation-delay: 0.18s; }
.link-btn:nth-child(3) { animation-delay: 0.26s; }
.link-btn:nth-child(4) { animation-delay: 0.34s; }
.link-btn:nth-child(5) { animation-delay: 0.42s; }
.link-btn:nth-child(6) { animation-delay: 0.58s; }

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

.link-btn:hover {
  transform: translateY(-2px);
}

.link-btn:active {
  transform: translateY(0) scale(0.98);
}


.icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.link-btn:hover .icon {
  opacity: 1;
  color: var(--purple-300);
}


.link-btn:focus-visible {
  outline: 2px solid var(--purple-400);
  outline-offset: 2px;
}


@media (max-width: 480px) {
  :root { --radius: 12px; }

  main {
    padding: 2.5rem 1rem;
    align-self: flex-start;
    padding-top: 5rem;
  }

  .username {
    font-size: 1.65rem;
  }

  .avatar {
    width: 94px;
    height: 94px;
  }

  .link-btn {
    padding: 0.8rem 1.1rem;
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) {
  .link-btn {
    padding: 1rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


.trace-blur {
  position: fixed;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  mask-image: radial-gradient(ellipse 10% 40% at 50% 50%, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 30%, transparent 40%);
  pointer-events: none;
}