/* 北外招生宣传协会 brand guidelines
   A document surface: white paper, ink type, one red. */

@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #171717;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --surface: #f6f6f6;
  /* 品牌红 in two steps: 500 fills large fields, 600 carries red type and
     white on red. 标志红 #B74141 belongs to the mark files only. */
  --red: #b83e34;
  --red-bright: #e14b3f;
  --dark: #0a0a0a;
  --dark-ink: #ededed;
  --dark-muted: #9a9a9a;
  --dark-line: #292929;

  /* The cover is 品牌红 500, so the page opens on the same red as the 核心色
     swatch. The dark demo panels further down stay ink-black (--dark). */
  --cover: var(--red-bright);
  --cover-ink: #fff;
  --cover-muted: #fff;

  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --pad: clamp(20px, 5vw, 88px);
  --rail: 168px;
  --bar-h: 78px;

  /* One curve family; lengths step up with the size of what moves. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-1: 160ms;
  --dur-2: 260ms;
  --dur-3: 420ms;
  --dur-4: 640ms;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 72px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: #f2d6d3; }

.wrap {
  width: min(100% - var(--pad) * 2, 1280px);
  margin-inline: auto;
}

/* ---------- top bar ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  color: var(--cover-ink);
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.topbar.solid {
  background: var(--paper);
  color: var(--ink);
  border-bottom-color: var(--line);
}

/* Without the script the bar never turns solid, so start it solid. */
html:not(.js) .topbar {
  background: var(--paper);
  color: var(--ink);
  border-bottom-color: var(--line);
}
html:not(.js) .brandline { opacity: 1; visibility: visible; transform: none; }

.brandline {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.42s var(--ease), transform 0.42s var(--ease),
    visibility 0.42s var(--ease);
}

/* The first screen belongs to the cover, which carries the mark at full size;
   the bar keeps it out of the way until the cover has scrolled past. */
.topbar.solid .brandline { opacity: 1; visibility: visible; transform: none; }

.brandline img { width: 58px; height: auto; }
.brandline span { opacity: 0.85; }

.topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar nav a { text-decoration: none; opacity: 0.7; transition: opacity 0.2s; }
.topbar nav a:hover { opacity: 1; }
/* White at 70% on the red cover sits under the 4.5:1 floor for 12 px text. */
.topbar:not(.solid) nav a { opacity: 0.92; }

/* The hit area reaches 44px on a finger without moving the type: the gap
   becomes padding, so the two links keep the same distance apart. */
@media (pointer: coarse) {
  .topbar nav { gap: 0; margin-right: -12px; }
  .topbar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
}

/* ---------- cover ---------- */

.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(40px, 6vw, 80px);
  background: var(--cover);
  color: var(--cover-ink);
  padding: 120px var(--pad) 40px;
  overflow: hidden;
}

.cover-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
}

.cover-figure { margin: 0; display: flex; justify-content: flex-end; }

.cover-art {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  pointer-events: none;
}

.cover-inner { position: relative; display: flex; flex-direction: column; gap: 24px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cover-muted);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

.cover h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9.4vw, 132px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.cover h1 em { font-style: normal; color: inherit; }

.cover .title-zh {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: 0.24em;
  color: var(--cover-ink);
}

.cover .lead {
  max-width: 30ch;
  margin: 14px 0 0;
  font-size: 17px;
  line-height: 1.75;
  color: var(--cover-muted);
}

.cover-foot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cover-muted);
}

.cover-foot .scroll { display: inline-flex; align-items: center; gap: 10px; }
.cover-foot .scroll i {
  display: block;
  width: 1px;
  height: 34px;
  background: currentColor;
  opacity: 0.6;
}

/* ---------- section nav ---------- */

.sectionnav {
  position: sticky;
  top: var(--bar-h);
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.navscroll { overflow-x: auto; scrollbar-width: none; }
.navscroll::-webkit-scrollbar { display: none; }

.sectionnav ol {
  position: relative;
  display: flex;
  gap: clamp(18px, 3vw, 40px);
  width: min(100% - var(--pad) * 2, 1280px);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.sectionnav a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 18px 0 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
  transition: color var(--dur-2) var(--ease-soft);
}

.sectionnav a b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  transition: color var(--dur-2) var(--ease-soft);
}

.sectionnav a:hover { color: var(--ink); }
.sectionnav a[aria-current="true"] { color: var(--ink); }
.sectionnav a[aria-current="true"] b { color: var(--red); }

/* The current chapter: one bar that slides between links. */
.sectionnav .navline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 2px;
  background: var(--red);
  transform-origin: 0 50%;
  transform: translateX(0) scaleX(0);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease-soft);
}

