/* OPC.FISH Brand Book — extends the homepage style.css (same tokens & theme system).
   Every page is locked to one screen (html/body overflow:hidden + body 100dvh, set in style.css). */

/* 思源柔黑 Medium (Resource Han Rounded CN, SIL OFL 1.1 — see fonts/OFL-ResourceHanRounded.txt).
   Subset to the glyphs the site renders with it: 摸鱼也是生产力 */
@font-face {
  font-family: "OPC Rounded CN";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local("Resource Han Rounded CN Medium"), local("ResourceHanRoundedCN-Medium"),
       url("fonts/resource-han-rounded-cn-medium-subset.woff2") format("woff2");
  unicode-range: U+4E5F, U+4EA7, U+529B, U+6478, U+662F, U+751F, U+9C7C;
}

:root {
  --surface: rgba(255, 255, 255, .55);
  --cjk: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --cjk-rounded: "OPC Rounded CN", "Resource Han Rounded CN", var(--cjk);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --surface: rgba(255, 255, 255, .07); }
}
:root[data-theme="dark"] { --surface: rgba(255, 255, 255, .07); }

body { line-height: 1.6; }
body::before { background: radial-gradient(ellipse at 50% 38%, var(--bg-glow) 0%, transparent 62%); }
a { color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* ---------- Page frame (hub + chapters) ---------- */
.book {
  flex: 1; min-height: 0; width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  display: flex; flex-direction: column;
}

/* Home link (top-left, mirrors toggle) */
.home-link {
  position: fixed; top: max(1rem, env(safe-area-inset-top)); left: max(1rem, env(safe-area-inset-left)); z-index: 10;
  display: inline-flex; align-items: center; gap: .3rem; height: 2.5rem; padding: 0 .95rem 0 .6rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--btn-bg);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  text-decoration: none; font-weight: 600; font-size: .8rem; letter-spacing: .02em; color: var(--ink);
  transition: border-color .2s, color .2s, background-color .35s;
}
.home-link svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.home-link em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: .15rem; }
.home-link:hover { border-color: var(--brand); color: var(--brand); }
.home-link:hover em { color: inherit; }
.home-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---------- Cover (brand hub) ---------- */
.cover {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 5.5rem 0 1.25rem; text-align: center;
}
.eyebrow { margin: 0 0 clamp(2rem, 6vh, 3.5rem); font-size: .8rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.eyebrow span { color: var(--muted); }
.hero-logo { width: min(400px, 72vw); max-height: 50vh; }
.cover-title { margin-top: clamp(2rem, 5vh, 3rem); display: flex; align-items: center; gap: .9rem; }
.cover-title p { margin: 0; white-space: nowrap; }
.cover-title::before, .cover-title::after { content: ""; width: 2.5rem; height: 1px; background: var(--line); }
.ct-cn { font-family: var(--cjk); font-size: 1rem; font-weight: 500; letter-spacing: .4em; padding-left: .4em; color: var(--ink); }
.ct-en { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; }
.toc { margin-top: clamp(2.5rem, 7vh, 4rem); display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; max-width: 820px; }
.toc a {
  display: inline-flex; align-items: baseline; gap: .4rem; padding: .45rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--ink);
  font-family: "Quicksand", var(--cjk); transition: border-color .2s, color .2s;
}
.toc a b { color: var(--brand); font-size: .75rem; }
.toc a span { color: var(--muted); font-weight: 500; font-size: .75rem; }
.toc a:hover { border-color: var(--brand); color: var(--brand); }
.toc a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* ---------- Chapter page ---------- */
.page-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: clamp(3.75rem, 6vw, 4.75rem);
}
.book-link {
  display: inline-flex; align-items: baseline; gap: .35rem;
  text-decoration: none; font-weight: 600; font-size: .88rem;
  font-family: "Quicksand", var(--cjk); color: var(--ink);
  border-bottom: 1px solid transparent; padding-bottom: .1rem;
  transition: color .2s, border-color .2s;
}
.book-link em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .78rem; }
.book-link:hover { color: var(--brand); border-bottom-color: var(--brand); }
.book-link:hover em { color: inherit; }
.book-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.page-head-num { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em; color: var(--muted); font-family: "Quicksand", var(--cjk); }

