/* patterns/axial.css — the corpus-owned stylesheet pattern for axial (timechorus.com).
 *
 * THIS FILE IS NOT LOADED BY ANYTHING. It lives outside engine/, schema/ and tools/, the
 * three trees tools/sync_engine.sh vendors, on purpose — so it never lands inside a
 * consumer's vendored `site/engine/` copy. It is documentation the engine repo ships
 * alongside v0.3.1 (task r3-2, "axial owns its own tokens"): the ready-to-land content of
 * `site/styles/axial.css` in the timechorus repo, where r3-4 is the task that actually
 * copies it there and links it in `index.html` — right after `engine/styles/engine.css` —
 * so the cascade order is: engine defaults, then this corpus's resets.
 *
 * It resets exactly the `--tc-*` tokens engine.css v0.3.1 introduced at `:root`
 * (docs/delivery_vision_r2-4.md §2.3 + §2.5, ruling L-50 — implemented here, not
 * redesigned). Two things, matching the two findings in that delivery:
 *
 *   1. Latin-first font stacks — engine/styles/sync.css's `.sync-home` already carries
 *      these verbatim (r1-2's own stacks, ported at r2-2). Promoted here to `:root` so
 *      every route gets them, not only the home screen — the fix for §2.5's SimSun
 *      finding (chunqiu's CJK-first `--serif`/`--sans` resolving on Latin text site-wide).
 *
 *   2. A whole-page dark palette under the standard `prefers-color-scheme: dark` query —
 *      the fix for §2.3's "dark island on a cream page": the exact page/surface/ink/soft/
 *      edge values r1-2 §8 measured and published (identical to the `.sync-home`-scoped
 *      dark block r2-6 removed under L-50 — "not-dark beats half-dark; Round-3 reinstates
 *      via corpus tokens" — this file is that reinstatement, now at `:root` so it reaches
 *      chronicle, relations, library, timeline, map and compare too, not just the home).
 *      `engine/styles/sync.css` v0.3.1 aliases five of `.sync-home`'s own `--sy-*` names to
 *      these same `--tc-*` tokens, so resetting them here also moves the home's own dark
 *      palette — nothing further is needed in this file for the home view specifically.
 *
 * No web fonts, no CDN, no script-driven styling: red line 7 holds. Nothing here needs a
 * build step or a preprocessor — plain CSS custom properties, reset once. */

:root {
  /* --- Latin-first stacks, verbatim from engine/styles/sync.css's `.sync-home` block ---
   * (r1-2's own font research: Latin faces first, then CJK/Hebrew/Devanagari fallbacks for
   * `name_original` / `quote_original` content, which still needs to render in its own
   * script wherever it appears on an otherwise-English page). */
  --tc-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "Noto Serif", "Liberation Serif", Georgia, "Times New Roman", serif,
    "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun",
    "Noto Serif Hebrew", "David Libre", "Frank Ruhl Libre",
    "Noto Serif Devanagari", "Nirmala UI", "Kohinoor Devanagari", "Mangal";
  --tc-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", "Liberation Sans", sans-serif,
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC",
    "Noto Sans Hebrew", "Arial Hebrew", "Nirmala UI", "Noto Sans Devanagari";
  --tc-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* --- axial light palette (Vision r3-6; lead decision, L-61) ----------------------------
   * Surfaces keep the inherited silk values. Four ink tokens are darkened just past the 4.5
   * text floor on --tc-surface #F4EDDF, the darker of the two light grounds (WCAG 2.1; the
   * figures are surface / surface-alt): */
  --tc-ink-soft: #71695f;  /* 4.64 / 5.05   was #7A7166  4.11 / 4.48 */
  --tc-accent: #9e5929;    /* 4.60 / 5.01   was #B4652F  3.72 / 4.05 */
  --tc-accent-2: #427268;  /* 4.70 / 5.11   was #44766B  4.45 / 4.84 */
  --tc-accent-3: #b84332;  /* 4.64 / 5.05   was #BC4433  4.49 / 4.89 */
}

