*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-start: #fffcfa;
  --bg-end: #fff0e8;
  --bg-deep: #ffe4d6;
  --accent: #e85a2b;
  --accent-hover: #c94820;
  --text: #3d1e14;
  --text-muted: #9a6858;
  --card-bg: #ffffff;
  --card-border: rgba(232, 90, 43, 0.14);
  --radius: 16px;
  --max-width: 420px;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
  background-color: var(--bg-deep);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: "Noto Sans TC", system-ui, sans-serif;
  color: var(--text);
  background: transparent;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.bg-gradient,
.bg-particles,
.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100lvh;
  min-height: -webkit-fill-available;
}

.bg-gradient {
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 55%, var(--bg-deep) 100%);
  z-index: -2;
}

.bg-particles {
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: -1rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  animation: particle-float linear infinite;
}

.particle--muted {
  background: color-mix(in srgb, var(--text-muted) 45%, transparent);
}

@keyframes particle-float {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }
  8% {
    opacity: var(--peak);
  }
  50% {
    transform: translate3d(calc(var(--sway) * 0.6), -52vh, 0);
  }
  88% {
    opacity: var(--peak);
  }
  100% {
    transform: translate3d(var(--sway), calc(-105vh - 1rem), 0);
    opacity: 0;
  }
}

.bg-noise {
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none;
    display: none;
  }
}

.page {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.25rem 2rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Profile */
.profile {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease both;
}

.avatar-wrap {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 3px;
  border-radius: var(--radius);
  background: #ffd9c8;
}

.avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: calc(var(--radius) - 3px);
  object-fit: cover;
  object-position: center;
  border: none;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(232, 90, 43, 0.12);
}

.name {
  font-family: "Playfair Display", "Noto Sans TC", serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.bio {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 auto 1rem;
}

.bio-lines-heading {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin: 0 auto 0.5rem;
  opacity: 0.85;
}

.bio-lines {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin: 0 auto 1rem;
  padding: 0;
  width: 100%;
}

.bio-lines li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
}

.bio-label {
  color: var(--text-muted);
}

.bio-arrow {
  color: var(--accent);
  opacity: 0.55;
  flex-shrink: 0;
}

.bio-brand {
  color: var(--accent);
  font-weight: 500;
}

.bio-brand-link {
  text-decoration: none;
  transition: color 0.2s ease;
}

.bio-brand-link:hover {
  color: var(--accent-hover);
}

.email {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.email:hover {
  color: var(--accent-hover);
}

.social-platforms {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.125rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(232, 90, 43, 0.06);
  animation: fadeUp 0.6s ease 0.06s both;
}

.social-platforms-heading {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.social-platforms-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-platform-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 52px;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a.social-platform-item:hover {
  opacity: 0.82;
}

.social-platform-item + .social-platform-item {
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}

.social-platform-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff8f5;
  box-shadow: 0 6px 20px rgba(232, 90, 43, 0.1);
}

.social-platform-item--facebook .social-platform-icon {
  color: #1877f2;
}

.social-platform-item--discord .social-platform-icon {
  color: #5865f2;
}

.social-platform-item--instagram .social-platform-icon {
  color: #e1306c;
}

.social-platform-icon svg {
  width: 20px;
  height: 20px;
}

.social-platform-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  min-height: 40px;
}

.social-platform-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.social-platform-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* Links */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(232, 90, 43, 0.06);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.6s ease both;
}

.link-card:nth-child(1) { animation-delay: 0.08s; }
.link-card:nth-child(2) { animation-delay: 0.14s; }
.link-card:nth-child(3) { animation-delay: 0.2s; }
.link-card:nth-child(4) { animation-delay: 0.26s; }
.link-card:nth-child(5) { animation-delay: 0.32s; }
.link-card:nth-child(6) { animation-delay: 0.38s; }

.link-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: #fff8f5;
  box-shadow: 0 8px 24px rgba(232, 90, 43, 0.12);
}

.link-card:active {
  transform: translateY(0);
}

.link-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff8f5;
  color: var(--accent);
  box-shadow: 0 6px 20px rgba(232, 90, 43, 0.1);
}

.link-icon svg {
  width: 20px;
  height: 20px;
}

.link-icon--logo {
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.link-icon--logo .link-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.link-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.link-title {
  font-weight: 500;
  font-size: 0.95rem;
}

.link-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.link-card:hover .link-arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--accent);
}

/* Footer */
.footer {
  margin-top: 2.5rem;
  text-align: center;
  animation: fadeUp 0.6s ease 0.4s both;
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.social-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 2px 8px rgba(232, 90, 43, 0.06);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
}

.social-link:hover {
  color: var(--accent);
  background: #fff8f5;
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-2px);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 480px) {
  .page {
    padding-top: 4rem;
  }

  .name {
    font-size: 2rem;
  }
}
