/* ============================================================
   eighteentang — 个人主页
   深色极简 · 居中式名片布局
   ============================================================ */

:root {
  --bg: #08080a;
  --text: #f2f2f0;
  --muted: #8b8b91;
  --dim: #6b6b73;
  --line: rgba(255, 255, 255, 0.09);
  --line-hover: rgba(255, 255, 255, 0.22);
  --surface: rgba(255, 255, 255, 0.028);
  --surface-hover: rgba(255, 255, 255, 0.058);
  --live: #7fc7a0;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', Helvetica, Arial, sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* 顶部极淡光晕，给纯色背景一点层次 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 78% 44% at 50% 0%,
    rgba(255, 255, 255, 0.06),
    transparent 72%
  );
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(255, 255, 255, 0.9);
  color: #08080a;
}

/* ---------- 主体 ---------- */
.profile {
  position: relative;
  width: 100%;
  max-width: 380px;
  display: grid;
  justify-items: center;
  text-align: center;
}

/* ---------- 头像 ---------- */
.avatar {
  position: relative;
  width: clamp(94px, 25vw, 118px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, #1d1d22, #0f0f12);
  border: 1px solid var(--line);
  box-shadow: 0 22px 55px -24px rgba(0, 0, 0, 0.95);
}

.avatar img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 没有照片时显示的字母标记 */
.avatar__initial {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--dim);
}

/* ---------- 名字 ---------- */
.name {
  margin-top: 2.1rem;
  margin-right: -0.16em; /* 抵消末位 letter-spacing，保证视觉居中 */
  font-size: clamp(1.3rem, 5vw, 1.95rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* ---------- 所在地 ---------- */
.location {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px rgba(127, 199, 160, 0.13);
}

/* ---------- 链接 ---------- */
.links {
  list-style: none;
  width: 100%;
  margin-top: 2.9rem;
  padding-top: 1.9rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.55rem;
}

.link {
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.92rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition:
    border-color 0.32s var(--ease),
    background 0.32s var(--ease),
    transform 0.32s var(--ease);
}

.link:hover {
  border-color: var(--line-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.link__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: var(--dim);
  text-align: left;
  transition: color 0.32s var(--ease);
}

.link__handle {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: left;
  transition: color 0.32s var(--ease);
}

.link__arrow {
  width: 13px;
  height: 13px;
  color: var(--dim);
  transition:
    color 0.32s var(--ease),
    transform 0.32s var(--ease);
}

.link:hover .link__label,
.link:hover .link__arrow {
  color: var(--text);
}

.link:hover .link__handle {
  color: var(--text);
}

.link:hover .link__arrow {
  transform: translate(2px, -2px);
}

/* ---------- 入场动效 ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(13px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.avatar {
  animation: rise 0.75s var(--ease) both;
}

.name {
  animation: rise 0.75s 0.08s var(--ease) both;
}

.location {
  animation: rise 0.75s 0.15s var(--ease) both;
}

.links {
  animation: rise 0.75s 0.22s var(--ease) both;
}

/* ---------- 小屏微调 ---------- */
@media (max-width: 400px) {
  .link {
    grid-template-columns: 1.8rem 1fr auto;
    padding: 0.85rem 1rem;
  }

  .link__handle {
    font-size: 0.86rem;
  }
}

/* ---------- 尊重系统「减少动态效果」设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
