/* 一克好奇 · 设计令牌。规范见 materials/design/design-system.md */
:root {
  /* 荧光笔：黑白笔记本 + 一支荧光黄 */
  --paper: #FBF8EC;
  --paper-2: #F4EFD9;
  --card: #FFFFFF;
  --ink: #161513;            /* 对纸色 17:1 */
  --muted: #5F5C54;          /* 对纸色 6.3:1 */
  --line: #E7E2CF;
  --grid: rgba(22, 21, 19, .06);
  --accent: #FFC81F;         /* 标志圆点，浅底上必须配 --dot-stroke */
  --dot-stroke: #161513;
  --accent-soft: #FFE36B;    /* 荧光笔划重点的底色，上面放墨色字 14:1 */
  --btn-bg: #161513;
  --btn-fg: #FFD84D;         /* 13:1 */
  --invert-bg: #FFD84D;      /* 联系卡片：黄底墨字 13:1 */
  --invert-fg: #161513;
  --invert-muted: #4D4636;   /* 6.8:1 */

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --space-6: 48px; --space-8: 64px; --space-12: 96px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141411;
    --paper-2: #1B1A16;
    --card: #1D1C18;
    --ink: #F4F1E6;          /* 16:1 */
    --muted: #A8A496;        /* 7.4:1 */
    --line: #34322B;
    --grid: rgba(244, 241, 230, .05);
    --accent: #FFD84D;       /* 深底上黄色本身就醒目，13:1 */
    --dot-stroke: none;
    --accent-soft: #4A3F12;  /* 上面放浅色字 9:1 */
    --btn-bg: #FFD84D;
    --btn-fg: #161513;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: .01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.contact-card :focus-visible { outline-color: var(--invert-fg); }

.skip {
  position: absolute; left: var(--space-2); top: -60px; z-index: 10;
  padding: 10px 16px; border-radius: 8px;
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none;
}
.skip:focus { top: var(--space-2); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

.label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; vertical-align: 1px;
  border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--dot-stroke, transparent);
}

/* ---------- 顶栏 ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 18px; letter-spacing: .1em; min-height: 44px; }
.brand-mark { width: 36px; height: 33px; }
.nav { display: flex; align-items: center; gap: var(--space-1); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; color: var(--muted); font-size: 15px; transition: color .15s; }
.nav a:hover { color: var(--ink); }
.nav .cta {
  margin-left: var(--space-1); padding: 0 18px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); font-weight: 550;
  transition: transform .15s var(--ease), background .15s;
}
.nav .cta:hover { color: var(--btn-fg); transform: translateY(-1px); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}
.hero .wrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}
.hero-text { grid-column: 1 / span 8; }
.hero h1 {
  margin-top: var(--space-3);
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.005em;
}
.hero h1 em {
  font-style: normal;
  padding: 0 .08em;
  background: linear-gradient(100deg, transparent 2%, var(--accent-soft) 4%, var(--accent-soft) 96%, transparent 98%) 0 62% / 100% 46% no-repeat;
}
.lead { margin-top: var(--space-4); max-width: 30em; font-size: 19px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-6); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; text-decoration: none; font-weight: 550; font-size: 16px;
  transition: transform .15s var(--ease), background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-ghost { border: 1px solid var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; }

.specimen { grid-column: 9 / span 4; position: relative; justify-self: center; width: 100%; max-width: 300px; margin: 0; }
.specimen-mark { display: block; width: 100%; aspect-ratio: 128 / 118; }
.callout {
  margin-top: var(--space-3); text-align: center;
  font: 500 12px/1.6 var(--mono); color: var(--muted); letter-spacing: .04em;
}

.facts { border-bottom: 1px solid var(--line); }
.facts dl { display: grid; grid-template-columns: repeat(3, 1fr); margin-block: 0; }
.facts div { padding: var(--space-3) 0; border-left: 1px solid var(--line); padding-left: var(--space-3); }
.facts div:first-child { border-left: 0; padding-left: 0; }
.facts dt { font: 500 11px/1.4 var(--mono); letter-spacing: .14em; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 16px; font-weight: 550; }
.facts a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; margin-block: -11px; }
.facts a:hover { background: var(--accent-soft); }

/* ---------- 区块 ---------- */
.section { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-4); align-items: start; }
.section-head .label { grid-column: 1 / span 3; padding-top: 10px; }
.section-head .body { grid-column: 4 / span 9; }
.section h2 { font-size: clamp(28px, 3.8vw, 44px); line-height: 1.3; }
.section-head p { margin-top: var(--space-3); max-width: 34em; font-size: 18px; color: var(--muted); }