/* The chapter is the one clipping box. A 8px gutter (padding, cancelled by negative margin) plus
   overflow-clip-margin keeps focus rings / hover lift of cards fully visible. */
.chapter {
  --gutter: 8px;
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  margin: 0 calc(-1 * var(--gutter));
  padding: clamp(.45rem, 1.4vw, .85rem) var(--gutter) var(--gutter);
  overflow: hidden; overflow: clip; overflow-clip-margin: 6px;
}
.chapter-head { flex-shrink: 0; max-width: 720px; margin-bottom: clamp(.85rem, 2vw, 1.35rem); }
.num { margin: 0 0 .3rem; font-size: .85rem; font-weight: 700; color: var(--brand); letter-spacing: .12em; }
.chapter h2 { margin: 0; font-family: "Quicksand", var(--cjk); font-size: clamp(1.75rem, 4.2vw, 2.6rem); font-weight: 700; line-height: 1.2; letter-spacing: .01em; }
.chapter h2 span { display: block; font-size: max(12px, .5em); font-weight: 500; color: var(--muted); letter-spacing: .04em; margin-top: .35rem; }
.sub { flex-shrink: 0; margin: .85rem 0 .55rem; font-size: 1.05rem; font-weight: 700; font-family: "Quicksand", var(--cjk); }
.sub span { color: var(--muted); font-weight: 500; font-size: .85em; margin-left: .35rem; }

