/* ==========================================================================
   Handraw Style — shared design system
   Paper-white editorial layout, ink-line details, restrained Klein-blue accents.
   ========================================================================== */

:root {
  --paper: #faf9f6;
  --paper-warm: #f3f0e9;
  --card: #ffffff;
  --ink: #1b1a18;
  --ink-2: #514d46;
  --ink-3: #8b857a;
  --line: #e5e0d6;
  --line-2: #d2ccbe;
  --blue: #1b3fa0;
  --blue-soft: #edf1fc;
  --red: #b8412c;
  --red-soft: #f9ece8;
  --yellow: #e3ae3c;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun",
    "Noto Serif CJK SC", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --wrap: 1200px;
  --radius: 4px;
  --shadow: 0 14px 34px rgba(27, 26, 24, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ---------- bilingual display ----------
   English is the default: html carries data-lang="en" from the inline boot script.
   Only the non-active language is hidden, so elements keep their authored display. */
html[data-lang="en"] [data-l="zh"],
html[data-lang="zh"] [data-l="en"] { display: none !important; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(27, 26, 24, 0.022) 1px, transparent 1px);
  background-size: 18px 18px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--blue-soft); color: var(--blue); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 860px; margin: 0 auto; }

/* ---------- typography ---------- */

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.28; letter-spacing: -0.015em; }

.display {
  font-size: clamp(38px, 5.2vw, 66px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 800;
}

h2.section-title {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 18px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.lede { font-size: 17px; line-height: 1.9; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

.red { color: var(--red); }
.blue { color: var(--blue); }

.scribble { position: relative; display: inline-block; }
.scribble svg { position: absolute; left: 0; bottom: -0.28em; width: 100%; height: 0.42em; overflow: visible; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-cn { font-size: 18px; font-weight: 800; letter-spacing: 0.02em; }
.brand-en { font-size: 9px; letter-spacing: 0.19em; color: var(--ink-3); font-weight: 700; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  position: relative;
  padding: 8px 13px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 3px;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--paper-warm); }
.nav a.active { color: var(--ink); font-weight: 700; }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 13px; right: 13px; bottom: 2px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transform: rotate(-1.4deg);
}

/* ---------- language switcher (top-right) ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
  padding: 3px;
  border: 1.5px solid var(--blue);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 0 rgba(27, 63, 160, 0.10);
}
.lang-globe { width: 15px; height: 15px; color: var(--blue); margin: 0 4px 0 7px; flex-shrink: 0; }
.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border-radius: 999px;
  transition: background 0.18s, color 0.18s;
}
.lang-switch button:hover { background: var(--blue-soft); }
html[data-lang="en"] .lang-switch [data-set-lang="en"],
html[data-lang="zh"] .lang-switch [data-set-lang="zh"] { background: var(--blue); color: #fff; }
html[data-lang="en"] .lang-switch [data-set-lang="en"]:hover,
html[data-lang="zh"] .lang-switch [data-set-lang="zh"]:hover { background: var(--blue); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(27, 26, 24, 0.16); }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); border-color: var(--ink); box-shadow: none; }
.btn-blue { background: var(--blue); border-color: var(--blue); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s, gap 0.18s;
}
.text-link:hover { border-color: var(--blue); gap: 10px; }
.text-link svg { width: 14px; height: 14px; }

/* ---------- sections ---------- */

.section { padding: 88px 0; }
.section.tight { padding: 62px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 42px; }
.section-head .lede { margin: 14px 0 0; max-width: 720px; }
.section-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.section-head.row .lede { max-width: 620px; }

/* ---------- hero ---------- */

.hero { padding: 82px 0 76px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.hero-copy .display { margin-bottom: 24px; }
.hero-copy .lede { max-width: 520px; margin: 0 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }

.seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1.4px solid var(--red);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 255px 8px 225px 8px / 8px 225px 8px 255px;
  transform: rotate(-2deg);
}
.seal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

.hero-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-3);
  border-left: 2px solid var(--line-2);
  padding-left: 14px;
  max-width: 460px;
}

