@font-face {
  font-family: PersonalWenKai;
  src: url("./wenkai-reading.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url("./poppins-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Poppins;
  src: url("./poppins-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --background: #101824;
  --text: #f0f3f8;
  --text-muted: #aeb9c7;
  --border: #344255;
  font-family: Poppins, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 48% 420px at 84% 110px, rgba(113, 93, 192, .17), transparent 76%),
    radial-gradient(ellipse 40% 340px at 10% 390px, rgba(46, 124, 160, .12), transparent 78%),
    var(--background);
}
.profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "photo" "heading" "intro";
  align-items: start;
  gap: clamp(12px, 2dvh, 18px);
  width: min(620px, calc(100% - 64px));
  margin-inline: auto;
  padding-block: clamp(16px, 3dvh, 24px);
}
.profile__photo {
  margin: 0;
  min-width: 0;
  grid-area: photo;
  align-self: start;
  justify-self: center;
  width: min(100%, clamp(330px, 42dvh, 390px));
}
.profile__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  border-radius: 20px;
}
.profile__intro { grid-area: intro; min-width: 0; }
h1 {
  grid-area: heading;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.6;
}
h1 span { white-space: nowrap; }
.profile__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-muted);
  font-family: PersonalWenKai, "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: 1.0625rem;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.765;
  text-align: start;
  overflow-wrap: anywhere;
}
p { margin: 0; }
strong { color: var(--text); font-weight: 500; }
.profile__body strong { font-weight: 400; }
.profile__signature {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  color: var(--text);
}
.profile__signature svg {
  display: block;
  width: 160px;
  max-width: 100%;
  height: auto;
  overflow: visible;
}
::selection { color: var(--text); background: #644c84; }

@media (max-width: 960px) {
  .profile { width: min(620px, calc(100% - 48px)); gap: 24px; padding-block: 28px; }
  .profile__photo { width: min(100%, 360px); }
  .profile__body { gap: 20px; line-height: 1.765; }
}
@media (max-width: 540px) {
  body { background: radial-gradient(ellipse 90% 300px at 88% 170px, rgba(113, 93, 192, .17), transparent 78%), var(--background); }
  .profile { width: calc(100% - 48px); padding-block: 32px 32px; gap: 24px; }
  .profile__body { gap: 20px; line-height: 1.765; }
  .profile__photo { width: 100%; }
  .profile__photo img { border-radius: 16px; }
  .profile__signature { margin-top: 22px; }
  .profile__signature svg { width: 140px; }
}
@media (forced-colors: active) {
  .profile__body { color: CanvasText; }
  .profile__photo img { border-color: CanvasText; }
  .profile__signature { color: CanvasText; }
}

/* The original ink stays readable; only the decorative layers repeat. */
.signature { max-width: 100%; }
.signature summary { position: relative; display: block; list-style: none; cursor: pointer; border-radius: 6px; }
.signature summary::-webkit-details-marker { display: none; }
.signature summary:focus-visible { outline: 2px solid #c7b7ff; outline-offset: 8px; }
.signature__glint { opacity: 0; stroke: url(#signature-aurora); stroke-width: 2.3; filter: drop-shadow(0 0 4px #d4b3ff) drop-shadow(0 0 8px #a5dcff); }
.signature__glint path { stroke-width: inherit; }
.signature__stars { color: #c9adff; pointer-events: none; }
.signature__star { opacity: 0; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .signature__ink path { stroke-dasharray: 1; stroke-dashoffset: 0; animation: signature-write 1.5s ease-out both; }
  .signature[open] .signature__glint { animation: signature-light 2s 1.5s ease-in-out infinite both; }
  .signature[open] .signature__star { animation: signature-star 2s 1.8s ease-in-out infinite both; }
  .signature[open] .signature__star--second { animation-delay: 2.1s; }
}
@keyframes signature-write { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes signature-light { 0%, 70%, 100% { opacity: 0; } 25%, 40% { opacity: 1; } }
@keyframes signature-star { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: .8; transform: scale(1); } }
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .signature__glint, .signature__stars { display: none; }
  .signature summary { cursor: default; }
}

.profile__github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 50%;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}
.profile__github svg { width: 24px; height: 24px; }
.profile__github:hover, .profile__github:focus-visible {
  color: #e0cdff;
  background-color: #bca3ff14;
  border-color: #bca3ff66;
}
.profile__github:focus-visible { outline: 2px solid #c7b7ff; outline-offset: 3px; }
@media (forced-colors: active) {
  .profile__github { color: LinkText; }
  .profile__github:focus-visible { outline-color: Highlight; }
}
