:root {
  color-scheme: light;
  --sea: #111f28;
  --paper: #e8e4da;
  --ink: #202e33;
  --muted: #52605c;
  --line: #b9bfb3;
  --lamp: #d8af78;
  --serif: Georgia, "Songti SC", SimSun, serif;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: .23em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid #9c582c; outline-offset: 4px; }
.wrap { width: min(90%, 66rem); margin-inline: auto; }
.masthead { background: var(--sea); color: var(--paper); }
.bar { min-height: 5.35rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.bar a { text-decoration: none; }
.brand { font: 600 1.35rem/1.3 var(--serif); letter-spacing: .06em; }
.bar nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
#language-toggle { font: inherit; font-size: .9rem; color: var(--paper); background: transparent; border: 1px solid #81908a; border-radius: 2px; padding: .45rem .8rem; cursor: pointer; }
.bar :focus-visible { outline-color: var(--lamp); }
.article { width: min(90%, 43rem); flex: 1; padding-block: clamp(2.7rem, 7vw, 5.75rem); }
.article h1 { margin: 0 0 1.5rem; font: 400 clamp(2.15rem, 5.6vw, 3.6rem)/1.22 var(--serif); letter-spacing: -.035em; overflow-wrap: anywhere; }
.article h2 { margin: 2.1rem 0 .55rem; font: 600 1.28rem/1.45 var(--serif); }
.article p, .article li { font-size: 1.035rem; line-height: 1.9; overflow-wrap: anywhere; }
.article p { margin: .55rem 0 1rem; }
.article ul, .article ol { padding-inline-start: 1.45rem; }
.article a, .page-footer a { color: #28564f; }
.article .lead, .article .intro { color: var(--muted); font-size: 1.14rem; }
.page-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; font-size: .9rem; line-height: 1.65; padding-block: 1.5rem 2rem; border-top: 1px solid var(--line); }
.page-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 500px) {
  .bar { min-height: 4.5rem; gap: .55rem; }
  .brand { font-size: 1.15rem; }
  .bar nav { gap: .6rem; }
  .article { padding-block: 2.65rem; }
}

/* ---- 2026-11 refinement: project pages ---- */
:root { --mono: "Cascadia Code", Consolas, monospace; --amber-deep: #7a4f17; --red: #a4472f; }
h1, h2, h3 { text-wrap: balance; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand svg { width: 20px; height: 28px; color: var(--lamp); flex: none; }
.bar-nav a { font-size: .85rem; color: #c8cfcd; transition: color .2s; }
.bar-nav a:hover { color: var(--lamp); }
#language-toggle { transition: color .2s, border-color .2s; }
#language-toggle:hover { color: var(--lamp); border-color: var(--lamp); }

/* Each project opens on the night side, then reads on paper. */
.project .bar { border-bottom: 1px solid #3b4b50; }
.page-hero { padding-block: clamp(2.4rem, 6vw, 4.2rem) clamp(2.2rem, 5vw, 3.4rem); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-hero > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.page-hero h1 { animation-delay: .08s; }
.page-hero .what { animation-delay: .16s; }
.page-hero .facts { animation-delay: .26s; }
.tier { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.4rem; font: .69rem/1.5 var(--mono); letter-spacing: .15em; color: var(--lamp); }
.tier:before { content: ""; width: 26px; height: 1px; background: var(--lamp); }
.page-hero h1 { margin: 0; max-width: 20em; font: 400 clamp(2.3rem, 6vw, 4rem)/1.18 var(--serif); letter-spacing: -.02em; overflow-wrap: anywhere; }
.what { max-width: 38rem; margin: 1rem 0 0; font-size: 1.08rem; line-height: 1.75; color: #c8cfcd; }
.facts { display: grid; grid-template-columns: auto 1fr; max-width: 38rem; margin: 2rem 0 0; border-top: 1px solid #3b4b50; }
.facts div { display: contents; }
.facts dt { padding: .7rem 1.6rem .7rem 0; border-bottom: 1px solid #3b4b50; font: .66rem/1.9 var(--mono); letter-spacing: .12em; color: #a3b1b3; white-space: nowrap; }
.facts dd { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .6rem 0; border-bottom: 1px solid #3b4b50; font-size: .9rem; line-height: 1.6; }

.lamp { display: inline-block; flex: none; width: 8px; height: 8px; border: 1.3px solid currentColor; border-radius: 50%; }
.st-on .lamp { background: #c98f3f; border-color: #c98f3f; box-shadow: 0 0 0 3px #d8af7838; }
.st-done .lamp { background: currentColor; }
.st-part .lamp { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.st-prog .lamp { border-style: dotted; }
.st-fail .lamp { border-color: #cf7a62; border-style: dashed; }
.masthead .st-part .lamp, .masthead .st-on .lamp { border-color: var(--lamp); color: var(--lamp); }

/* Reading */
.project .article { width: min(90%, 46rem); padding-block: clamp(2.4rem, 6vw, 4.4rem) 2rem; }
.project .article .lead { margin: 0 0 1.6rem; padding-left: 1.3rem; border-left: 3px solid var(--lamp); color: var(--ink); font-size: 1.1rem; line-height: 1.95; }
.project .article h2 { margin: 3.2rem 0 1rem; padding-top: 1.3rem; border-top: 1px solid var(--ink); font: 400 1.7rem/1.35 var(--serif); }
.blk { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); column-gap: 1.6rem; padding: 1.15rem 0 .5rem; border-top: 1px solid var(--line); }
.blk + .blk { margin-top: 0; }
.blk-label { margin: .32rem 0 0; font: 600 .95rem/1.6 var(--serif); color: var(--ink); }
html[lang="en"] .blk { grid-template-columns: 8.2rem minmax(0, 1fr); }
.blk p { margin: 0 0 .7rem; }
.case { margin: 1.6rem 0; padding: 1.1rem 1.4rem .4rem; border: 1px solid var(--line); border-left: 3px solid var(--amber-deep); background: #f1eee6; }
.case h3 { margin: 0 0 .3rem; font: 600 1rem/1.6 var(--serif); }
.case p { font-size: .97rem; }

.stances { list-style: none; counter-reset: stance; margin: 1.6rem 0; padding: 0; border-top: 1px solid var(--ink); }
.stances li { counter-increment: stance; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: .6rem; padding: 1rem 0 .4rem; border-bottom: 1px solid var(--line); }
.stances li:before { content: counter(stance, decimal-leading-zero); grid-row: span 2; padding-top: .35rem; font: .7rem var(--mono); color: var(--amber-deep); }
.stances h3 { margin: 0; font: 600 1.12rem/1.6 var(--serif); }
.stances p { margin: .15rem 0 .6rem; font-size: .98rem; }
.open { list-style: none; margin: 1rem 0; padding: 0; border-top: 1px solid var(--line); }
.open li { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.open b { margin-right: .35em; font-family: var(--serif); }
.closing { font-family: var(--serif); font-style: italic; color: var(--muted); }
.points { list-style: none; margin: 0; padding: 0 !important; border-top: 1px solid var(--line); }
.points li { padding: .9rem 0; border-bottom: 1px solid var(--line); }

figcaption { margin: 0 0 .6rem; font-size: .84rem; line-height: 1.6; color: var(--muted); }
figcaption b { margin-right: .7em; font: 600 .74rem var(--mono); letter-spacing: .08em; color: var(--ink); }
.tbl { margin: 1.8rem 0; }
.tbl-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.62; }
thead th { padding: .55rem 1rem .55rem 0; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); font: 500 .72rem/1.5 var(--mono); letter-spacing: .08em; text-align: left; color: var(--muted); }
td { padding: .7rem 1rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
td:first-child { font-family: var(--serif); font-weight: 600; white-space: nowrap; }
td:last-child, thead th:last-child { padding-right: 0; }
td.st { min-width: 9.5em; }
td.st .lamp { margin-right: .55rem; }
td.st-fail span { color: var(--red); }

.arch-fig { margin: 1.8rem 0 2rem; }
.arch-fig figcaption { margin: .75rem 0 0; }
.arch { border: 1px solid var(--ink); background: #f1eee6; }
.arch-stance { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1.3rem; padding: .75rem 1.1rem; background: var(--sea); color: var(--paper); font-size: .86rem; line-height: 1.6; }
.arch-stance b { font: .68rem var(--mono); letter-spacing: .2em; color: var(--lamp); }
.arch-stance ul { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0 !important; }
.arch-stance li { font-size: .86rem !important; line-height: 1.6 !important; }
.arch-stance li + li:before { content: "·"; margin: 0 .65rem; color: var(--lamp); }
.arch-tracks { display: grid; grid-template-columns: minmax(0, 5fr) auto minmax(0, 9fr); padding: 1.1rem; }
.track { padding: 1rem; border: 1px solid var(--muted); }
.track-learn { border-style: dashed; }
.track h4 { margin: 0; font: 600 1rem/1.4 var(--serif); }
.track > p { margin: .1rem 0 .85rem !important; font-size: .78rem !important; line-height: 1.5 !important; color: var(--muted); }
.node { display: block; padding: .5rem .3rem; border: 1px solid #9aa19b; background: var(--paper); font-size: .8rem; line-height: 1.4; text-align: center; text-decoration: none; color: var(--ink) !important; transition: border-color .2s, color .2s; }
.node:hover { border-color: var(--amber-deep); color: var(--amber-deep) !important; }
.track-learn .node + .node { margin-top: .6rem; }
.arch-meet { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .3rem; padding: 0 .85rem; font-size: .75rem; line-height: 1.4; color: var(--muted); text-align: center; }
.arch-meet i { font-style: normal; color: var(--amber-deep); letter-spacing: 3px; }
.layers { margin: 0; display: grid; gap: .6rem; }
.layers div { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .75rem; align-items: center; }
.layers dt { font-size: .78rem; line-height: 1.4; color: var(--muted); }
.layers dd { margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .4rem; }

.next-card { display: grid; gap: .5rem; margin: 3rem 0 0; padding: 1.4rem 1.5rem; background: var(--sea); color: var(--paper) !important; text-decoration: none; transition: background .25s; }
.next-card:hover { background: #17303b; }
.next-card .kicker { font: .68rem var(--mono); letter-spacing: .18em; color: var(--lamp); }
.next-card strong { font: 400 1.3rem/1.5 var(--serif); }
.next-card .go { font-size: .85rem; color: #c8cfcd; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; width: min(90%, 46rem); margin-top: 2.4rem; padding-block: 1.3rem; border-top: 1px solid var(--ink); }
.pager a { color: var(--ink); text-decoration: none; transition: color .2s; }
.pager a:hover { color: var(--amber-deep); }
.pg-prev, .pg-next { display: grid; gap: .2rem; }
.pg-next { text-align: right; }
.pager small { font: .66rem var(--mono); letter-spacing: .14em; color: var(--muted); }
.pager b { font: 600 1.05rem/1.5 var(--serif); }
.pg-prev b:before { content: "← "; font-weight: 400; }
.pg-next b:after { content: " →"; font-weight: 400; }
.pg-home { align-self: center; padding: .5rem 1rem; border: 1px solid var(--line); font-size: .82rem; }
.pg-home:hover { border-color: var(--amber-deep); }
.project .page-footer { width: min(90%, 46rem); border-top: 0; padding-top: .6rem; }

@media (max-width: 640px) {
  .bar-nav { display: none; }
  .blk, html[lang="en"] .blk { grid-template-columns: minmax(0, 1fr); }
  .blk-label { margin: 0 0 .2rem; }
  .arch-tracks { grid-template-columns: minmax(0, 1fr); }
  .arch-meet { flex-direction: row; padding: .6rem 0; }
  .layers div { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .layers dd { grid-auto-flow: row; }
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tr { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:first-child { border-top: 1.5px solid var(--ink); }
  .tbl tbody tr:last-child { border-bottom: 1.5px solid var(--ink); }
  .tbl td, .tbl tbody tr:last-child td { padding: .12rem 0; border: 0; white-space: normal; }
  .tbl td:not(:first-child):before { content: attr(data-label); display: inline-block; min-width: 5.2em; margin-right: .6rem; font: .68rem var(--mono); letter-spacing: .06em; color: var(--muted); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pg-home { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
.asof { width: min(90%, 46rem); margin: 1.6rem auto 0; font: .72rem/1.6 var(--mono); letter-spacing: .04em; color: var(--muted); }

/* ---- notes (src/notes): one reading told plainly; headings carry a small step label, figures stay pixel-sharp ---- */
.article h2 .step { display: block; margin-bottom: .2rem; font: .68rem/1.6 var(--mono); letter-spacing: .16em; color: var(--amber-deep); }
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; margin: 1.3rem 0; }
.roles div { padding: .95rem 1.15rem .2rem; border: 1px solid var(--line); background: #f1eee6; }
.roles b { display: block; font: 600 1.12rem/1.5 var(--serif); }
.roles p { margin: .3rem 0 .75rem; font-size: .97rem; }
.plates { margin: 1.6rem 0 1.8rem; }
.plate { margin: 0 0 1rem; }
.plate img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: #fff; image-rendering: pixelated; }
.plate span { display: block; margin-top: .35rem; font: .68rem/1.6 var(--mono); letter-spacing: .1em; color: var(--muted); }
.plates figcaption, .tally figcaption { margin: .3rem 0 0; }
.article .parable { margin: 1.5rem 0 1rem; padding: .15rem 0 .15rem 1.2rem; border-left: 3px solid var(--amber-deep); font-family: var(--serif); font-size: 1.12rem; }
.tally { margin: 1.6rem 0; padding: .9rem 1.2rem .7rem; border: 1px solid var(--line); background: #f1eee6; }
.tally-row { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) 2.4rem; gap: .9rem; align-items: center; padding: .35rem 0; font-size: .9rem; line-height: 1.5; }
.tally-row svg { display: block; width: 100%; height: 12px; }
.tally-row rect { fill: var(--red); }
.tally-row.all rect { fill-opacity: .45; }
.tally-row.usual rect { fill: #28564f; }
.tally-row b { font: 600 1rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .tally-row { grid-template-columns: minmax(0, 1fr) 2.4rem; row-gap: .3rem; }
  .tally-row span { grid-column: 1; grid-row: 1; }
  .tally-row b { grid-column: 2; grid-row: 1; }
  .tally-row svg { grid-column: 1 / -1; grid-row: 2; }
}

/* ---- going between pages: the old page dissolves into the new one (home.css carries the same rule) ---- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .36s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }

/* ---- a hairline along the top edge shows how far down the page the reader is: rust where it has been, lamp light
   at the leading end, so it still reads on the pale paper ---- */
@supports (animation-timeline: scroll()) {
  body.project:before { content: ""; position: fixed; inset: 0 0 auto; z-index: 5; height: 2px; background: linear-gradient(90deg, #9c582c, var(--lamp)); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; animation: reading linear both; animation-timeline: scroll(root); }
  @keyframes reading { to { transform: scaleX(1); } }
}

/* ---- print: paper drops the night-blue panels, so their words turn to ink; status lamps keep their colour ---- */
@media print {
  @page { margin: 16mm 15mm; }
  *, *:before, *:after { animation: none !important; transition: none !important; box-shadow: none !important; }
  :root, body, .case, .arch, .roles div, .tally { background: #fff !important; }
  .tally-row rect { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .masthead, .arch-stance, .next-card { background: none !important; color: var(--ink) !important; }
  .masthead *, .arch-stance *, .next-card * { color: inherit !important; border-color: var(--line) !important; }
  .arch-stance { border-bottom: 1px solid var(--ink); }
  .next-card { border: 1px solid var(--line); }
  .lamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bar-nav, #language-toggle, .pager, body.project:before { display: none !important; }
  .bar { min-height: 0; }
  .page-hero { padding-block: 2mm 6mm !important; border-bottom: 1px solid var(--line); }
  .article { width: auto; padding-block: 8mm 0; }
  .article a { color: inherit; }
  .tbl-scroll { overflow: visible !important; }
  .case, .arch, figure, tr, .roles div, .plate { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
}
