/* ============================================================
   Jack Cao — 个人站点 · 浅色克制主题
   设计基调：米白底 / 深砂金强调 / 大留白 / 细分割线
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* 色彩：暖调米白，避免纯白的刺眼 */
  --bg:        #FBFAF7;
  --bg-soft:   #F4F2ED;
  --bg-card:   #FFFFFF;
  --ink:       #16171A;
  --ink-2:     #55575C;
  --ink-3:     #8C8E93;
  --line:      #E5E2DB;
  --line-soft: #EFEDE7;

  /* 强调色：砂金在深底上的对应深色版，浅底对比度 ≈ 5.6:1 (AA) */
  --accent:      #8A5A16;
  --accent-ink:  #6F470F;
  --accent-soft: rgba(138, 90, 22, .08);
  --accent-line: rgba(138, 90, 22, .28);

  /* 字体 */
  --font-display: 'Space Grotesk', 'PingFang SC', -apple-system,
                  BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'PingFang SC', -apple-system,
                  BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, monospace;

  /* 间距节奏：留白是本设计的主体，数值偏大 */
  --gap-section: clamp(120px, 15vw, 220px);
  --gap-block:   clamp(56px, 7vw, 104px);
  --pad-x:       clamp(24px, 6vw, 96px);
  --maxw:        1160px;
  --maxw-text:   680px;

  --radius:  4px;
  --ease:    cubic-bezier(.22, .61, .36, 1);
  --nav-h:   76px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 32px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

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

/* ---------- 布局容器 ---------- */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.wrap--text { max-width: calc(var(--maxw-text) + var(--pad-x) * 2); }

.section { padding-block: var(--gap-section); }
.section--tight { padding-block: var(--gap-block); }
.section--soft { background: var(--bg-soft); }

/* 细分割线 */
.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ============================================================
   导航 — 多页面站点，tab 是真实跳转而非锚点
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(251, 250, 247, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: border-color .3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-shrink: 0;
}
.brand__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-2px);
}
.brand__sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: .06em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
}
.nav__link {
  position: relative;
  font-size: 15px;
  color: var(--ink-2);
  padding-block: 6px;
  transition: color .22s var(--ease);
  white-space: nowrap;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after { transform: scaleX(1); }

.nav__link[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* 移动端菜单按钮 */
.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  margin-right: -8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink);
  transition: transform .28s var(--ease), opacity .2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================================
   排版
   ============================================================ */
.h-display {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.4vw, 92px);
  line-height: 1.06;
  letter-spacing: -.035em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.1;
  letter-spacing: -.03em;
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.22;
  letter-spacing: -.022em;
  font-weight: 500;
  margin: 0;
}
.h3 {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -.015em;
  font-weight: 600;
  margin: 0;
}

.lead {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.72;
  color: var(--ink-2);
  max-width: var(--maxw-text);
  margin: 0;
}
.body-text {
  font-size: 17px;
  line-height: 1.82;
  color: var(--ink-2);
  max-width: var(--maxw-text);
  margin: 0;
}
.body-text + .body-text { margin-top: 1.4em; }

/* 区块眉标：小号等宽 + 强调色 */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 clamp(20px, 2.6vw, 32px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--accent-line);
  flex-shrink: 0;
}

.meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .05em;
  color: var(--ink-3);
}

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
  padding-top: clamp(88px, 13vw, 190px);
  padding-bottom: var(--gap-section);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .62fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: end;
}
.hero__statement { margin-bottom: clamp(32px, 4vw, 52px); }
.hero__statement em {
  font-style: normal;
  color: var(--accent);
}
.hero__aside {
  padding-bottom: 8px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.hero__aside p {
  margin: 0 0 1.1em;
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--ink-2);
}
.hero__facts {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 11px;
}
.hero__facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13.5px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.hero__facts dt, .hero__facts .k { color: var(--ink-3); }
.hero__facts .v { color: var(--ink); text-align: right; }

/* ============================================================
   通用组件
   ============================================================ */

/* 文字链接箭头 */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  transition: gap .25s var(--ease);
}
.link-arrow svg { width: 15px; height: 15px; flex-shrink: 0; }
.link-arrow:hover { gap: 15px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  border: 1px solid transparent;
  transition: background .24s var(--ease), color .24s var(--ease),
              border-color .24s var(--ease), transform .24s var(--ease);
}
.btn--solid {
  background: var(--ink);
  color: var(--bg);
}
.btn--solid:hover { background: var(--accent); transform: translateY(-1px); }
.btn--ghost {
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(32px, 4vw, 46px);
}

