/* Blog concept D: A's route + B's pencil, built to scale.
   Index: a short "Start here" route (4 guides as stops, drawn once with the hedgehog walking it), then "All guides",
   a filterable grid of bounded cards. Article: B's marked-up article with A's reading route in the left margin.
   Tokens, header and footer from the portfolio page (paper, ink, one orange). */
@font-face { font-family: "DM Sans"; src: url("../assets/fonts/DMSans.ttf") format("truetype"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../assets/fonts/CormorantGaramond.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/Caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --field: #eef0f3;
  --hi: #fbfcfd;
  --paper: #f0eadf;  /* the sample pages' own paper (sampled), also used to cover the Chinese label */
  --text: #424a58;
  --hand: #914430;   /* dark pencil brown for text in the orange family (7.0:1 on the field) */
  --ink: #172031;
  --muted: #4c5666;
  --route: #d2582f;  /* the pencil and the route: strokes, dots and large labels only (3.7:1) */
  --gap: #8f97a6;    /* the no-signal gap, as in the app */
  --line: color-mix(in oklab, var(--ink) 15%, transparent);
  --warn: color-mix(in oklab, var(--route) 62%, var(--ink));
  --page-shadow: drop-shadow(0 14px 18px rgba(23, 32, 49, .16)) drop-shadow(0 2px 3px rgba(23, 32, 49, .10));
  --card-shadow: 0 1px 0 var(--line), 0 12px 26px -18px rgba(23, 32, 49, .55);
  --card-shadow-up: 0 1px 0 var(--line), 0 18px 32px -16px rgba(23, 32, 49, .55);
  --draw: cubic-bezier(.55, .1, .35, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --gutter: clamp(16px, 3.4vw, 48px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--field); color: var(--text); overflow-x: clip; font: 400 18px/1.55 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--route); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: min(100% - 2 * var(--gutter), 1344px); margin-inline: auto; }
.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 60; background: var(--ink); color: var(--field); padding: 12px 16px; border-radius: 4px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }

/* Header (home and portfolio pages) */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; padding-block: 10px; }
.wordmark { font: 700 32px/1 "Caveat", cursive; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; border-radius: 4px; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--route); border-radius: 0; }
@media (hover: hover) and (pointer: fine) { .nav a:not([aria-current]):hover { background: var(--line); } }

/* Shared bits */
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border: 1px solid color-mix(in oklab, var(--ink) 30%, transparent); border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); line-height: 1.3; }
.tag-warn { color: var(--warn); border-color: currentColor; border-style: dashed; }
.cat { color: var(--hand); font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; font-weight: 500; letter-spacing: .02em; color: var(--muted); }
.meta .cat { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.dur { font-variant-numeric: tabular-nums; }
.soon-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1.5px dashed var(--gap); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: none; }
.kicker { font: 600 12px/1.4 "DM Sans", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--hand); margin-bottom: 10px; }
.smp { position: absolute; right: 6px; bottom: 6px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: color-mix(in oklab, var(--hi) 90%, transparent); padding: 2px 6px; border-radius: 3px; line-height: 1.3; }

/* ================================================================ The pencil (shared)
   Figures are SVG in the page's own 1120x1400 units, so a crop is a viewBox and marks never drift.
   Strokes draw with stroke-dashoffset (pathLength=1); notes write on line by line with clip-path. Both once, on .on. */
