:root {
  --bg-1: #070b16;
  --bg-2: #0c1020;
  --bg-3: #15182c;
  --card-bg: rgba(18, 22, 39, 0.86);
  --card-bg-2: rgba(255, 255, 255, 0.045);
  --text-main: #f8fafc;
  --text-soft: #c4ccdc;
  --text-muted: #8f9bb0;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(125, 211, 252, 0.34);
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --accent-3: #22c55e;
  --shadow: 0 34px 90px rgba(2, 6, 23, 0.72);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 14% 14%, rgba(56, 189, 248, 0.24), transparent 30%),
    radial-gradient(circle at 86% 12%, rgba(167, 139, 250, 0.22), transparent 32%),
    radial-gradient(circle at 50% 112%, rgba(37, 99, 235, 0.26), transparent 46%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 46%, var(--bg-3));
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 34px 16px 24px;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.075) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 84%);
  opacity: 0.22;
}

body::after {
  background:
    radial-gradient(circle at 22% 50%, rgba(125, 211, 252, 0.08), transparent 38%),
    radial-gradient(circle at 78% 54%, rgba(167, 139, 250, 0.07), transparent 42%);
}

.page {
  width: 100%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}

.profile-card {
  width: min(760px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 16%),
    var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 30px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.18), transparent 28%, rgba(167, 139, 250, 0.13) 74%, transparent);
  opacity: 0.65;
}

.banner {
  height: 196px;
  position: relative;
  background:
    linear-gradient(to bottom, rgba(7, 11, 22, 0.05), rgba(7, 11, 22, 0.68)),
    radial-gradient(circle at 20% 80%, rgba(96, 165, 250, 0.35), transparent 42%),
    radial-gradient(circle at 82% 15%, rgba(196, 181, 253, 0.32), transparent 38%),
    url("assets/banner.jpg") center / cover no-repeat,
    linear-gradient(135deg, #1c233a 0%, #252d52 54%, #342247 100%);
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 36%, rgba(125, 211, 252, 0.18), transparent 32%),
    radial-gradient(circle at 78% 42%, rgba(167, 139, 250, 0.16), transparent 34%);
  mix-blend-mode: screen;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 56%, rgba(10, 15, 31, 0.62) 100%),
    linear-gradient(90deg, rgba(7, 11, 22, 0.18), transparent 45%, rgba(7, 11, 22, 0.22));
}

.profile-head {
  padding: 0 30px;
  margin-top: -64px;
  display: flex;
  gap: 18px;
  align-items: flex-end;
  position: relative;
  z-index: 2;
}

.avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

.avatar {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 6px solid rgba(10, 15, 31, 0.96);
  background: #111827;
  object-fit: cover;
  display: block;
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 26px rgba(125, 211, 252, 0.22);
}

.status-dot {
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: var(--accent-3);
  border: 4px solid rgba(10, 15, 31, 0.96);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.75);
}

.identity {
  padding-bottom: 10px;
  min-width: 0;
}

.identity h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
}

.status {
  margin: 7px 0 2px;
  color: #d5def0;
  line-height: 1.55;
}

.block {
  margin: 18px 24px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025));
  position: relative;
  z-index: 2;
}

.block h2 {
  margin: 0 0 10px;
  font-size: 1.04rem;
  letter-spacing: 0.03em;
}

.block p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.78;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(125, 211, 252, 0.1);
  color: #e2f7ff;
  font-size: 0.88rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.projects {
  display: grid;
  gap: 12px;
}

.project-card {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(150deg, rgba(125, 211, 252, 0.085), rgba(167, 139, 250, 0.075)),
    rgba(255, 255, 255, 0.025);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.project-card p {
  margin-bottom: 12px;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.035);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.badge:hover,
.chip:hover,
.project-card:hover,
.project-card:focus-visible,
.social-links a:hover,
.social-links a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(125, 211, 252, 0.22);
  border-color: rgba(125, 211, 252, 0.72);
  background-color: rgba(125, 211, 252, 0.11);
  outline: none;
}

footer {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.fade-in {
  animation: fadeInUp 0.7s ease both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 640px) {
  body {
    padding: 22px 12px 18px;
  }

  .profile-card {
    border-radius: 24px;
  }

  .banner {
    height: 164px;
  }

  .profile-head {
    padding: 0 18px;
    margin-top: -52px;
    gap: 14px;
  }

  .avatar {
    width: 98px;
    height: 98px;
    border-width: 5px;
  }

  .status-dot {
    right: 6px;
    bottom: 6px;
    width: 19px;
    height: 19px;
    border-width: 3px;
  }

  .block {
    margin: 12px;
    padding: 16px;
  }
}

@media (max-width: 420px) {
  .profile-head {
    align-items: center;
  }

  .identity h1 {
    font-size: 1.9rem;
  }

  .status {
    font-size: 0.95rem;
  }

  .social-links a {
    width: 100%;
    text-align: center;
  }
}