/* collage board */
.collage {
  position: relative;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 3px;
  box-shadow: var(--shadow);
  transform: rotate(0.6deg);
}
.collage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.collage-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.collage-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
}
.collage-sticker {
  position: absolute;
  right: -22px;
  top: -26px;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(11deg);
  box-shadow: 0 8px 20px rgba(27, 63, 160, 0.22);
  font-family: var(--font-serif);
  line-height: 1.15;
}
.collage-sticker strong { font-size: 26px; }
.collage-sticker span { font-size: 9px; letter-spacing: 0.12em; margin-top: 3px; }

/* ---------- quick search ---------- */

.quick-search { padding: 0 0 8px; }
.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 20px;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 5px 5px 0 var(--paper-warm);
}
.search-form .search-icon { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  padding: 10px 0;
}
.search-form input::placeholder { color: var(--ink-3); }
.search-form .btn { flex-shrink: 0; }
.search-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; color: var(--ink-3); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  white-space: nowrap;
}
a.chip:hover, button.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
button.chip.active { border-color: var(--blue); color: #fff; background: var(--blue); font-weight: 700; }
.chip .count { color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; }
button.chip.active .count { color: rgba(255, 255, 255, 0.75); }

/* ---------- stats ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 30px 20px 32px; border-right: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat-num { font-family: var(--font-serif); font-size: clamp(34px, 4vw, 50px); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.stat-num em { font-style: normal; color: var(--blue); }
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 10px; letter-spacing: 0.04em; }

/* ---------- category cards ---------- */

.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.cat-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.cat-thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.cat-body { display: block; padding: 20px 22px 22px; }
.cat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cat-code { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: 0.06em; }
.cat-count { font-size: 12px; color: var(--ink-3); }
.cat-card h3 { font-size: 18px; margin-bottom: 8px; }
.cat-card p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink-2); min-height: 47px; }
.cat-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 700; color: var(--blue); }

/* ---------- gallery / cards ---------- */

.page-head { padding: 62px 0 40px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(32px, 4vw, 50px); letter-spacing: -0.035em; margin: 0 0 16px; }
.page-head .lede { max-width: 760px; margin: 0; }
.page-head .eyebrow { margin-bottom: 14px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.filter-search { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 260px; padding: 0 14px; background: var(--card); border: 1px solid var(--line-2); border-radius: 3px; }
.filter-search svg { width: 17px; height: 17px; color: var(--ink-3); flex-shrink: 0; }
.filter-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: 14px; color: var(--ink); }
.filter-search input::placeholder { color: var(--ink-3); }
.filter-tools { display: flex; gap: 8px; flex-wrap: wrap; }

.chips-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0 4px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0 18px; font-size: 13px; color: var(--ink-3); }
.result-bar strong { color: var(--ink); font-family: var(--font-mono); font-size: 14px; }