.ann { position: relative; container-type: inline-size; }
.ann > svg { width: 100%; height: auto; overflow: hidden; }
.pg { filter: var(--page-shadow); }
.mk { fill: none; stroke: var(--route); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.ln { display: block; padding-block: .06em; }

.js:not(.state-done) [data-draw] .mk:not(.static) { stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; }
.js:not(.state-done) [data-draw] .ln { clip-path: inset(-25% 100% -25% -4%); }
.js:not(.state-done) [data-draw].on .mk { stroke-dashoffset: 0; opacity: 1;
  transition: stroke-dashoffset var(--t, .7s) var(--draw) var(--d, 0s), opacity 0s linear var(--d, 0s); }
.js:not(.state-done) [data-draw].on .ln { clip-path: inset(-25% -4% -25% -4%); transition: clip-path .6s cubic-bezier(.45, .05, .4, 1) var(--d, 0s); }

/* ================================================================ Cards (one post = one bounded, clickable card) */
.card { position: relative; background: var(--hi); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--card-shadow);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.stretch { text-decoration: none; color: inherit; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: 8px; }
.stretch:focus-visible { outline: none; }
.card:has(.stretch:focus-visible) { outline: 3px solid var(--route); outline-offset: 3px; }
.card-title { font: 600 24px/1.1 "Cormorant Garamond", serif; color: var(--ink); text-wrap: balance; letter-spacing: -.003em; }
.card-title .stretch { background: linear-gradient(var(--route), var(--route)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--draw); }
@media (hover: hover) and (pointer: fine) {
  .card:has(.stretch):hover { transform: translateY(-3px); box-shadow: var(--card-shadow-up); }
  .card:has(.stretch):hover .card-title .stretch { background-size: 100% 2px; }
}
.thumb { position: relative; overflow: hidden; border-radius: 4px; background: var(--paper); aspect-ratio: 4 / 3; }
.thumb > svg { width: 100%; height: 100%; }
.thumb-desk { background: #e4e0d8; }
.thumb .fan { filter: drop-shadow(0 10px 12px rgba(23, 32, 49, .22)); }
.card-lg .thumb .mk { stroke-width: var(--sl); }
.card-row .thumb .mk { stroke-width: var(--sr); }
.sum { font-size: 15px; line-height: 1.45; color: var(--text); }

/* Coming soon: dashed, no fill, no shadow, no link, no read time */
.card-soon { background: transparent; border: 1.5px dashed color-mix(in oklab, var(--ink) 32%, transparent); box-shadow: none; }
.card-soon .thumb { opacity: .75; }
.card-soon .card-title { color: color-mix(in oklab, var(--ink) 66%, var(--field)); }
.card-soon .sum { color: var(--muted); }
.ghost { fill: none; stroke: color-mix(in oklab, var(--ink) 34%, transparent); stroke-width: 5; stroke-dasharray: 18 13; stroke-linejoin: round; }

/* ================================================================ Index: intro */
.intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px 56px; align-items: end; padding-block: clamp(20px, 2.6vw, 36px) clamp(24px, 2.6vw, 36px); }
h1 { font: 500 clamp(42px, 4.8vw, 70px)/.98 "Cormorant Garamond", serif; color: var(--ink); letter-spacing: -.01em; text-wrap: balance; }
.lede { font-size: 18px; line-height: 1.5; max-width: 34em; }
.ph-note { margin-top: 10px; }
.topics { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-top: 6px; font-size: 15px; }
.topics-h { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }
.topics a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--route) 70%, transparent); text-decoration-thickness: 2px; text-underline-offset: .28em; }
.topics a:first-of-type { margin-left: -8px; }
@media (hover: hover) and (pointer: fine) { .topics a:hover { text-decoration-color: var(--route); } }

/* ================================================================ Index: Start here (a bounded route) */
.start { padding-bottom: clamp(40px, 4vw, 64px); }
.start-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.start-head h2, .all-head h2 { font: 500 clamp(32px, 2.8vw, 40px)/1.05 "Cormorant Garamond", serif; color: var(--ink); }
.start-meta { font-size: 15px; font-weight: 600; color: var(--muted); }

.route { --lane: 0px; --line-y: 74px; position: relative; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, .9fr); column-gap: 24px; padding-top: 60px; }
.route-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; overflow: visible; pointer-events: none; }
.r-under { fill: none; stroke: color-mix(in oklab, var(--ink) 11%, transparent); stroke-width: 4; stroke-linecap: round; }
.r-walk { fill: none; stroke: var(--route); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.r-gap { fill: none; stroke: var(--gap); stroke-width: 3; stroke-dasharray: 7 7; stroke-linecap: round; }
.r-pin { fill: var(--ink); }
.rider { position: absolute; left: 0; top: 0; width: 44px; z-index: 3; pointer-events: none; will-change: transform; }

.stops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; counter-reset: none; }
.stop { position: relative; display: grid; grid-template-rows: auto 1fr; justify-items: center; }
.dot { position: relative; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--field); border: 3px solid var(--ink);
  font: 700 13px/1 "DM Sans", system-ui, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; transition: background-color .35s ease, color .35s ease; }
