/* =========================================================
   LIMBEI · 个人主页
   简约风格：大量留白、克制的配色、排版驱动
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #0d0d0f;
  --text: #ededf0;
  --text-dim: #a1a1aa;
  --text-faint: #71717a;
  --line: #26262b;
  --line-strong: #3f3f46;
  --maxw: 720px;
  --nav-h: 64px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfb;
  --text: #18181b;
  --text-dim: #52525b;
  --text-faint: #71717a;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.3; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
svg { width: 1em; height: 1em; }

a { color: inherit; }

::selection { background: var(--line-strong); }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  color: var(--text);
}

.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a {
  font-size: 14.5px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__actions { display: flex; align-items: center; gap: 14px; }

.theme-btn {
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-btn:hover { color: var(--text); border-color: var(--line-strong); }
.theme-btn__light { display: none; }
html[data-theme="light"] .theme-btn__dark { display: none; }
html[data-theme="light"] .theme-btn__light { display: inline; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0 7px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 1.5px;
  background: var(--text-dim);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------------- 首屏 ---------------- */
.hero {
  padding-top: 96px;
  padding-bottom: 104px;
}

.hero__eyebrow {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero__title {
  margin-top: 18px;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero__role {
  margin-top: 12px;
  font-size: 1.0625rem;
  color: var(--text-dim);
}

.hero__desc {
  margin-top: 30px;
  max-width: 56ch;
  color: var(--text-dim);
}

.hero__links {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.link-arrow:hover { border-color: var(--text); gap: 10px; }

.hero__facts {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.hero__facts dt {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.hero__facts dd {
  margin-top: 5px;
  font-size: 14.5px;
}

/* ---------------- 通用版块 ---------------- */
.section {
  padding-top: 40px;
  padding-bottom: 64px;
  scroll-margin-top: var(--nav-h);
}

.sec-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.prose {
  margin-top: 28px;
  max-width: 60ch;
  color: var(--text-dim);
}
.prose + .prose { margin-top: 16px; }

/* 列表（技能 / 项目） */
.list { margin-top: 28px; display: grid; gap: 34px; }

.list li h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}
.list li > p {
  margin-top: 7px;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: 15px;
}

.work__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.work__year {
  flex: none;
  font-size: 12.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.meta {
  font-size: 13.5px;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}
.list li .meta { margin-top: 10px; }

.section > .meta {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* 联系 */
.links {
  margin-top: 28px;
  display: grid;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.links li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  background: var(--bg);
}
.links span {
  flex: none;
  width: 68px;
  font-size: 13.5px;
  color: var(--text-faint);
}
.links a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.links a:hover { border-bottom-color: var(--text); }

/* ---------------- 页脚 ---------------- */
.footer {
  padding-top: 30px;
  padding-bottom: 56px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  color: var(--text-faint);
}
.footer a {
  text-decoration: none;
  color: var(--text-faint);
  transition: color 0.2s ease;
}
.footer a:hover { color: var(--text); }

/* ---------------- 入场动画（克制） ---------------- */
.reveal { transition: opacity 0.5s ease, transform 0.5s ease; }
html.js .reveal { opacity: 0; transform: translateY(10px); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
html.js .reveal[data-delay="1"] { transition-delay: 0.05s; }
html.js .reveal[data-delay="2"] { transition-delay: 0.1s; }
html.js .reveal[data-delay="3"] { transition-delay: 0.15s; }
html.js .reveal[data-delay="4"] { transition-delay: 0.2s; }
html.js .reveal[data-delay="5"] { transition-delay: 0.25s; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .hero { padding-top: 60px; padding-bottom: 76px; }
  .hero__facts { grid-template-columns: 1fr; gap: 18px; }
  .section { padding-bottom: 52px; }
  .list { gap: 28px; }

  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 24px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 11px 0; font-size: 15px; }
  .burger { display: flex; }
}

/* ---------------- 可访问性 ---------------- */
:focus-visible {
  outline: 2px solid var(--text-dim);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