.sectionnav .navline.on { opacity: 1; }

.sectionnav .progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* ---------- sections ---------- */

.section { padding: clamp(80px, 12vh, 150px) 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: start;
  margin-bottom: clamp(48px, 7vw, 88px);
}

.section-head .num {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--red);
}

.section-head h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1;
  letter-spacing: -0.015em;
}

.section-head .lead {
  max-width: 46ch;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.sub {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 60px);
  align-items: start;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--line);
}

.sub:first-of-type { border-top: 0; padding-top: 0; }

.sub-head h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sub-head p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.sub-body { min-width: 0; }

.sub-body > p { max-width: 52ch; margin: 0 0 28px; color: var(--muted); }
.sub-body > p:last-child { margin-bottom: 0; }

/* ---------- logo stages ---------- */

.stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  border: 1px solid var(--line);
  background: var(--paper);
  min-height: 220px;
}

.stage img { max-height: 320px; width: auto; }
.stage.dark { background: var(--dark); border-color: var(--dark); }
.stage.soft { background: var(--surface); }

.stage + .caption { margin-top: 10px; }

.caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.caption code { font-family: var(--mono); font-size: 11px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pair > * { background: var(--paper); }
.pair .stage { border: 0; }

/* variants */

.variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.variant .stage { aspect-ratio: 4 / 3; min-height: 0; padding: 18px; }
.variant .stage img { width: 100%; height: 100%; max-height: none; object-fit: contain; }

/* clear space diagram */

.specimen {
  position: relative;
  border: 1px solid var(--line);
  background: var(--paper);
  padding: clamp(28px, 6vw, 72px);
}

.specimen-inner {
  position: relative;
  padding: clamp(24px, 5vw, 56px);
  border: 1px dashed #c9c9c9;
}

.specimen-inner img { position: relative; z-index: 1; width: 100%; }
.specimen-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 0h40v40H0z' fill='none' stroke='%23ececec' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}
.specimen .x {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* One annotation block: a rule, a label, a one-line note. Column count varies. */
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
.rule { border-top: 1px solid var(--ink); padding-top: 14px; }
.rule b { display: block; font-size: 14px; margin-bottom: 4px; }
.rule span { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* do / don't */

.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }

.dd { margin: 0; }

.dd .box {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
  padding: 18px;
  transition: border-color var(--dur-2) var(--ease-soft);
}

.dd .box img { width: 78%; max-height: 100%; object-fit: contain; transition: transform var(--dur-3) var(--ease); }
.dd .box.inset img { width: 50%; }
.dd .stretch img { width: 70%; transform: scaleY(1.4); }
.dd .rotate img { transform: rotate(-11deg) scale(0.86); }
.dd .recolor img { filter: hue-rotate(150deg) saturate(1.1); }
.dd .shadow img { filter: drop-shadow(7px 9px 5px rgba(0, 0, 0, 0.45)); }
.dd .crop img { width: 100%; transform: scale(1.4); }

.dd figcaption { margin-top: 10px; font-size: 13px; }
.dd figcaption b { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.dd figcaption b::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
}
.dd.do figcaption b::before { content: "✓"; }
.dd.dont figcaption b::before { content: "✕"; }
.dd.dont figcaption b { color: var(--red); }
.dd figcaption span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.dd.dont:hover .box { border-color: #d9b3b0; }

/* co-branding */

.lockups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.lockup { margin: 0; }

.lockup .panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  aspect-ratio: 4 / 3;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.lockup .ours { height: 72px; width: auto; }

.lockup .partner { display: flex; align-items: center; gap: 10px; height: 72px; color: var(--ink); }
.lockup .partner i { display: block; width: 26px; height: 26px; background: currentColor; }
.lockup .partner b { font-size: 18px; font-weight: 600; letter-spacing: 0.08em; }

.lockup .divider { width: 1px; height: 78px; background: var(--line); }

.lockup .panel.stack { flex-direction: column; align-items: center; gap: 18px; }

.lockup .panel.dark { background: var(--dark); border-color: var(--dark); }
.lockup .panel.dark .partner { color: var(--dark-ink); }

.lockup figcaption { margin-top: 10px; font-size: 13px; }
.lockup figcaption b { display: block; font-weight: 600; }
.lockup figcaption span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.7; }

.guard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0 0; padding: 0; list-style: none; }
.guard li { border-top: 1px solid var(--ink); padding-top: 14px; }
.guard b { display: flex; align-items: center; gap: 7px; font-size: 14px; margin-bottom: 4px; }
.guard b::before {
  content: "✕";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #c9c9c9;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  color: var(--muted);
}
.guard span { display: block; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------- colour ---------- */

.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }

.swatch {
  position: relative;
  background: var(--paper);
  padding: 0;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.swatch .chip {
  position: relative;
  display: block;
  height: clamp(90px, 12vw, 150px);
  transition: outline-color var(--dur-2) var(--ease-soft);
}
.swatch .hint {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 5px 10px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.1em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-2) var(--ease-soft), transform var(--dur-3) var(--ease);
}
.swatch .meta { display: block; padding: 14px 16px 16px; background: var(--paper); }
.swatch .meta b { display: block; font-size: 14px; font-weight: 600; }
.swatch .meta code { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; }
.swatch .meta em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); }
.swatch:hover .chip { outline: 2px solid var(--ink); outline-offset: -2px; }
.swatch:hover .hint, .swatch:focus-visible .hint { opacity: 1; transform: none; }
.swatch:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.swatch[data-hex="#FFFFFF"] .chip { box-shadow: inset 0 0 0 1px var(--line); }