.beliefs { list-style: none; padding: 0; margin: var(--space-8) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); counter-reset: b; }
.beliefs li { border-top: 2px solid var(--ink); padding-top: var(--space-3); }
.beliefs li::before {
  counter-increment: b; content: "0" counter(b);
  display: inline-block; padding: 0 6px; border-radius: 3px; background: var(--accent-soft); font: 600 13px var(--mono); color: var(--ink); letter-spacing: .1em;
}
.beliefs h3 { margin: 12px 0 8px; font-size: 21px; }
.beliefs p { color: var(--muted); font-size: 15.5px; }

/* 正在折腾 */
.projects { margin-top: var(--space-8); display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.project {
  display: flex; flex-direction: column;
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.project:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); transform: translateY(-2px); }
.project-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.icon-tile { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: var(--paper-2); }
.icon { width: 32px; height: 32px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon .hot { stroke: var(--ink); }
.icon-tile { background: var(--accent-soft); }
.status { display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--mono); color: var(--ink); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--dot-stroke, transparent), 0 0 0 4px var(--accent-soft); }
.project h3 { font-size: 22px; }
.project p { margin-top: 8px; color: var(--muted); }
.spec { margin: var(--space-4) 0 0; padding-top: var(--space-2); border-top: 1px dashed var(--line); display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-3); font-size: 14px; }
.spec dt { font: 500 12px/1.75 var(--mono); color: var(--muted); letter-spacing: .08em; }
.spec dd { margin: 0; }
.lab-note { margin-top: var(--space-3); font-size: 14px; color: var(--muted); }

/* 联系 */
.contact { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.contact-card {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-4); align-items: end;
  padding: var(--space-8); border-radius: 24px;
  background: var(--invert-bg); color: var(--invert-fg);
}
.contact-card .label { color: var(--invert-fg); }
.contact-card .label::before { background: var(--invert-fg); box-shadow: none; }
.contact-card .text { grid-column: 1 / span 7; }
.contact-card h2 { margin-top: var(--space-2); font-size: clamp(28px, 3.8vw, 44px); line-height: 1.3; }
.contact-card p { margin-top: var(--space-2); color: var(--invert-muted); }
.contact-card .action { grid-column: 8 / span 5; justify-self: end; text-align: right; }
.mail {
  display: inline-flex; align-items: flex-end; min-height: 44px; font: 600 clamp(20px, 2.6vw, 30px)/1.3 var(--mono); text-decoration: none;
  border-bottom: 3px solid currentColor; padding-bottom: 4px; overflow-wrap: anywhere;
  transition: color .15s;
}
.mail:hover { opacity: .75; }

/* 页脚 */
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px var(--space-3); padding-top: var(--space-3); padding-bottom: var(--space-6); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-brand { display: flex; align-items: center; gap: 8px; }
.foot-brand svg { width: 20px; height: 18px; }
.beian { display: flex; flex-wrap: wrap; gap: 4px var(--space-2); }
.beian a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.beian a:hover { color: var(--ink); }

/* 入场动效：只在 JS 可用且用户未要求减少动效时启用 */
/* main.js 初始化成功后才加 .reveal-ready；脚本失败或打印时内容始终可见 */
@media screen and (prefers-reduced-motion: no-preference) {
  .reveal-ready .reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
  .reveal-ready .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero .wrap, .section-head, .contact-card { grid-template-columns: minmax(0, 1fr); }
  .hero-text { grid-column: 1 / -1; }
  .specimen { display: none; }
  .section-head .label, .section-head .body { grid-column: 1 / -1; }
  .section-head .label { padding-top: 0; }
  .contact-card .text, .contact-card .action { grid-column: 1 / -1; justify-self: start; text-align: left; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .top .wrap { height: 60px; }
  .nav a:not(.cta) { display: none; }
  .hero .wrap { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .lead { font-size: 17px; }
  .facts dl { grid-template-columns: 1fr; }
  .facts div, .facts div:first-child { border-left: 0; padding: var(--space-2) 0; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
  .section { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .beliefs, .projects { grid-template-columns: 1fr; }
  .beliefs { margin-top: var(--space-6); }
  .projects { margin-top: var(--space-6); }
  .project { padding: var(--space-3); }
  .contact { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .contact-card { padding: var(--space-4) var(--space-3); border-radius: 18px; }
}
