:root {
  color-scheme: dark;
  --bg-0: #0c1018;
  --bg-1: #131a28;
  --bg-2: #1a1f2d;
  --text-main: #eef3fb;
  --text-subtle: #94a3b8; /* Shifted slightly brighter for better readability */
  --card-border: rgba(255, 255, 255, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(88rem 52rem at 8% -24%, rgba(111, 137, 182, 0.22), transparent 60%),
    radial-gradient(56rem 38rem at 104% 118%, rgba(142, 103, 186, 0.14), transparent 62%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 46px);
  opacity: 0.07;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(35rem 18rem at 50% 5%, rgba(255, 255, 255, 0.08), transparent 67%);
  opacity: 0.38;
  z-index: 0;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.8rem 1.3rem;
  position: relative;
  z-index: 1;
}

.links-card {
  width: min(660px, 95vw);
  padding: 2rem 1.75rem; /* Marginally expanded breathing room */
  border-radius: 1.2rem;
  border: 1px solid var(--card-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.avatar {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, #3f4f6b, #2a374d);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 220ms ease, box-shadow 220ms ease;
}

.avatar:hover {
  transform: rotate(-6deg) scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.38);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar.has-logo {
  background: #101722;
}

.avatar.has-logo img {
  display: block;
}

.avatar.has-logo .avatar-fallback {
  display: none;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #ecf2ff;
  font-weight: 700;
  font-size: 1.35rem;
  text-transform: lowercase;
}

.profile-info h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.profile-info p {
  margin: 0.35rem 0 0;
  color: var(--text-subtle);
  font-size: 0.95rem;
  font-weight: 450;
}

.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.link-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.92rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 1.1rem 1.3rem;
  transition: transform 200ms cubic-bezier(0.215, 0.610, 0.355, 1), border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

/* Subtle accent dynamic line border indicators */
.link-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: rgb(var(--accent));
  opacity: 0.4;
  transition: opacity 200ms ease, top 200ms ease, bottom 200ms ease;
}

.platform-meta {
  display: flex;
  align-items: center; /* This forces vertical centering */
  gap: 0.75rem;
}

.brand-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px; /* Tiny adjustment to pixel-perfect it if needed */
  flex-shrink: 0;
  color: var(--text-subtle);
  transition: color 200ms ease, transform 200ms ease;
}

.platform {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
}

.handle {
  color: var(--text-subtle);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 200ms ease;
}

/* 1. Set the indicator to its full height from the start, but hide it with scaleY(0) */
.link-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0.92rem 0 0 0.92rem;
  background: rgb(var(--accent));
  opacity: 0; /* Keeps it completely hidden initially */
  transform: scaleY(0); /* Shrinks it vertically to a center point */
  transform-origin: center; /* Ensures it grows outward smoothly */
  transition: transform 220ms cubic-bezier(0.25, 1, 0.5, 1), opacity 220ms ease;
}

/* 2. On hover, just smoothly scale it up and fade it in */
.link-item:hover::before,
.link-item:focus-visible::before {
  opacity: 1;
  transform: scaleY(1); /* Snaps smoothly to 100% height without shifting position */
}

.link-item:hover .brand-icon,
.link-item:focus-visible .brand-icon {
  color: rgb(var(--accent));
  transform: scale(1.05);
}

.link-item:hover .handle,
.link-item:focus-visible .handle {
  color: #fff;
}

.link-item:focus-visible {
  outline: 2px solid rgba(var(--accent), 0.6);
  outline-offset: 3px;
}

/* Clean up layouts dynamically for small devices */
@media (max-width: 540px) {
  .links-card {
    padding: 1.5rem 1.15rem;
  }

  .card-header {
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  .link-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1rem 1.15rem;
  }
  
  .handle {
    margin-left: 2.1rem; /* Aligns handles directly under platform titles cleanly */
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }

  .avatar:hover, .link-item:hover {
    transform: none !important;
  }
}