/* Antiphon v2 · 对经 — reset & reading typography */

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

html {
  font-size: var(--text-base);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--wall);
  color: var(--on-wall);
  font-family: var(--font-serif);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

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

a:hover {
  color: var(--seal);
}

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

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

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100%;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  letter-spacing: 0.16em;
}

.skip:focus {
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— reading surface ———
   One measure, one rhythm. Headings open with a hairline so the page
   reads like a filed document rather than a magazine. */

.prose {
  font-family: var(--font-serif);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--ink);
  overflow-wrap: break-word;
  letter-spacing: 0;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-synthesis: weight style small-caps;
  /* Chrome ships `text-autospace` with an initial value of `no-autospace` (kept
     for web compatibility), so this declaration is what actually switches on the
     ~¼em of air at a Chinese/Latin or Chinese/numeral boundary. Without it
     「中文English」 collides; with it, a real space already in the source is not
     doubled (the engine only adds space where there is none). Latin-only prose
     is untouched because the property never fires away from a CJK edge.
     `text-spacing-trim: normal` trims full-width punctuation to its ink at the
     line edge — same reason it is stated rather than inherited. */
  text-autospace: normal;
  text-spacing-trim: normal;
}

/* ——— per-language prose deltas ———
   `:lang()` mirrors the data-script hooks so a blog whose 网站语言 is not one of
   the three known values still gets sane typography from the document language. */

body[data-script="latin"] .prose,
body:not([data-script]):lang(en) .prose {
  text-wrap: pretty;
}

body[data-script="latin"] .prose p,
body:not([data-script]):lang(en) .prose p {
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
  word-break: normal;
}

body[data-script="cjk"] .prose p,
body:not([data-script]):lang(zh) .prose p {
  text-wrap: wrap;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  /* Chinese forbids a handful of closing marks at line start; `normal` already
     applies those. `strict` adds the Japanese small-kana and ー rules, which are
     meaningless in Chinese and can push a lone ー onto the previous line. */
  line-break: normal;
  /* Safari-only progressive enhancement (Chrome parses but ignores it): lets a
     closing 」 or 。 hang into the margin instead of dragging a whole character
     down. It is inert everywhere else, so it costs nothing to declare. */
  hanging-punctuation: allow-end;
}

body[data-script="ja"] .prose p,
body:not([data-script]):lang(ja) .prose p {
  text-wrap: wrap;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
  /* Japanese also keeps small kana (っゃゅょ) and the long-vowel mark ー off the
     line start, and treats 々 like a kanji for break purposes. */
  line-break: strict;
  hanging-punctuation: allow-end;
}

/* English: headings set optically tighter than CJK, quotes on the Latin rhythm */

body[data-script="latin"] .prose h2,
body:not([data-script]):lang(en) .prose h2 {
  line-height: 1.2;
}

body[data-script="latin"] .prose h3,
body:not([data-script]):lang(en) .prose h3 {
  line-height: 1.25;
}

body[data-script="latin"] .prose blockquote,
body:not([data-script]):lang(en) .prose blockquote {
  line-height: 1.62;
  font-size: 1.06rem;
}

body[data-script="latin"] .prose li,
body:not([data-script]):lang(en) .prose li {
  margin: 0.32em 0;
}

/* Japanese display type: proportional kana metrics (`palt`) stop the kanji grid
   from opening holes in large headings. Body copy keeps the full-width grid. */

body[data-script="ja"] .prose h1,
body[data-script="ja"] .prose h2,
body[data-script="ja"] .prose h3,
body[data-script="ja"] .prose h4,
body:not([data-script]):lang(ja) .prose h1,
body:not([data-script]):lang(ja) .prose h2,
body:not([data-script]):lang(ja) .prose h3,
body:not([data-script]):lang(ja) .prose h4 {
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "palt" 1, "vpal" 1;
}

.prose > * + * {
  margin-top: var(--para-gap, 1.3em);
}

.prose p {
  margin: 0;
  text-align: start;
}

/* Paragraph air is a per-language token (--para-gap): 1.3em for Chinese, 1.35em
   for Japanese, 1.15em for English. `* + p` catches paragraphs that follow a
   heading or a figure, not just the previous paragraph. */

.prose > * + p {
  margin-top: var(--para-gap, 1.3em);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.28;
  margin: 0;
  text-align: start;
}

.prose h2 {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.7rem;
  font-size: var(--text-h2);
  letter-spacing: var(--script-h2-tracking, -0.008em);
  margin-top: 3.1em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}

.prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h3 {
  font-size: var(--text-h3);
  color: var(--ink);
  margin-top: 2.3em;
  letter-spacing: 0.002em;
}

.prose h3::before {
  content: "—";
  margin-inline-end: 0.45em;
  color: var(--signal);
  font-weight: 400;
}

.prose h4 {
  font-size: 1.02rem;
  color: var(--ink-2);
  margin-top: 1.8em;
}

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent);
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.prose a:hover {
  color: var(--seal);
  text-decoration-color: var(--seal);
}

.prose blockquote {
  margin: 2em 0;
  padding: 0.9rem 1.4rem 0.95rem;
  border-inline-start: 2px solid var(--signal);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 1.03rem;
  line-height: 1.85;
}

.prose blockquote p {
  text-align: start;
  text-justify: none;
}

.prose blockquote p + p {
  margin-top: 0.75em;
}

.prose strong {
  font-weight: 600;
  color: var(--ink);
}

.prose em {
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--panel-2);
  color: var(--code-ink);
  padding: 0.1em 0.34em;
  border: 1px solid var(--rule);
  border-radius: 0;
  white-space: pre-wrap;
  /* `text-autospace` inherits from .prose, and code must render exactly as
     authored: the ¼em CJK/Latin air would shift the monospace grid around
     mixed ASCII + 中文 lines, and text-spacing-trim would bite full-width
     punctuation inside a string literal. */
  text-autospace: no-autospace;
  text-spacing-trim: space-all;
}

/* code blocks get an address line, like a filed sample */

.prose pre {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--rule-2);
  border-top: 3px solid var(--ink-2);
  padding: 2.35rem 1.1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.72;
  margin: 2em 0;
  tab-size: 2;
}

.prose pre::before {
  content: "";
  position: absolute;
  top: 0.85rem;
  inset-inline-start: 1.1rem;
  width: 2.4rem;
  height: 1px;
  background: var(--signal);
  box-shadow: 2.9rem 0 0 rgba(194, 102, 60, 0.45), 5.8rem 0 0 rgba(194, 102, 60, 0.18);
}

.prose pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  display: block;
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 0.62rem;
  inset-inline-end: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--signal);
  padding: 0 0 2px;
  opacity: 0.8;
}

.code-copy:hover {
  color: var(--ink);
  opacity: 1;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.prose table thead th {
  text-align: start;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 1px solid var(--ink-2);
  padding: 0.5em 0.7em;
  white-space: nowrap;
}

.prose table td {
  border-bottom: 1px solid var(--rule);
  padding: 0.6em 0.7em;
  vertical-align: top;
}

.prose ul,
.prose ol {
  margin: 1.3em 0;
  padding-inline-start: 1.35em;
}

.prose li {
  margin: 0.5em 0;
  text-align: start;
}

.prose li::marker {
  color: var(--signal);
}

.prose figure {
  margin: 2.2em 0;
}

.prose figure img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--rule);
  height: auto;
}

.prose figure.is-responsive img {
  max-height: min(70vh, 640px);
  width: auto;
}

.prose figcaption {
  margin-top: 0.6rem;
  text-align: start;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose img[data-viewer] {
  cursor: zoom-in;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.8em 0;
}

.prose .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5em 0;
  margin: 1.6em 0;
}

/* ——— reference markers ——— */

.prose ref {
  display: inline;
}

.prose sup.ref {
  font-size: 0.66em;
  line-height: 0;
  vertical-align: super;
}

.prose sup.ref a {
  color: var(--seal);
  text-decoration: none;
  padding: 0 0.08em;
  font-family: var(--font-mono);
}

.prose sup.ref a:hover {
  color: var(--link);
}

.reference-list {
  margin-top: 2.6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  line-height: 1.75;
}

.reference-list h3 {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.18em;
  color: var(--ink-2);
  font-weight: 500;
  margin: 0 0 0.7em;
}

.reference-list h3::before {
  content: none;
}

.reference-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.4rem;
  color: var(--ink-2);
  margin: 0.35em 0;
}

.reference-item a {
  color: var(--signal);
  text-decoration: none;
  font-family: var(--font-mono);
}

.reference-item a:hover {
  color: var(--link);
}

/* ——— hints ——— */

.prose info-hint,
.prose warning-hint,
.prose success-hint,
.prose danger-hint {
  display: block;
  margin: 1.9em 0;
  padding: 0.9rem 1.1rem 1rem;
  background: var(--panel-2);
  border-inline-start: 3px solid var(--rule-2);
  font-size: 0.93rem;
  line-height: 1.78;
  text-align: start;
}

