/* Art-isms — paper, ink and a little De Stijl.
   Layout concept: an editorial field guide on warm paper; Mondrian appears only where it
   carries meaning (the masthead composition, the timeline's scale breaks, colour = region). */
:root {
  color-scheme: light;
  --paper: #f3efe5;
  --paper-deep: #e9e4d8;
  --mat: #e2dccd;
  --white: #fffdf7;
  --ink: #141414;
  --muted: #66625b;
  --hair: #c9c2b4;
  --red: #d52b1e;
  --blue: #1d4ed8;
  --blue-deep: #17388f;
  --yellow: #f3c623;

  --f-display: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --f-body: "Avenir Next", Avenir, Inter, "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --rule: 10px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --sidebar: 268px;
  --bar-h: 58px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px + env(safe-area-inset-top, 0px)); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--white); z-index: 40; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
button, select { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.mono, .kicker, .idx { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
:lang(zh) .kicker { letter-spacing: .06em; }
.pad { padding-left: var(--gutter); padding-right: var(--gutter-r); }
.wrap { max-width: 1440px; margin: 0 auto; }

/* ── Top bar ── */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--white); border-bottom: 2px solid var(--ink); }
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: var(--bar-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 21px; letter-spacing: -.02em; white-space: nowrap; }
.brand small { font-family: var(--f-body); font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 10px; white-space: nowrap; }
.lang { display: flex; flex: none; border: 2px solid var(--ink); }
.lang button { border: 0; background: transparent; padding: 5px 11px; font-size: 13px; font-weight: 700; cursor: pointer; min-width: 48px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
@media (max-width: 720px) { .nav { display: none; } .lang { margin-left: auto; } .brand small { display: none; } }

/* ── Masthead ── */
/* Masthead: same anatomy as the sibling site, Worldlines: copy on paper, a two-tone stacked title,
   a meta line with an arrow cue, and the art on the other side of a thick rule. */
.masthead { min-height: calc(86vh - var(--bar-h)); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); border-bottom: var(--rule) solid var(--ink); background: var(--paper); overflow: hidden; }
.mast-copy { padding: clamp(32px, 6vw, 96px) var(--gutter-r) clamp(32px, 5vw, 64px) max(var(--gutter), clamp(22px, 6vw, 96px)); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; border-right: var(--rule) solid var(--ink); }
.masthead h1 { font-family: var(--f-display); font-weight: 900; font-size: clamp(72px, 12vw, 180px); letter-spacing: -.085em; line-height: .72; margin: 0 0 36px; }
.masthead h1 span { display: block; }
.masthead h1 .red { color: var(--red); padding-left: .48em; }
:lang(zh) .masthead h1 { letter-spacing: -.02em; line-height: .95; font-size: clamp(72px, 11vw, 168px); }
.dek { max-width: 760px; font-family: var(--f-display); font-size: clamp(21px, 2.2vw, 32px); line-height: 1.16; }
:lang(zh) .dek { line-height: 1.45; }
.dek strong { color: var(--blue); }
.hero-meta { display: flex; align-items: end; justify-content: space-between; gap: 24px; font-size: 13px; font-weight: 700; }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.scroll-cue::before { content: "→"; font-size: 24px; color: var(--red); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 2px solid var(--ink); background: var(--white); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.solid { background: var(--ink); color: var(--white); }
.linkish { border: 0; padding: 0; background: none; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--red); }

/* Analytics consent bar: a card pinned to the bottom, offset shadow like a printed block */
.consent { position: fixed; z-index: 50; left: var(--gutter); right: var(--gutter-r); bottom: max(12px, env(safe-area-inset-bottom, 0px)); max-width: 720px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 14px 16px; background: var(--white); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); font-size: 14px; }
.consent p { flex: 1 1 260px; }
.consent-actions { display: flex; gap: 8px; }
.consent .btn { padding: 7px 14px; font-size: 14px; }
.btn:hover { background: var(--yellow); color: var(--ink); }