/* --- whole-page dark palette --------------------------------------------------------
 * Values are r1-2 §8's own dark-theme table (docs/delivery_vision_r1-2.md), the same
 * numbers the `.sync-home`-scoped block carried before r2-6 removed it (L-50):
 *   --tc-surface     "page"    #191c21
 *   --tc-surface-alt "surface" #20242a
 *   --tc-ink                   #ece8e0   (12.76 on surface — r1-2 §8, floor 4.5)
 *   --tc-ink-soft    "role tag"#b6afa3   (7.16  on surface — r1-2 §8, floor 4.5)
 *   --tc-line        "edge"    #727b88   (3.64  on surface — r1-2 §8, floor 3.0;
 *                                         a meaningful border, not a decorative hairline)
 * r1-2 §8 never measured chunqiu's three accent hues (ochre/bronze/cinnabar) in dark
 * mode — the mock it measured had no accent hue at all, only page/surface/ink/soft/edge.
 * Left unlifted, two of the three fall under the 3:1 graphical-object floor against
 * `--tc-surface-alt` (measured: ochre 3.59, bronze 3.01, cinnabar 2.98 — cinnabar fails).
 * This file lifts all three toward white by 42%, the exact `liftColour()` formula
 * `engine/views/sync.js` already applies to region colours for the same reason (r1-2 §5's
 * recommendation, generalised here to the three functional accents rather than left as a
 * gap): `v + (255-v)*0.42`. Re-measured after the lift — all comfortably clear both
 * floors against both dark backgrounds:
 *   --tc-accent   (ochre,    #B4652F -> #d4a686)  7.12 / 7.81  (surface-alt / page)
 *   --tc-accent-2 (bronze,   #44766B -> #93b0a9)  6.70 / 7.34
 *   --tc-accent-3 (cinnabar, #BC4433 -> #d89389)  6.28 / 6.88
 * This is Skipper's engineering decision, not part of the r1-2/r2-4 design brief verbatim
 * — flagged here and in docs/delivery_skipper_r3-2.md so the lead or Vision can rule
 * otherwise if a different dark accent is wanted. Confirmed as shipped, Vision r3-6 (live origin, 2026-09-14). */
@media (prefers-color-scheme: dark) {
  :root {
    --tc-surface: #191c21;
    --tc-surface-alt: #20242a;
    --tc-ink: #ece8e0;
    --tc-ink-soft: #b6afa3;
    --tc-line: #727b88;
    --tc-accent: #d4a686;
    --tc-accent-2: #93b0a9;
    --tc-accent-3: #d89389;
    /* r5-4(5)(e), L-84(4): the dark base map, sized down from r5-0's "engine CSS plus the
     * token block" to five corpus declarations only (r5-6 §4) -- the SVG (base_map.svg) and
     * home_map.css already read these five --bm-* tokens with light fallbacks (including the
     * caption's own text-shadow halo), they were simply never set in dark, so the map's land,
     * sea, coasts and rivers stayed light inside the dark page and every place caption on the
     * front door measured 1.11 : 1 against it (r5-6 §4, live). Values are the layout contract's
     * own `proposed_dark_basemap_tokens` (docs/design/home_r4/layout_report.json), not new
     * numbers: --bm-land raises the caption to 10.86 : 1. */
    --bm-sea: #1b2027;
    --bm-land: #2b3038;
    --bm-coast: #6b7480;
    --bm-river: #4f7592;
    --bm-grat: #3b424c;
  }
}

/* --- the about-page section index (r5-4(4), r5-1 §6.1/§7.2 mock, three rules verbatim from
 * the mock's own <style> block) --- the "On this page" nav; #/about/<section> scrolling to it
 * is core/router.js's job, this is only its appearance. Corpus stylesheet material. */