.dot.on { background: var(--route); color: #fff; }
.stop::after { content: ""; position: absolute; left: 50%; top: 30px; height: 14px; border-left: 2px solid color-mix(in oklab, var(--ink) 18%, transparent); }
.card-lg { margin-top: 14px; width: 100%; padding: 10px 10px 16px; display: grid; gap: 12px; align-content: start; }
.card-lg .card-text { display: grid; gap: 6px; padding-inline: 6px; }
.card-lg .card-title { font-size: clamp(22px, 1.75vw, 26px); }

.route-end { position: relative; padding-top: 44px; }
.gap-note { font: 600 25px/1.05 "Caveat", cursive; color: var(--hand); transform: rotate(-2deg); transform-origin: 0 50%; margin-bottom: 14px; }
.soon-mini { display: grid; gap: 10px; }
.soon-mini li { display: grid; gap: 4px; justify-items: start; padding: 10px 12px 12px; border: 1.5px dashed color-mix(in oklab, var(--ink) 32%, transparent); border-radius: 8px; font-size: 12px; }
.soon-mini .cat { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.mini-t { font: 600 19px/1.1 "Cormorant Garamond", serif; color: color-mix(in oklab, var(--ink) 66%, var(--field)); }
/* the gap note writes on once the walk reaches the end (main.js adds .on to .route-end) */
.js:not(.state-done) .route-end .ln { clip-path: inset(-30% 100% -30% -6%); }
.js:not(.state-done) .route-end.on .ln { clip-path: inset(-30% -6% -30% -6%); transition: clip-path .8s cubic-bezier(.45, .05, .4, 1); }

/* ================================================================ Index: All guides */
.all { padding-bottom: clamp(64px, 7vw, 104px); scroll-margin-top: 16px; }
.all:focus { outline: none; }
.all-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; padding-top: 22px; border-top: 1px solid var(--line); }
.count { font-size: 15px; font-weight: 600; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
html:not(.js) .filters { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid color-mix(in oklab, var(--ink) 26%, transparent); background: var(--hi); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.chip .n { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--hi); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: color-mix(in oklab, var(--hi) 75%, var(--ink)); }
@media (hover: hover) and (pointer: fine) { .chip[aria-pressed="false"]:hover { border-color: var(--ink); } }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.card-row { height: 100%; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: start; padding: 12px 16px 14px 12px; }
.card-row .card-text { display: grid; gap: 6px; padding-top: 2px; }
.card-row .card-title { font-size: 23px; }

.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; margin-top: 28px; }
.shown { font-size: 15px; color: var(--muted); }
.more-btn { min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--hi); font-size: 16px; font-weight: 600; color: var(--ink); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .more-btn:hover { background: var(--ink); color: var(--hi); } }

/* ================================================================ Article: B's reading column + margin, A's rail */
.reader { display: grid; grid-template-columns: 200px minmax(0, auto); column-gap: 56px; justify-content: center; padding-block: clamp(20px, 3vw, 44px) clamp(64px, 8vw, 112px); }
.article { --measure: 612px; --mgap: 56px; --margin: 260px; --full: calc(var(--measure) + var(--mgap) + var(--margin));
  width: min(100%, var(--full)); font-size: 19px; line-height: 1.68; min-width: 0; }
