/* ============================================
   CollectorGreg — Cozy Moonlight Link Page
   Deep midnight sky + silver-blue + twinkling stars
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* Light theme (soft fog) */
  --bg-primary: #eef1f5;
  --bg-gradient-start: #eef1f5;
  --bg-gradient-mid: #e4e8ee;
  --bg-gradient-end: #eef1f5;
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-button: rgba(255, 255, 255, 0.5);
  --bg-button-hover: rgba(255, 255, 255, 0.82);
  --text-primary: #1e2a3a;
  --text-secondary: #5a6778;
  --text-bio: #3d4d60;
  --accent: #4a90b8;
  --accent-secondary: #6baac5;
  --accent-hover: #5da3cc;
  --accent-glow: rgba(74, 144, 184, 0.15);
  --shadow-soft: 0 2px 16px rgba(30, 42, 58, 0.06);
  --shadow-hover: 0 8px 32px rgba(30, 42, 58, 0.13);
  --border: rgba(30, 42, 58, 0.08);
  --border-hover: rgba(74, 144, 184, 0.3);
  --grain-opacity: 0.02;
  --toggle-bg: rgba(30, 42, 58, 0.06);
  --toggle-hover: rgba(30, 42, 58, 0.12);
  --footer-border: rgba(30, 42, 58, 0.07);
  --social-icon: #5a6778;
  --social-icon-hover: #4a90b8;
  --avatar-glow: rgba(74, 144, 184, 0.12);
  --avatar-ring: rgba(74, 144, 184, 0.2);
  --blob-1: rgba(74, 144, 184, 0.05);
  --blob-2: rgba(107, 170, 197, 0.04);
  --blob-3: rgba(60, 100, 140, 0.04);
  --stars-opacity: 0;
}

[data-theme="dark"] {
  --bg-primary: #0b0f18;
  --bg-gradient-start: #0b0f18;
  --bg-gradient-mid: #101828;
  --bg-gradient-end: #0b0f18;
  --bg-card: rgba(14, 22, 38, 0.6);
  --bg-button: rgba(16, 26, 44, 0.55);
  --bg-button-hover: rgba(22, 36, 58, 0.7);
  --text-primary: #d0ddef;
  --text-secondary: #92a4b8;
  --text-bio: #a8bdd0;
  --accent: #5eaad4;
  --accent-secondary: #78c0dd;
  --accent-hover: #72bce0;
  --accent-glow: rgba(94, 170, 212, 0.12);
  --shadow-soft: 0 2px 16px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.45);
  --border: rgba(200, 212, 226, 0.06);
  --border-hover: rgba(94, 170, 212, 0.2);
  --grain-opacity: 0.01;
  --toggle-bg: rgba(200, 212, 226, 0.06);
  --toggle-hover: rgba(200, 212, 226, 0.1);
  --footer-border: rgba(200, 212, 226, 0.05);
  --social-icon: #7a8da0;
  --social-icon-hover: #5eaad4;
  --avatar-glow: rgba(94, 170, 212, 0.1);
  --avatar-ring: rgba(94, 170, 212, 0.2);
  --blob-1: rgba(94, 170, 212, 0.03);
  --blob-2: rgba(60, 120, 180, 0.03);
  --blob-3: rgba(40, 80, 140, 0.03);
  --stars-opacity: 1;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-gradient-start);
  background: linear-gradient(180deg,
      var(--bg-gradient-start) 0%,
      var(--bg-gradient-mid) 40%,
      var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1.25rem;
  transition: background 0.5s ease, color 0.4s ease;
  position: relative;
  overflow-x: hidden;
}

/* Subtle grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: var(--grain-opacity);
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Ambient background blobs */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, var(--blob-1), transparent),
    radial-gradient(ellipse 500px 500px at 80% 60%, var(--blob-2), transparent),
    radial-gradient(ellipse 400px 300px at 50% 90%, var(--blob-3), transparent);
  transition: background 0.5s ease;
}

/* =============================
   Starry Background
   Uses radial-gradient dots — guaranteed visible
   ============================= */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--stars-opacity);
  transition: opacity 0.6s ease;
}

