/* =========================================================
   个人网站 · 样式
   配色、字号都在下面的变量里，改一处全站生效
   ========================================================= */

:root {
  color-scheme: dark;

  --bg: #080a0e;
  --bg-soft: #0d1016;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9edf5;
  --muted: #97a1b2;
  --on-accent: #06080c;

  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-3: #c084fc;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));

  --nav-bg: rgba(8, 10, 14, 0.72);
  --shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9);

  --radius: 22px;
  --max: 1100px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #fbfbfd;
  --bg-soft: #f3f4f8;
  --surface: rgba(10, 14, 24, 0.03);
  --surface-hover: rgba(10, 14, 24, 0.06);
  --line: rgba(10, 14, 24, 0.1);
  --text: #0d1117;
  --muted: #5b6472;
  --on-accent: #ffffff;

  --accent: #0d9488;
  --accent-2: #4f46e5;
  --accent-3: #9333ea;
  --grad: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, var(--accent-3));

  --nav-bg: rgba(251, 251, 253, 0.78);
  --shadow: 0 40px 90px -50px rgba(16, 24, 40, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: color-mix(in oklab, var(--accent-2) 35%, transparent);
  color: var(--text);
}

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

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

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }

p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-200%);
  z-index: 99;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: 10px;
}
.skip:focus { transform: none; }

/* ---------------- 导航 ---------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav__links {
  margin-left: auto;
  display: flex;
  gap: 4px;
  font-size: 0.94rem;
}

.nav__links a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
.nav__links a.is-active { color: var(--text); }

.theme {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.theme:hover { background: var(--surface-hover); transform: rotate(-12deg); }
.theme .icon { width: 18px; height: 18px; }

[data-theme="dark"] .icon--moon,
[data-theme="light"] .icon--sun { display: none; }

/* ---------------- 首屏 ---------------- */

.hero {
  position: relative;
  isolation: isolate;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 11vw, 132px) 28px clamp(48px, 7vw, 88px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -12% auto -12%;
  height: 130%;
  z-index: -1;
  background:
    radial-gradient(42% 46% at 22% 32%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 72%),
    radial-gradient(38% 42% at 78% 18%, color-mix(in oklab, var(--accent-2) 26%, transparent), transparent 72%),
    radial-gradient(34% 40% at 62% 78%, color-mix(in oklab, var(--accent-3) 16%, transparent), transparent 72%);
  filter: blur(18px);
  opacity: 0.85;
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}

.hero h1 {
  font-size: clamp(2.9rem, 8.2vw, 5.1rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}
.h1__dot {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 22px;
  max-width: 34em;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--muted);
}

.cta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.24s ease, background 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--grad);
  color: var(--on-accent);
  box-shadow: 0 12px 30px -12px color-mix(in oklab, var(--accent-2) 65%, transparent);
}
.btn--primary:hover {
  box-shadow: 0 18px 40px -14px color-mix(in oklab, var(--accent-2) 80%, transparent);
}

.btn--ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-hover); border-color: color-mix(in oklab, var(--text) 22%, transparent); }

.btn--lg { padding: 15px 30px; font-size: 1rem; }

.facts {
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 0.88rem;
  color: var(--muted);
}
.facts li { display: inline-flex; align-items: center; gap: 7px; }
.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}

/* 右上的名片 */

.hero__art { justify-self: center; width: 100%; max-width: 340px; }

.pcard {
  position: relative;
  padding: 30px 28px 26px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--text) 7%, transparent), transparent 55%),
    var(--bg-soft);
  box-shadow: var(--shadow);
  transform: rotate(-2.2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.pcard:hover { transform: rotate(0deg) translateY(-4px); }

.pcard__ring {
  position: absolute;
  inset: -12px;
  border-radius: 34px;
  border: 1px dashed color-mix(in oklab, var(--text) 16%, transparent);
  pointer-events: none;
}

.pcard__avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--on-accent);
  background: var(--grad);
  box-shadow: 0 10px 34px -10px color-mix(in oklab, var(--accent-2) 70%, transparent);
}

.pcard__name {
  margin-top: 20px;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pcard__role {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.pcard__tags {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pcard__tags span {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}

/* ---------------- 通用区块 ---------------- */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) 28px;
  scroll-margin-top: 80px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 22px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.sec-num {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.sec-head h2 {
  font-size: clamp(1.5rem, 3vw, 1.95rem);
  font-weight: 700;
}

/* 关于 */

.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.about__body p {
  color: var(--muted);
  font-size: 1.02rem;
}
.about__body p + p { margin-top: 18px; }
.about__body p:first-child { color: var(--text); }

.about__meta { margin: 0; display: grid; gap: 2px; }
.about__meta > div {
  display: grid;
  grid-template-columns: 5.2em 1fr;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.about__meta > div:first-child { border-top: 1px solid var(--line); }
.about__meta dt { color: var(--muted); font-size: 0.86rem; }
.about__meta dd { margin: 0; font-size: 0.92rem; }
.about__meta a { border-bottom: 1px solid color-mix(in oklab, var(--text) 30%, transparent); }
.about__meta a:hover { border-color: var(--accent-2); color: var(--accent-2); }

/* 作品 */

.works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 18px;
}

.work {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.25s ease, border-color 0.25s ease;
}
.work:hover {
  transform: translateY(-5px);
  background: var(--surface-hover);
  border-color: color-mix(in oklab, var(--accent-2) 40%, var(--line));
}

.work__num {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.work h3 { margin-top: 14px; font-size: 1.16rem; font-weight: 700; }
.work p { margin-top: 10px; font-size: 0.92rem; color: var(--muted); }

.work__tags {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.work__tags li {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
}

.work__arrow {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.2s ease, transform 0.25s ease;
}
.work:hover .work__arrow {
  color: var(--accent-2);
  transform: translate(2px, -2px);
}

/* 联系 */

.contact { text-align: center; }
.contact .sec-head { justify-content: center; }
.contact .sec-head h2 { text-align: center; }

.contact__lede {
  max-width: 30em;
  margin: 0 auto;
  color: var(--muted);
}

.contact__mail {
  display: inline-block;
  margin-top: 26px;
  font-size: clamp(1.35rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s ease, opacity 0.25s ease;
}
.contact__mail:hover { border-color: color-mix(in oklab, var(--accent-2) 55%, transparent); }

.socials {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.socials a {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.socials a:hover {
  color: var(--text);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

/* ---------------- 页脚 ---------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 34px 28px 44px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------------- 404 ---------------- */

.nf {
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 28px;
}
.nf__code {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}
.nf h1 { margin-top: 16px; font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 800; }
.nf p { margin-top: 14px; color: var(--muted); }
.nf .btn { margin-top: 30px; }

/* ---------------- 滚动出现 ---------------- */

/* 仅在 JS 可用时才隐藏，保证无脚本环境下内容照常显示 */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}
html.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    padding-top: 56px;
  }
  .hero__art { justify-self: start; max-width: 300px; }
  .about { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav__inner { padding: 0 18px; gap: 12px; height: 58px; }
  .nav__links { gap: 0; font-size: 0.88rem; }
  .nav__links a { padding: 6px 9px; }
  .section, .hero { padding-left: 18px; padding-right: 18px; }
  .facts { gap: 8px 16px; }
  .btn { padding: 11px 20px; }
}

/* ---------------- 降低动效 ---------------- */

@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; }
}