.article > * { max-width: var(--measure); }
.article > .row, .article > .example, .article > .next { max-width: none; }
.a-head { padding-bottom: 24px; display: grid; gap: 14px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.crumbs a { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.a-head h1 { font-size: clamp(44px, 5vw, 72px); line-height: .98; }
.a-lead { font-size: 22px; line-height: 1.55; color: var(--ink); margin-bottom: 8px; }
.article h2 { font: 500 clamp(30px, 3vw, 40px)/1.1 "Cormorant Garamond", serif; color: var(--ink); margin: 1.6em 0 .5em; text-wrap: balance; scroll-margin-top: 24px; }
#article { scroll-margin-top: 16px; }
.article p + p, .article .row + p, .article p + .row { margin-top: 1em; }

.row { display: grid; grid-template-columns: var(--measure) var(--margin); column-gap: var(--mgap); align-items: start; }
.mnote { position: relative; padding-top: 2px; font: 600 26px/1.08 "Caveat", cursive; color: var(--hand); }
.mnote-tick { position: absolute; left: -50px; top: 6px; width: 40px; height: 20px; overflow: visible; }
.mnote-tick .mk { stroke-width: 2.4; }
.mnote-h { color: var(--route); font-size: 30px; margin-bottom: 4px; transform: rotate(-2deg); transform-origin: 0 50%; }
.mnote p + p { margin-top: 0; }
.mnote-t { transform: rotate(-1deg); transform-origin: 0 50%; }
.mnote .ln { white-space: nowrap; }

.example { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); column-gap: 44px; align-items: center; margin-block: 40px 48px; }
.worked figcaption { margin: 10px 0 0 11.5%; font-size: 14px; line-height: 1.45; color: var(--muted); }
.zone { transition: opacity .3s ease, stroke-width .3s ease; }
.worked[data-active] .zone { opacity: .22; }
.worked[data-active="1"] .zone[data-z="1"], .worked[data-active="2"] .zone[data-z="2"], .worked[data-active="3"] .zone[data-z="3"] { opacity: 1; stroke-width: 14; }
.pin { position: absolute; left: max(22px, var(--x)); top: var(--y); transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; font: 700 26px/1 "Caveat", cursive; color: var(--route); z-index: 1; }
.pin::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; border: 2.5px solid var(--route); background: var(--field); z-index: -1; transition: background-color .25s ease; }
.pin.is-active { color: #fff; }
.pin.is-active::before { background: var(--route); }
.js:not(.state-done) .worked .pin { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
.js:not(.state-done) .worked.on .pin { opacity: 1; transform: translate(-50%, -50%); transition: opacity .35s ease var(--d), transform .45s var(--ease-out) var(--d); }

.steps { display: grid; gap: 6px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 14px 16px 16px 10px; border-radius: 8px; transition: background-color .25s ease; cursor: default; }
.steps li.is-active { background: color-mix(in oklab, var(--route) 9%, var(--hi)); }
.steps .n { width: 36px; height: 36px; margin: 2px 4px; border-radius: 50%; border: 2.5px solid var(--route); display: grid; place-items: center; font: 700 24px/1 "Caveat", cursive; color: var(--route); transition: background-color .25s ease, color .25s ease; }
.steps li.is-active .n { background: var(--route); color: #fff; }
.steps h3 { font: 600 19px/1.3 "DM Sans", system-ui, sans-serif; color: var(--ink); margin-bottom: 4px; }
.steps p { font-size: 17px; line-height: 1.55; }

.tip { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; margin-block: 2.2em 1em; padding: 20px 24px 22px 16px; background: var(--hi); border-radius: 10px; box-shadow: var(--card-shadow); }
.tip img { width: 120px; }
.tip-h { font: 700 28px/1 "Caveat", cursive; color: var(--hand); margin-bottom: 6px; }
.tip p:not(.tip-h) { font-size: 17px; line-height: 1.55; margin: 0; }

.next { margin-top: 64px; padding-top: 22px; border-top: 1px solid var(--line); max-width: var(--measure) !important; }
.next-k { font: 600 12px/1.4 "DM Sans", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.next-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; padding: 12px 18px 12px 12px; }
.next-thumb { display: block; overflow: hidden; border-radius: 4px; background: var(--paper); aspect-ratio: 4 / 3; }
.next-thumb svg { width: 100%; height: 100%; }
.next-thumb .mk { stroke-width: 12; }
.next-t { display: grid; gap: 8px; justify-items: start; }
.next-title { font: 600 clamp(26px, 2.4vw, 32px)/1.08 "Cormorant Garamond", serif; color: var(--ink); background: linear-gradient(var(--route), var(--route)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--draw); }
@media (hover: hover) and (pointer: fine) { .next-card:hover .next-title { background-size: 100% 2px; } }
.next-ph { font-size: 11px; letter-spacing: .04em; text-transform: none; border-radius: 6px; }
.next-all { margin-top: 18px; font-size: 16px; }
.next-all a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }

/* The rail (desktop): route in the left margin */
.rail { width: 200px; }
.rail-in { position: sticky; top: 32px; padding-top: 12px; }
.rail-h { font: 600 12px/1.4 "DM Sans", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rail-route { position: relative; margin-top: 18px; height: 300px; }
.rail-track, .rail-fill { position: absolute; left: 9px; top: 0; bottom: 0; width: 3px; border-radius: 2px; }
.rail-track { background: color-mix(in oklab, var(--ink) 13%, transparent); }
.rail-fill { background: var(--route); transform-origin: 50% 0; transform: scaleY(0); will-change: transform; }
.rail-stops { position: absolute; inset: 0; }
.rail-stops li { position: absolute; left: 0; right: 0; top: calc(var(--y, 0) * 1px); translate: 0 -50%; }
.rail-stops li:nth-child(1) { --y: 0; } .rail-stops li:nth-child(2) { --y: 80; } .rail-stops li:nth-child(3) { --y: 160; } .rail-stops li:nth-child(4) { --y: 240; }
.rail-stops a { display: flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.25; transition: color .25s ease; }
.rd { flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--field); border: 3px solid var(--ink); transition: background-color .3s ease, scale .3s var(--ease-out); }
.rail-stops a.on .rd { background: var(--route); }
.rail-stops a.cur { color: var(--ink); font-weight: 600; }
.rail-stops a.cur .rd { scale: 1.15; }
@media (hover: hover) and (pointer: fine) { .rail-stops a:hover { color: var(--ink); } .rail-stops a:hover .rl { text-decoration: underline; } }
.rail-end { position: absolute; left: 5px; bottom: -6px; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
.rail-left { margin-top: 26px; font-size: 14px; color: var(--muted); }
.rl-n { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.strip { display: none; }

/* Footer */
.foot { background: var(--hi); border-top: 1px solid var(--line); padding: 20px var(--gutter) 28px; }
.foot .wrap { width: min(100%, 1344px); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.foot .wordmark { font-size: 26px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
.foot-links a { color: var(--ink); }
.copy { margin-left: auto; font-size: 14px; color: var(--muted); }

/* ================================================================ Narrower screens */
@media (max-width: 1279px) {
  .reader { grid-template-columns: 176px minmax(0, auto); column-gap: 40px; }
  .rail { width: 176px; }
  .article { --mgap: 44px; --margin: 220px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Below 1200 the rail would crowd the reading column: the route becomes a strip at the top */
@media (max-width: 1199px) {
  .reader { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .article { margin-inline: auto; }
  .strip { display: block; position: fixed; left: 0; right: 0; top: 0; z-index: 40; pointer-events: none; }
  .strip-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 36px; padding: 0 var(--gutter); background: color-mix(in oklab, var(--field) 94%, transparent); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink); opacity: 0; translate: 0 -100%; transition: opacity .3s ease, translate .35s var(--ease-out); }
  .strip.show .strip-bar { opacity: 1; translate: 0 0; }
  .strip-label { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .strip-left { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .strip-track { position: absolute; left: 0; right: 0; top: 0; height: 3px; }
  .strip-fill { position: absolute; inset: 0; background: var(--route); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
  .article h2 { scroll-margin-top: 56px; }
}
/* Start here turns vertical: one lane on the left, a card per stop */
/* Below 1024 Start here becomes one compact horizontal strip: route, dots and cards scroll sideways together
   (native overflow + scroll-snap, no JS scrolling); the dashed gap and the Coming soon boxes close the strip. */
@media (max-width: 1023px) {
  .intro { grid-template-columns: 1fr; }
  .start { padding-bottom: 28px; }
  .start-head { flex-wrap: nowrap; padding-top: 16px; gap: 4px 12px; }
  .start-head h2 { font-size: 30px; white-space: nowrap; }
  .start-meta { font-size: 14px; white-space: nowrap; }
  .sm-order { display: none; }
  .strip-pos { display: inline-flex; margin-left: auto; align-self: center; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .route { --cw: min(calc((100vw - 2 * var(--gutter)) * .74), 300px);
    display: flex; align-items: stretch; gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding: 36px var(--gutter) 10px;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: thin; }
  .stops { display: flex; gap: 12px; flex: none; }
  .stop { flex: 0 0 var(--cw); scroll-snap-align: start; grid-template-rows: auto 1fr; }
  .stop::after { top: 24px; height: 8px; }
  .dot { width: 24px; height: 24px; border-width: 2.5px; font-size: 12px; }
  .card-lg { margin-top: 8px; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 12px 10px 8px; }
  .card-lg .card-text { padding: 2px 0 0; gap: 4px; }
  .card-lg .card-title { font-size: 19px; line-height: 1.1; }
  .card-lg .meta { font-size: 12px; gap: 2px 10px; }
  .card-lg .meta .cat { font-size: 11px; }
  .card-lg .thumb .mk { stroke-width: var(--sr); }
  .card-lg .smp { display: none; }
  .route-end { flex: none; position: relative; padding: 32px 0 0; scroll-snap-align: end; }
  .gap-note { position: absolute; left: 40px; top: -30px; font-size: 21px; margin: 0; white-space: nowrap; }
  .soon-mini { display: flex; gap: 10px; }
  .soon-mini li { width: 168px; padding: 8px 10px 10px; gap: 3px; align-content: start; }
  .soon-mini .soon-tag { min-height: 20px; font-size: 11px; padding: 0 7px; }
  .mini-t { font-size: 17px; }
  .rider { width: 26px; }
}
@media (min-width: 1024px) { .strip-pos { display: none; } }
@media (max-width: 900px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  .mnote { margin: 14px 0 4px; padding: 2px 0 2px 20px; }
  .mnote::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--route); }
  .mnote-tick { display: none; }
  .example { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .worked { max-width: 440px; }
  .article > * { max-width: 640px; }
  .article > .row { max-width: 640px; }
}
/* Phones: the step text ends where the paragraphs end. */
@media (max-width: 640px) {
  .steps li { margin-right: -8px; padding-right: 8px; }   /* the active background reaches 8 px past the text column */
}
/* Phones: the sample page is centred in the column. The figure keeps room for the pins on both sides (40 px each) instead of
   only on the left, so the svg (viewBox -150 -30 1300 1460: the page is 1120 wide, 150 units of room on its left, 30 on its right)
   is sized and offset so the page itself spans the column minus 40 px on each side. */
@media (max-width: 480px) {
  .worked > svg { width: calc((100cqw - 80px) * 1300 / 1120); margin-left: calc(40px - (100cqw - 80px) * 150 / 1120); }
  .worked .pin { left: 22px; }
  .worked figcaption { margin-left: 40px; margin-right: 40px; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 600px) {
  .nav a { padding: 0 9px; }
  .lede { font-size: 17px; }
  .card-row { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 10px 12px 12px 10px; }
  .card-row .sum { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .card-row .card-title { font-size: 22px; }
  .topics-all { display: none !important; }
  .topics a { padding: 0 7px; }
  .chip { padding: 0 14px; font-size: 14px; }
  .article { font-size: 18px; line-height: 1.65; }
  .a-lead { font-size: 20px; }
  .tip { grid-template-columns: 1fr; padding: 18px; }
  .tip img { width: 96px; }
  .next-card { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; }
  .copy { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .zone, .pin::before, .steps li, .steps .n, .card-title .stretch, .next-title, .dot, .chip, .rail-fill, .rd, .rail-stops a, .strip-bar { transition: none !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Phone header, same on every page: the wordmark on its own row, the four links on the next, aligned to the text edge. */
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 0 12px; padding-block: 6px 0; }
  .nav { order: 3; width: 100%; margin-left: -12px; }
}

/* ---------- Chinese pages (html lang="zh-Hans", the /zh/ copies load this same file). System fonts only, nothing downloaded:
   the brand faces stay first, so Latin letters and digits keep them, and the CJK face that follows draws the Chinese.
   No faux italic, no tracking on label styles (it pulls Chinese apart), no negative tracking on headings (it makes
   Chinese glyphs touch), and a little more line height where Chinese runs as body text or wraps in headings. */
html:lang(zh) :is(body, .kicker, .dot, .steps h3, .next-k, .rail-h) { font-family: "DM Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
html:lang(zh) :is(.card-title, h1, .start-head h2, .all-head h2, .mini-t, .article h2, .next-title) { font-family: "Cormorant Garamond", "Songti SC", "Noto Serif SC", serif; }
html:lang(zh) :is(.wordmark, .gap-note, .mnote, .pin, .steps .n, .tip-h) { font-family: "Caveat", "Kaiti SC", "STKaiti", "KaiTi", cursive; }
html:lang(zh) :is(.tag, .meta .cat, .kicker, .smp, .topics-h, .soon-mini .cat, .next-k, .rail-h, .meta, .soon-tag, .next-ph, .card-title, h1) { letter-spacing: 0; }
html:lang(zh) :is(em, i, cite, dfn, var, address) { font-style: normal; }
html:lang(zh) body { line-height: 1.7; }
html:lang(zh) .article { line-height: 1.85; }
html:lang(zh) h1 { line-height: 1.15; }
html:lang(zh) .card-title { line-height: 1.25; }
/* Short Chinese footer labels (支持) still get a 44 px wide target. */
html:lang(zh) .foot-links a { min-width: 44px; justify-content: center; }
/* The Start here strip head: the Chinese meta line may wrap at phone widths (it is one unbreakable line in English). */
@media (max-width: 1023px) { html:lang(zh) .start-meta { white-space: normal; min-width: 0; } }
