:root {
  color-scheme: dark;
  --background: #242b38;
  --foreground: #f9f7f2;
  --muted: #b8c0cd;
  --card: #fcfaf6;
  --card-ink: #252a34;
  --accent: #9d8cff;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -130px, rgba(151, 141, 200, .19), transparent 390px),
    var(--background);
  color: var(--foreground);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(46px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.profile {
  width: min(100%, 550px);
  margin: 0 auto;
}

.profile-header { text-align: center; }

.avatar-frame {
  display: grid;
  place-items: center;
  width: 136px;
  height: 136px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  background: linear-gradient(145deg, #6b7190 0%, #323a50 54%, #8f7785 100%);
  box-shadow: 0 16px 46px rgba(5, 9, 20, .22), inset 0 0 0 3px rgba(255,255,255,.08);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initials {
  color: white;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.08em;
  transform: translateX(-.05em);
}

.profile-name {
  margin: 0;
  font-size: clamp(25px, 6vw, 32px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.profile-handle {
  margin: 8px 0 0;
  color: #e0e2e8;
  font-size: 15px;
  letter-spacing: .015em;
}

.profile-description {
  max-width: 400px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: balance;
}

.section-marker {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 150px;
  margin: 36px auto 27px;
  color: #f8f7f5;
}

.section-marker span {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.25);
}

.section-marker svg { flex: none; width: 30px; height: 30px; }

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

.link-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  min-height: 92px;
  padding: 10px;
  border: 3px solid rgba(31, 37, 47, .27);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 7px 0 rgba(11, 15, 24, .16), 0 14px 30px rgba(4, 8, 16, .09);
  color: var(--card-ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}

a.link-card:hover,
a.link-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 0 rgba(11, 15, 24, .12), 0 19px 36px rgba(4, 8, 16, .16);
}

a.link-card:active { transform: translateY(1px); }

a.link-card:focus-visible { outline: 3px solid white; outline-offset: 4px; }

.link-card.is-inactive { cursor: default; opacity: .8; }

.link-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--badge-color, #343c4d);
  color: white;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.06em;
}

.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-title {
  min-width: 0;
  padding: 0 5px;
  overflow-wrap: anywhere;
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.link-trailing { width: 64px; }

.load-error {
  padding: 20px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 16px;
  color: #f6d9d9;
  text-align: center;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(100%, 400px);
  margin: auto auto 0;
  padding-top: 55px;
  color: #aab2c0;
  font-size: 12px;
  letter-spacing: .09em;
  text-align: center;
  text-transform: uppercase;
}

.footer-line { flex: 1; height: 1px; background: rgba(255,255,255,.16); }

@media (max-width: 380px) {
  .page-shell { padding-right: 14px; padding-left: 14px; }
  .link-card { grid-template-columns: 56px minmax(0, 1fr) 56px; min-height: 82px; padding: 8px; }
  .link-icon, .link-trailing { width: 56px; height: 56px; }
  .links { gap: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .link-card { transition: none; }
}
