/* 200721.xyz — 设计变量
   想改风格，只改这一块。 */

:root {
  /* 颜色：瑞士网格 —— 白底、墨黑字、一点瑞士红 */
  --bg: #ffffff;
  --surface: #f7f7f5;
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e3e3df;
  --accent: #c4201a;
  --accent-ink: #ffffff;

  /* 字体 */
  --font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Courier New", monospace;

  /* 字号阶梯（比例 ~1.25） */
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-40: 40px;
  --fs-hero: clamp(36px, 6.4vw, 68px);

  /* 间距（4 / 8 的倍数） */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;

  /* 形状 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* 栅格 */
  --page: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e;
    --surface: #171717;
    --ink: #f2f2ef;
    --ink-soft: #cfcfc9;
    --muted: #9a9a94;
    --line: #2a2a28;
    --accent: #ff4a3d;
    --accent-ink: #0e0e0e;
  }
}

/* ---------- 基础 ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: 1.7;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
}

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

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

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

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- 顶栏 ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 95%, transparent);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand__mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}

.brand__name {
  font-size: var(--fs-16);
}

.topbar__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  color: var(--muted);
}

.dot {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
}

.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}

#clock {
  font-variant-numeric: tabular-nums;
}

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

.hero {
  padding-block: var(--sp-96) var(--sp-64);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
  margin-bottom: var(--sp-24);
  color: var(--muted);
}

.eyebrow__rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  flex: none;
}

.hero h1 {
  margin: 0;
  font-size: var(--fs-hero);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 20ch;
  text-wrap: balance;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero__lede {
  margin: var(--sp-32) 0 0;
  max-width: 34em;
  font-size: var(--fs-20);
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-24) var(--sp-32);
  margin-top: var(--sp-48);
  padding-top: var(--sp-32);
  border-top: 1px solid var(--line);
  max-width: 720px;
}

.fact {
  margin: 0;
}

.fact dt,
.fact dd {
  margin: 0;
}

.fact__key {
  color: var(--muted);
  margin-bottom: var(--sp-4);
}

.fact__val {
  font-size: var(--fs-16);
  font-weight: 500;
}

/* ---------- 区块 ---------- */

.section {
  padding-block: var(--sp-64);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--sp-32) var(--sp-48);
  align-items: start;
}

.section__title {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 88px;
}

.section__title span {
  display: block;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: var(--sp-4);
}

.section__body {
  min-width: 0;
}

/* 现在 */

.nowlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-16);
}

.nowlist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: var(--sp-16);
  font-size: var(--fs-20);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.nowlist li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 11px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.nowlist small {
  display: block;
  font-size: var(--fs-14);
  color: var(--muted);
  letter-spacing: 0;
  margin-top: var(--sp-4);
}

/* 笔记列表 */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.list li {
  border-bottom: 1px solid var(--line);
}

.list .row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 24px;
  gap: var(--sp-16);
  align-items: baseline;
  padding-block: var(--sp-16);
}

.list .row::after {
  content: "";
  justify-self: end;
  width: 14px;
  height: 14px;
  border-right: 1.75px solid var(--line);
  border-bottom: 1.75px solid var(--line);
  transform: rotate(-45deg);
  align-self: center;
  transition: border-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.list li:hover .row::after {
  border-color: var(--accent);
}

.list time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.03em;
}

.list .title {
  font-size: var(--fs-16);
  line-height: 1.5;
  transition: color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.list li:hover .title {
  color: var(--accent);
}

/* 作品 */

.works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-16);
}

.work {
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  padding: var(--sp-24);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-height: 100%;
  transition:
    border-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.work__tag {
  color: var(--accent);
}

.work h3 {
  margin: 0;
  font-size: var(--fs-20);
  line-height: 1.4;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.work p {
  margin: 0;
  font-size: var(--fs-14);
  line-height: 1.65;
  color: var(--muted);
}

/* 联系 */

.contact {
  display: grid;
  gap: var(--sp-12);
}

.contact a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  padding-block: var(--sp-16);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-20);
  letter-spacing: -0.01em;
  transition: color 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.contact a:hover {
  color: var(--accent);
}

.contact .label {
  color: var(--muted);
  font-size: var(--fs-14);
}

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

.foot {
  padding-block: var(--sp-32) var(--sp-48);
  color: var(--muted);
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8) var(--sp-24);
  justify-content: space-between;
  align-items: baseline;
}

.foot a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.foot a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- 窄屏 ---------- */

@media (max-width: 760px) {
  .section {
    grid-template-columns: 1fr;
    gap: var(--sp-16);
    padding-block: var(--sp-48);
  }

  .section__title {
    position: static;
  }

  .hero {
    padding-block: var(--sp-64) var(--sp-48);
  }

  .hero__lede {
    font-size: var(--fs-16);
  }

  .nowlist li {
    font-size: var(--fs-16);
  }

  .list .row {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: var(--sp-4) var(--sp-12);
  }

  .list time {
    grid-column: 1 / -1;
  }

  .topbar__meta .dot {
    display: none;
  }

  .contact a {
    font-size: var(--fs-16);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}