/* Masthead composition: Mondrian grid whose cells hold real works */
.mast-art { background: var(--ink); display: grid; gap: 8px;
  grid-template-columns: 1.3fr .7fr 1fr; grid-template-rows: 1.2fr .55fr 1fr; min-height: 520px; }
.mast-art .cell { position: relative; overflow: hidden; background: var(--white); }
.mast-art .cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.mast-art .cell img.ok { opacity: 1; }
.mast-art .cell.red { background: var(--red); } .mast-art .cell.blue { background: var(--blue); } .mast-art .cell.yellow { background: var(--yellow); }
.mast-art .c1 { grid-column: 1; grid-row: 1 / 3; } .mast-art .c2 { grid-column: 2 / 4; grid-row: 1; }
.mast-art .c3 { grid-column: 2; grid-row: 2; } .mast-art .c4 { grid-column: 3; grid-row: 2 / 4; }
.mast-art .c5 { grid-column: 1 / 3; grid-row: 3; }
.mast-art .cell button { position: absolute; inset: 0; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.mast-art .tag { position: absolute; left: 0; bottom: 0; background: var(--white); font-size: 11px; font-weight: 700; padding: 3px 7px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (max-width: 900px) {
  .masthead { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .mast-copy { border-right: 0; border-bottom: 8px solid var(--ink); min-height: 600px; }
  .mast-art { min-height: 380px; }
}
@media (max-width: 560px) {
  .masthead h1 { font-size: clamp(68px, 25vw, 118px); }
  .mast-copy { min-height: 560px; padding: 26px var(--gutter-r) 36px var(--gutter); }
  .hero-meta { align-items: start; flex-direction: column; }
}

/* ── Answer band ── */
.answer { background: var(--yellow); border-bottom: 3px solid var(--ink); }
.answer .wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 12px 48px; padding-block: 28px; }
.answer h2 { font-family: var(--f-display); font-size: 28px; line-height: 1.1; letter-spacing: -.02em; }
.answer .body { display: grid; gap: 10px; max-width: 78ch; font-weight: 500; }
.answer .body p:last-child { font-size: 14px; }
@media (max-width: 760px) { .answer .wrap { grid-template-columns: 1fr; } }

/* ── Section heads ── */
.block { padding-block: 64px 8px; }
.head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 48px; align-items: end; margin-bottom: 22px; }
.head h2 { font: 900 clamp(40px, 5.6vw, 80px)/.92 var(--f-display); letter-spacing: -.05em; }
:lang(zh) .head h2 { letter-spacing: -.01em; line-height: 1.1; }
.head p { color: var(--muted); max-width: 62ch; }
@media (max-width: 760px) { .head { grid-template-columns: 1fr; } }

/* ── Timeline ── */
.tl-scroll { overflow-x: auto; border: 3px solid var(--ink); background: var(--white); }
.tl { --label: 232px; position: relative; min-width: 960px; }
.tl-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); min-height: 28px; }
.tl-row + .tl-row { border-top: 1px solid var(--paper-deep); }
.tl-name { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 3px 10px; border: 0; border-right: 3px solid var(--ink); background: var(--white); text-align: left; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.tl-name .n { font-family: var(--f-mono); font-size: 11px; color: var(--muted); width: 18px; flex: none; }
.sw { width: 10px; height: 10px; flex: none; border: 1.5px solid var(--ink); }
.g-west { --g: var(--red); } .g-asia { --g: var(--blue); } .g-africa { --g: var(--yellow); } .g-deep { --g: var(--ink); }
.sw { background: var(--g); }
.tl-track { position: relative; height: 28px; }
.tl-bar { position: absolute; top: 7px; height: 14px; min-width: 6px; border: 1.5px solid var(--ink); background: var(--g); padding: 0; cursor: pointer; }
.tl-bar.living { background: repeating-linear-gradient(135deg, var(--g) 0 6px, var(--white) 6px 9px); }
.tl-axis { position: sticky; top: 0; z-index: 4; background: var(--white); border-bottom: 3px solid var(--ink); }
.tl-axis .tl-name { cursor: default; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.tl-axis .tl-track { height: 40px; }
.tick { position: absolute; bottom: 6px; transform: translateX(-50%); font-family: var(--f-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tick.l { transform: none; padding-left: 4px; } .tick.r { transform: translateX(-100%); padding-right: 4px; }
.tl-rules { position: absolute; top: 0; bottom: 0; left: var(--label); right: 0; pointer-events: none; z-index: 1; }
.tl-rules .r { position: absolute; top: 0; bottom: 0; width: 4px; background: var(--ink); transform: translateX(-50%); }
.tl-rules .g { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--paper-deep); }
.tl-row.dim .tl-bar { opacity: .18; } .tl-row.dim .tl-name { color: #a39d92; }
.tl-row.out .tl-bar { opacity: .14; } .tl-row.out .tl-name { color: #b0aa9f; } .tl-row.out .tl-name .sw { opacity: .35; }
.tl-row.rel .tl-name { background: var(--yellow); }
.tl-row.focus .tl-name { background: var(--ink); color: var(--white); }
.tl-row.focus .tl-name .n { color: var(--hair); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 22px; height: 12px; border: 1.5px solid var(--ink); background: var(--g); }
.legend i.hatch { --g: var(--hair); background: repeating-linear-gradient(135deg, var(--muted) 0 5px, var(--white) 5px 8px); }
.legend i.rule { background: var(--ink); width: 6px; }
.hint { display: none; margin-top: 8px; font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
@media (max-width: 960px) { .hint { display: block; } .tl { --label: 168px; } .tl-name { font-size: 12px; } }

/* ── Filter bar: sticky inside the Styles section, so it leaves with it ── */
.atlas { padding-top: 40px; }
.fbar { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--paper); border-block: 2px solid var(--ink); margin-bottom: 8px; }
/* Desktop: era strip, results and Reset on the first row; regions get the whole second row. */
.fbar-in { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding-block: 10px; }
.fb-toggle { display: none; }
.fb-panel { display: contents; }
.fb-era { flex: 1 1 0; min-width: 0; } .fb-reg { flex: 1 1 100%; order: 3; }
.fb-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fb-h { flex: none; width: 56px; font-family: var(--f-mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.fb-count { order: 1; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fb-reset { order: 2; border: 2px solid var(--ink); background: var(--white); padding: 4px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.fb-reset:hover:not(:disabled) { background: var(--ink); color: var(--white); }
.fb-reset:disabled { opacity: .4; cursor: default; }
.ct { font-family: var(--f-mono); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Era: a segmented strip in time order, ruled like the timeline, with an arrow for "later" */
.eras { position: relative; flex: 1; min-width: 0; margin-right: 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; border: 2px solid var(--ink); background: var(--ink); }
.eras::after { content: ""; position: absolute; top: 50%; right: -13px; transform: translateY(-50%); border-left: 10px solid var(--ink); border-block: 8px solid transparent; }
.seg { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n ct" "s ct"; align-items: center; gap: 1px 6px; min-height: 46px; padding: 5px 9px; border: 0; background: var(--white); text-align: left; cursor: pointer; }
.seg-n { grid-area: n; font-size: 13px; font-weight: 700; line-height: 1.15; }
.seg-s { grid-area: s; font-family: var(--f-mono); font-size: 11px; color: var(--muted); }
.seg .ct { grid-area: ct; }
.seg:hover { background: var(--paper-deep); }
.seg.none:not([aria-pressed="true"]) { color: #a39d92; }
.seg[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.seg[aria-pressed="true"] .seg-s { color: var(--hair); }

/* Region toggle: also the colour legend (shared with the timeline legend) */
.regions { display: flex; flex-wrap: wrap; gap: 6px; }
.rt { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--ink); background: var(--white); padding: 4px 9px; font-size: 13px; font-weight: 600; line-height: 1.25; text-align: left; color: var(--ink); cursor: pointer; }
.rt i { flex: none; width: 22px; height: 12px; border: 1.5px solid var(--ink); background: var(--g); }
.rt .ct { color: var(--muted); }
.rt:hover { background: var(--paper-deep); }
.rt[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.rt[aria-pressed="true"] i { border-color: var(--white); }
.rt[aria-pressed="true"] .ct { color: var(--hair); }
.seg:focus-visible, .rt:focus-visible { outline: 3px solid var(--blue); outline-offset: -5px; }
.seg[aria-pressed="true"]:focus-visible, .rt[aria-pressed="true"]:focus-visible { outline-color: var(--yellow); }
.legend .regions { gap: 6px; }
/* Mid widths: drop the visible captions (still read out via aria-labelledby) so both rows fit. */
@media (min-width: 901px) and (max-width: 1180px) {
  .fb-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (max-width: 900px) {
  .fbar-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "tog count reset" "panel panel panel"; gap: 8px 12px; padding-block: 8px; }
  .fb-count { grid-area: count; } .fb-reset { grid-area: reset; }
  .fb-toggle { grid-area: tog; display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--ink); background: var(--white); padding: 5px 11px; font-size: 13px; font-weight: 700; cursor: pointer; }
  .fb-toggle::after { content: "▾"; margin-left: 4px; }
  .fb-toggle[aria-expanded="true"] { background: var(--ink); color: var(--white); }
  .fb-toggle[aria-expanded="true"]::after { content: "▴"; }
  .fb-panel { grid-area: panel; display: none; min-width: 0; }
  .fbar[data-open="true"] .fb-panel { display: grid; gap: 12px; max-height: calc(100dvh - var(--bar-h) - 72px); overflow-y: auto; padding-bottom: 6px; }
  .fb-group { flex-direction: column; align-items: stretch; gap: 6px; }
  .eras { margin-right: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eras::after { display: none; }
  .fb-panel .regions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .fb-panel .rt .ct { margin-left: auto; }
}

/* ── Atlas: sidebar + sections ── */
.atlas > .wrap { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 0 48px; align-items: start; }
.side { position: sticky; top: calc(var(--bar-h) + var(--fbar-h, 0px) + env(safe-area-inset-top, 0px)); max-height: calc(100dvh - var(--bar-h) - var(--fbar-h, 0px) - env(safe-area-inset-top, 0px)); overflow-y: auto; padding: 20px 14px 32px 0; border-right: 1px solid var(--hair); scrollbar-width: thin; }
.side h3 { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--hair); text-decoration: none; font-size: 13px; line-height: 1.3; }
.toc a .idx { color: var(--muted); font-size: 11px; padding-top: 2px; }
.toc a b { font-weight: 650; display: block; }
.toc a small { color: var(--muted); }
.toc a[aria-current="true"] b { color: var(--red); }
.jump { display: none; }
.empty { padding: 32px 0; color: var(--muted); }
.seo-works { margin: 0 0 0 80px; padding-left: 18px; font-size: 14px; } /* static fallback only; app.js replaces it */
@media (max-width: 1000px) {
  .atlas > .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; overflow: visible; border-right: 0; padding: 0 0 8px; }
  .toc { display: none; }
  .jump { display: block; width: 100%; padding: 8px 10px; border: 2px solid var(--ink); background: var(--white); font-weight: 600; }
}

/* ── Movement section ── */
.mv { padding: 56px 0 40px; border-bottom: 2px solid var(--ink); scroll-margin-top: calc(var(--fbar-h, 0px) - 4px); } /* adds to html's scroll-padding (top bar + 12px) */
.mv:first-child { padding-top: 24px; }
.mv-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; margin-bottom: 22px; }
.mv-head .idx { font-size: 18px; font-weight: 700; color: var(--red); padding-top: 10px; }
.mv-head h2 { font-family: var(--f-display); font-size: clamp(34px, 4.6vw, 62px); font-weight: 800; line-height: .98; letter-spacing: -.04em; }
:lang(zh) .mv-head h2 { letter-spacing: 0; font-weight: 900; }
.mv-head h2 .alt { font-family: var(--f-body); font-size: .42em; font-weight: 700; letter-spacing: -.01em; color: var(--muted); margin-left: .35em; white-space: nowrap; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 10px; font-size: 14px; }
.meta-row .yrs { color: var(--blue-deep); font-weight: 750; }
.meta-row .grp { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.meta-row .home { background: var(--ink); color: var(--white); font-size: 11px; font-weight: 700; padding: 2px 7px; }
.mv-head .idea { font-family: var(--f-display); font-style: italic; font-size: 20px; margin-top: 10px; max-width: 40em; }
:lang(zh) .mv-head .idea { font-style: normal; }
.mv-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 40px; margin: 0 0 26px 80px; }
.summary { max-width: 68ch; }
.facts { display: grid; gap: 14px; align-content: start; }
.facts h4 { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.traits li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.traits li::before { content: ""; width: 8px; height: 8px; background: var(--g); border: 1px solid var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 5px; }
.lk { border: 1.5px solid var(--ink); background: var(--white); padding: 2px 9px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.lk:hover { background: var(--yellow); color: var(--ink); }
.none { font-size: 13px; color: var(--muted); }
@media (max-width: 1180px) { .mv-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .mv-head { grid-template-columns: 1fr; gap: 4px; } .mv-head .idx { padding-top: 0; } .mv-body { margin-left: 0; } .mv-head h2 .alt { display: block; margin: 6px 0 0; white-space: normal; } }

/* ── Work cards ── */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--white); border: 1px solid var(--hair); display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.frame { position: relative; height: 300px; background: var(--mat); border-bottom: 1px solid var(--hair); overflow: hidden; }
.frame > button { position: absolute; inset: 0; border: 0; padding: 14px; background: transparent; cursor: zoom-in; display: grid; place-items: center; }
.frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.12); opacity: 0; transition: opacity .35s ease; }
.frame img.ok { opacity: 1; }
.frame .spin { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.frame.ready .spin { display: none; }
.frame.plate { background: var(--ink); }
.frame.plate svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame.plate .why { position: absolute; left: 12px; right: 12px; bottom: 12px; background: var(--white); border: 2px solid var(--ink); padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; line-height: 1.35; }
.frame.plate .why b { font-size: 12px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.frame.plate .why a { font-weight: 700; }
.card-copy { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.card-copy h3 { font-family: var(--f-display); font-size: 20px; line-height: 1.15; letter-spacing: -.01em; }
.card-copy .by { font-size: 14px; font-weight: 650; }
.card-copy .where { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.card-copy .look { font-size: 13px; color: var(--blue-deep); }
.card-copy .look b { font-weight: 700; }
.card-copy .note { font-size: 14px; }
.card-copy .credit { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; }
/* Work titles link to Wikipedia: underline grows in and ↗ appears on hover/focus; always shown on touch screens. */
.wl { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .2s ease; }
.wl:hover, .wl:focus-visible { background-size: 100% 2px; }
.wl .go { display: inline-block; color: var(--blue); font-size: .72em; opacity: 0; transform: translate(-3px, 1px); transition: opacity .2s ease, transform .2s ease; }
.wl .go small { font-family: var(--f-mono); font-size: .7em; letter-spacing: .04em; margin-left: 3px; }
.wl:hover .go, .wl:focus-visible .go { opacity: 1; transform: translate(0, 0); }
@media (hover: none) { .wl { background-size: 100% 1px; } .wl .go { opacity: 1; transform: none; } }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Why styles change ── */
.engines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; background: var(--ink); border: 8px solid var(--ink); }
.eng { padding: 24px; display: grid; gap: 12px; align-content: start; }
.eng.red { background: var(--red); color: var(--white); } .eng.blue { background: var(--blue); color: var(--white); } .eng.yellow { background: var(--yellow); }
.eng h3 { font-family: var(--f-display); font-size: 30px; letter-spacing: -.02em; }
.eng .links .lk { background: transparent; border-color: currentColor; color: inherit; }
.eng .links .lk:hover { background: var(--white); color: var(--ink); }
.caveat { grid-column: 1 / -1; background: var(--white); padding: 18px 24px; font-size: 15px; }
.caveat b { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-right: 10px; }
.names { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.names > div { background: var(--white); padding: 14px 16px; display: grid; gap: 4px; align-content: start; font-size: 13px; }
.names > div:first-child { background: var(--paper-deep); }
.names .lk { justify-self: start; font-family: var(--f-display); font-size: 17px; border: 0; padding: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.names .lk:hover { background: none; color: var(--red); }
@media (max-width: 900px) { .engines { grid-template-columns: minmax(0, 1fr); } .names { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── How to study ── */
/* "How to look": the dark learning band, as on Worldlines */
.learning { padding-block: clamp(48px, 7vw, 100px); background: var(--ink); color: var(--white); }
.learning h2 { font: 900 clamp(40px, 6.5vw, 92px)/.9 var(--f-display); letter-spacing: -.055em; margin: 0 0 18px; max-width: 920px; }
:lang(zh) .learning h2 { letter-spacing: -.01em; line-height: 1.1; }
.learning-lede { color: #c8c1b4; margin-bottom: 40px; max-width: 62ch; }
.learning-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid #787469; }
.learning-grid li { padding: 22px 22px 22px 0; display: grid; gap: 8px; align-content: start; }
.learning-grid li + li { padding-left: 22px; border-left: 1px solid #787469; }
.learning-grid .n { color: var(--yellow); font: 700 12px/1 var(--f-mono); letter-spacing: .1em; }
.learning-grid b { font: 800 22px/1.05 var(--f-display); }
.learning-grid p { color: #c8c1b4; font-size: 14px; }
@media (max-width: 900px) {
  .learning-grid { grid-template-columns: minmax(0, 1fr); }
  .learning-grid li + li { padding-left: 0; border-left: 0; border-top: 1px solid #787469; }
}

/* ── Footer ── */
footer { background: var(--white); border-top: var(--rule) solid var(--ink); }
footer .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 40px; padding-block: 36px 48px; font-size: 14px; }
footer h3 { font-family: var(--f-display); font-size: 19px; margin-bottom: 6px; }
footer p + p { margin-top: 8px; }
@media (max-width: 900px) { footer .wrap { grid-template-columns: minmax(0, 1fr); } }

/* ── Image viewer ── */
dialog#viewer { width: min(1200px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; border: 3px solid var(--ink); background: var(--white); }
dialog#viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
dialog#viewer::backdrop { background: rgba(20, 20, 20, .78); }
.v-img { background: var(--mat); display: grid; place-items: center; padding: 16px; min-height: 0; max-height: calc(100dvh - 30px); }
.v-img img { max-width: 100%; max-height: calc(100dvh - 64px); object-fit: contain; }
.v-copy { padding: 22px; display: grid; gap: 8px; align-content: start; overflow-y: auto; border-left: 3px solid var(--ink); }
.v-copy h3 { font-family: var(--f-display); font-size: 26px; line-height: 1.1; }
.v-close { justify-self: end; border: 2px solid var(--ink); background: var(--white); width: 40px; height: 40px; font-size: 18px; font-weight: 700; cursor: pointer; }
.v-close:hover { background: var(--yellow); }
@media (max-width: 760px) { dialog#viewer[open] { grid-template-columns: minmax(0, 1fr); overflow-y: auto; } .v-copy { border-left: 0; border-top: 3px solid var(--ink); } .v-img img { max-height: 60dvh; } }
html.modal-open { overflow: hidden; }
