/* ------------------------------------------------------------------
   imdare.xin — a working sheet
   Hand-drawn paper system: warm ground, pencil ink, blue annotations,
   red corrections, yellow highlights.
------------------------------------------------------------------ */

@font-face {
  font-family: "Sketch Working Marker";
  src: url("/assets/fonts/caveat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sketch Working Hand";
  src: url("/assets/fonts/patrick-hand-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --dp-color-ground: #f7f2e7;
  --dp-color-ink: #38352f;
  --dp-color-ink-muted: #514d44;
  --dp-color-line: #b3ac9d;
  --dp-color-accent: #9e3a2e;
  --dp-color-annotation: #344c69;
  --dp-color-highlight: #f0dfa0;
  --dp-color-scrap: #fcf8ef;

  --paper-2: #f0e8d7;
  --highlight-pale: #f6ecc6;

  --font-marker: "Sketch Working Marker", "Caveat", "Segoe Print", cursive;
  --font-hand: "Sketch Working Hand", "Patrick Hand", "Noto Sans CJK SC", "Comic Sans MS", cursive;

  --reading: 23px;
  --detail: 21px;

  --radius-control: 9px 4px 17px 5px / 4px 12px 5px 9px;
  --radius-scrap: 12px 5px 18px 7px / 7px 16px 6px 14px;

  --shadow-pencil: 3px 3px 0 rgba(56, 53, 47, 0.16);
  --shadow-soft: 4px 4px 0 rgba(56, 53, 47, 0.08);

  --page-max: 1200px;
  --gutter: clamp(20px, 4.5vw, 56px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--dp-color-ground);
  color: var(--dp-color-ink);
  font-family: var(--font-hand);
  font-size: var(--reading);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint paper grain, laid over the sheet like a cheap scan. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
}

::selection {
  background: var(--dp-color-highlight);
  color: var(--dp-color-ink);
}

#dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

:where(a, summary, button):focus-visible {
  outline: 3px dashed var(--dp-color-annotation);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------
   Language blocks
   Each language has its own nodes. Only one set is in the layout at a
   time; display: contents lets the visible wrapper disappear so the
   existing grid/flex structure is untouched.
------------------------------------------------------------------ */

.lang {
  display: none;
}

html[data-lang="en"] .lang-en,
html[data-lang="zh"] .lang-zh {
  display: block;
  display: contents;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-ink);
  border-radius: var(--radius-control);
  font-family: var(--font-marker);
  font-size: 1.3rem;
  text-decoration: none;
  box-shadow: var(--shadow-pencil);
}

.skip-link:focus {
  top: 14px;
}

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

.display {
  font-family: var(--font-marker);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.015em;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1.5px;
  flex: none;
  background: currentColor;
  transform: rotate(-2deg);
}

.section-head {
  max-width: 790px;
}

.section-head h2 {
  margin: 0.1em 0 0.32em;
  font-size: clamp(2.6rem, 5vw, 4.35rem);
}

.section-lede {
  max-width: 52ch;
  margin: 0;
  color: var(--dp-color-ink-muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------ */

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0 20px;
  border-bottom: 1.5px solid var(--dp-color-line);
}

.wordmark {
  font-family: var(--font-marker);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  letter-spacing: 0.01em;
  transform: rotate(-1deg);
}

.wordmark span {
  color: var(--dp-color-accent);
}

.sheet-nav {
  display: flex;
  gap: clamp(14px, 2.2vw, 28px);
}

.sheet-nav a {
  color: var(--dp-color-ink-muted);
  font-size: 1rem;
  text-decoration: none;
  transition: color 100ms ease;
}

.sheet-nav a:hover {
  color: var(--dp-color-ink);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  text-decoration-color: var(--dp-color-annotation);
}

.sheet-no {
  margin: 0;
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.05rem;
  line-height: 1.2;
  opacity: 0.9;
  transform: rotate(0.6deg);
}

.header-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: clamp(10px, 1.5vw, 20px);
}

.lang-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 4px 10px 6px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-ink);
  border-radius: var(--radius-control);
  box-shadow: 2px 2px 0 rgba(56, 53, 47, 0.55);
  color: var(--dp-color-ink);
  font-family: var(--font-marker);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transform: rotate(0.6deg);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

html.i18n-ready .lang-toggle {
  display: inline-flex;
}

.lang-toggle:hover {
  transform: translate(-1px, -1px) rotate(-0.4deg);
  box-shadow: 1px 1px 0 rgba(56, 53, 47, 0.55);
}

.lang-toggle:active {
  transform: translate(1px, 1px) rotate(0deg);
  box-shadow: 0 0 0 rgba(56, 53, 47, 0.55);
}

/* The visible "中文" label needs a CJK face even on the English page. */
.lang-toggle [lang="zh-Hans"] {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif CJK SC",
    "Source Han Serif SC", "Songti SC", "Noto Sans CJK SC", "PingFang SC",
    "Microsoft YaHei", serif;
  font-weight: 400;
}

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
  padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
}