.prose .hint-heading {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.prose info-hint .hint-heading { color: var(--info); }
.prose warning-hint .hint-heading { color: var(--signal); }
.prose success-hint .hint-heading { color: var(--success); }
.prose danger-hint .hint-heading { color: var(--danger); }

.prose info-hint { border-inline-start-color: var(--info); }
.prose warning-hint { border-inline-start-color: var(--signal); }
.prose success-hint { border-inline-start-color: var(--success); }
.prose danger-hint { border-inline-start-color: var(--danger); }

/* ——— drop cap: CJK only ———
   Latin openings get a small-caps first line instead (see the rule below),
   because a 3em Songti initial in English reads like a magazine parody. */

.dropcap {
  /* The initial is floated into the opening line, so the float and the optical
     margin both have to follow the inline direction — otherwise an Arabic or
     Hebrew drop cap hangs away from the text it belongs to. */
  float: inline-start;
  font-family: var(--font-cjk);
  font-size: var(--script-dropcap, 3em);
  line-height: 0.84;
  color: var(--ink);
  margin-block: 0.1em 0;
  margin-inline: 0 0.1em;
  font-weight: 500;
  font-style: normal;
}

/* Latin: no drop cap; open with one restrained small-caps line instead.
   Japanese keeps the drop cap (kanji/kana only, never Latin) — js/markdown.js
   decides that by testing the first character's script. */

body[data-script="latin"] #article-prose > p:first-of-type::first-line,
body[data-script="latin"] #page-prose > p:first-of-type::first-line,
body:not([data-script]):lang(en) #article-prose > p:first-of-type::first-line,
body:not([data-script]):lang(en) #page-prose > p:first-of-type::first-line {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.03em;
}

body[data-script="latin"] .prose .dropcap,
body:not([data-script]):lang(en) .prose .dropcap,
body[data-script="cyrillic"] .prose .dropcap,
body:not([data-script]):lang(ru) .prose .dropcap,
body[data-script="arabic"] .prose .dropcap,
body:not([data-script]):lang(ar) .prose .dropcap,
body[data-script="ko"] .prose .dropcap {
  float: none;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
  color: inherit;
  font-family: inherit;
}

/* Cyrillic opens like Latin: the all-small-caps line is the Latin device that
   suits a cased alphabet, and Russian has real small capitals to render it. */

body[data-script="cyrillic"] #article-prose > p:first-of-type::first-line,
body[data-script="cyrillic"] #page-prose > p:first-of-type::first-line,
body:not([data-script]):lang(ru) #article-prose > p:first-of-type::first-line,
body:not([data-script]):lang(ru) #page-prose > p:first-of-type::first-line {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.02em;
}

/* Arabic and Korean open plainly. Arabic is a unicase joined script, so neither
   a 3em initial nor a small-caps first line exists as a readable treatment; Hangul
   has no case at all, and a magnified syllable reads as a typo rather than an
   initial. Both keep the first paragraph flush with the rest of the column. */

body[data-script="arabic"] #article-prose > p:first-of-type::first-line,
body[data-script="arabic"] #page-prose > p:first-of-type::first-line,
body[data-script="ko"] #article-prose > p:first-of-type::first-line,
body[data-script="ko"] #page-prose > p:first-of-type::first-line {
  font-variant-caps: normal;
  letter-spacing: 0;
}

/* Traditional Chinese keeps the CJK drop cap — ideographs take an initial the
   same way Simplified does — but the glyph must come from the TC stack, which
   the hant token block already swaps in. */

body[data-script="hant"] .dropcap,
body:not([data-script]):lang(zh-Hant) .dropcap {
  font-family: var(--font-cjk);
}

/* Korean prose needs the script's own line-breaking: Hangul syllables may break
   between jamo blocks, but a break inside a word still looks wrong, so `keep-all`
   is the right default for the body copy and the browser handles the phrase
   spacing that follows. */

body[data-script="ko"] .prose p,
body:not([data-script]):lang(ko) .prose p {
  text-wrap: wrap;
  hyphens: none;
  -webkit-hyphens: none;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
  /* Korean sets its punctuation full-width like CJK, so the same trimming rule
     applies at the line edge; nothing extra is needed at Latin boundaries. */
  text-spacing-trim: normal;
}

/* Arabic: no hyphenation (Arabic does not hyphenate), no letter-spacing (it
   breaks the cursive joins), and `text-autospace: no-autospace` because that
   property only exists to space CJK against Latin. */