.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.item-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.item-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.item-media { display: block; position: relative; aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.item-media img { width: 100%; height: 100%; object-fit: contain; }
.item-id {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.item-body { padding: 14px 15px 16px; flex: 1; display: flex; flex-direction: column; }
.item-name { display: block; font-size: 14px; font-weight: 700; line-height: 1.5; margin-bottom: 6px; }
.item-desc {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 12px; font-size: 11px; color: var(--ink-3); }
.item-foot .mono { color: var(--blue); font-weight: 700; }

/* color cards */
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.color-card { background: var(--card); color: inherit; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding: 0; text-align: left; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.color-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.color-card .item-media { aspect-ratio: 1 / 1; }
/* Colour swatches are portrait source images (224x387): fill the square tile. */
.color-card .item-media img { object-fit: cover; }
html[data-lang="en"] .hero-copy .display { font-size: clamp(36px, 4.6vw, 60px); }
.color-card h3 { font-size: 15px; padding: 13px 14px 3px; }
.color-card .note { font-size: 12px; color: var(--ink-3); padding: 0 14px 14px; line-height: 1.6; }
.color-group-head { display: flex; align-items: baseline; gap: 14px; margin: 44px 0 18px; }
.color-group-head h3 { font-size: 20px; }
.color-group-head p { margin: 0; font-size: 13px; color: var(--ink-3); }

.load-more { display: flex; justify-content: center; padding: 40px 0 6px; }
.empty { text-align: center; padding: 80px 20px; color: var(--ink-3); }
.empty svg { width: 42px; height: 42px; margin: 0 auto 16px; color: var(--line-2); }
.empty h3 { color: var(--ink); font-size: 18px; margin-bottom: 8px; }

/* ---------- feature cards / steps ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  padding: 28px 26px 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.feature-num { font-family: var(--font-serif); font-size: 34px; line-height: 1; color: var(--blue); margin-bottom: 18px; }
.feature h3 { font-size: 18px; margin-bottom: 10px; }
.feature p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.85; }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); background: var(--card); }
.step { padding: 32px 28px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step-tag { font-family: var(--font-mono); font-size: 12px; color: var(--blue); font-weight: 700; letter-spacing: 0.08em; }
.step h3 { font-size: 19px; margin: 12px 0 10px; }
.step p { margin: 0; font-size: 14px; color: var(--ink-2); }

.pick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.pick { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.pick:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pick img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.pick-meta { display: block; padding: 10px 11px 12px; }
.pick-meta .mono { font-size: 11px; color: var(--blue); font-weight: 700; }
.pick-meta p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- code blocks ---------- */

.code-block { position: relative; background: #201f1d; color: #f4f1ea; border-radius: var(--radius); padding: 22px 24px; margin: 18px 0 0; overflow: hidden; }
.code-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; }
.code-block .code-tag { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: #a8a299; margin-bottom: 10px; text-transform: uppercase; }
.copy-code { position: absolute; right: 12px; top: 12px; padding: 5px 10px; font-size: 11px; color: #f4f1ea; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 2px; transition: background 0.18s; }
.copy-code:hover { background: rgba(255, 255, 255, 0.22); }

.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.formula span { padding: 8px 14px; background: var(--card); border: 1px solid var(--line-2); border-radius: 3px; font-family: var(--font-mono); font-size: 13px; }
.formula .plus { border: 0; background: transparent; color: var(--ink-3); font-size: 18px; padding: 0 2px; }
.formula .result { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 700; }

/* ---------- guide page ---------- */

.guide-layout { display: grid; grid-template-columns: 210px 1fr; gap: 56px; align-items: start; padding: 60px 0 90px; }
.toc { position: sticky; top: 100px; }
.toc-title { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: 14px; }
.toc a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--line); font-size: 13px; color: var(--ink-2); transition: border-color 0.18s, color 0.18s; }
.toc a:hover, .toc a.active { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.guide-content section { padding: 0 0 52px; margin-bottom: 52px; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.guide-content section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.guide-content h2 { font-size: 27px; margin: 0 0 10px; }
.guide-content h3 { font-size: 17px; margin: 30px 0 8px; }
.guide-content p { color: var(--ink-2); line-height: 1.95; margin: 0 0 14px; }
.guide-content ul { color: var(--ink-2); padding-left: 20px; margin: 0 0 16px; }
.guide-content li { margin-bottom: 8px; line-height: 1.9; }
.guide-content strong { color: var(--ink); }
.guide-content .tag { display: inline-block; padding: 2px 8px; font-family: var(--font-mono); font-size: 12px; background: var(--blue-soft); color: var(--blue); border-radius: 2px; font-weight: 700; }

.note-box { margin-top: 20px; padding: 18px 20px; background: var(--paper-warm); border-left: 3px solid var(--blue); border-radius: 0 3px 3px 0; font-size: 14px; color: var(--ink-2); }
.note-box strong { color: var(--ink); }

.faq-item { border-top: 1px solid var(--line); padding: 20px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { margin: 0 0 8px; font-size: 16px; }
.faq-item p { margin: 0; font-size: 14px; }

/* ---------- about page ---------- */

.about-hero { padding: 70px 0 54px; border-bottom: 1px solid var(--line); }
.about-hero h1 { font-size: clamp(34px, 4.4vw, 54px); letter-spacing: -0.035em; margin: 0 0 18px; }
.about-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: start; }
.about-grid h2 { font-size: 24px; margin: 0 0 14px; }
.about-grid p { color: var(--ink-2); line-height: 1.95; margin: 0 0 16px; }
.info-list { border-top: 1px solid var(--line); }
.info-row { display: flex; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-row dt { width: 116px; flex-shrink: 0; color: var(--ink-3); }
.info-row dd { margin: 0; font-weight: 600; }
.credit-card { padding: 30px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 5px 5px 0 var(--paper-warm); }
.credit-card .seal { margin-bottom: 18px; }
.credit-card h3 { font-size: 21px; margin-bottom: 12px; }
.credit-card p { font-size: 14px; color: var(--ink-2); }
.credit-card .btn { margin-top: 14px; width: 100%; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--paper-warm); padding: 56px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr; gap: 40px; }
.footer-brand p { font-size: 13px; color: var(--ink-2); max-width: 290px; margin: 14px 0 0; line-height: 1.9; }
.footer-col h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--ink-2); padding: 4px 0; transition: color 0.18s; }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); }
.footer-bottom a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }

