@font-face {
  font-family: "Courier Prime";
  src: url("./assets/fonts/CourierPrime-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "BioRhyme";
  src: url("./assets/fonts/BioRhyme-Medium.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Huiwen Fangsong";
  src: local("汇文仿宋"), local("Huiwen Fangsong"), url("./assets/fonts/HuiwenFangsong.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1f1c17;
  --muted: #6f6857;
  --faint: #a39c8c;
  --paper: #faf8f2;        /* page surface — 米色 */
  --paper-2: #f1ece1;      /* faint warm fill / panels */
  --line: #e8e4da;
  --line-soft: #efebe1;
  /* app paper tints — only used in the live color demo */
  --cream: #fefbef;
  --blue: #e6f3f9;
  --green: #ebf5e1;
  --pink: #f9e6ea;
  --shadow: 0 14px 40px rgb(60 50 30 / 0.08);
  --mono: "Courier Prime", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fangsong: "Huiwen Fangsong", "Songti SC", "STSong", serif;
  --serif: "Iowan Old Style", "Apple Garamond", "Hoefler Text", Georgia, "Songti SC", "STSong", serif;
  --slab: "BioRhyme", "Iowan Old Style", Georgia, "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --maxw: 1080px;
  --pad: clamp(22px, 6vw, 84px);
  --r: 3px;   /* near-square, like the app */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.72;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ol, table { margin-top: 0; }

/* italic serif accent + mono inline label (kept from current type system) */
.it { font-family: var(--serif); font-style: italic; }
em { font-style: normal; font-family: var(--mono); letter-spacing: 0.01em; }

/* ░░ Header ░░ */
.site-header {
  position: fixed;
  z-index: 30;
  inset: 0 0 auto 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--pad);
  background: rgb(250 248 242 / 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: flex-end; gap: 11px; font-family: var(--mono); font-size: 13px; line-height: 1; text-transform: lowercase; white-space: nowrap; }
.logo-mark { position: relative; display: inline-flex; align-items: flex-end; padding-top: 0.46em; color: var(--ink); font-family: var(--mono); line-height: 1; }
.logo-text, .logo-underscore { display: inline-block; letter-spacing: 0.2em; }
.logo-slot { position: relative; display: inline-block; width: 1.06em; line-height: 1; }
.logo-k { position: absolute; left: 38%; top: -0.44em; display: inline-block; letter-spacing: 0; transform: translateX(-50%) rotate(-15deg); transform-origin: 50% 70%; }
.brand-cn { padding-left: 12px; border-left: 1px solid var(--line); color: #4b4437; font-family: var(--fangsong); font-size: 12px; letter-spacing: 0.18em; line-height: 1; text-transform: none; transform: translateY(0.12em); }
.top-nav { display: flex; align-items: flex-end; gap: clamp(14px, 3vw, 30px); color: var(--muted); font-family: var(--mono); font-size: 11px; line-height: 1; }
.top-nav a { padding-bottom: 0; border-bottom: 1px solid transparent; }
.top-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ░░ Buttons ░░ */
.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}
.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover { background: #000; }
.button.ghost { background: transparent; color: var(--ink); }
.button.ghost:hover { background: var(--paper-2); }

/* ░░ Shared labels ░░ */
.kicker, .index-label, .eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.kicker { display: block; margin: 0 0 20px; }
.index-label { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.index-label .no { color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 3px 9px; }

/* ░░ Sections ░░ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(54px, 7vw, 88px) var(--pad);
  border-top: 1px solid var(--line);
}
.section-head { max-width: 640px; margin-bottom: 42px; }
.section-sub { color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }

h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(18px, 2vw, 24px); line-height: 1.26; letter-spacing: -0.005em; }
h2 .it { font-weight: 500; }
h3 { font-family: var(--serif); font-weight: 600; font-size: 15px; line-height: 1.36; margin-bottom: 6px; }

/* ░░ Masthead — flat, light ░░ */
.masthead {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(120px, 15vw, 188px) var(--pad) clamp(54px, 7vw, 86px);
}
.cover-title { margin: 0 0 12px; font-family: var(--slab); font-weight: 500; font-size: clamp(24px, 3vw, 36px); line-height: 1.08; letter-spacing: 0; }
.cover-title .it { font-family: var(--slab); font-style: normal; font-weight: 500; }
.cover-cn { margin: 0 0 16px; font-family: var(--fangsong); font-size: clamp(14.5px, 1.45vw, 17px); letter-spacing: 0.05em; color: #38332a; }
.cover-lede { max-width: 500px; margin: 0 0 24px; font-family: var(--serif); font-size: clamp(13.5px, 1.05vw, 15px); line-height: 1.68; color: #44402f; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.cover-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 58px 0 0; padding-top: 0; }
.cover-meta dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.cover-meta dd { margin: 0; font-size: 12.5px; }

/* ░░ Foreword ░░ */
.foreword .index-label { display: flex; max-width: 760px; margin-left: 0; margin-right: 0; }
.foreword-body { max-width: 760px; margin-left: 0; margin-right: 0; }
.foreword-body { font-family: var(--serif); font-size: clamp(15px, 1.45vw, 18px); line-height: 1.72; color: #2e2a20; }

/* ░░ Color lab ░░ */
.lab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.specimen-card { position: relative; margin: 0; }
.specimen {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background 0.45s ease;
}
.specimen img { width: 100%; mix-blend-mode: multiply; }

.lab-readout { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-family: var(--mono); }
.lab-swatch { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: var(--r); }
.lab-name { font-size: 13px; }
.lab-hex { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--mono); font-size: 11.5px; color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chip span { width: 18px; height: 18px; background: var(--c); border: 1px solid var(--line); border-radius: var(--r); }
.chip:hover { border-color: var(--faint); }
.chip.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.lab-note { margin: 20px 0 0; color: var(--muted); font-size: 12.8px; line-height: 1.72; }

/* ░░ Process — flat ruled rows, no cards / no colored dots ░░ */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: clamp(14px, 3vw, 34px); align-items: baseline; padding: 10px 0; }
.steps li + li { margin-top: 18px; }
.step-dot { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.step-body h3 { margin: 0 0 4px; }
.step-body p { margin: 0; color: var(--muted); max-width: 62ch; font-size: 12.8px; }

/* ░░ Catalogue — image + caption, no card ░░ */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.cat-item { margin: 0; }
.cat-sheet img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.cat-item figcaption { display: flex; flex-direction: column; gap: 3px; margin-top: 14px; }
.cat-no { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.cat-name { font-family: var(--serif); font-size: 13.5px; }
.cat-name em { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.cat-spec { font-family: var(--mono); font-size: 10.5px; color: var(--faint); margin-top: 3px; }

/* ░░ Spec table — flat hairline table ░░ */
.spec-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--mono); font-size: 11.8px; }
.spec-col-name { width: 18%; }
.spec-col-size { width: 28%; }
.spec-col-use { width: 54%; }
.spec-table th, .spec-table td { text-align: left; vertical-align: middle; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.spec-table thead th { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--ink); }
.spec-table tbody td:first-child { color: var(--ink); }
.spec-table tbody td:nth-child(3) { color: var(--muted); font-family: var(--sans); }
.spec-table tbody tr:last-child td { border-bottom-color: var(--ink); }
.spec-table tbody tr:hover { background: var(--paper-2); }
.spec-foot { margin: 16px 0 0; font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* ░░ Notes — plain columns, no dots ░░ */
.note-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.note-grid article { margin: 0; padding-top: 0; }
.note-dot { display: none; }
.note-grid h3 { margin: 0 0 6px; }
.note-grid p { margin: 0; color: var(--muted); font-size: 12.8px; }

/* ░░ Colophon ░░ */
.colophon { max-width: var(--maxw); margin: 0 auto; text-align: left; padding: clamp(54px, 7vw, 88px) var(--pad); border-top: 1px solid var(--line); }
.colophon .index-label { display: flex; justify-content: flex-start; max-width: 640px; }
.colophon-lede { max-width: 560px; margin: 14px 0 0; font-family: var(--fangsong); font-size: 14.2px; letter-spacing: 0.03em; color: #44402f; }
.launch-panel { max-width: 640px; margin: 36px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: var(--r); }
.launch-label { margin-bottom: 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.launch-title { margin-bottom: 6px; font-family: var(--fangsong); font-size: 16px; letter-spacing: 0.04em; }
.launch-note { margin: 0; font-size: 11.8px; color: var(--muted); line-height: 1.6; }

/* ░░ Footer — light ░░ */
.site-footer { padding: 40px var(--pad) 48px; background: var(--paper); border-top: 1px solid var(--line); font-size: 12.5px; }
.footer-inner, .footer-legal { max-width: var(--maxw); margin-inline: auto; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 24px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 24px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.footer-nav a:hover, .footer-legal a:hover { color: var(--ink); }
.footer-legal { margin: 22px auto 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.footer-legal a { border-bottom: 0; }

/* ░░ Privacy page ░░ */
.policy-main { max-width: 760px; margin: 0 auto; padding: 132px var(--pad) 90px; }
.policy-main h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 5vw, 50px); }
.policy-date { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.policy-main section { padding: 28px 0; border-top: 1px solid var(--line); }
.policy-main section h2 { margin-bottom: 12px; font-family: var(--serif); font-size: 21px; }
.policy-main a { border-bottom: 1px solid currentColor; }

/* ░░ Responsive ░░ */
@media (max-width: 860px) {
  .top-nav a:nth-child(3), .top-nav a:nth-child(4) { display: none; }
  .lab { grid-template-columns: 1fr; }
  .specimen { max-width: 360px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .cover-meta { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 560px) {
  body { font-size: 13.2px; line-height: 1.68; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .brand { font-size: 12.5px; }
  .top-nav { font-size: 11px; transform: translateY(0.34em); }
  .top-nav a:nth-child(1) { display: none; }
  .button { width: 100%; min-height: 38px; font-size: 13px; padding: 8px 14px; }
  .kicker, .index-label, .eyebrow { font-size: 10px; }
  .section { padding-top: 78px; padding-bottom: 78px; }
  .masthead { padding-top: 108px; }
  .cover-title { font-size: 24px; line-height: 1.1; }
  .cover-cn { font-size: 14px; line-height: 1.58; margin-bottom: 14px; }
  .cover-lede { font-size: 13px; line-height: 1.68; margin-bottom: 22px; }
  .lab { gap: 22px; }
  .specimen { max-width: min(56vw, 210px); max-height: none; box-shadow: 0 10px 26px rgb(60 50 30 / 0.06); }
  .cover-meta dt { font-size: 10px; }
  .cover-meta dd { font-size: 12px; }
  h2 { font-size: 18px; line-height: 1.28; }
  h3 { font-size: 14px; }
  .section-sub { font-size: 12.8px; }
  .foreword-body { font-size: 15px; line-height: 1.72; }
  .step-body p,
  .note-grid p { font-size: 12.5px; }
  .steps li { padding: 6px 0; }
  .steps li + li { margin-top: 20px; }
  .cat-name { font-size: 13px; }
  .colophon-lede { font-size: 13px; }
  .launch-title { font-size: 15px; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .note-grid { grid-template-columns: 1fr; }
  .cover-meta { grid-template-columns: 1fr 1fr; }
  .site-footer { padding-top: 42px; padding-bottom: 46px; }
  .footer-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 24px; }
  .footer-nav { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: 12px 22px; margin-top: 0; font-size: 11.5px; }
  .footer-nav a { display: block; padding-bottom: 0; border-bottom: 0; }
  .footer-legal { display: grid; grid-template-columns: 1fr; justify-content: stretch; gap: 9px; margin-top: 18px; font-size: 10.8px; line-height: 1.45; }
  .footer-legal > * { display: block; }
  .footer-legal a { width: fit-content; }
  .launch-panel { display: block; }
  .launch-panel .button { margin-top: 18px; width: auto; }
  .spec-col-name { width: 21%; }
  .spec-col-size { width: 31%; }
  .spec-col-use { width: 48%; }
  .spec-table { font-size: 10.8px; }
  .spec-table th, .spec-table td { padding: 10px 8px; line-height: 1.38; }
  .spec-table thead th { font-size: 10px; letter-spacing: 0.04em; white-space: nowrap; }
  .spec-table thead .unit { display: block; margin-top: 2px; }
  .spec-table tbody tr { height: 58px; }
  .spec-table tbody td:first-child,
  .spec-table tbody td:nth-child(2) { white-space: nowrap; }
  .spec-table tbody td:nth-child(3) { font-size: 11.5px; line-height: 1.35; }
}
