/* =========================================================
   Mochiigii — Link in Bio
   Dark, minimal, glassmorphism, gamer/streamer/dev vibe
   ========================================================= */

:root {
  --bg: #0a0b0d;
  --bg-alt: #0f1115;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(255, 255, 255, 0.07);

  --text-primary: #f4f6f8;
  --text-secondary: #9aa4b2;
  --text-muted: #6b7280;

  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --accent-glow: rgba(34, 211, 238, 0.35);

  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  min-height: 100svh;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #12151c 0%, var(--bg) 55%);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Ambient background ---------- */

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.bg-glow--one {
  width: 480px;
  height: 480px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
}

.bg-glow--two {
  width: 420px;
  height: 420px;
  bottom: -160px;
  right: -140px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 0%, transparent 75%);
}

/* ---------- Layout ---------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

/* ---------- Card ---------- */

.card {
  width: 100%;
  max-width: 420px;
  padding: 40px 28px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  animation: cardEnter 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Avatar ---------- */

.avatar-wrap {
  position: relative;
  margin-bottom: 18px;
}

.avatar-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringSpin 6s linear infinite;
  box-shadow: 0 0 30px -4px var(--accent-glow);
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-alt);
  display: block;
  background: var(--bg-alt);
}

.status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #0a0b0d;
  box-shadow: 0 0 10px 1px rgba(34, 197, 94, 0.6);
}

/* ---------- Text ---------- */

.name {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.username {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.bio {
  margin-top: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 320px;
}

/* ---------- Links ---------- */

.links {
  width: 100%;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-btn {
  --btn-accent: var(--accent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--transition-fast), border-color var(--transition-fast),
    background var(--transition-fast), box-shadow var(--transition-fast);
  opacity: 0;
  transform: translateY(14px);
  animation: linkEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes linkEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.links .link-btn:nth-child(1) { animation-delay: 0.15s; }
.links .link-btn:nth-child(2) { animation-delay: 0.22s; }
.links .link-btn:nth-child(3) { animation-delay: 0.29s; }
.links .link-btn:nth-child(4) { animation-delay: 0.36s; }
.links .link-btn:nth-child(5) { animation-delay: 0.43s; }

.link-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.link-btn:hover::before,
.link-btn:focus-visible::before {
  transform: translateX(100%);
}

.link-btn:hover,
.link-btn:focus-visible {
  transform: translateY(-3px);
  border-color: var(--btn-accent);
  background: var(--surface-hover);
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--btn-accent) 55%, transparent);
}

.link-btn:active {
  transform: translateY(-1px) scale(0.99);
}

.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--btn-accent);
  font-size: 1.05rem;
  transition: transform var(--transition-fast);
}

.link-btn:hover .link-icon {
  transform: scale(1.08);
}

.link-text {
  flex: 1;
  text-align: left;
}

.link-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--transition-fast);
}

.link-btn:hover .link-arrow,
.link-btn:focus-visible .link-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--btn-accent);
}

/* Per-brand accent colors */
.link-btn--discord   { --btn-accent: #5865f2; }
.link-btn--support   { --btn-accent: #f59e0b; }
.link-btn--instagram { --btn-accent: #e1306c; }
.link-btn--youtube   { --btn-accent: #ff0033; }
.link-btn--portfolio { --btn-accent: #22d3ee; }

/* ---------- Footer ---------- */

.footer {
  margin-top: 30px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0;
  animation: linkEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.55s;
}

.coffee {
  display: inline-block;
  animation: steam 2.4s ease-in-out infinite;
}

@keyframes steam {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(-6deg); }
}

.footer-name {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 420px) {
  .card {
    padding: 34px 20px 22px;
    border-radius: 22px;
  }

  .name {
    font-size: 1.3rem;
  }

  .link-btn {
    padding: 13px 14px;
  }
}

@media (min-width: 640px) {
  .card {
    max-width: 440px;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .avatar-ring {
    animation: none;
  }
}
