
  /* ---------- Theme tokens ---------- */
  :root {
    --paper:        #f4efe4;
    --paper-deep:   #ece5d4;
    --paper-card:   rgba(255, 255, 255, 0.35);
    --rule:         #d6cdb6;
    --rule-strong:  #b9ae8e;
    --ink:          #2a2620;
    --ink-soft:     #4b443a;
    --ink-mute:     #7a6f5e;
    --ochre:        #9a5a1f;
    --ochre-deep:   #6f3f12;
    --ochre-glow:   rgba(154, 90, 31, 0.18);
    --slate:        #3a4b56;
    --slate-glow:   rgba(58, 75, 86, 0.12);
    --accent-up:    #6f3f12;
    --accent-down:  #3a4b56;
    --layer-bottom: #2f3a44;
    --layer-middle: #6f3f12;
    --layer-surface:#9a5a1f;
    --texture-1:    rgba(110, 90, 50, 0.035);
    --texture-2:    rgba(110, 90, 50, 0.025);
    --shadow-soft:  0 1px 2px rgba(60, 50, 30, 0.05), 0 4px 14px rgba(60, 50, 30, 0.06);
    --shadow-lift:  0 2px 4px rgba(60, 50, 30, 0.08), 0 12px 30px rgba(60, 50, 30, 0.10);
    --tooltip-bg:   #2a2620;
    --tooltip-fg:   #f4efe4;
    --tooltip-rule: rgba(255, 255, 255, 0.08);
    --serif:        "Iowan Old Style", "Palatino Linotype", "Palatino", "Book Antiqua", Georgia, "Times New Roman", serif;
    --sans:         "Inter", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
    --ease-out:     cubic-bezier(0.2, 0.7, 0.2, 1);
    --ease-in-out:  cubic-bezier(0.5, 0, 0.2, 1);
  }

  html[data-theme="sepia"] {
    --paper:        #e9dec5;
    --paper-deep:   #ddd0b1;
    --paper-card:   rgba(255, 250, 235, 0.4);
    --rule:         #c6b88f;
    --rule-strong:  #a99a6e;
    --ink:          #2d2415;
    --ink-soft:     #4d3f25;
    --ink-mute:     #7a6940;
    --ochre:        #8a4a14;
    --ochre-deep:   #5d3009;
    --ochre-glow:   rgba(138, 74, 20, 0.20);
    --slate:        #4a4530;
    --slate-glow:   rgba(74, 69, 48, 0.14);
    --accent-up:    #5d3009;
    --accent-down:  #4a4530;
    --layer-bottom: #36321f;
    --layer-middle: #5d3009;
    --layer-surface:#8a4a14;
    --texture-1:    rgba(100, 75, 30, 0.05);
    --texture-2:    rgba(100, 75, 30, 0.035);
    --tooltip-bg:   #2d2415;
    --tooltip-fg:   #e9dec5;
  }

  html[data-theme="dark"] {
    --paper:        #14130f;
    --paper-deep:   #1c1a14;
    --paper-card:   rgba(255, 250, 235, 0.04);
    --rule:         #2f2c23;
    --rule-strong:  #4a4533;
    --ink:          #ece4d1;
    --ink-soft:     #c5bca6;
    --ink-mute:     #8a8170;
    --ochre:        #d49355;
    --ochre-deep:   #b87a3a;
    --ochre-glow:   rgba(212, 147, 85, 0.20);
    --slate:        #8aa3b3;
    --slate-glow:   rgba(138, 163, 179, 0.14);
    --accent-up:    #d49355;
    --accent-down:  #8aa3b3;
    --layer-bottom: #6c7c8a;
    --layer-middle: #b87a3a;
    --layer-surface:#d49355;
    --texture-1:    rgba(180, 150, 90, 0.022);
    --texture-2:    rgba(180, 150, 90, 0.014);
    --shadow-soft:  0 1px 2px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.5);
    --shadow-lift:  0 2px 4px rgba(0,0,0,0.5), 0 12px 30px rgba(0,0,0,0.6);
    --tooltip-bg:   #ece4d1;
    --tooltip-fg:   #14130f;
    --tooltip-rule: rgba(0,0,0,0.08);
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }

  html { scroll-behavior: smooth; }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-image:
      radial-gradient(var(--texture-1) 1px, transparent 1px),
      radial-gradient(var(--texture-2) 1px, transparent 1px);
    background-size: 3px 3px, 7px 7px;
    background-position: 0 0, 1px 2px;
    transition: background-color 0.5s var(--ease-in-out), color 0.5s var(--ease-in-out);
    overflow-x: hidden;
  }

  @media (min-width: 720px) {
    body { font-size: 19px; }
  }

  /* ---------- Reading progress ---------- */
  .progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--ochre), var(--ochre-deep));
    z-index: 100;
    transition: width 0.08s linear;
    will-change: width;
  }

  /* ---------- Top utility bar (theme + mobile nav toggle) ---------- */
  .top-bar {
    position: fixed;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 95;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .theme-switch {
    display: inline-flex;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 3px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .theme-switch button {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0.45rem 0.55rem;
    font: inherit;
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    cursor: pointer;
    border-radius: 999px;
    transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    line-height: 1;
  }
  .theme-switch button:hover { color: var(--ink); }
  .theme-switch button[aria-pressed="true"] {
    background: var(--paper);
    color: var(--ochre-deep);
    box-shadow: inset 0 0 0 1px var(--rule);
  }
  html[data-theme="dark"] .theme-switch button[aria-pressed="true"] { color: var(--ochre); }
  .theme-switch button svg { width: 14px; height: 14px; display: block; }
  .theme-switch button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

  /* Language switch — same pill treatment as the theme switch */
  .lang-switch {
    display: inline-flex;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 3px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .lang-switch button {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0.45rem 0.6rem;
    font: inherit;
    font-family: var(--sans);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-mute);
    cursor: pointer;
    border-radius: 999px;
    transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
    display: inline-flex;
    align-items: center;
    /* Match the theme-switch button's 14px icon line-box so both pills are the same height */
    line-height: 14px;
  }
  .lang-switch button:hover { color: var(--ink); }
  .lang-switch button[aria-pressed="true"] {
    background: var(--paper);
    color: var(--ochre-deep);
    box-shadow: inset 0 0 0 1px var(--rule);
  }
  html[data-theme="dark"] .lang-switch button[aria-pressed="true"] { color: var(--ochre); }
  .lang-switch button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
  /* The Chinese glyph is not uppercase; keep its casing natural */
  .lang-switch button[data-lang-value="zh"] .label { text-transform: none; letter-spacing: 0.04em; }

  /* CJK-friendly system font stack and comfortable line-height in Chinese mode */
  html[lang="zh"] body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; line-height: 1.8; }
  html[lang="zh"] .lead,
  html[lang="zh"] h1,
  html[lang="zh"] .section-heading,
  html[lang="zh"] .callout h3,
  html[lang="zh"] .geo-feature .stat-value,
  html[lang="zh"] .faction-card h4,
  html[lang="zh"] .closing-text,
  html[lang="zh"] .closing-mark { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }

  /* Translation-notice pill — shown only in Chinese mode, beneath the top bar */
  .lang-note {
    position: fixed;
    top: calc(0.85rem + 38px + 0.55rem);
    right: 0.85rem;
    z-index: 95;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 0.72rem;
    color: var(--ink-mute);
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
    pointer-events: none;
    max-width: calc(100vw - 1.7rem);
  }
  html[lang="zh"] .lang-note {
    opacity: 0.95;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s linear 0s;
  }
  @media (max-width: 520px) {
    .lang-note {
      top: calc(0.55rem + 38px + 0.45rem);
      right: 0.55rem;
      font-size: 0.66rem;
      padding: 0.28rem 0.6rem;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .lang-note { transition: none; transform: none; }
  }

  /* Mobile nav menu button */
  .nav-toggle {
    display: none;
    appearance: none;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 999px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-soft);
    box-shadow: var(--shadow-soft);
    transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
  }
  .nav-toggle:hover { color: var(--ink); }
  .nav-toggle svg { width: 18px; height: 18px; display: block; }
  .nav-toggle:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

  @media (max-width: 520px) {
    .top-bar { top: 0.55rem; right: 0.55rem; gap: 0.4rem; }
    .theme-switch button { padding: 0.4rem 0.5rem; }
    .theme-switch .label { display: none; }
    /* Language labels are short ("EN" / "中文") — keep them visible */
    .lang-switch button { padding: 0.4rem 0.5rem; }
  }

  /* ---------- Section navigation: desktop vertical rail ---------- */
  .section-nav {
    position: fixed;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  }

  .section-nav a {
    --dot: 9px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    text-decoration: none;
    color: inherit;
    outline: none;
  }
  .section-nav a::before {
    content: "";
    width: var(--dot);
    height: var(--dot);
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--rule-strong);
    transition:
      background 0.25s var(--ease-out),
      border-color 0.25s var(--ease-out),
      transform 0.25s var(--ease-out),
      width 0.25s var(--ease-out),
      height 0.25s var(--ease-out);
  }
  .section-nav a:hover::before {
    border-color: var(--ochre);
    transform: scale(1.15);
  }
  .section-nav a.is-active::before {
    background: var(--ochre);
    border-color: var(--ochre);
    width: 11px;
    height: 11px;
  }
  .section-nav a:focus-visible::before {
    box-shadow: 0 0 0 2px var(--paper-deep), 0 0 0 4px var(--ochre);
  }

  /* Label tooltip on rail */
  .section-nav a .nav-label {
    position: absolute;
    left: calc(100% + 0.6rem);
    top: 50%;
    transform: translate(-4px, -50%);
    white-space: nowrap;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  }
  .section-nav a:hover .nav-label,
  .section-nav a:focus-visible .nav-label,
  .section-nav a.is-active:hover .nav-label {
    opacity: 1;
    transform: translate(0, -50%);
  }

  /* Mobile / tablet: collapse the rail into a drawer */
  @media (max-width: 900px) {
    .section-nav {
      position: fixed;
      top: 0; left: 0; right: 0;
      bottom: auto;
      transform: translateY(-100%);
      flex-direction: column;
      gap: 0;
      width: 100%;
      max-width: none;
      padding: 4.5rem 1.5rem 1.5rem;
      border: 0;
      border-bottom: 1px solid var(--rule);
      border-radius: 0;
      background: var(--paper);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      box-shadow: var(--shadow-lift);
      opacity: 0;
      transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
    }
    .section-nav.is-open {
      transform: translateY(0);
      opacity: 1;
    }
    .section-nav a {
      width: auto;
      height: auto;
      justify-content: flex-start;
      padding: 0.85rem 0.4rem;
      border-bottom: 1px solid var(--rule);
      gap: 0.85rem;
    }
    .section-nav a:last-child { border-bottom: 0; }
    .section-nav a::before {
      position: static;
      flex: 0 0 auto;
    }
    .section-nav a .nav-label {
      position: static;
      transform: none;
      opacity: 1;
      pointer-events: auto;
      background: transparent;
      border: 0;
      box-shadow: none;
      padding: 0;
      color: var(--ink-soft);
      font-size: 0.85rem;
      letter-spacing: 0.05em;
    }
    .section-nav a.is-active .nav-label { color: var(--ochre-deep); }
    html[data-theme="dark"] .section-nav a.is-active .nav-label { color: var(--ochre); }

    .nav-toggle { display: inline-flex; }
  }

  /* Backdrop behind mobile nav drawer */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
  }
  .nav-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  @media (min-width: 901px) { .nav-backdrop { display: none; } }

  /* ---------- Page layout container ---------- */

  main {
    padding: 0 0 clamp(4rem, 8vw, 7rem);
  }

  /* Container utility: centered with consistent left/right padding */
  .container {
    max-width: 78rem;
    margin: 0 auto;
    padding-left: clamp(1.25rem, 4vw, 3rem);
    padding-right: clamp(1.25rem, 4vw, 3rem);
  }

  /* The left rail pushes content right at large widths */
  @media (min-width: 1100px) {
    main { padding-left: 5rem; }
  }

  /* ---------- Reveal on scroll ---------- */
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    will-change: opacity, transform;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  /* ---------- Hero / Masthead ---------- */
  section.hero {
    position: relative;
    padding: clamp(4rem, 10vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
    overflow: hidden;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: end;
  }
  @media (min-width: 880px) {
    .hero-grid {
      grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
      gap: clamp(2.5rem, 6vw, 5rem);
    }
  }

  .eyebrow {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 1.1rem;
  }

  h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(3.5rem, 11vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--ink);
    position: relative;
    display: inline-block;
  }
  h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.14em;
    height: 3px;
    width: 0;
    background: var(--ochre);
    transition: width 1.4s var(--ease-out) 0.4s;
  }
  body.loaded h1::after { width: 0.55em; }

  .hero-tagline {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 1.5rem 0 0;
  }

  .lead {
    font-size: clamp(1.05rem, 1.5vw, 1.18rem);
    color: var(--ink);
    line-height: 1.55;
    margin: 0;
    font-family: var(--serif);
  }
  .lead .term, p .term { /* shared term style; see below */ }

  /* ---------- General prose ---------- */
  p { margin: 0 0 1.2em; color: var(--ink-soft); hyphens: auto; -webkit-hyphens: auto; transition: color 0.4s var(--ease-in-out); }
  p:last-child { margin-bottom: 0; }
  p strong { color: var(--ink); font-weight: 600; }

  /* Marked vocabulary term */
  .term {
    position: relative;
    color: var(--ink);
    cursor: help;
    border-bottom: 1px dotted var(--rule-strong);
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
    /* Allow term to be focusable */
  }
  .term:hover, .term:focus-visible {
    color: var(--ochre-deep);
    border-bottom-color: var(--ochre);
    outline: none;
  }
  html[data-theme="dark"] .term:hover,
  html[data-theme="dark"] .term:focus-visible { color: var(--ochre); }
  .term[tabindex]:focus-visible { outline: none; }

  /* ---------- Tooltip ---------- */
  .tooltip {
    position: fixed;
    z-index: 200;
    max-width: min(20rem, calc(100vw - 1.5rem));
    background: var(--tooltip-bg);
    color: var(--tooltip-fg);
    font-family: var(--sans);
    font-size: 0.82rem;
    line-height: 1.5;
    padding: 0.75rem 0.95rem;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
    border: 1px solid var(--tooltip-rule);
  }
  .tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .tooltip-arrow {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--tooltip-bg);
    transform: rotate(45deg);
    border: 1px solid var(--tooltip-rule);
  }
  .tooltip[data-placement="top"] .tooltip-arrow {
    bottom: -6px;
    left: var(--arrow-x, 50%);
    margin-left: -5px;
    border-top: 0; border-left: 0;
  }
  .tooltip[data-placement="bottom"] .tooltip-arrow {
    top: -6px;
    left: var(--arrow-x, 50%);
    margin-left: -5px;
    border-bottom: 0; border-right: 0;
  }
  .tooltip-term {
    display: block;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.65;
    margin-bottom: 0.3rem;
  }

  /* ---------- Section: principles (two cards, split) ---------- */
  section.principles-section {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
    position: relative;
  }
  section.principles-section::before {
    content: "";
    display: block;
    width: 4rem;
    height: 2px;
    background: var(--ochre);
    margin: 0 0 1.6rem;
    opacity: 0.7;
  }

  .section-eyebrow {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 0.6rem;
  }
  .section-heading {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.15;
    margin: 0 0 1.8rem;
    color: var(--ink);
    letter-spacing: -0.01em;
    max-width: 32ch;
  }

  .principles {
    display: grid;
    gap: clamp(1rem, 2vw, 1.5rem);
    grid-template-columns: minmax(0, 1fr);
  }
  @media (min-width: 880px) {
    .principles {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
  }

  .principle {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-top: 3px solid var(--ochre);
    padding: clamp(1.4rem, 3vw, 2rem);
    border-radius: 2px;
    transition:
      transform 0.35s var(--ease-out),
      box-shadow 0.35s var(--ease-out),
      border-top-width 0.25s var(--ease-out),
      background 0.4s var(--ease-in-out);
    position: relative;
    overflow: hidden;
  }
  .principle::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--ochre-glow), transparent 55%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
  }
  .principle:hover,
  .principle:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    border-top-width: 5px;
  }
  .principle:hover::before,
  .principle:focus-within::before { opacity: 1; }

  .principle .label {
    display: block;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ochre-deep);
    margin-bottom: 0.7em;
    position: relative;
  }
  html[data-theme="dark"] .principle .label { color: var(--ochre); }
  .principle .roman-numeral {
    position: absolute;
    top: clamp(0.5rem, 1.5vw, 0.85rem);
    right: clamp(0.9rem, 2vw, 1.4rem);
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(3rem, 6vw, 4.5rem);
    color: var(--ochre);
    opacity: 0.08;
    line-height: 1;
    pointer-events: none;
    user-select: none;
  }
  .principle p {
    margin: 0;
    color: var(--ink);
    font-size: 1em;
    line-height: 1.65;
    position: relative;
  }
  .principle p strong {
    font-size: 1.08em;
    letter-spacing: -0.005em;
    display: inline;
  }

  /* ---------- Section: three-layer diagram (full-bleed feature) ---------- */
  section.diagram-section {
    padding: clamp(3rem, 7vw, 5rem) 0;
    background: var(--paper-deep);
    position: relative;
    transition: background 0.4s var(--ease-in-out);
  }
  section.diagram-section::before,
  section.diagram-section::after {
    content: "";
    display: block;
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: var(--rule);
  }
  section.diagram-section::before { top: 0; }
  section.diagram-section::after  { bottom: 0; }

  .diagram-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
  }
  @media (min-width: 1024px) {
    .diagram-grid {
      grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
      gap: clamp(2rem, 5vw, 4rem);
    }
  }

  .diagram-intro p { margin-bottom: 1rem; }
  .diagram-intro p:last-child { margin-bottom: 0; }
  .diagram-intro .section-heading { margin-bottom: 1.2rem; }

  .diagram {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: clamp(1.25rem, 3vw, 2rem);
    position: relative;
    box-shadow: var(--shadow-soft);
    transition: background 0.4s var(--ease-in-out), border-color 0.4s var(--ease-in-out);
    margin: 0;
  }

  .diagram-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
  }
  .diagram-title {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0;
  }
  .diagram-hint {
    font-family: var(--sans);
    font-size: 0.7rem;
    color: var(--ink-mute);
    font-style: italic;
    letter-spacing: 0.02em;
    margin: 0;
  }

  .diagram-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 2.5vw, 2.25rem);
    align-items: stretch;
  }
  @media (max-width: 640px) {
    .diagram-stage { grid-template-columns: 1fr; }
  }

  .flow-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
  }
  .flow-btn {
    appearance: none;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.7rem 0.75rem;
    font: inherit;
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.6em;
    transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    position: relative;
  }
  .flow-btn:hover { transform: translateY(-1px); }
  .flow-btn:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
  .flow-btn .swatch {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
  }
  .flow-btn--up .swatch { background: var(--accent-up); }
  .flow-btn--down .swatch { background: var(--accent-down); }
  .flow-btn--up[aria-pressed="true"] {
    background: var(--ochre-glow);
    border-color: var(--accent-up);
    color: var(--accent-up);
  }
  .flow-btn--down[aria-pressed="true"] {
    background: var(--slate-glow);
    border-color: var(--accent-down);
    color: var(--accent-down);
  }
  html[data-theme="dark"] .flow-btn--up[aria-pressed="true"] { color: var(--ochre); }
  html[data-theme="dark"] .flow-btn--down[aria-pressed="true"] { color: var(--slate); }
  .flow-btn .arrow-mini { width: 14px; height: 14px; margin-left: auto; }
  .flow-btn .arrow-mini svg { width: 100%; height: 100%; display: block; }

  .layers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
    min-height: 16rem;
  }
  .layer {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 4.5rem;
  }
  .layer::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--layer-bottom);
    border-radius: 3px 0 0 3px;
    transition: width 0.3s var(--ease-out);
  }
  .layer[data-layer="middle"]::before  { background: var(--layer-middle); }
  .layer[data-layer="surface"]::before { background: var(--layer-surface); }
  .layer:hover, .layer:focus-visible, .layer.is-active {
    transform: translateX(2px);
    box-shadow: var(--shadow-soft);
    outline: none;
  }
  .layer.is-active::before { width: 6px; }
  .layer-name {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 0.25em;
  }
  .layer-desc {
    font-size: 0.92em;
    color: var(--ink);
    line-height: 1.45;
    margin: 0;
  }

  /* Flow rails */
  .flow-rail {
    position: absolute;
    top: 0; bottom: 0;
    width: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out);
  }
  .flow-rail.is-on { opacity: 1; }
  .flow-rail--up   { left: -28px; }
  .flow-rail--down { right: -28px; }
  @media (max-width: 900px) {
    .flow-rail--up   { left: -22px; }
    .flow-rail--down { right: -22px; }
  }
  @media (max-width: 640px) {
    .flow-rail { display: none; }
  }
  .flow-rail svg {
    width: 100%; height: 100%;
    display: block;
    color: var(--accent-up);
  }
  .flow-rail--down svg { color: var(--accent-down); }

  /* Animated dashed lines.
     UP rail: line drawn from y=98 (bottom) to y=6 (top); dashes move in path-forward direction with negative stroke-dashoffset → visually upward. CORRECT.
     DOWN rail: line drawn from y=2 (top) to y=94 (bottom); dashes must move in path-forward direction with negative stroke-dashoffset → visually downward. */
  .flow-rail .rail-line {
    stroke-dasharray: 4 5;
    animation: dash-up 1.6s linear infinite;
  }
  .flow-rail--down .rail-line {
    animation: dash-down 1.6s linear infinite;
  }
  .flow-rail .rail-head {
    transform-origin: center;
    animation: head-pulse-up 1.6s var(--ease-in-out) infinite;
  }
  .flow-rail--down .rail-head {
    animation: head-pulse-down 1.6s var(--ease-in-out) infinite;
  }
  @keyframes dash-up   { to { stroke-dashoffset: -18; } }
  /* down rail dashes flow visually downward → path forward direction → negative offset */
  @keyframes dash-down { to { stroke-dashoffset: -18; } }
  @keyframes head-pulse-up {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(-3px); opacity: 1; }
  }
  @keyframes head-pulse-down {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50%      { transform: translateY(3px); opacity: 1; }
  }

  /* Examples column */
  .examples {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 16rem;
  }
  .example {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.7rem 0.85rem;
    font-size: 0.88em;
    line-height: 1.45;
    color: var(--ink-soft);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.35s var(--ease-out), border-color 0.35s var(--ease-out), background 0.35s var(--ease-out), transform 0.35s var(--ease-out);
    position: relative;
  }
  .example.is-on {
    opacity: 1;
    border-color: var(--rule-strong);
    box-shadow: var(--shadow-soft);
    transform: translateX(-2px);
  }
  .example[data-flow="up"].is-on   { border-left: 3px solid var(--accent-up); }
  .example[data-flow="down"].is-on { border-left: 3px solid var(--accent-down); }
  .example-label {
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 0.2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
  }
  .example-label .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-up);
    display: inline-block;
  }
  .example[data-flow="down"] .example-label .dot { background: var(--accent-down); }
  .example-text { color: var(--ink); margin: 0; }

  .diagram-legend {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--rule);
    font-family: var(--sans);
    font-size: 0.72rem;
    color: var(--ink-mute);
    line-height: 1.6;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    align-items: baseline;
  }
  .diagram-legend strong { color: var(--ink-soft); font-weight: 600; letter-spacing: 0.04em; }

  .coda {
    font-style: italic;
    color: var(--ink-soft);
    border-left: 2px solid var(--ochre);
    padding-left: 1.1rem;
    margin: 1.5rem 0 0;
    font-size: 0.98em;
    transition: border-color 0.4s var(--ease-in-out), color 0.4s var(--ease-in-out);
  }

  /* ---------- Section: player & combat (split panel) ---------- */
  section.player-section { padding: clamp(3rem, 7vw, 5rem) 0; }

  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
  }
  @media (min-width: 900px) {
    .split {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .split--reverse > :first-child { order: 2; }
  }

  .callout {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--accent-down);
    padding: clamp(1.4rem, 3vw, 2rem);
    border-radius: 2px;
    position: relative;
    transition: background 0.4s var(--ease-in-out);
  }
  .callout .callout-label {
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 0.7rem;
  }
  .callout h3 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0 0 0.7rem;
    color: var(--ink);
    letter-spacing: -0.005em;
  }
  .callout p { margin: 0; color: var(--ink-soft); }
  .callout--up { border-left-color: var(--accent-up); }

  /* ---------- Section: geography (full-bleed dark panel feel) ---------- */
  section.geography-section {
    padding: clamp(3.5rem, 8vw, 6rem) 0;
    position: relative;
  }
  .geo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: start;
  }
  @media (min-width: 960px) {
    .geo-grid {
      grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
    }
  }
  .geo-feature {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: clamp(1.5rem, 3.5vw, 2.4rem);
    position: relative;
    overflow: hidden;
  }
  .geo-feature::after {
    content: "";
    position: absolute;
    right: -3rem;
    bottom: -3rem;
    width: 14rem;
    height: 14rem;
    background: radial-gradient(circle at center, var(--ochre-glow), transparent 65%);
    pointer-events: none;
  }
  .geo-feature .stat-label {
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin: 0 0 0.5rem;
  }
  .geo-feature .stat-value {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    margin: 0 0 0.9rem;
    color: var(--ink);
    letter-spacing: -0.015em;
  }
  .geo-feature p { margin: 0; }

  /* ---------- Section: factions (overlapping cards) ---------- */
  section.factions-section { padding: clamp(3rem, 7vw, 5rem) 0; }

  .factions-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 2vw, 1.4rem);
  }
  @media (min-width: 760px) {
    .factions-stack {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  .faction-card {
    background: var(--paper-deep);
    border: 1px solid var(--rule);
    padding: clamp(1.2rem, 2.5vw, 1.6rem);
    border-radius: 3px;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
    position: relative;
  }
  .faction-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
  .faction-card .num {
    font-family: var(--serif);
    font-style: italic;
    color: var(--ochre);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
  }
  .faction-card h4 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: var(--ink);
  }
  .faction-card p { margin: 0; font-size: 0.95em; }

  .factions-body {
    margin-top: clamp(1.5rem, 3vw, 2.2rem);
    max-width: 42rem;
  }

  /* ---------- Section: closing / no victory ---------- */
  section.closing-section {
    padding: clamp(4rem, 9vw, 7rem) 0 clamp(2rem, 5vw, 4rem);
    text-align: center;
  }
  section.closing-section .container {
    max-width: 42rem;
  }
  .closing-mark {
    display: inline-block;
    font-family: var(--serif);
    font-style: italic;
    color: var(--ochre);
    font-size: 1.5rem;
    margin: 0 0 1.2rem;
    letter-spacing: 0.1em;
  }
  .closing-text {
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.45;
    color: var(--ink);
    margin: 0;
    font-weight: 400;
    letter-spacing: -0.005em;
  }
  .closing-rule {
    display: block;
    width: 4rem;
    height: 1px;
    background: var(--rule);
    margin: 2rem auto 0;
  }

  /* ---------- Selection / focus ---------- */
  ::selection { background: var(--ochre-glow); color: var(--ink); }
  :focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; border-radius: 2px; }

  /* ---------- Reduced motion ---------- */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .flow-rail .rail-line,
    .flow-rail .rail-head { animation: none; }
  }

  /* ---------- Print ---------- */
  @media print {
    body { background: #fff; color: #000; }
    .principle, .diagram, .layer, .example, .callout, .faction-card, .geo-feature { background: #fff; }
    .progress, .theme-switch, .lang-switch, .lang-note, .flow-rail, .section-nav, .nav-toggle, .nav-backdrop, .tooltip { display: none !important; }
    .reveal { opacity: 1; transform: none; }
    main { padding-left: 0; }
  }

  /* ---------- Editorial context: original June vision vs. 0.25.1 ---------- */
  .vision-context { margin-top: 0; padding: 1.2rem 0; border-bottom: 1px solid var(--rule); background: var(--paper-deep); }
  .vision-context-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.8rem; }
  .vision-context-copy { max-width: 49rem; }
  .vision-context-kicker { margin: 0 0 0.15rem; font: 600 .64rem/1.5 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ochre-deep); }
  .vision-context-body { font: .84rem/1.62 var(--sans); margin: 0; color: var(--ink-soft); }
  .vision-context-link { font: 600 .72rem/1.5 var(--sans); color: var(--ochre-deep); letter-spacing: .04em; white-space: nowrap; text-decoration: none; border-bottom: 1px solid var(--ochre); padding-bottom: .2rem; }
  .vision-context-link:hover { color: var(--ink); }
  html[data-theme="dark"] .vision-context-kicker, html[data-theme="dark"] .vision-context-link { color: var(--ochre); }
  @media (max-width: 720px) { .vision-context-inner { align-items: flex-start; flex-direction: column; gap: .6rem; } .vision-context-link { white-space: normal; } }

  /* ---------- One continuous list: June vision, item by item ---------- */
  .status-section { padding: clamp(3.75rem, 8vw, 6rem) 0; background: var(--paper-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
  .status-intro { max-width: 48rem; margin-bottom: 1.4rem; }
  .status-intro .section-heading { max-width: 37ch; margin-bottom: 1rem; }
  .status-intro-text { font-size: .98em; line-height: 1.67; }
  .vision-list-summary { margin: 0 0 1rem; font: 500 .78rem/1.6 var(--sans); color: var(--ink-mute); }
  .vision-list { margin: 0; padding: 0; list-style: none; counter-reset: vision-item; border-top: 1px solid var(--rule-strong); }
  /* Goal text stays in the left column. The status is a visible, fixed right column. */
  .vision-list-item {
    position: relative;
    counter-increment: vision-item;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10.2rem;
    align-items: start;
    column-gap: clamp(1rem, 3vw, 2.4rem);
    padding: 1.28rem .55rem 1.35rem 3.2rem;
    border-bottom: 1px solid var(--rule);
    transition: background-color .2s var(--ease-out);
  }
  .vision-list-item:hover { background: var(--paper-card); }
  .vision-list-item::before { content: counter(vision-item, decimal-leading-zero); position: absolute; left: .1rem; top: 1.36rem; font: 600 .8rem/1.5 var(--sans); letter-spacing: .055em; color: var(--ink-mute); }
  .vision-list-copy { grid-column: 1; min-width: 0; }
  .vision-list-title { font: 600 clamp(1rem, 1.6vw, 1.15rem)/1.42 var(--serif); color: var(--ink); margin: 0; }
  .vision-list-detail { font-size: .88em; line-height: 1.58; color: var(--ink-soft); margin: .4rem 0 .35rem; }
  .vision-list-status {
    grid-column: 2;
    justify-self: stretch;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .55rem;
    min-height: 2.35rem;
    padding: .5rem .7rem;
    border-radius: 5px;
    border: 1px solid currentColor;
    font: 700 .66rem/1.3 var(--sans);
    letter-spacing: .05em;
    text-align: center;
    text-transform: uppercase;
  }
  .vision-list-status::before {
    content: '';
    display: inline-block;
    flex: 0 0 auto;
    width: .67rem;
    height: .67rem;
    border-radius: 50%;
    background: currentColor;
  }
  .vision-list-status--achieved { color: #126e47; background: rgba(28, 143, 92, .10); }
  .vision-list-status--partial { color: #895a08; background: rgba(226, 158, 22, .15); }
  .vision-list-status--unrealized { color: #a33d3d; background: rgba(198, 65, 65, .10); }
  html[data-theme="dark"] .vision-list-status--achieved { color: #80e4b2; background: rgba(38, 176, 109, .14); }
  html[data-theme="dark"] .vision-list-status--partial { color: #f6ca76; background: rgba(227, 163, 37, .13); }
  html[data-theme="dark"] .vision-list-status--unrealized { color: #ffaaaa; background: rgba(224, 80, 80, .15); }
  .status-evidence-link { display: inline-flex; align-items: baseline; gap: .4rem; max-width: 100%; font: 500 .65rem/1.4 var(--sans); color: var(--ink-mute); text-decoration: none; border-bottom: 1px dotted var(--rule-strong); }
  .status-evidence-file { overflow-wrap: anywhere; }
  .status-evidence-link:hover { color: var(--ochre); border-color: var(--ochre); }
  .status-evidence-arrow { white-space: nowrap; }
  .status-release-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: 3rem; }
  .status-release-panel { padding: clamp(1.35rem, 3vw, 1.8rem); background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--ochre); border-radius: 3px; }
  .status-release-panel--limit { border-left-color: var(--slate); }
  .status-release-heading { font: 600 1.13rem/1.3 var(--serif); color: var(--ink); margin: 0 0 .6rem; }
  .status-release-body { font-size: .9em; line-height: 1.65; margin: 0; }
  .status-sources { margin-top: 1.6rem; border-top: 1px dashed var(--rule-strong); padding-top: 1.3rem; }
  .status-sources-title { font: 600 .72rem/1.5 var(--sans); letter-spacing: .12em; color: var(--ink-mute); text-transform: uppercase; margin: 0 0 .4rem; }
  .status-sources-body { max-width: 53rem; font-size: .84em; line-height: 1.55; margin: 0 0 .65rem; }
  .status-release-link { font: 600 .7rem/1.4 var(--sans); color: var(--ochre-deep); text-decoration: none; border-bottom: 1px solid currentColor; }
  html[data-theme="dark"] .status-release-link { color: var(--ochre); }
  @media (max-width: 720px) {
    .status-release-notes { grid-template-columns: 1fr; }
    .vision-list-item { grid-template-columns: minmax(0, 1fr) 7.65rem; column-gap: .7rem; padding: 1.12rem .05rem 1.24rem 2.35rem; }
    .vision-list-item::before { top: 1.18rem; font-size: .7rem; }
    .vision-list-status { min-height: 2.2rem; padding: .42rem .25rem; gap: .3rem; font-size: .57rem; letter-spacing: .01em; }
    .vision-list-status::before { width: .57rem; height: .57rem; }
  }
  @media (max-width: 390px) {
    .vision-list-item { grid-template-columns: minmax(0, 1fr) 6.55rem; column-gap: .45rem; }
    .vision-list-status { font-size: .52rem; gap: .25rem; padding-inline: .2rem; }
  }
  @media print { .vision-context, .status-section { background: #fff; } .status-release-panel { background: #fff; } }


.mt-half{margin-top:0.5rem}