/* Pager: prev · progress dots · next */
.pager {
  flex-shrink: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  margin: max(0px, clamp(.5rem, 1.5vw, .9rem) - 8px) 0 0; padding-top: .55rem;
  border-top: 1px solid var(--line);
}
.pager-card {
  justify-self: start; display: inline-flex; flex-direction: column; gap: .2rem; padding: .35rem 0;
  border-radius: 10px; text-decoration: none; color: var(--ink); font-family: "Quicksand", var(--cjk);
  transition: color .2s, background-color .25s;
}
.pager-next { justify-self: end; align-items: flex-end; text-align: right; }
.pager-dir { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; color: var(--muted); transition: color .2s; }
.pager-dir em, .pager-title em, .pager-book em { font-style: normal; font-weight: 500; color: var(--muted); }
.pager-dir svg { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.pager-title { font-size: .92rem; font-weight: 700; line-height: 1.3; transition: color .2s; }
.pager-title b { color: var(--brand); font-size: .75rem; letter-spacing: .08em; margin-right: .35rem; }
.pager-title em { font-size: .82em; margin-left: .1rem; }
.pager-card:hover .pager-title, .pager-card:hover .pager-dir, .pager-card:hover em { color: var(--brand); }
.pager-prev:hover .pager-dir svg { transform: translateX(-3px); }
.pager-next:hover .pager-dir svg { transform: translateX(3px); }
.pager-card:focus-visible, .pager-dot:focus-visible, .pager-book:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.pager-mid { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.pager-dots { display: flex; margin: 0; padding: 0; list-style: none; }
.pager-dots li { display: flex; }
/* 6px dot drawn in the content box; the 9px padding makes a 24 × 24px tap/click target */
.pager-dot {
  display: block; box-sizing: content-box; width: .375rem; height: .375rem; padding: 9px;
  border-radius: 999px; background: var(--muted); background-clip: content-box; opacity: .65;
  transition: width .3s cubic-bezier(.2,.7,.2,1), background-color .2s, opacity .2s;
}
.pager-dot:hover { opacity: 1; }
.pager-dot[aria-current="page"] { width: 1rem; background-color: var(--brand); opacity: 1; }
.pager-dot:focus-visible { outline-offset: -5px; }
.pager-book { font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-decoration: none; font-family: "Quicksand", var(--cjk); white-space: nowrap; transition: color .2s; }
.pager-book:hover, .pager-book:hover em { color: var(--brand); }

/* ---------- 01 Mark ---------- */
.mark-stage {
  flex: 1; min-height: 0; display: grid; place-items: center; padding: clamp(1rem, 2.8vw, 2rem) 1.5rem;
  border-radius: 24px; background: var(--surface); border: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: center;
  overflow: hidden; container-type: size;
}
/* width capped by the stage width and height (viewBox 740 × 300) */
.mark-svg { display: block; height: auto; width: min(560px, 82cqw, calc(100cqh * 2.466)); }
.facts { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: .75rem 0 0; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.facts div { background: var(--bg); padding: .7rem 1.1rem; }
.facts dt { font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-bottom: .3rem; }
.facts dd { margin: 0; font-family: var(--cjk); font-size: .95rem; }
.nw { white-space: nowrap; }

/* ---------- 02 Lockups ---------- */
.lockup-group { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lockup-group h3 { flex-shrink: 0; margin: 0 0 1rem; font-size: 1rem; font-weight: 700; font-family: "Quicksand", var(--cjk); }
.lockup-group h3 b { display: inline-block; min-width: 3.4rem; color: var(--brand); }
.lockup-group h3 span { color: var(--muted); font-weight: 500; margin-left: .35rem; font-size: .9em; }
.lockups { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.65fr 1fr; grid-template-rows: minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 1.5rem); }
.lockup {
  margin: 0; position: relative; display: grid; place-items: center; min-height: 0;
  padding: 2.25rem 2rem 2.75rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; container-type: size;
}
.lockup figcaption { position: absolute; left: 1.25rem; bottom: .9rem; font-size: .75rem; font-weight: 600; color: var(--muted); font-family: "Quicksand", var(--cjk); }
.lockup figcaption span { font-weight: 500; opacity: .8; }
/* widths capped by the card width and height (viewBox ratios 4.879 / 1.162) */
.lockup-svg { display: block; height: auto; }
.lockup-svg.h { width: min(480px, 100cqw, calc(100cqh * 4.879)); }
.lockup-svg.s { width: min(230px, 78cqw, calc(100cqh * 1.162)); }
.logo-ink { fill: var(--ink); transition: fill .35s ease; }
.logo-muted { fill: var(--muted); transition: fill .35s ease; }

/* ---------- 03 Color ---------- */
.swatches { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: clamp(.75rem, 2vw, 1.25rem); }
.swatch {
  font: inherit; color: inherit; text-align: left; cursor: copy; padding: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 26%, transparent); border-radius: 18px; background: var(--surface); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .2s, border-color .2s;
}
.swatch:hover { transform: translateY(-3px); border-color: var(--brand); }
.swatch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* the chip keeps 5:3 but may give up height on short screens */
.chip { display: block; aspect-ratio: 5 / 3; flex: 0 1 auto; min-height: 1.5rem; background: var(--c); box-shadow: inset 0 -1px 0 0 var(--line); }
.sw-name { padding: .75rem 1rem 0; font-weight: 700; font-family: "Quicksand", var(--cjk); }
.sw-name em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .85em; margin-left: .2rem; }
.sw-hex { padding: .1rem 1rem 0; font-size: 1.2rem; font-weight: 700; letter-spacing: .03em; }
.sw-meta { padding: .35rem 1rem .85rem; font-size: .78rem; color: var(--muted); line-height: 1.7; font-family: "Quicksand", var(--cjk); }

/* ---------- 04 Type ---------- */
.type-cards { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.5rem); container-type: size; }
.type-card { min-height: 0; overflow: hidden; padding: 1.25rem 1.15rem 1.15rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.tc-role { margin: 0; font-size: .75rem; font-weight: 700; color: var(--brand); letter-spacing: .06em; font-family: "Quicksand", var(--cjk); }
.tc-role span { color: var(--muted); font-weight: 500; }
/* "Aa" scales with the available height (cqh of .type-cards), capped at the full desktop size */
.tc-aa { margin: .5rem 0 .25rem; font-size: clamp(2.5rem, 24cqh - 1rem, 5.5rem); line-height: 1.05; color: var(--ink); }
.tc-aa.cn { font-family: var(--cjk-rounded); font-weight: 500; font-size: clamp(2.1rem, 20cqh - 1rem, 4.6rem); padding: .25rem 0; letter-spacing: .05em; }
.q700 { font-family: "Quicksand", sans-serif; font-weight: 700; }
.q500 { font-family: "Quicksand", sans-serif; font-weight: 500; }
.type-card h3 { margin: 0 0 .75rem; font-size: 1.15rem; font-family: "Quicksand", var(--cjk); }
.type-card h3 small { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; }
.tc-sample { margin: 1rem 0 0; }
.tc-sample.wm { font-size: 1.6rem; letter-spacing: .05em; color: var(--ink); }
.tc-sample.wm i { font-style: normal; color: var(--brand); }
.tc-sample.en { font-size: .95rem; letter-spacing: .02em; color: var(--muted); }
.cn-specimen { display: block; width: 100%; height: auto; aspect-ratio: 694 / 73; margin: .25rem 0 0; }
.cn-specimen .logo-ink { fill: var(--muted); }
.type-card dl { margin: auto 0 0; padding-top: .85rem; display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .8rem; font-family: "Quicksand", var(--cjk); }
.type-card dt { color: var(--muted); }
.type-card dd { margin: 0; }
/* one-line spec summary (weight · tracking) — shown only where the full spec list is hidden */
.tc-spec { display: none; margin: .3rem 0 0; font-size: .75rem; line-height: 1.4; color: var(--muted); white-space: nowrap; font-family: "Quicksand", var(--cjk); }
/* Desktop: subgrid so role / Aa / name / sample and each spec row line up across the three cards */
@media (min-width: 901px) {
  .type-cards { grid-template-rows: auto auto auto 1fr auto auto auto; row-gap: 0; }
  .type-card { display: grid; grid-row: span 7; grid-template-rows: subgrid; align-content: start; }
  .type-card > * { align-self: start; }
  .type-card dl { margin-top: 0; grid-row: span 3; grid-template-rows: subgrid; align-self: stretch; }
  .type-card dt, .type-card dd { align-self: start; }
}

/* ---------- 05 Icons ---------- */
.icon-hero {
  flex: 1; min-height: 0;
  display: flex; gap: clamp(1.5rem, 5vw, 3rem); align-items: center; justify-content: center;
  padding: clamp(1rem, 2.8vw, 2rem) 1rem; border-radius: 24px; background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; container-type: size;
}
/* sized by the card's height (cqh) so preview + shadow always stay inside the card */
.icon-hero img { display: block; flex: none; height: min(200px, 70cqh, 30cqw); width: auto; max-height: 100%; }
.icon-hero img:first-child { filter: drop-shadow(0 10px 18px rgba(240, 64, 28, .25)); }
.icon-row { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: clamp(1rem, 3.5vw, 2.25rem); padding: 1rem 1.25rem; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.icon-row figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.icon-row img { display: block; }
.icon-row figcaption { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* ---------- Toast: top-centre in the toolbar row, so it never covers BLOG / © ---------- */
.toast {
  position: fixed; left: 50%; top: max(1rem, env(safe-area-inset-top)); z-index: 60;
  max-width: calc(100vw - 7.5rem); white-space: nowrap;
  transform: translate(-50%, -.5rem); opacity: 0; pointer-events: none;
  padding: .6rem 1rem; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: .85rem; font-weight: 600; line-height: 1.5; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .pager-card, .pager-dir svg, .pager-dot, .swatch { transition: none; }
}

/* ==========================================================================
   Responsive — one-screen lock. Height thresholds assume real browsers
   (toolbars eat 100–200px): content is compressed first, hidden only when
   it truly cannot fit. Main display, pager and footer always stay.
   ========================================================================== */

/* Desktop / landscape tablet ≤ 1000px tall: icon hero and 1:1 row side by side
   (the 180px size is dropped from the row — the hero already shows it large). */
@media (min-width: 901px) and (max-height: 1000px) {
  #icon { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); column-gap: clamp(1rem, 2.5vw, 1.5rem); }
  #icon .chapter-head { grid-column: 1 / -1; }
  #icon .icon-hero { grid-column: 1; grid-row: 2 / 4; }
  #icon .sub { grid-column: 2; grid-row: 2; margin-top: 0; }
  #icon .icon-row { grid-column: 2; grid-row: 3; min-height: 0; align-content: center; justify-content: center; }
  .icon-row figure:first-child { display: none; }
}
@media (max-height: 860px) { .icon-row figure:first-child { display: none; } }

/* Color 901–1180px wide: the English name always takes its own line, so name / HEX / usage line up in all five cards */
@media (min-width: 901px) and (max-width: 1180px) {
  .sw-name em { display: block; margin-left: 0; }
}

/* Short desktop: compress the type cards step by step */
@media (min-width: 901px) and (max-height: 820px) {
  .type-card { padding: 1rem 1.15rem; }
  .tc-aa { margin: .25rem 0 .1rem; }
  .tc-aa.cn { padding: .15rem 0; }
  .type-card h3 { margin-bottom: .4rem; }
  .tc-sample { margin-top: .35rem; }
  .type-card dl { padding-top: .6rem; gap: .15rem .9rem; }
}
@media (min-width: 901px) and (max-height: 740px) {
  .type-card { padding: .8rem 1rem; }
  .type-card h3 { font-size: 1.05rem; margin-bottom: .25rem; }
  .type-card h3 small { display: none; }
  .tc-sample.wm { font-size: 1.35rem; }
  .tc-sample.en { font-size: .85rem; line-height: 1.45; }
  .type-card dl { font-size: .75rem; line-height: 1.45; padding-top: .45rem; gap: .05rem .75rem; }
}
/* ≤ 600px tall: full spec list replaced by the one-line summary */
@media (min-width: 901px) and (max-height: 600px) {
  .type-card dl { display: none; }
  .tc-spec { display: block; }
}

/* Tablet portrait & narrower (≤ 900px wide) */
@media (max-width: 900px) {
  .lockups { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr); }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .swatch:last-child { grid-column: 1 / -1; }
  .chip { aspect-ratio: auto; flex: 1 1 0; }
  /* type: stacked cards, specimen left, details right */
  .type-cards { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .type-card { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: 1.25rem; grid-template-rows: repeat(5, auto); align-content: center; align-items: start; padding: .8rem 1.25rem; }
  .type-card > * { grid-column: 2; }
  .type-card .tc-aa { grid-column: 1; grid-row: 1 / -1; align-self: center; margin: 0; font-size: clamp(2.4rem, 11cqh, 4.5rem); }
  .type-card .tc-aa.cn { font-size: clamp(1.7rem, 7cqh, 2.8rem); padding: 0; }
  .type-card h3 { margin: .15rem 0 .35rem; }
  .type-card h3 small { display: inline; margin-left: .4rem; }
  .tc-sample { margin: 0; }
  .tc-sample.wm { font-size: 1.35rem; }
  .cn-specimen { width: auto; height: clamp(1.25rem, 5vw, 2.3rem); max-width: 100%; }
  .type-card dl { margin: 0; padding-top: .4rem; gap: .1rem .9rem; }
}
/* Tablet portrait: spec list in a third column so each card stays short */
@media (min-width: 641px) and (max-width: 900px) {
  .type-card { grid-template-columns: 6.5rem minmax(0, 1fr) minmax(0, 1.15fr); }
  .type-card dl { grid-column: 3; grid-row: 1 / -1; align-self: center; padding: 0 0 0 1rem; border-left: 1px solid var(--line); }
  .type-card h3 small { display: block; margin-left: 0; }
}

/* Phones (≤ 640px wide) */
@media (max-width: 640px) {
  .pager { gap: .5rem; margin-top: 0; padding-top: .45rem; }
  .pager-card { min-width: 0; }
  .pager-title em, .pager-dir em, .pager-book em { display: none; }
  .pager-title { white-space: nowrap; }
  .chapter-head { margin-bottom: .75rem; }
  .chapter h2 { font-size: 1.6rem; }
  .chapter h2 span { margin-top: .15rem; }
  .toc a span { display: none; }
  /* mark: facts as compact single-line rows */
  .facts { grid-template-columns: 1fr; margin-top: .6rem; }
  .facts div { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; padding: .45rem .9rem; }
  .facts dt { margin: 0; flex: none; }
  .facts dd { font-size: .85rem; text-align: right; }
  /* lockups */
  .lockup-group h3 { margin-bottom: .6rem; font-size: .95rem; }
  .lockup { padding: 1rem 1rem 2.1rem; }
  .lockup figcaption { left: 1rem; bottom: .6rem; }
  .lockups { gap: .75rem; }
  /* type: full spec list → one compact spec line per card */
  .type-cards { gap: .75rem; }
  .type-card { padding: .85rem 1rem; grid-template-columns: 4.25rem minmax(0, 1fr); column-gap: .9rem; }
  .type-card .tc-aa { font-size: clamp(2.2rem, 10cqh, 3rem); }
  .type-card .tc-aa.cn { font-size: clamp(1.5rem, 6.5cqh, 1.9rem); letter-spacing: 0; }
  .type-card h3 { font-size: 1rem; margin: .1rem 0 .25rem; }
  .type-card h3 small { display: none; }
  .tc-sample.wm { font-size: 1.15rem; }
  .tc-sample.en { font-size: .8rem; }
  .type-card dl { display: none; }
  .tc-spec { display: block; }
  /* icons: hero + the small 1:1 sizes */
  .icon-row figure:first-child { display: none; }
  .icon-row { justify-content: center; padding: .85rem 1rem; gap: 1.5rem; }
  .sub { margin: .6rem 0 .45rem; font-size: .95rem; }
}

/* Small phones (≤ 480px wide): page header sits in the top bar between Home and Theme */
@media (max-width: 480px) {
  .eyebrow span { display: none; }
  .home-link span { display: none; }
  .home-link { width: 2.5rem; padding: 0; justify-content: center; }
  .cover-title::before, .cover-title::after { width: 1.25rem; }
  body.brand-chapter .page-head { height: 2.5rem; box-sizing: content-box; padding: max(1rem, env(safe-area-inset-top)) 2.85rem 0; }
  .chapter { padding-top: .6rem; }
  .chapter-head .num { margin-bottom: .1rem; font-size: .8rem; }
  /* color: one column, chip on the left */
  .swatches { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(5, minmax(0, 1fr)); gap: .6rem; }
  .swatch:last-child { grid-column: auto; }
  .swatch { display: grid; grid-template-columns: 34% minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: center; }
  .swatch .chip { grid-row: 1 / -1; align-self: stretch; height: auto; min-height: 0; }
  .sw-name { padding: 0 .9rem; }
  .sw-hex { padding: 0 .9rem; font-size: 1.1rem; line-height: 1.4; }
  .sw-meta { padding: .1rem .9rem 0; line-height: 1.5; }
  .icon-row figure:last-child { display: none; }
}

/* Short phones (real-browser heights): compress first … */
@media (max-width: 640px) and (max-height: 740px) {
  .chapter-head { margin-bottom: .6rem; }
  .chapter h2 { font-size: 1.45rem; }
  .facts div { padding: .35rem .9rem; }
  .sw-hex { font-size: 1rem; line-height: 1.35; }
  .sw-meta { font-size: .75rem; line-height: 1.35; }
  .type-card { padding: .7rem 1rem; }
}
/* … then hide secondary labels only where it truly does not fit */
@media (max-width: 640px) and (max-height: 700px) {
  .chapter h2 span, .facts dt span, .sub span, .tc-role { display: none; }
}
@media (max-width: 640px) and (max-height: 620px) {
  .sw-meta, .sw-name em { display: none; }
  .type-card { padding: .5rem 1rem; }
  .tc-spec { margin-top: .15rem; }
}
@media (max-width: 640px) and (max-height: 580px) {
  .tc-spec { display: none; }
}
@media (max-width: 480px) and (max-height: 560px) {
  body.brand-hub .cover .hero-logo { max-width: min(72vw, calc(100vw - 8rem)); }
}
/* Narrowest phones (≤ 360px) */
@media (max-width: 360px) {
  .book-link em { display: none; }
  .cover-title::before, .cover-title::after { display: none; }
  .ct-cn { letter-spacing: .25em; padding-left: .25em; }
  .type-card { grid-template-columns: 3.6rem minmax(0, 1fr); padding: .5rem .85rem; }
  .tc-sample.en { font-size: .75rem; line-height: 1.45; }
}

/* Short screens wider than 480px (laptops with browser chrome): page header moves into the top bar;
   side padding computed so it never runs under the fixed Home / Theme buttons. */
@media (max-height: 700px) and (min-width: 481px) {
  body.brand-chapter .page-head {
    height: 2.5rem; box-sizing: content-box;
    padding: max(1rem, env(safe-area-inset-top)) max(0px, calc(9.5rem - max(0px, (100vw - 1120px) / 2) - clamp(1.25rem, 5vw, 3rem))) 0;
  }
  .chapter { padding-top: .5rem; }
  .chapter-head { margin-bottom: .75rem; }
  .sub { margin: .6rem 0 .45rem; }
}

/* Very short viewports (≤ 560px tall — landscape phones / tiny windows) */
@media (max-height: 560px) {
  .facts, .sub, .icon-row, .chapter h2 span, .sw-meta, .lockup-group h3 { display: none; }
  body.brand-hub .cover { padding: 1.4rem 0 .5rem; }
  body.brand-hub .eyebrow { margin-bottom: .75rem; }
  body.brand-hub .hero-logo { flex: 1 1 0; min-height: 4rem; width: auto; max-width: 72vw; max-height: none; }
  body.brand-hub .cover-title { margin-top: .75rem; }
  body.brand-hub .toc { margin-top: .75rem; }
  body.brand-hub .toc a span { display: none; }
}
/* Landscape phones (≤ 460px tall): one-line chapter title, side-by-side layouts */
@media (max-height: 460px) {
  .chapter-head .num, .tc-role, .type-card dl, .type-card h3 small, .sw-name em { display: none; }
  .chapter h2 { font-size: 1.3rem; }
  .chapter-head { margin-bottom: .5rem; }
  .chapter { padding-top: .35rem; }
  .pager { margin-top: 0; padding-top: .3rem; }
  .pager-card { padding: .15rem 0; }
  .lockups { grid-template-columns: 1.65fr 1fr; grid-template-rows: minmax(0, 1fr); gap: .75rem; }
  .lockup { padding: .75rem .75rem 1.9rem; }
  .swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: .6rem; }
  .swatch, .swatch:last-child { display: flex; flex-direction: column; grid-column: auto; }
  .swatch .chip { grid-row: auto; flex: 1 1 0; aspect-ratio: auto; min-height: 1rem; }
  .sw-name { padding: .4rem .7rem 0; font-size: .85rem; }
  .sw-hex { padding: 0 .7rem .5rem; font-size: .95rem; }
  .type-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: .6rem; }
  .type-card { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: .6rem .85rem; }
  .type-card > * { max-width: 100%; }
  .type-card .tc-aa { font-size: clamp(1.8rem, 26cqh, 3rem); margin: 0; }
  .type-card .tc-aa.cn { font-size: clamp(1.4rem, 20cqh, 2.2rem); }
  .type-card h3 { font-size: .9rem; margin: .1rem 0 .2rem; }
  .tc-sample.wm { font-size: 1rem; }
  .tc-sample.en { font-size: .75rem; line-height: 1.4; }
  .cn-specimen { height: auto; width: 100%; }
  .tc-spec { display: block; }
}
