/* ============================================================
   Link page styles
   Defaults live here; links.json overrides them via CSS vars.
   ============================================================ */

:root {
  --bg: #0b1120;
  --text: #f1f5f9;
  --text-muted: rgba(241, 245, 249, 0.62);
  --accent: #818cf8;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.10);
  --card-hover-bg: rgba(255, 255, 255, 0.09);
  --card-radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Soft accent glow behind the profile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    52rem 22rem at 50% -6rem,
    color-mix(in srgb, var(--accent) 22%, transparent),
    transparent 70%
  );
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- layout ---------- */

.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

/* ---------- profile ---------- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 0 0 3px var(--card-border), 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

.avatar.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent));
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.name {
  margin: 20px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bio {
  margin: 8px 0 0;
  max-width: 46ch;
  line-height: 1.6;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- links ---------- */

.links {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.link-card .label { display: block; }

.link-card .description {
  display: block;
  margin-top: 3px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

@media (hover: hover) {
  .link-card:hover {
    background: var(--card-hover-bg);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--card-border));
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }
}

.link-card:active {
  transform: translateY(0);
}

/* ---------- socials row ---------- */

.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition:
    transform 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.social iconify-icon {
  width: 20px;
  height: 20px;
  color: inherit;
}

@media (hover: hover) {
  .social:hover {
    color: var(--accent);
    background: var(--card-hover-bg);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--card-border));
    transform: translateY(-2px);
  }
}

.social:active {
  transform: translateY(0);
}

/* ---------- footer ---------- */

.footer {
  margin-top: 44px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ---------- entrance animation ---------- */

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

.loaded .reveal {
  animation: rise 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; }
  .link-card { transition: none; }
  .social { transition: none; }
}

/* ---------- loading & error states ---------- */

.loader {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 20vh;
}

.loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: pulse 1.1s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

.error {
  padding-top: 20vh;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.7;
}

.error code {
  font-size: 0.9em;
  color: var(--text);
}

.noscript {
  max-width: 620px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}
