:root {
  --bg-top: #cdd6e0;
  --bg-mid: #7c8aa3;
  --bg-bottom: #10182c;
  --card-bg: rgba(255, 255, 255, 0.5);
  --card-bg-hover: rgba(255, 255, 255, 0.68);
  --card-border: rgba(255, 255, 255, 0.55);
  --text-primary: #171d2b;
  --text-muted: rgba(23, 29, 43, 0.58);
  --footer-color: rgba(255, 255, 255, 0.55);
  --accent-ig: #d6336c;
  --accent-tt: #0d1321;
  --accent-yt: #e0342b;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, #3d4864 72%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Aurora background blobs ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.55;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

.blob-a {
  width: 340px;
  height: 340px;
  top: -60px;
  left: -80px;
  background: radial-gradient(circle, #a9c6ff 0%, transparent 70%);
  animation: drift-a 22s ease-in-out infinite;
}

.blob-b {
  width: 380px;
  height: 380px;
  top: 30%;
  right: -120px;
  background: radial-gradient(circle, #ffd7ea 0%, transparent 70%);
  animation: drift-b 26s ease-in-out infinite;
}

.blob-c {
  width: 420px;
  height: 420px;
  bottom: -100px;
  left: 10%;
  background: radial-gradient(circle, #6c7bd6 0%, transparent 70%);
  animation: drift-c 30s ease-in-out infinite;
  opacity: 0.8;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.15); }
  66% { transform: translate(-30px, 70px) scale(0.9); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-70px, 50px) scale(1.1); }
  75% { transform: translate(20px, -40px) scale(0.95); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -60px) scale(1.2); }
}

/* ---------- Floating particles ---------- */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particles::before,
.particles::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 30% 60%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 60% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 90% 50%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 45% 35%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 70% 65%, rgba(255,255,255,0.5), transparent);
  animation: particles-rise 14s linear infinite;
}

.particles::after {
  animation-duration: 20s;
  animation-delay: -7s;
  opacity: 0.6;
  transform: scale(1.3) translateX(5%);
}

@keyframes particles-rise {
  0% { transform: translateY(6%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100%); opacity: 0; }
}

/* ---------- Grain texture ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Clock widget ---------- */
.clock-widget {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 10px rgba(15, 20, 30, 0.1);
  animation: fade-down 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.clock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mushroom (MapleStory Orange Mushroom sprite) ---------- */
.mushroom {
  position: fixed;
  bottom: 10px;
  left: 0;
  z-index: 4;
  width: 76px;
  height: 70px;
  pointer-events: none;
  will-change: transform;
  transform: translateX(0) scaleX(1);
  transition: transform 520ms cubic-bezier(0.32, 0, 0.35, 1);
}

.mushroom.face-left {
  transform: translateX(var(--shroom-x, 0px)) scaleX(-1);
}

.mushroom.face-right {
  transform: translateX(var(--shroom-x, 0px)) scaleX(1);
}

.shroom-sprite {
  position: absolute;
  inset: 0;
  background-image: url("public/mushroom.png");
  background-repeat: no-repeat;
  background-size: 304px 70px;
  background-position: 0 0;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(15, 20, 30, 0.2));
}

.shroom-shadow {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 34px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(15, 20, 30, 0.34) 0%, transparent 72%);
  transform: translateX(-50%);
  transition: transform 180ms ease, opacity 180ms ease;
}

.mushroom.airborne .shroom-sprite {
  animation: shroom-jump 420ms cubic-bezier(0.33, 0, 0.35, 1);
}

.mushroom.airborne .shroom-shadow {
  transform: translateX(-50%) scale(0.55);
  opacity: 0.45;
}

@keyframes shroom-jump {
  0% { transform: translateY(0); }
  45% { transform: translateY(-30px); }
  100% { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mushroom { display: none; }
}

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 68px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 16px;
  animation: avatar-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both, avatar-float 5s ease-in-out 0.6s infinite;
}

.avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff9ec4, #a9c6ff, #6c7bd6, #ffd7ea, #ff9ec4);
  animation: spin-ring 6s linear infinite;
  filter: blur(0.3px);
}

.avatar-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #c9d3de;
}

.avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(15, 20, 30, 0.08), 0 10px 28px rgba(15, 20, 30, 0.25);
}

.status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #34d399;
  border: 3px solid #cdd6e0;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes spin-ring {
  to { transform: rotate(360deg); }
}

@keyframes avatar-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes avatar-in {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.name {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.tagline {
  margin: 5px 0 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--text-muted);
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mini social row ---------- */
.mini-links {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.mini-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}

.mini-link svg {
  width: 17px;
  height: 17px;
}

.mini-link:active {
  transform: scale(0.88);
}

@media (hover: hover) {
  .mini-link:hover {
    background: rgba(255, 255, 255, 0.55);
    transform: translateY(-3px) scale(1.06);
  }
}

/* ---------- Link cards ---------- */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  text-decoration: none;
  color: var(--text-primary);
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(15, 20, 30, 0.04), 0 4px 14px rgba(15, 20, 30, 0.08);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: none;
}

.link-card:active::before {
  animation: shimmer 0.7s ease;
}

@keyframes shimmer {
  to { left: 130%; }
}

.link-card:nth-child(1) { animation-delay: 0.36s; }
.link-card:nth-child(2) { animation-delay: 0.42s; }
.link-card:nth-child(3) { animation-delay: 0.48s; }

.link-card:active {
  transform: scale(0.97);
  background: var(--card-bg-hover);
  transition-duration: 0.1s;
}

.badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  flex-shrink: 0;
  color: #fff;
}

.badge svg {
  width: 21px;
  height: 21px;
}

.link-card[data-tint="ig"] .badge {
  background: radial-gradient(circle at 30% 110%, #ffdb73 0%, #fe5d51 25%, #d6336c 55%, #6a3fd6 85%);
}

.link-card[data-tint="tt"] .badge {
  background: linear-gradient(135deg, #131722, #34394a);
}

.link-card[data-tint="yt"] .badge {
  background: linear-gradient(135deg, #ff5c4d, #e0342b);
}

.text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.label {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.sublabel {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
}

.chevron {
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.link-card:active .chevron {
  transform: translateX(3px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) {
  .link-card:hover {
    background: var(--card-bg-hover);
    box-shadow: 0 1px 1px rgba(15, 20, 30, 0.05), 0 6px 22px rgba(15, 20, 30, 0.14);
    transform: translateY(-2px);
  }
  .link-card:hover .chevron {
    transform: translateX(3px);
  }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding-top: 48px;
}

.footer p {
  margin: 0;
  font-size: 12px;
  letter-spacing: -0.005em;
  color: var(--footer-color);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .blob, .particles::before, .particles::after, .avatar-wrap, .avatar-ring,
  .clock-dot, .status-dot, .link-card, .name, .tagline, .mini-links {
    animation: none !important;
  }
}