/* Static star layer */
.stars::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    /* Bright feature stars (3-4px) */
    radial-gradient(2px 2px at 150px 80px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2px 2px at 420px 45px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(2.5px 2.5px at 700px 130px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 300px 220px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2.5px 2.5px at 550px 300px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(2px 2px at 100px 380px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 800px 350px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2.5px 2.5px at 250px 480px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(2px 2px at 620px 520px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 450px 600px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(2.5px 2.5px at 50px 550px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(2px 2px at 750px 480px, rgba(255, 255, 255, 0.7), transparent),
    /* Medium stars (1.5-2px) */
    radial-gradient(1.5px 1.5px at 80px 30px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 220px 110px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 380px 70px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 500px 150px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 650px 60px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 170px 260px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 340px 320px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 480px 250px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 720px 280px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 60px 450px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 200px 400px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 560px 430px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 680px 550px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 830px 180px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 350px 500px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.5px 1.5px at 130px 580px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 770px 600px, rgba(255, 255, 255, 0.55), transparent),
    /* Small dim stars (1px) */
    radial-gradient(1px 1px at 40px 160px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 120px 50px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 270px 180px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 430px 120px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 580px 200px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 310px 380px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 500px 340px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 660px 420px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 90px 500px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 400px 560px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 740px 520px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 190px 620px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 600px 640px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 850px 90px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 30px 280px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 520px 60px, rgba(255, 255, 255, 0.35), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Twinkling star layer — gently pulses */
.stars::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 200px 120px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 500px 80px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 350px 280px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 680px 200px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 100px 450px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 450px 400px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(2px 2px at 750px 380px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 280px 550px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 600px 500px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 820px 280px, rgba(255, 255, 255, 0.65), transparent),
    /* Slight blue-tinted stars */
    radial-gradient(2px 2px at 160px 320px, rgba(150, 200, 240, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 580px 150px, rgba(150, 200, 240, 0.45), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* --- Main Container --- */
.container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

/* --- Page Load Animation --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in:nth-child(1) {
  animation-delay: 0.05s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.12s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.20s;
}

.fade-in:nth-child(4) {
  animation-delay: 0.28s;
}

.fade-in:nth-child(5) {
  animation-delay: 0.36s;
}

.fade-in:nth-child(6) {
  animation-delay: 0.44s;
}

.fade-in:nth-child(7) {
  animation-delay: 0.52s;
}

.fade-in:nth-child(8) {
  animation-delay: 0.60s;
}

.fade-in:nth-child(9) {
  animation-delay: 0.68s;
}

.fade-in:nth-child(10) {
  animation-delay: 0.76s;
}

/* --- Dark Mode Toggle --- */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--toggle-bg);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-toggle:hover {
  background: var(--toggle-hover);
  transform: scale(1.08);
  border-color: var(--border-hover);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* --- Avatar --- */
.avatar-wrapper {
  position: relative;
}

/* Soft ambient glow behind avatar */
.avatar-wrapper::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--avatar-glow) 0%, transparent 70%);
  z-index: -1;
  transition: all 0.4s ease;
}

.avatar-wrapper:hover::before {
  inset: -18px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--avatar-ring);
  box-shadow:
    var(--shadow-soft),
    0 0 0 6px var(--avatar-glow);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.avatar:hover {
  transform: scale(1.06) rotate(2deg);
  box-shadow:
    var(--shadow-hover),
    0 0 0 8px var(--accent-glow);
}

/* --- Profile Info --- */
.profile {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  background: linear-gradient(90deg,
      var(--text-primary) 0%,
      var(--accent) 40%,
      rgba(255, 255, 255, 0.9) 50%,
      var(--accent) 60%,
      var(--text-primary) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 10s ease-in-out infinite;
}

@keyframes shimmer-text {

  0%,
  100% {
    background-position: 100% center;
  }

  50% {
    background-position: 0% center;
  }
}

.profile .bio {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-bio);
  line-height: 1.4;
  max-width: 320px;
  margin: 0 auto;
  letter-spacing: 0.02em;
}

.profile .about {
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 310px;
  margin: 0.15rem auto 0;
}

.location {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.location-pin {
  color: var(--accent);
  flex-shrink: 0;
}

/* --- Link Buttons --- */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.6rem;
  width: 100%;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  background: var(--bg-button);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Subtle animated shimmer on hover */
.link-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(105deg,
      transparent 20%,
      var(--accent-glow) 50%,
      transparent 80%);
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.3s ease;
}

.link-btn:hover::before {
  opacity: 1;
  transform: translateX(100%);
  transition: opacity 0.3s ease, transform 0.8s ease;
}

.link-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
  background: var(--bg-button-hover);
}

.link-btn:hover .label {
  color: var(--accent);
}

.link-btn:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.link-btn .icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
  color: var(--accent);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s ease;
}

.link-btn .icon svg {
  width: 100%;
  height: 100%;
}

.link-btn:hover .icon {
  transform: scale(1.15);
  color: var(--accent-hover);
}

.link-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.link-btn .label {
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.link-btn .desc {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.3;
  transition: color 0.3s ease;
}

.link-btn:hover .desc {
  color: var(--text-bio);
}

/* --- Footer --- */
.footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--footer-border);
  width: 100%;
}

.footer .thanks {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.social-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.social-link {
  color: var(--social-icon);
  transition: color 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.social-link:hover {
  color: var(--social-icon-hover);
  transform: scale(1.2) translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --- Responsive --- */
@media (min-width: 480px) {
  body {
    padding: 4rem 2rem;
  }

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

  .profile h1 {
    font-size: 1.7rem;
  }
}

@media (min-width: 768px) {
  body {
    align-items: center;
    padding: 2rem;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
    opacity: 1;
  }

  .stars::after {
    animation: none;
  }

  .link-btn,
  .link-btn::before,
  .avatar,
  .avatar-wrapper::before,
  .theme-toggle,
  .social-link,
  .link-btn .emoji {
    transition: none;
  }
}