body[data-script="arabic"] .prose,
body:not([data-script]):lang(ar) .prose {
  text-autospace: no-autospace;
  letter-spacing: 0;
}

body[data-script="arabic"] .prose p,
body:not([data-script]):lang(ar) .prose p {
  hyphens: none;
  -webkit-hyphens: none;
  text-align: start;
  word-break: normal;
  line-break: auto;
}

/* Mixed Arabic-and-Latin runs in the margin furniture — the status strip,
   the archive dates, the section meta, the visitor id — are Arabic sentences
   with Latin islands in them. Their word order is the bidi order a reader
   expects, so they inherit the page's RTL base and only need isolating; the
   rule below explains why `direction: ltr` must not be added back. */
body[dir="rtl"] .panel-status,
body[dir="rtl"] .article-kicker,
body[dir="rtl"] .article-catalog,
body[dir="rtl"] .entry-no,
body[dir="rtl"] .entry-side,
body[dir="rtl"] .archive-date,
body[dir="rtl"] .archive-year-arabic,
body[dir="rtl"] .sec-head-meta,
body[dir="rtl"] .result-no,
body[dir="rtl"] .footer-brand,
body[dir="rtl"] .visitor {
  unicode-bidi: isolate;
}

/* The footer readout is the one exception: it is pure Latin — "FOLIA VII (7)",
   "SYS DIURN", "MMXXVI · ANTIPHON" — and it is meant to look like a machine
   log, so it keeps a literal left-to-right base in every locale. Every other
   element in the list above carries a localized string, and an ltr base
   silently reorders those: Arabic reads "نوفمبر 08", not "08 نوفمبر", and
   "سنة واحدة" comes out as "واحدة سنة". Forcing ltr also turns the elements'
   inline padding and border properties physical, which is how the article
   stamp came to overlap its file number instead of sitting in the kicker's
   reserved gutter. */
body[dir="rtl"] .log-line {
  direction: ltr;
  unicode-bidi: isolate;
}

/* The two masthead rows are deliberately absent from the list above. They are
   the only flex rows in the theme whose trailing item is positioned with
   `margin-inline-start: auto` (.protocol, .nav-tail), and `margin-inline-*`
   resolves against the element's OWN direction: forcing ltr on the row would
   turn that logical margin into a physical one and park the item mid-row under
   RTL — which is exactly the bug this comment prevents from coming back.

   The leaf runs are isolated instead, and they deliberately do NOT take
   `direction: ltr`: both carry localized sentences (»البروتوكول 20261001«,
   »الرصد جارٍ«) whose own bidi resolution is already correct, and changing the
   leaf's direction would re-resolve the auto margin that positions it.
   `unicode-bidi: isolate` alone keeps the run from re-ordering the adjacent
   punctuation, which is all these two need. */
body[dir="rtl"] .sys-line strong,
body[dir="rtl"] .sys-line .protocol,
body[dir="rtl"] .nav-tail {
  unicode-bidi: isolate;
}

/* Code, URLs and keyboard-ish strings in prose always run left to right, even
   inside the Arabic body. `unicode-bidi: plaintext` would let the first strong
   character decide, which is exactly the coin-flip this needs to avoid. */