.hero-title {
  margin: 0;
  font-size: clamp(2.75rem, 7.4vw, 4.6rem);
}

.hero-title .dare {
  display: inline-block;
  color: var(--dp-color-accent);
  transform: rotate(-0.7deg);
}

.hero-underline {
  display: block;
  width: min(430px, 82%);
  height: auto;
  margin: -2px 0 18px;
  overflow: visible;
}

.hero-underline path {
  fill: none;
  stroke: var(--dp-color-accent);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.hero-underline .echo {
  stroke-width: 1.4;
  opacity: 0.3;
}

.lead {
  max-width: 47ch;
  margin: 0 0 30px;
  color: var(--dp-color-ink-muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 12px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-ink);
  border-radius: var(--radius-control);
  box-shadow: 4px 3px 0 rgba(56, 53, 47, 0.72);
  color: var(--dp-color-ink);
  font-family: var(--font-marker);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transform: rotate(-0.5deg);
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.button svg {
  width: 30px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button:hover {
  transform: translate(-1px, -1px) rotate(0.4deg);
  box-shadow: 2px 2px 0 rgba(56, 53, 47, 0.72);
}

.button:active {
  transform: translate(2px, 2px) rotate(0deg);
  box-shadow: 0 0 0 rgba(56, 53, 47, 0.72);
}

.text-link {
  color: var(--dp-color-ink);
  font-size: 1rem;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--dp-color-annotation);
  text-underline-offset: 6px;
  transition: color 100ms ease;
}

.text-link:hover {
  color: var(--dp-color-accent);
}

.hero-cluster {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
}

.mount {
  position: relative;
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 22px 12px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-line);
  border-radius: var(--radius-scrap);
  box-shadow: var(--shadow-soft);
  transform: rotate(-1.1deg);
}

.mount-drawing {
  display: block;
  width: 100%;
  height: auto;
  color: var(--dp-color-ink);
}

.mount figcaption {
  margin-top: 4px;
  color: var(--dp-color-ink-muted);
  font-family: var(--font-marker);
  font-size: 1.25rem;
  line-height: 1.2;
  text-align: right;
  transform: rotate(0.5deg);
}

.tape {
  position: absolute;
  z-index: 3;
  width: 96px;
  height: 28px;
  background: rgba(240, 226, 180, 0.62);
  border-left: 1px dashed rgba(56, 53, 47, 0.12);
  border-right: 1px dashed rgba(56, 53, 47, 0.12);
  clip-path: polygon(3% 8%, 97% 0%, 100% 88%, 6% 100%, 0% 52%);
  transform: rotate(-4deg);
}

.tape-top {
  top: -15px;
  left: 50%;
  margin-left: -48px;
}

.note {
  position: relative;
  margin: 0;
  font-family: var(--font-marker);
  line-height: 1.28;
}

.note-blue {
  grid-column: 1 / 2;
  justify-self: start;
  align-self: start;
  padding: 14px 18px;
  background: var(--dp-color-scrap);
  border: 1.5px solid rgba(52, 76, 105, 0.4);
  border-radius: var(--radius-control);
  box-shadow: 2px 2px 0 rgba(52, 76, 105, 0.13);
  color: var(--dp-color-annotation);
  font-size: 1.28rem;
  transform: rotate(-1.4deg);
}

.note-yellow {
  grid-column: 2 / 3;
  justify-self: end;
  align-self: start;
  margin-top: 4px;
  padding: 12px 17px 14px;
  background: var(--highlight-pale);
  border-radius: var(--radius-scrap);
  box-shadow: 2px 2px 0 rgba(56, 53, 47, 0.09);
  color: var(--dp-color-ink);
  font-size: 1.3rem;
  transform: rotate(1.5deg);
}

.note-red {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  color: var(--dp-color-accent);
  font-size: 1.28rem;
  text-decoration: none;
  transform: rotate(-1deg);
}

.note-red:hover {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.note-red svg {
  width: 46px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------
   Facts under the bracket
------------------------------------------------------------------ */

.facts {
  margin: clamp(28px, 4vw, 44px) 0 0;
}

.bracket {
  display: block;
  width: 100%;
  height: 18px;
  overflow: visible;
}

.bracket path {
  fill: none;
  stroke: var(--dp-color-line);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
  margin: 10px 0 0;
  padding: 0;
}

.facts dl > div {
  min-width: 0;
}

.facts dt {
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.1rem;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.facts dd {
  margin: 3px 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* ------------------------------------------------------------------
   Things I make
------------------------------------------------------------------ */

.making {
  padding: clamp(64px, 9vw, 110px) 0 0;
}

.feature-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(34px, 4.5vw, 48px);
  margin-top: clamp(44px, 5vw, 60px);
}

.feature-icon {
  width: 58px;
  height: 58px;
  color: var(--dp-color-ink);
  transform: rotate(-2deg);
  overflow: visible;
}

.feature h3 {
  margin: 12px 0 8px;
  font-family: var(--font-marker);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
}

.feature p {
  max-width: 36ch;
  margin: 0;
  color: var(--dp-color-ink-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.reserved {
  position: relative;
  max-width: 380px;
  margin: clamp(56px, 7vw, 78px) 0 0 auto;
  padding: 20px 26px 22px;
  background: var(--highlight-pale);
  border-radius: var(--radius-scrap);
  box-shadow: var(--shadow-pencil);
  font-family: var(--font-marker);
  font-size: 1.3rem;
  line-height: 1.3;
  transform: rotate(0.8deg);
}

.reserved-label {
  display: block;
  margin-bottom: 4px;
  color: var(--dp-color-accent);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tape-small {
  top: -14px;
  right: 26px;
  width: 62px;
  height: 22px;
  transform: rotate(5deg);
}

/* ------------------------------------------------------------------
   404 — a blank page
------------------------------------------------------------------ */

.not-found {
  padding: clamp(72px, 11vw, 140px) 0 clamp(40px, 6vw, 70px);
}

.not-found h1 {
  margin: 0 0 0.3em;
  font-size: clamp(3rem, 8vw, 6rem);
}

.not-found .lead {
  max-width: 44ch;
}

.not-found p:last-child {
  margin-top: 30px;
}

/* ------------------------------------------------------------------
   Process strip
------------------------------------------------------------------ */

.process-wrap {
  padding: clamp(64px, 9vw, 110px) 0 0;
}

.process {
  padding: clamp(30px, 4.2vw, 52px);
  background: var(--paper-2);
  border: 1.5px solid var(--dp-color-line);
  border-radius: 18px 8px 24px 10px / 10px 22px 8px 18px;
  box-shadow: var(--shadow-soft);
  transform: rotate(-0.25deg);
}

.process-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
}

.process-head h2 {
  margin: 0;
  font-size: clamp(2.1rem, 3.7vw, 3.1rem);
}

.aside-hand {
  margin: 0;
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.2rem;
  transform: rotate(-1deg);
}

.process-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
  margin: clamp(28px, 4vw, 42px) 0 0;
  padding: 0;
  list-style: none;
}

.process-list li {
  position: relative;
  min-width: 0;
}

.step-no {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border: 1.5px solid var(--dp-color-ink);
  border-radius: 52% 46% 55% 47% / 47% 54% 45% 52%;
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  transform: rotate(-2deg);
  background: var(--dp-color-scrap);
}

.process-list h3 {
  margin: 0 0 6px;
  font-family: var(--font-marker);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.1;
}

.process-list p {
  max-width: 28ch;
  margin: 0;
  color: var(--dp-color-ink-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* ------------------------------------------------------------------
   Field notes
------------------------------------------------------------------ */

.notes {
  padding: clamp(64px, 9vw, 110px) 0 0;
}

.notes-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(36px, 5vw, 56px);
  margin-top: clamp(32px, 4vw, 44px);
}

.thought p {
  max-width: 58ch;
  margin: 0 0 1.35em;
  font-size: var(--reading);
  line-height: 1.72;
}

.thought p:first-child::first-letter {
  float: left;
  padding: 7px 10px 0 0;
  color: var(--dp-color-accent);
  font-family: var(--font-marker);
  font-size: 3.1em;
  font-weight: 600;
  line-height: 0.72;
}

.thought p:last-child {
  margin-bottom: 0;
}

mark {
  padding: 0 0.14em;
  background: var(--dp-color-highlight);
  color: inherit;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.margin-notes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 34px;
}

.margin-notes .note-blue {
  max-width: 250px;
  font-size: 1.22rem;
  transform: rotate(-1deg);
}

.quote-note {
  position: relative;
  width: min(100%, 300px);
  margin: 0;
  padding: 24px 24px 20px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-ink);
  border-radius: 16px 6px 18px 8px / 8px 18px 6px 16px;
  box-shadow: var(--shadow-pencil);
  transform: rotate(0.9deg);
}

.quote-note::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 26px;
  width: 16px;
  height: 16px;
  background: var(--dp-color-scrap);
  border-right: 1.5px solid var(--dp-color-ink);
  border-bottom: 1.5px solid var(--dp-color-ink);
  transform: rotate(45deg);
}

.quote-note blockquote {
  margin: 0;
  font-family: var(--font-marker);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.15;
}

.quote-note figcaption {
  margin-top: 10px;
  color: var(--dp-color-ink-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------------
   Colophon
------------------------------------------------------------------ */

.colophon {
  margin-top: clamp(64px, 9vw, 110px);
  padding-top: clamp(44px, 6vw, 64px);
  border-top: 1.5px solid var(--dp-color-line);
}

.colophon h2 {
  margin: 0;
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
}

.disclosure {
  max-width: 730px;
  margin-top: clamp(26px, 3vw, 34px);
}

.disclosure summary {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-marker);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1.5px solid var(--dp-color-ink);
  border-radius: 48% 52% 45% 55% / 52% 48% 54% 46%;
  background: var(--dp-color-scrap);
  font-family: var(--font-hand);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 100ms ease;
}

.disclosure[open] summary::before {
  transform: rotate(45deg);
}

.disclosure-body {
  margin-top: 18px;
  padding: 20px 24px 22px;
  background: var(--dp-color-scrap);
  border: 1.5px solid var(--dp-color-line);
  border-radius: var(--radius-scrap);
  box-shadow: var(--shadow-soft);
}

.disclosure-body p {
  margin: 0;
  color: var(--dp-color-ink-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.disclosure-body p + p {
  margin-top: 0.85em;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */

.sheet-footer {
  margin-top: clamp(72px, 9vw, 112px);
  padding: clamp(52px, 7vw, 84px) 0 36px;
  border-top: 1.5px solid var(--dp-color-line);
}

.footer-cry {
  margin: 0 0 clamp(44px, 6vw, 64px);
  color: var(--dp-color-accent);
  font-size: clamp(2.55rem, 6.6vw, 5.1rem);
  font-weight: 600;
  line-height: 0.98;
}

.footer-cry span {
  display: inline-block;
  transform: rotate(-0.5deg);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 40px;
  max-width: 860px;
}

.footer-label {
  margin: 0 0 12px;
  color: var(--dp-color-annotation);
  font-family: var(--font-marker);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin: 7px 0;
}

.footer-links a {
  font-size: 0.95rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--dp-color-accent);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.footer-grid p {
  max-width: 42ch;
  margin: 0;
  color: var(--dp-color-ink-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.footer-domain {
  color: var(--dp-color-ink);
  font-family: var(--font-marker);
  font-size: 1.15rem;
}

/* ------------------------------------------------------------------
   中文排版
   The Latin handwritten faces stay for letters and numerals; CJK text
   falls through to a calligraphic/system serif stack. No webfont
   download, so Chinese stays light on a phone.
------------------------------------------------------------------ */

html[data-lang="zh"] {
  --font-marker: "Sketch Working Marker", "Caveat", "Kaiti SC", "STKaiti",
    "KaiTi", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC",
    "SimSun", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", serif;
  --font-hand: "Sketch Working Hand", "Patrick Hand", "Kaiti SC", "STKaiti",
    "KaiTi", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC",
    "SimSun", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", serif;
}

html[data-lang="zh"] body {
  line-height: 1.75;
  letter-spacing: 0.01em;
}

html[data-lang="zh"] .display {
  line-height: 1.18;
  letter-spacing: 0.02em;
}

html[data-lang="zh"] .kicker {
  line-height: 1.45;
  letter-spacing: 0.04em;
}

html[data-lang="zh"] .sheet-nav a {
  font-size: 1.05rem;
}

html[data-lang="zh"] .hero-title {
  font-size: clamp(2.05rem, 9.2vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: 0.03em;
}

html[data-lang="zh"] .lead {
  font-size: 1.3rem;
  line-height: 1.85;
}

html[data-lang="zh"] .section-head h2 {
  font-size: clamp(2.1rem, 4.3vw, 3.5rem);
  line-height: 1.25;
}

html[data-lang="zh"] .section-lede {
  font-size: 1.25rem;
  line-height: 1.8;
}

html[data-lang="zh"] .feature p {
  font-size: 1.2rem;
  line-height: 1.75;
}

html[data-lang="zh"] .facts dd {
  font-size: 1.1rem;
  line-height: 1.6;
}

html[data-lang="zh"] .note {
  line-height: 1.6;
  letter-spacing: 0.02em;
}

html[data-lang="zh"] .button {
  gap: 8px;
  padding: 9px 16px 11px;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

html[data-lang="zh"] .text-link {
  font-size: 1.15rem;
}

html[data-lang="zh"] .reserved {
  line-height: 1.7;
}

html[data-lang="zh"] .reserved-label {
  font-size: 1rem;
  letter-spacing: 0.12em;
}

html[data-lang="zh"] .process-head h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.3;
}

html[data-lang="zh"] .aside-hand {
  line-height: 1.5;
}

html[data-lang="zh"] .process-list p {
  font-size: 1.15rem;
  line-height: 1.7;
}

html[data-lang="zh"] .thought p {
  line-height: 1.9;
}

html[data-lang="zh"] .thought p:first-child::first-letter {
  float: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

html[data-lang="zh"] .margin-notes .note-blue {
  line-height: 1.6;
}

html[data-lang="zh"] .quote-note {
  width: min(100%, 320px);
}

html[data-lang="zh"] .quote-note blockquote {
  font-size: 1.4rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

html[data-lang="zh"] .quote-note figcaption {
  font-size: 1rem;
  line-height: 1.5;
}

html[data-lang="zh"] .colophon h2 {
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.3;
}

html[data-lang="zh"] .disclosure summary {
  font-size: 1.4rem;
  line-height: 1.5;
}

html[data-lang="zh"] .disclosure-body p {
  font-size: 1.15rem;
  line-height: 1.8;
}

html[data-lang="zh"] .footer-cry {
  font-size: clamp(2.05rem, 7vw, 4.4rem);
  line-height: 1.22;
  letter-spacing: 0.02em;
}

html[data-lang="zh"] .footer-links a {
  font-size: 1.1rem;
}

html[data-lang="zh"] .footer-grid p {
  font-size: 1.05rem;
  line-height: 1.7;
}

html[data-lang="zh"] .not-found h1 {
  font-size: clamp(2rem, 6.5vw, 4.5rem);
  line-height: 1.22;
}

/* ------------------------------------------------------------------
   Wider layouts
------------------------------------------------------------------ */

@media (min-width: 680px) {
  .facts dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 44px 36px;
  }

  .process-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 30px;
  }

  .notes-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.6fr);
    align-items: start;
  }
}

@media (min-width: 1050px) {
  .hero {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(48px, 5.5vw, 72px);
    padding-bottom: clamp(36px, 4vw, 52px);
  }

  .hero-cluster {
    display: block;
    max-width: none;
    margin: 0;
    padding: 12px 0 40px;
  }

  .mount {
    width: 87%;
    margin: 0 5% 0 auto;
    transform: rotate(-1.6deg);
  }

  .hero-cluster .note-blue {
    position: absolute;
    left: -14px;
    top: 58%;
    z-index: 2;
    width: 190px;
    transform: rotate(-1.8deg);
  }

  .hero-cluster .note-yellow {
    position: absolute;
    top: 8px;
    right: -6px;
    z-index: 2;
    width: 192px;
    margin: 0;
    transform: rotate(2deg);
  }

  .hero-cluster .note-red {
    position: absolute;
    right: 12px;
    bottom: 4px;
    z-index: 2;
    transform: rotate(-1.2deg);
  }

  .feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 48px);
  }

  .feature:nth-child(2) {
    transform: translateY(26px);
  }

  .feature:nth-child(3) {
    transform: translateY(8px);
  }

  .process-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
  }

  .process-list li:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 2px;
    right: -23px;
    color: var(--dp-color-accent);
    font-family: var(--font-marker);
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.85;
  }

  html[data-lang="zh"] .hero-cluster .note-blue,
  html[data-lang="zh"] .hero-cluster .note-yellow {
    width: 214px;
    font-size: 1.2rem;
  }
}

/* The 1050–1199 split is narrow enough that the pinned blue note would
   otherwise sit over the longer Chinese illustration caption. */
@media (min-width: 1050px) and (max-width: 1199px) {
  html[data-lang="zh"] .hero-cluster .note-blue {
    top: 42%;
  }
}

@media (max-width: 899px) {
  .sheet-no {
    display: none;
  }
}

@media (max-width: 679px) {
  body {
    font-size: 22px;
  }

  .sheet-header {
    gap: 14px;
    padding-top: 22px;
  }

  .wordmark {
    font-size: 1.95rem;
  }

  .sheet-nav {
    gap: 12px;
  }

  .sheet-nav a {
    font-size: 0.92rem;
  }

  .header-tools {
    gap: 10px;
  }

  .hero-cluster {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .hero-cluster .note-blue,
  .hero-cluster .note-yellow,
  .hero-cluster .note-red {
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
  }

  .hero-cluster .note-yellow {
    justify-self: end;
    margin-top: 0;
  }

  .hero-cluster .note-red {
    display: none;
  }

  .mount {
    transform: rotate(-0.5deg);
  }

  .feature-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .reserved {
    margin-left: 0;
    transform: rotate(0.4deg);
  }

  .process {
    transform: rotate(0deg);
  }

  .thought p:first-child::first-letter {
    font-size: 2.8em;
  }

  .footer-grid {
    gap: 26px 24px;
  }

  .footer-label {
    font-size: 1.15rem;
  }
}

@media (max-width: 380px) {
  .sheet-header {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .wordmark {
    flex-basis: 100%;
    font-size: 1.75rem;
  }

  .sheet-nav {
    gap: 12px;
  }

  .sheet-nav a {
    font-size: 0.88rem;
  }

  .header-tools {
    margin-left: auto;
  }

  html[data-lang="zh"] .facts dl > div:last-child {
    grid-column: 1 / -1;
  }

  .hero-title {
    font-size: 2.55rem;
  }
}

/* ------------------------------------------------------------------
   Motion preferences & print
------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .button:hover,
  .button:active {
    transform: none;
    box-shadow: 4px 3px 0 rgba(56, 53, 47, 0.72);
  }

  .lang-toggle:hover,
  .lang-toggle:active {
    transform: none;
    box-shadow: 2px 2px 0 rgba(56, 53, 47, 0.55);
  }
}

@media print {
  #dust,
  body::after {
    display: none;
  }

  body {
    background: #fff;
  }

  .sheet-header {
    border-bottom-color: #999;
  }
}