/* ---------- modal ---------- */

.modal-mask { position: fixed; inset: 0; z-index: 100; background: rgba(27, 26, 24, 0.52); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-mask.open { display: flex; }
.modal { width: min(880px, 100%); max-height: min(86vh, 760px); overflow: auto; background: var(--card); border-radius: 5px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28); display: grid; grid-template-columns: 0.95fr 1.05fr; }
.modal-media { background: var(--paper-warm); display: flex; align-items: center; justify-content: center; padding: 26px; border-right: 1px solid var(--line); }
.modal-media img { max-width: 100%; max-height: 480px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.modal-body { padding: 34px 34px 30px; }
.modal-close { float: right; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: transparent; border-radius: 2px; color: var(--ink-2); font-size: 19px; line-height: 1; transition: background 0.18s; }
.modal-close:hover { background: var(--paper-warm); }
.modal-id { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: 0.06em; }
.modal-body h2 { font-size: 25px; margin: 10px 0 6px; }
.modal-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 20px; }
.modal-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 20px 0 8px; }
.modal-desc { font-size: 14px; line-height: 1.9; color: var(--ink-2); margin: 0; }
.modal-note { font-size: 12px; line-height: 1.75; color: var(--ink-3); margin: 10px 0 0; padding-left: 12px; border-left: 2px solid var(--line-2); }
.modal-prompt { background: var(--paper-warm); border: 1px solid var(--line); border-radius: 3px; padding: 14px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; color: var(--ink); word-break: break-word; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.section.tight.catalog-body { padding-top: 30px; }
#grid > .color-group-head:first-child { margin-top: 4px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; }
.cta-center { text-align: center; }
.cta-center .lede { margin: 14px auto 26px; max-width: 620px; }
.cta-center .hero-actions { justify-content: center; }

.toast { position: fixed; right: 26px; bottom: 26px; z-index: 200; padding: 12px 18px; background: var(--ink); color: #fff; border-radius: 3px; font-size: 13px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .color-grid { grid-template-columns: repeat(4, 1fr); }
  .pick-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { gap: 40px; }
  .nav a { padding: 8px 9px; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 54px; }
  .collage { max-width: 520px; margin: 0 auto; }
  .cat-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-layout { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 12px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .toc-title { width: 100%; }
  .toc a { border-left: 0; padding: 4px 0; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .modal { grid-template-columns: 1fr; max-height: 90vh; }
  .modal-media { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .modal-media img { max-height: 300px; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 20px; }
  .header-inner { height: auto; flex-wrap: wrap; padding: 12px 0; gap: 10px; }
  .nav { order: 3; width: 100%; flex-wrap: wrap; overflow-x: visible; padding-bottom: 2px; }
  .nav a { padding: 6px 6px; font-size: 12.5px; }
  .nav a.active::after { left: 6px; right: 6px; }
  .lang-switch { order: 2; margin-left: auto; }
  .section { padding: 60px 0; }
  .hero { padding: 54px 0 56px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 22px 14px; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-bottom: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid, .feature-grid { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(2, 1fr); }
  .search-form { flex-wrap: wrap; padding: 10px 12px; box-shadow: 3px 3px 0 var(--paper-warm); }
  .search-form .btn { width: 100%; }
  .section-head.row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-head { padding: 44px 0 30px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .modal-body { padding: 24px 22px; }
  .display { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
