:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --gap: clamp(5rem, 14vh, 9rem);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  font-weight: 300;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.mono {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.dot {
  color: var(--ink);
}

/* ---------- 光标 ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .cursor {
    opacity: 0.7;
  }
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem clamp(1.5rem, 6vw, 4rem);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s ease;
}

.nav.scrolled {
  border-bottom-color: var(--line);
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(1.5rem, 8vw, 8rem);
}

.hero-kicker {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 12vw, 9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.hero-sub {
  display: flex;
  align-items: center;
  min-height: 1.6rem;
  color: var(--muted);
}

.hero-sub .prefix {
  margin-right: 0.6rem;
  color: var(--ink);
}

.caret {
  display: inline-block;
  width: 1ch;
  height: 1.2em;
  background: var(--ink);
  margin-left: 0.15em;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-line {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 3.5rem 0 2.5rem;
  position: relative;
}

.hero-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 1px;
  width: 0;
  background: var(--ink);
  animation: grow 1.6s ease-out 0.6s forwards;
}

@keyframes grow {
  to { width: 100%; }
}

.hero-desc {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted);
  max-width: 34rem;
}

/* ---------- 通用 Section ---------- */
.section {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--gap) clamp(1.5rem, 6vw, 4rem);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 3.5rem;
}

.section-head .index {
  color: var(--muted);
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.section-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

/* ---------- About ---------- */
.about-body {
  max-width: 44rem;
}

.about-body p {
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  line-height: 1.8;
  margin-bottom: 1.8rem;
}

.facts {
  list-style: none;
  margin-top: 3rem;
  border-top: 1px solid var(--line);
}

.facts li {
  display: flex;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.facts li span {
  width: 7rem;
  color: var(--muted);
  flex-shrink: 0;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  margin-right: 0.5rem;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* ---------- Work ---------- */
.work-list {
  border-top: 1px solid var(--line);
}

.work-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.work-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.45s ease;
  z-index: 0;
}

.work-item:hover::before {
  width: 100%;
}

.work-item > * {
  position: relative;
  z-index: 1;
}

.work-item:hover .work-title h3,
.work-item:hover .work-desc,
.work-item:hover .work-meta {
  color: var(--paper);
}

.work-item:hover .work-meta {
  border-color: rgba(255, 255, 255, 0.4);
}

.work-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 1rem;
}

.work-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.work-title h3 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: color 0.35s ease, transform 0.35s ease;
}

.work-item:hover .work-title h3 {
  transform: translateX(0.4rem);
}

.arrow {
  font-size: 1.4rem;
  transition: transform 0.35s ease, color 0.35s ease;
}

.work-item:hover .arrow {
  transform: translateX(0.6rem) translateY(-0.2rem);
  color: var(--paper);
}

.work-desc {
  margin-top: 0.8rem;
  color: var(--muted);
  transition: color 0.35s ease;
}

/* ---------- Contact ---------- */
.contact-line {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
}

.contact-mail {
  font-size: clamp(1.8rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-position: 0 100%;
  background-size: 0 2px;
  background-repeat: no-repeat;
  transition: background-size 0.5s ease;
  word-break: break-all;
}

.contact-mail:hover {
  background-size: 100% 2px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 3rem;
}

.contact-links a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s ease, border-color 0.3s ease;
}

.contact-links a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: var(--gap);
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 6vw, 4rem);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

/* ---------- 滚动渐入 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  transition-delay: var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .caret,
  .hero-line::after,
  .pulse {
    animation: none;
  }

  .cursor {
    display: none;
  }
}
