:root {
  --ink: #3a2e4d;        /* deep plum text */
  --ink-soft: #6b5f80;   /* muted plum */
  --accent: #ff7ab6;     /* bubblegum */
  --accent-2: #8b6dff;   /* violet */
  --card: #ffffff;
  --card-shadow: 0 10px 30px -12px rgba(90, 60, 120, 0.35);
  --card-shadow-hi: 0 18px 40px -14px rgba(139, 109, 255, 0.5);
  --radius: 20px;

  /* liquid glass */
  --glass-bg: rgba(255, 255, 255, 0.38);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-blur: blur(18px) saturate(185%);
  --glass-shadow: 0 8px 26px -10px rgba(90, 60, 120, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --glass-shadow-hi: 0 18px 42px -12px rgba(139, 109, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

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

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

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* drifting multi-hue pastel gradient */
  background: linear-gradient(-45deg, #ffe0ec, #e7d9ff, #ece0ff, #ffe9d6, #ffd6ea, #ffe0ec);
  background-size: 400% 400%;
  animation: drift 24s ease-in-out infinite;
}

@keyframes drift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.page {
  width: 100%;
  max-width: 460px;
  padding: 56px 20px 24px;
  flex: 1;
}

/* ---------- profile ---------- */
.profile { text-align: center; margin-bottom: 34px; }

.avatar-ring {
  width: 116px;
  height: 116px;
  margin: 0 auto 18px;
  border-radius: 50%;
  padding: 5px;
  /* sticker ring — the signature */
  background: conic-gradient(from 0deg, #ff7ab6, #8b6dff, #7ad0ff, #ffd36e, #ff7ab6);
  animation: spin 9s linear infinite;
  box-shadow: var(--card-shadow);
}
.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
  border: 4px solid #fff;
  animation: spin-rev 9s linear infinite; /* keep photo upright */
}
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes spin-rev  { to { transform: rotate(-360deg); } }

.name {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.bio {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  max-width: 34ch;
  margin-inline: auto;
}

/* ---------- socials (icon row under bio) ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}
.social-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: grid;
  place-items: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.18s ease, background 0.18s ease;
}
.social-btn img { width: 21px; height: 21px; display: block; }
.social-btn:hover,
.social-btn:focus-visible {
  transform: translateY(-4px) scale(1.08);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--glass-shadow-hi);
  outline: none;
}
.social-btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.social-btn:active { transform: scale(0.94); }

/* ---------- links ---------- */
.links { display: flex; flex-direction: column; gap: 14px; }

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.18s ease, background 0.18s ease;
}
/* specular sheen — the liquid-glass highlight */
.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}
.link-card > * { position: relative; } /* keep content above the sheen */
.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-4px) rotate(-0.6deg) scale(1.015);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--glass-shadow-hi);
  outline: none;
}
.link-card:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
.link-card:active { transform: translateY(-1px) scale(0.99); }

.link-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 240, 246, 0.75), rgba(239, 234, 255, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
}
.link-icon img { width: 22px; height: 22px; display: block; }

.link-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.link-label {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 16px;
}
.link-desc {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* section heading before a group of cards */
.section-head {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 20px 6px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(139,109,255,0.35), transparent);
}
.links > .section-head:first-child { margin-top: 4px; }
.link-arrow { color: var(--ink-soft); font-size: 18px; transition: transform 0.18s ease; }
.link-card:hover .link-arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- footer ---------- */
.foot {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 18px 0 26px;
  opacity: 0.8;
}

/* ---------- states ---------- */
.msg {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  padding: 40px 10px;
  line-height: 1.6;
}

/* skeleton */
.skeleton { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.sk { background: rgba(255,255,255,0.6); border-radius: 14px; animation: pulse 1.3s ease-in-out infinite; }
.sk-avatar { width: 116px; height: 116px; border-radius: 50%; }
.sk-name { width: 160px; height: 26px; }
.sk-bio { width: 220px; height: 16px; margin-bottom: 20px; }
.sk-card { width: 100%; max-width: 420px; height: 72px; border-radius: var(--radius); }
@keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ---------- featured: now reading ---------- */
.featured { display: flex; flex-direction: column; gap: 22px; margin-top: 26px; }
.feature { display: flex; flex-direction: column; gap: 8px; }

.book { display: flex; gap: 14px; align-items: flex-start; width: 100%; }
.book-cover {
  flex: 0 0 58px; width: 58px; height: 86px;
  object-fit: cover; border-radius: 8px;
  box-shadow: 0 6px 16px -6px rgba(90, 60, 120, 0.5);
}
.book-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.book-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; }
.book-author { font-size: 13px; color: var(--ink-soft); }
.book-note { font-size: 13px; font-style: italic; margin-top: 2px; }
.book-progress {
  margin-top: 8px; height: 7px; border-radius: 99px;
  background: rgba(139, 109, 255, 0.18); overflow: hidden;
}
.book-progress-fill {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.book-pct { font-size: 11px; color: var(--ink-soft); margin-top: 5px; font-family: "Space Mono", monospace; }

/* ---------- avatar easter egg ---------- */
.avatar-ring.has-egg { cursor: pointer; }
.avatar-ring.has-egg:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.confetti-piece {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: confetti 1s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes confetti {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(35deg); }
}
.egg-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(12px);
  z-index: 60;
  pointer-events: none;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--ink);
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.egg-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