/* 卡片网格 */
.grid {
  display: grid;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--bg);
  padding: clamp(28px, 3.4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background .3s var(--ease);
}
.section--soft .card { background: var(--bg-soft); }
.card:hover { background: var(--bg-card); }
.card p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* 区块头：标题 + 右侧入口 */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: clamp(40px, 5vw, 68px);
}
.section-head__text { max-width: 640px; }
.section-head__text .h2 { margin-bottom: 14px; }
.section-head__text p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.7;
}
.section-head__more { flex-shrink: 0; padding-bottom: 6px; }

/* ============================================================
   项目卡片（首页精选 / 做做页共用）
   ============================================================ */
.pgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 2.6vw, 36px);
}
.pcard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(26px, 2.8vw, 36px);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .3s var(--ease), transform .3s var(--ease),
              box-shadow .3s var(--ease);
}
.pcard:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: 0 14px 40px -22px rgba(22, 23, 26, .18);
}
.pcard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pcard__cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.pcard p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
}
.pcard__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 18px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 3px 11px;
}

/* ============================================================
   列表（想想 / 学习）
   ============================================================ */
.list { border-top: 1px solid var(--line); }
.list__item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto;
  gap: clamp(20px, 3vw, 48px);
  align-items: baseline;
  padding-block: clamp(26px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  transition: padding-left .3s var(--ease);
}
.list__item:hover { padding-left: 10px; }
.list__item:hover .list__title { color: var(--accent); }
.list__date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
  padding-top: 5px;
}
/* 列表项内部用 span 承载，需显式块级化 */
.list__title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.35;
  letter-spacing: -.018em;
  font-weight: 500;
  margin: 0 0 8px;
  transition: color .25s var(--ease);
  text-wrap: balance;
}
.list__desc {
  display: block;
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink-2);
  max-width: 62ch;
}
.list__aside {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  padding-top: 6px;
}

/* ============================================================
   筛选器（做做 / 学习）
   ============================================================ */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(32px, 4vw, 52px);
  padding-bottom: clamp(28px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
}
.filter {
  font-size: 14px;
  padding: 7px 17px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-2);
  transition: all .24s var(--ease);
}
.filter:hover { border-color: var(--ink-3); color: var(--ink); }
.filter[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.filter__count {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: .55;
  margin-left: 6px;
}

/* ============================================================
   页头（子页面）
   ============================================================ */
.page-head {
  padding-top: clamp(72px, 10vw, 140px);
  padding-bottom: clamp(48px, 6vw, 84px);
}
.page-head .h1 { margin-bottom: clamp(20px, 2.4vw, 30px); }
.page-head .lead { max-width: 640px; }

/* ============================================================
   技能行 / 联系方式（关于页）
   ============================================================ */
.skill-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 40px);
  padding-block: clamp(20px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.skill-row:first-child { border-top: 1px solid var(--line); }
.skill-row__k {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.skill-row__v {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(36px, 4vw, 56px);
  max-width: 760px;
}
.contact-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 2.4vw, 28px);
  background: var(--bg);
  transition: background .26s var(--ease);
}
.section--soft .contact-item { background: var(--bg-soft); }
.contact-item:hover { background: var(--bg-card); }
.contact-item:hover .contact-item__v { color: var(--accent); }
.contact-item__k {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex-shrink: 0;
}
.contact-item__v {
  font-size: 15.5px;
  text-align: right;
  transition: color .24s var(--ease);
  word-break: break-all;
}

@media (max-width: 900px) {
  .skill-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-item { flex-direction: column; gap: 6px; }
  .contact-item__v { text-align: left; }
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 6vw, 76px) clamp(36px, 4vw, 52px);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}
.footer__nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
  flex-wrap: wrap;
}
.footer__nav a {
  font-size: 14.5px;
  color: var(--ink-2);
  transition: color .22s var(--ease);
}
.footer__nav a:hover { color: var(--accent); }
.footer__note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ink-3);
  margin: 0;
}
.footer__note a {
  color: inherit;
  transition: color .22s var(--ease);
}
.footer__note a:hover { color: var(--accent); }

/* ============================================================
   滚动进场动效
   ============================================================ */
[data-rv] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-rv].is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1040px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--pad-x) 22px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .26s var(--ease), transform .26s var(--ease);
  }
  .nav__links.is-open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav__link {
    width: 100%;
    font-size: 17px;
    padding-block: 13px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] { color: var(--accent); }

  .hero__grid { grid-template-columns: 1fr; align-items: start; }
  .hero__aside { border-top: 1px solid var(--line); }

  .list__item { grid-template-columns: 1fr; gap: 10px; }
  .list__date { padding-top: 0; }
  .list__aside { padding-top: 0; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .pgrid { grid-template-columns: 1fr; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .brand__sub { display: none; }
  .section-head__more { width: 100%; }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  [data-rv] { opacity: 1; transform: none; }
}