body[dir="rtl"] .prose code,
body[dir="rtl"] .prose pre,
body[dir="rtl"] .prose kbd,
body[dir="rtl"] .prose samp,
body[dir="rtl"] .prose a[href^="http"] {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

/* Authored prose keeps the direction the author wrote in.
   The interface mirrors for RTL, but an article body, a site subtitle, a
   pull-quote or an excerpt is never translated: a Chinese sentence stays
   Chinese inside an Arabic page. Inheriting the document `dir` makes those
   blocks resolve as RTL paragraphs, and the bidi algorithm then treats a
   trailing 。 or . as a neutral at the end of an RTL run, so it is painted at
   the visual start of the line — 「。在纸与光之间，抄写每一次呼吸」 — instead of
   where the author typed it.

   `unicode-bidi: plaintext` gives each of these blocks the base direction of
   its own first strong character (UAX #9 P2/P3), which is exactly the rule
   the authored text already follows. `text-align: start` then follows that
   resolved direction too, so an English excerpt goes flush left in the Arabic
   interface while an Arabic one stays flush right. UI chrome is untouched:
   these selectors only name author-written copy.

   Each block is listed individually rather than hanging the fix off `.prose`:
   `unicode-bidi` is not inherited, and a container-only declaration would
   leave every nested paragraph, list item and caption on the RTL base. */
body[dir="rtl"] .blog-subtitle,
body[dir="rtl"] .lead-title,
body[dir="rtl"] .lead-dek,
body[dir="rtl"] .entry-title,
body[dir="rtl"] .entry-excerpt,
body[dir="rtl"] .article-title,
body[dir="rtl"] .article-dek,
body[dir="rtl"] .search-result-title,
body[dir="rtl"] .search-result-excerpt,
body[dir="rtl"] .verse,
body[dir="rtl"] .license-block,
body[dir="rtl"] .friend-note,
body[dir="rtl"] .footer-bottom,
body[dir="rtl"] .prose p,
body[dir="rtl"] .prose h1,
body[dir="rtl"] .prose h2,
body[dir="rtl"] .prose h3,
body[dir="rtl"] .prose h4,
body[dir="rtl"] .prose li,
body[dir="rtl"] .prose dt,
body[dir="rtl"] .prose dd,
body[dir="rtl"] .prose blockquote,
body[dir="rtl"] .prose blockquote p,
body[dir="rtl"] .prose td,
body[dir="rtl"] .prose th,
body[dir="rtl"] .prose figcaption,
body[dir="rtl"] .prose info-hint,
body[dir="rtl"] .prose warning-hint,
body[dir="rtl"] .prose success-hint,
body[dir="rtl"] .prose danger-hint {
  unicode-bidi: plaintext;
}

/* A list marker is painted by the list container at its inline-start edge, so
   it would stay pinned to the right while `plaintext` moved a Chinese or
   English item's text to the left — the bullet would sit at the opposite end of
   the line from the words it belongs to. Pulling the marker inside the line box
   makes it travel with the item's own resolved direction instead.

   `inside` alone would then push the first line in by the marker's width while
   the wrapped lines stayed put; the negative `text-indent` cancels that, so the
   marker hangs in the indent instead of displacing the text, and every line of
   the item starts at the same x — the same hanging indent an outside marker
   gives in the LTR locales. `text-indent` is inherited, so direct children of a
   loose list item (`<li><p>…</p></li>`) reset it.

   Two further details make that indent land exactly instead of drifting:

   The marker's advance is not the same for every marker. Chromium sizes the
   built-in marker against the item's resolved paragraph direction, and for an
   RTL-resolved item it reserves a full `1.35em` gutter, so a bullet sat ~23px
   away from the Arabic text it introduces while CJK/Latin bullets sat flush.
   Giving `::marker` an explicit `content` drops that reserved gutter and makes
   the advance purely the inked glyph's width (measured 7.54px for `•`).
   Numbers still widen it — 14.28px for `1.`, 24.48px for `10.` — so the
   indent is calibrated per list type below, with the two-digit step covered by
   `:nth-child(n + 10)`.

   The list padding is symmetric rather than start-only. With `plaintext` a
   CJK/Latin item resolves `inline-end` to the left, so its negative
   `text-indent` used to pull its first line 4–7px past the list box, out into
   the prose margin — the reported overflow, and the piece most likely to clip
   at 390px. Reserving the same padding on both sides puts a floor under that
   edge, so no item can leave the box whichever way it resolves. Scoped to RTL:
   the ten LTR locales keep their existing marker and geometry untouched. */
body[dir="rtl"] .prose ul,
body[dir="rtl"] .prose ol {
  list-style-position: inside;
  padding-inline: 1.35em;
}

body[dir="rtl"] .prose li {
  padding-inline-start: 0;
  text-indent: 0;
}

body[dir="rtl"] .prose li > * {
  text-indent: 0;
}

body[dir="rtl"] .prose ul > li::marker {
  content: "\2022";
}

body[dir="rtl"] .prose ol > li::marker {
  content: counter(list-item) ".";
}

body[dir="rtl"] .prose ul > li {
  text-indent: -0.41em;
}

body[dir="rtl"] .prose ol > li {
  text-indent: -0.77em;
}

body[dir="rtl"] .prose ol > li:nth-child(n + 10) {
  text-indent: -1.32em;
}

/* The stamp hangs off the prose column's end edge; in RTL that is the left
   side, which is also where the archive mark reads, so it must not inherit a
   mirrored inset that pushes it over the title. */
body[dir="rtl"] .stamp {
  inset-inline-end: 0;
}

@media (max-width: 640px) {
  /* On narrow phones the three decorative bars ran to ~114px and sat under the
     COPY/FAILED copy label (up to 161px wide at 320px). Two compact bars end
     at ~73px and clear it. */
  .prose pre::before {
    width: 1.4rem;
    box-shadow: 1.8rem 0 0 rgba(194, 102, 60, 0.45);
  }
}

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