.about-index { display: flex; flex-wrap: wrap; gap: .15rem .7rem; align-items: baseline;
  font-size: .8rem; padding: .55rem .75rem; margin: 0 0 1.1rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--paper-2, transparent); }
.about-index span { color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase;
  font-size: .7rem; margin-right: .2rem; }
.about-index a { color: var(--ochre); text-decoration: none; border-bottom: 1px solid var(--line); }
.about-index a:hover, .about-index a:focus { border-bottom-color: currentColor; }

/* r6-2 (Vision)'s `.about-body section { scroll-margin-top: 10px; }` fix moved to its durable
 * home, `engine/styles/engine.css`, at r7-1 (L-93(7)): `.about-body` is engine-owned material,
 * every other rule under that class already lived there, and this one shipped here only because
 * it landed before the engine release train that could carry it. No rendered-output change —
 * the rule is still in effect, just no longer duplicated per corpus. See engine.css for the full
 * comment. */

/* --- the method/credits page, stage 1 (r5-7, per Vision's r5-1 §6.1/§7.2 mock) ---------
 * The `.credits` / `.cr-*` rules for #view-about's "Credits and licences" section. Corpus
 * stylesheet material, not engine.css: this is one corpus's About page. Contrast measured
 * by Vision against the r1-2 §8 floors (4.5 body / 3.0 large) in both themes, 0 fails. */
.credits { margin: .6rem 0 0; }
.credits dt { font-weight: 600; font-size: .92rem; margin-top: .95rem; display: flex;
  flex-wrap: wrap; gap: .45rem; align-items: baseline; }
.credits dd { margin: .2rem 0 0; padding-left: .85rem; border-left: 2px solid var(--line);
  font-size: .88rem; color: var(--ink); }
.cr-lic { font-weight: 500; font-size: .72rem; letter-spacing: .03em; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 3px; padding: .05rem .35rem; white-space: nowrap; }
.cr-pending { font-weight: 500; font-size: .72rem; color: var(--ink-soft); font-style: italic; }
.cr-use, .cr-shown { color: var(--ink-soft); }
.cr-clause { margin: .35rem 0 0; font-size: .86rem; }
.cr-gap { margin: .35rem 0 0; font-size: .86rem; font-style: italic; color: var(--ink-soft); }

/* Vision's r5-9 §6(6) spec ("Mine, Round 6: the `code` rule in axial.css, to land with
 * Sophia's restored backticks") -- landed here at r6-mergeG because Vision had not landed it
 * herself by this sitting (disclosed in docs/delivery_skipper_r6-mergeG.md). appendWithCode()
 * (engine/views/about.js) has always split .cr-use / .cr-shown / .cr-clause text on backtick
 * pairs into bare <code> elements; until this rule they rendered as unstyled UA monospace
 * inline text with no visual distinction from the surrounding prose. This is what makes
 * SRC_CHUNQIU.credit_clause's three restored backtick spans (`data/csv`, `data/csv/places.csv`,
 * the pin -- L-92(1), r6-1b) render as intended rather than as a plain-text regression. */
code { font-family: var(--tc-mono); font-size: .92em; background: var(--silk-panel);
  border: 1px solid var(--line); border-radius: 3px; padding: .05em .3em;
  /* r6-4 (Vision): a literal is only useful if the reader can read all of it. The longest thing
   * this rule styles is a 40-character commit hash (SRC_CHUNQIU's credit_clause), which at 320 px
   * measured 327 px wide inside a 279 px <dd> — 49 px past its parent, clipped without an ellipsis
   * by the page root's `overflow-x: clip` (engine.css's horizontal-overflow guard). The reader saw
   * `6beb833294fa535b874e3d640fa80fa7101` and no sign that four characters were missing, on the one
   * page whose whole purpose is that a claim can be gone and checked. One declaration: an
   * unbreakable literal wraps instead. */
  overflow-wrap: anywhere; }