/* palettes */

.palette { border-top: 1px solid var(--line); }
.palette:last-child { border-bottom: 1px solid var(--line); }
.palette summary {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 74px 20px;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.palette summary::-webkit-details-marker { display: none; }
.palette summary .name { font-size: 14px; }
.palette summary .strip { display: flex; height: 34px; }
.palette summary .strip i { display: block; flex: 1; }
.palette summary .hex { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; text-align: right; letter-spacing: 0.02em; }
.palette summary .chev { font-size: 12px; color: var(--muted); transition: transform var(--dur-2) var(--ease); }
.palette:hover summary .name { color: var(--red); }
.palette[open] summary .chev { transform: rotate(180deg); }

.scale-wrap { overflow: hidden; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 6px 0 22px 108px; }
.scale div { padding: 0; cursor: copy; }
.scale div:hover i { outline: 1px solid var(--ink); outline-offset: -1px; }
.scale i { display: block; height: 56px; }
.scale code { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; letter-spacing: 0.02em; }

.proportion { margin-top: 8px; }
.bar { display: flex; height: 64px; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; }
.bar .p-white { flex: 90; background: #fff; }
.bar .p-ink { flex: 9; background: var(--ink); }
.bar .p-red { flex: 1; background: var(--red-bright); }
.bar-key { display: flex; gap: 24px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- type ---------- */

.specimen-type {
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 64px);
  display: grid;
  gap: 24px;
}
.specimen-type .big {
  font-family: var(--serif);
  font-size: clamp(88px, 18vw, 240px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.specimen-type .latin { font-family: var(--serif); font-size: clamp(28px, 4vw, 48px); letter-spacing: 0.02em; }
.specimen-type .meta { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--muted); }

.tester { display: grid; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.tester label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tester input {
  width: 100%;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color var(--dur-2) var(--ease-soft);
}
.tester input:focus { outline: none; border-bottom-color: var(--ink); }
.tester input::placeholder { color: #b3b3b3; }
.tester-out {
  display: block;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  min-height: 1.12em;
  overflow-wrap: anywhere;
}

.type-table { width: 100%; border-collapse: collapse; }
.type-table th, .type-table td { padding: 18px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.type-table th { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.type-table td:first-child { font-family: var(--serif); font-size: 20px; }
.type-table td { font-size: 13px; color: var(--muted); }
.type-table td strong { color: var(--ink); font-weight: 600; }

.setting { display: grid; gap: 18px; }
.setting p { margin: 0; }
.setting .sample { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; }
.setting .note { color: var(--muted); }

/* ---------- layout ---------- */

.grid-demo {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 20px 20px 24px;
}
.grid-demo .cols,
.grid-demo .nums,
.grid-demo .spans { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.grid-demo .cols i { display: block; height: 140px; background: #ededed; }
.grid-demo .nums b { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--muted); letter-spacing: 0.04em; }
.grid-demo .span { border-top: 1px solid var(--ink); padding-top: 7px; }
.grid-demo .span span { font-size: 12px; color: var(--muted); }

.spacing { display: grid; gap: 10px; }
.spacing div { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 16px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.spacing span { text-align: right; }
.spacing i { display: block; height: 8px; background: var(--ink); }

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.poster .p-mark { width: 46%; }
.poster .p-title { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; margin: 0; }
.poster .p-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.poster .p-red { position: absolute; left: 0; top: 0; width: 100%; height: 6px; background: var(--red-bright); }

/* ---------- voice ---------- */

.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.voice { border-top: 1px solid var(--ink); padding-top: 14px; }
.voice b { display: block; font-size: 14px; margin-bottom: 4px; }
.voice p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

.examples { display: grid; }
.example { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 20px; padding: 16px 0; align-items: baseline; border-bottom: 1px solid var(--line); }
.example.head { padding: 0 0 10px; }
.example.head span { font-size: 11px; letter-spacing: 0.12em; color: var(--muted); font-weight: 500; }
.example .tag { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.example .yes { color: var(--ink); }
.example .no { color: var(--muted); text-decoration: line-through; text-decoration-color: #b3b3b3; }

/* ---------- applications ---------- */

.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.app figure { margin: 0; }
.app .frame { border: 1px solid var(--line); background: var(--surface); padding: 20px; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; }
.app img { max-width: 100%; }
.app figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); }

.social {
  position: relative;
  width: 78%;
  aspect-ratio: 1;
  background: var(--dark);
  color: var(--dark-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12%;
}
.social img { width: 54%; }
.social b { font-family: var(--serif); font-size: clamp(14px, 1.6vw, 20px); font-weight: 400; letter-spacing: 0.06em; }

.badge {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10%;
  display: grid;
  gap: 8px;
}
.badge img { width: 42%; }
.badge b { font-size: 13px; }
.badge span { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }

/* icons */

.icons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.icon-card { margin: 0; }

.icon-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--paper);
}

.tabm {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.tabm img { width: 16px; height: 16px; }

.appicon,
.avatar {
  width: 104px;
  height: 104px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.appicon { border-radius: 24px; }
.avatar { border-radius: 50%; }
.appicon img { width: 79%; height: auto; }
.avatar img { width: 68%; height: auto; }

/* credit strip */

.credit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
  padding: clamp(22px, 3vw, 40px);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  background: var(--paper);
}
.credit-mark img { height: 46px; width: auto; }
.credit-mark span { display: block; margin-top: 12px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.credit-rows > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.credit-rows > div:first-child { border-top: 0; padding-top: 0; }
.credit-rows span { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.credit-rows b { font-size: 14px; font-weight: 500; }

/* image layouts */

.layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.layout { margin: 0; }

.mock {
  display: flex;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ededed;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #9a9a9a;
}

.mock.full { flex-direction: column; }
.mock.full .photo { flex: 1 1 62%; }
.mock.full .bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 20px; }

.mock.split { flex-direction: row; }
.mock.split .photo { flex: 0 0 54%; }
.mock.split .side { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 18px 20px; }

.mock b { display: block; font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.2; }
.mock span { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
.mock img { height: 22px; width: auto; flex: 0 0 auto; }

.icon-card figcaption, .layout figcaption, .lockup figcaption { margin-top: 10px; font-size: 13px; }
.icon-card figcaption b, .layout figcaption b, .lockup figcaption b { display: block; font-weight: 600; }
.icon-card figcaption span, .layout figcaption span, .lockup figcaption span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- resources ---------- */

.file-table { width: 100%; border-collapse: collapse; margin-top: 28px; }
.file-table th, .file-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.file-table th { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.file-table td:first-child { font-family: var(--mono); font-size: 12px; }
.file-table td:last-child { white-space: nowrap; }

.boundaries { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 28px; }
.boundaries div { border-top: 1px solid var(--ink); padding-top: 14px; }
.boundaries b { display: block; font-size: 14px; margin-bottom: 4px; }
.boundaries p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 40px var(--pad) 48px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* ---------- 404 ---------- */

/* One page, so a wrong address gets the same paper and type, not a server page. */
.lost { background: var(--paper); }
.lost .eyebrow { color: var(--muted); }
.lost-main {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  padding-top: calc(var(--bar-h, 78px) + 40px);
  padding-bottom: 80px;
}
.lost-main h1 {
  margin: 18px 0 0;
  font-size: clamp(40px, 6vw, 64px);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.lost-note { max-width: 42ch; margin: 22px 0 0; color: var(--muted); line-height: 1.9; }
.lost-back { margin: 40px 0 0; font-size: 14px; }
.lost-back a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
}
.lost-back a:hover { color: var(--red); border-color: var(--red); }

/* ---------- motion ---------- */

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes settle {
  from { opacity: 0; transform: translateY(26px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.cover-inner > *, .cover-figure, .cover-foot { animation: rise var(--dur-4) var(--ease) both; }
.cover-inner > :nth-child(1) { animation-delay: 80ms; }
.cover-inner > :nth-child(2) { animation-delay: 150ms; }
.cover-inner > :nth-child(3) { animation-delay: 240ms; }
.cover-inner > :nth-child(4) { animation-delay: 330ms; }
.cover-figure { animation-name: settle; animation-delay: 200ms; }
.cover-foot { animation-delay: 440ms; }

/* Content is hidden only when JS is running; a reader without it sees the page. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-4) var(--ease), transform var(--dur-4) var(--ease);
}
.js .reveal.in { opacity: 1; transform: none; }

.js [data-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}
.js [data-stagger].in > * { opacity: 1; transform: none; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 60;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity var(--dur-2) var(--ease-soft), transform var(--dur-3) var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */

@media (min-width: 761px) {
  .sub-head { position: sticky; top: calc(var(--bar-h) + 68px); }
}

@media (max-width: 1100px) {
  .variants, .apps, .voice-grid, .rules { grid-template-columns: 1fr 1fr; }
  .lockups, .guard, .icons, .layouts { grid-template-columns: 1fr 1fr; }
  .credit { grid-template-columns: 1fr; }
  .swatch-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 96px; }
  .cover { padding-top: 104px; gap: 32px; }
  .cover-main { grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
  .cover-figure { justify-content: flex-start; }
  .cover-art { width: min(100%, 420px); opacity: 0.8; }
  .section-head, .sub { grid-template-columns: 1fr; gap: 14px; }
  .section-head .num { font-size: 16px; }
  .variants, .apps, .voice-grid, .rules, .swatch-grid, .boundaries { grid-template-columns: 1fr 1fr; }
  .lockups, .guard, .icons, .layouts { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .example { grid-template-columns: 1fr; gap: 6px; }
  /* Stacked, the two columns lose their alignment; the strikethrough carries it. */
  .example.head { display: none; }
  .scale { grid-template-columns: repeat(5, 1fr); padding-left: 0; }
  .palette summary { grid-template-columns: 60px minmax(0, 1fr) 20px; gap: 14px; }
  .palette summary .hex { display: none; }

  /* Three columns cannot hold on a phone: each file becomes one row of type,
     the size riding in brackets after its use. */
  .file-table thead { display: none; }
  .file-table, .file-table tbody, .file-table tr, .file-table td { display: block; width: auto; }
  .file-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .file-table td { padding: 0; border: 0; }
  .file-table td:first-child { margin-bottom: 6px; }
  .file-table td:nth-child(2), .file-table td:nth-child(3) { display: inline; white-space: normal; }
  .file-table td:nth-child(3)::before { content: "（"; }
  .file-table td:nth-child(3)::after { content: "）"; }
}

@media (max-width: 460px) {
  .variants, .apps, .voice-grid, .rules, .boundaries { grid-template-columns: 1fr; }
  .swatch-grid { grid-template-columns: 1fr 1fr; }
  .dodont { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .cover-inner > *, .cover-figure, .cover-foot { animation: none !important; opacity: 1 !important; transform: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Keyboard: the first stop skips the cover and the header. */
.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(calc(-100% - 24px));
  transition: transform var(--dur-2) var(--ease);
}
.skip:focus-visible {
  transform: none;
  outline-color: var(--paper);
}
main:focus { outline: none; }

/* Print: the guide on paper. Cover on its own page, then the chapters,
   with nothing cut in half and nothing left invisible by the reveal system. */
@media print {
  @page { margin: 16mm 14mm; }
  @page :first { margin: 0; }

  body {
    background: #fff;
    color: var(--ink);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .skip, .topbar, .sectionnav, .toast, .scroll { display: none !important; }

  .cover {
    min-height: 100vh;
    padding: 20mm 18mm;
    break-after: page;
  }
  .cover-main { min-height: auto; }
  .cover-inner > *, .cover-figure, .cover-foot { animation: none !important; opacity: 1 !important; }
  .wrap { max-width: none; padding: 0; }
  .section { padding-top: 0; padding-bottom: 10mm; }
  footer {
    padding: 18px 0 0;
    break-before: avoid;
  }
  .file-table td:last-child { white-space: nowrap; }
  /* The file catalogue fills a page on its own, so let it run over rather than
     push a lone chapter title onto the previous page. Rows stay whole and the
     heading repeats. */
  .file-table { break-inside: auto; }
  .file-table tr { break-inside: avoid; }
  .file-table thead { display: table-header-group; }
  .section-head, .sub-head { position: static !important; top: auto !important; }
  .sub { grid-template-columns: 1fr; gap: 14px; }

  .js .reveal, .js [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }

  h2, h3, .section-head, .sub-head { break-after: avoid; }
  figure, table, details, .dd, .lockup, .icon-card, .layout, .credit,
  .swatch, .palette, .stage, .mock, .specimen-type, .example, .rule,
  .boundaries > *, .variants > *, .apps > * { break-inside: avoid; }

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