Repository navigation
Expand file tree
/
Copy pathstyle.css
More file actions
342 lines (321 loc) · 22.1 KB
/
Copy pathstyle.css
File metadata and controls
342 lines (321 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/* =========================================================
A research notebook: graph paper by day, blackboard by night.
Serif for reading, handwriting only for the margins.
========================================================= */
:root {
--paper: #fbf8f1;
--grid: rgba(70, 110, 170, .13);
--margin-line: rgba(200, 60, 60, .45);
--ink: #1f2a44; /* blue-black fountain pen */
--ink-2: #4a5570;
--pencil: #75756e;
--red: #c0392b; /* correcting pen */
--hl: rgba(255, 214, 0, .55);
--tape: rgba(236, 222, 170, .8);
--polaroid: #ffffff;
--card: rgba(255, 255, 255, .6);
--line: rgba(31, 42, 68, .16);
--code-bg: rgba(255, 255, 255, .72);
--serif: "Source Serif 4", Georgia, "Songti SC", "STSong", "Noto Serif SC", serif;
--hand: "Caveat", "Long Cang", "Kaiti SC", cursive;
--hand-zh: "Caveat", "Long Cang", "Kaiti SC", cursive; /* Caveat for Latin/digits/§, Long Cang for CJK */
--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
color-scheme: light;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--paper: #1e2a24; --grid: rgba(255, 255, 255, .045); --margin-line: rgba(255, 150, 140, .25);
--ink: #ecebe4; --ink-2: #c3c7bd; --pencil: #979d93; --red: #f4a49a;
--hl: rgba(255, 230, 120, .28); --tape: rgba(230, 220, 190, .35); --polaroid: #e9e6dc;
--card: rgba(255, 255, 255, .04); --line: rgba(236, 235, 228, .16); --code-bg: rgba(0, 0, 0, .22);
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--paper: #1e2a24; --grid: rgba(255, 255, 255, .045); --margin-line: rgba(255, 150, 140, .25);
--ink: #ecebe4; --ink-2: #c3c7bd; --pencil: #979d93; --red: #f4a49a;
--hl: rgba(255, 230, 120, .28); --tape: rgba(230, 220, 190, .35); --polaroid: #e9e6dc;
--card: rgba(255, 255, 255, .04); --line: rgba(236, 235, 228, .16); --code-bg: rgba(0, 0, 0, .22);
color-scheme: dark;
}
html[data-lang="zh"] .en { display: none !important; }
html:not([data-lang="zh"]) .zh { display: none !important; }
/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
margin: 0; color: var(--ink); font-family: var(--serif); font-size: 17.5px; line-height: 1.7;
background-color: var(--paper);
background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
background-size: 24px 24px;
-webkit-font-smoothing: antialiased;
}
html[data-lang="zh"] body { line-height: 1.9; }
a { color: inherit; text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px dashed var(--red); outline-offset: 3px; }
::selection { background: var(--hl); }
p { margin: 0 0 14px; }
b, strong { font-weight: 600; }
.hand { font-family: var(--hand); }
html[data-lang="zh"] .hand { font-family: var(--hand-zh); }
/* ---------- sheet: margin | text | marginalia ---------- */
.sheet { max-width: 1080px; margin: 0 auto; padding: 30px 28px 80px; position: relative; }
.sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 92px; width: 2px; background: var(--margin-line); }
.row { display: grid; grid-template-columns: 70px minmax(0, 660px) minmax(0, 1fr); column-gap: 34px; }
.num { font-family: var(--hand); font-size: 28px; color: var(--red); text-align: right; line-height: 1.2; padding-top: 4px; }
html[data-lang="zh"] .num { font-family: var(--hand-zh); font-size: 25px; }
.note { font-family: var(--hand); font-size: 22px; line-height: 1.15; color: var(--red); padding-top: 6px; }
html[data-lang="zh"] .note { font-family: var(--hand-zh); font-size: 20px; line-height: 1.35; }
.note.pencil { color: var(--pencil); }
section { margin-top: 64px; scroll-margin-top: 20px; }
/* ---------- top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 18px; font-family: var(--hand); font-size: 23px; color: var(--pencil); }
html[data-lang="zh"] .topbar { font-family: var(--hand-zh); font-size: 21px; }
.tabs a { text-decoration: none; color: var(--ink-2); padding: 0 2px; }
.tabs a:hover { color: var(--red); }
.tabs a[aria-current="page"] { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.tabs .sep { color: var(--pencil); margin: 0 4px; }
.ctl button { color: var(--ink-2); padding: 0 4px; }
.ctl button:hover { color: var(--red); }
/* ---------- headings ---------- */
h1 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(46px, 7vw, 72px); line-height: 1.05; margin: 22px 0 10px; letter-spacing: -.01em; }
.tagline { font-size: 19px; color: var(--ink-2); margin: 0 0 6px; }
h2 { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1.1; margin: 0 0 12px; }
html[data-lang="zh"] h2 { font-family: var(--hand-zh); font-weight: 400; font-size: 32px; }
h3.sub { font-family: var(--hand); font-size: 25px; font-weight: 500; margin: 22px 0 6px; color: var(--ink-2); }
html[data-lang="zh"] h3.sub { font-family: var(--hand-zh); font-size: 23px; font-weight: 400; }
h3.sub:first-child { margin-top: 0; }
.mark { padding: 0 1px; }
/* ---------- worked problem ---------- */
.given { font-style: italic; color: var(--ink-2); }
.step { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; margin: 10px 0; }
.step .k { font-family: var(--hand); font-size: 24px; color: var(--pencil); line-height: 1.3; }
.result { display: inline-block; max-width: 100%; margin: 14px 0 6px; padding: 8px 16px; }
.katex { font-size: 1.05em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.qed { font-family: var(--hand); font-size: 26px; color: var(--ink-2); }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig-cap { font-family: var(--hand); font-size: 21px; color: var(--pencil); text-align: center; margin-top: 2px; line-height: 1.2; }
html[data-lang="zh"] .fig-cap { font-family: var(--hand-zh); font-size: 19px; }
/* ---------- research ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { position: relative; padding-left: 28px; margin: 8px 0 14px; }
.todo li::before { content: "□"; position: absolute; left: 0; top: -2px; font-family: var(--hand); font-size: 23px; color: var(--pencil); }
.todo li.done::before { content: "☑"; color: var(--red); }
.todo .it { font-weight: 600; }
.todo small { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.55; margin-top: 2px; }
.todo .more { font-family: var(--hand); font-size: 19px; color: var(--red); text-decoration: none; }
html[data-lang="zh"] .todo .more { font-family: var(--hand-zh); font-size: 17px; }
.todo .more:hover { text-decoration: underline; }
/* ---------- papers ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 16px; font-family: var(--hand); font-size: 22px; }
html[data-lang="zh"] .filters { font-family: var(--hand-zh); font-size: 20px; }
.filters button { color: var(--ink-2); }
.filters button sup { font-size: .62em; color: var(--pencil); margin-left: 1px; }
.filters button:hover { color: var(--red); }
.filters button.active { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.refs { list-style: none; margin: 0; padding: 0; }
.refs li { display: grid; grid-template-columns: 40px minmax(0, 1fr); margin: 0 0 12px; font-size: 16px; line-height: 1.55; }
.refs .n { color: var(--pencil); font-family: var(--hand); font-size: 20px; line-height: 1.3; }
.refs .t { font-style: italic; }
.refs a { word-break: break-word; }
.stamp { display: inline-block; font-family: var(--hand); font-size: 18px; color: var(--red); border: 1.5px solid var(--red); border-radius: 3px; padding: 0 6px; line-height: 1.25; transform: rotate(-4deg); margin-left: 6px; white-space: nowrap; }
.pencil-tag { font-family: var(--hand); font-size: 19px; color: var(--pencil); margin-left: 6px; white-space: nowrap; }
.refs-group { font-family: var(--hand); font-size: 22px; color: var(--pencil); margin: 18px 0 8px; }
html[data-lang="zh"] .refs-group { font-family: var(--hand-zh); font-size: 20px; }
.refs li[hidden], .refs-group[hidden] { display: none; }
.refs li.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--hl); } 100% { background: transparent; } }
.empty { font-family: var(--hand); font-size: 22px; color: var(--pencil); }
/* ---------- timeline + lists ---------- */
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 14px; margin: 5px 0; }
.plain .when { font-family: var(--hand); font-size: 21px; color: var(--pencil); line-height: 1.45; }
.plain .what b { font-weight: 600; }
.plain .what span.role { color: var(--ink-2); }
.set { font-style: italic; margin: 4px 0; }
.set .k { font-style: normal; font-family: var(--hand); font-size: 22px; color: var(--pencil); display: inline-block; min-width: 118px; }
html[data-lang="zh"] .set .k { font-family: var(--hand-zh); font-size: 20px; }
/* ---------- notes & photos ---------- */
.notes { list-style: none; margin: 0 0 8px; padding: 0; }
.notes li { margin: 6px 0; }
.notes a { text-decoration: none; }
.notes a:hover .ti { text-decoration: underline; text-decoration-color: var(--red); }
.notes .d { font-family: var(--hand); font-size: 20px; color: var(--pencil); margin-right: 10px; }
.more-link { font-family: var(--hand); font-size: 21px; color: var(--red); text-decoration: none; }
html[data-lang="zh"] .more-link { font-family: var(--hand-zh); font-size: 19px; }
.more-link:hover { text-decoration: underline; }
.polaroids { display: flex; flex-wrap: wrap; gap: 22px; padding: 16px 4px 10px; }
.pola { position: relative; margin: 0; background: var(--polaroid); padding: 9px 9px 36px; width: 180px; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 8px 18px -10px rgba(0,0,0,.35); text-decoration: none; display: block; }
.pola:nth-child(3n+1) { transform: rotate(-3deg); }
.pola:nth-child(3n+2) { transform: rotate(2deg); margin-top: 12px; }
.pola:nth-child(3n) { transform: rotate(-1.5deg); }
.pola img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pola .cap { position: absolute; left: 6px; right: 6px; bottom: 5px; text-align: center; font-family: var(--hand); font-size: 20px; color: #2b2b2b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pola::before { content: ""; position: absolute; top: -12px; left: 50%; width: 80px; height: 22px; margin-left: -40px; background: var(--tape); transform: rotate(-2deg); }
.visitors-map { margin-top: 8px; width: min(100%, 280px); }
.wide { grid-column: 2 / 4; }
/* ---------- footer ---------- */
footer.row { margin-top: 72px; }
.sign { font-family: var(--hand); font-size: 26px; margin: 0 0 6px; }
html[data-lang="zh"] .sign { font-family: var(--hand-zh); font-size: 24px; }
.copy { font-family: var(--hand); font-size: 20px; color: var(--pencil); margin-left: 6px; }
.copy:hover { color: var(--red); }
.updated { font-family: var(--hand); font-size: 19px; color: var(--pencil); }
.toast {
position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 10px) rotate(-1deg);
background: #fff6a8; color: #2b2b2b; font-family: var(--hand); font-size: 22px; padding: 6px 16px;
box-shadow: 0 6px 16px -8px rgba(0,0,0,.4); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
html[data-lang="zh"] .toast { font-family: var(--hand-zh); font-size: 20px; }
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1deg); }
/* =========================================================
Sub-pages
========================================================= */
.page-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(40px, 6vw, 58px); line-height: 1.1; margin: 22px 0 8px; }
.page-sub { color: var(--ink-2); margin: 0 0 18px; }
.state-msg { font-family: var(--hand); font-size: 22px; color: var(--pencil); }
html[data-lang="zh"] .state-msg { font-family: var(--hand-zh); font-size: 20px; }
.state-msg code { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.search { display: flex; align-items: baseline; gap: 10px; max-width: 420px; border-bottom: 1.5px solid var(--line); margin: 8px 0 14px; }
.search .pfx { font-family: var(--hand); font-size: 22px; color: var(--pencil); }
html[data-lang="zh"] .search .pfx { font-family: var(--hand-zh); font-size: 20px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding: 4px 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 20px; font-family: var(--hand); font-size: 21px; }
html[data-lang="zh"] .tag-row { font-family: var(--hand-zh); font-size: 19px; }
.chip { color: var(--ink-2); }
.chip i { font-style: normal; font-size: .7em; color: var(--pencil); vertical-align: super; margin-left: 1px; }
.chip:hover { color: var(--red); }
.chip.active { color: var(--red); text-decoration: underline wavy var(--red); text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
/* blog list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { margin: 0 0 22px; }
.post-item a { display: block; text-decoration: none; }
.post-item time { font-family: var(--hand); font-size: 21px; color: var(--pencil); }
.post-item .ti { display: block; font-size: 22px; font-weight: 600; line-height: 1.35; margin: 2px 0 4px; }
.post-item a:hover .ti { text-decoration: underline; text-decoration-color: var(--red); }
.post-item .su { display: block; color: var(--ink-2); font-size: 16px; }
.post-item .tg { display: block; font-family: var(--hand); font-size: 19px; color: var(--red); margin-top: 2px; }
/* article */
.back-link { font-family: var(--hand); font-size: 22px; color: var(--pencil); text-decoration: none; }
html[data-lang="zh"] .back-link { font-family: var(--hand-zh); font-size: 20px; }
.back-link:hover { color: var(--red); }
.article-title { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 4.4vw, 42px); line-height: 1.2; margin: 14px 0 6px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 0 14px; font-family: var(--hand); font-size: 21px; color: var(--pencil); }
.toc-side { position: sticky; top: 20px; }
.toc-side h4 { margin: 0 0 6px; font-family: var(--hand); font-size: 23px; font-weight: 500; color: var(--red); }
html[data-lang="zh"] .toc-side h4 { font-family: var(--hand-zh); font-size: 21px; font-weight: 400; }
.toc-side ol { list-style: none; margin: 0; padding: 0; }
.toc-side a { display: block; font-size: 15px; line-height: 1.45; color: var(--ink-2); text-decoration: none; padding: 3px 0; }
.toc-side a:hover { color: var(--red); }
.toc-side a.active { color: var(--red); }
.toc-side a.active::before { content: "→ "; }
.toc-side .lvl-3 a { padding-left: 14px; font-size: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; padding-top: 14px; border-top: 1.5px dashed var(--line); }
.pager a { text-decoration: none; }
.pager small { display: block; font-family: var(--hand); font-size: 20px; color: var(--pencil); }
.pager span { font-weight: 600; }
.pager a:hover span { color: var(--red); }
.pager .next { text-align: right; grid-column: 2; }
/* prose */
.prose { margin-top: 26px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 32px; margin: 42px 0 10px; scroll-margin-top: 20px; }
.prose h3 { font-family: var(--hand); font-size: 26px; font-weight: 700; margin: 30px 0 8px; scroll-margin-top: 20px; }
html[data-lang="zh"] .prose h3 { font-family: var(--hand-zh); font-weight: 400; font-size: 24px; }
.prose h4 { font-size: 18px; margin: 24px 0 6px; }
.prose a { color: var(--red); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: 18px 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--red); color: var(--ink-2); font-style: italic; }
.prose blockquote p:last-child { margin: 0; }
.prose hr { border: 0; border-top: 1.5px dashed var(--line); margin: 30px 0; }
.prose img { max-width: 100%; }
.prose :not(pre) > code { font-family: var(--mono); font-size: .84em; padding: .1em .35em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 3px; }
.prose .table-wrap { overflow-x: auto; margin: 18px 0; }
.prose table { border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 6px 18px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--hand); font-size: 20px; font-weight: 500; color: var(--pencil); }
.code-block { position: relative; margin: 18px 0; }
.code-block pre {
margin: 0; padding: 30px 18px 16px; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px;
font-family: var(--mono); font-size: 13.5px; line-height: 1.65; tab-size: 4; font-variant-ligatures: none;
}
.code-block pre code { font-family: inherit; }
.code-block .code-lang { position: absolute; top: 5px; left: 14px; font-family: var(--hand); font-size: 18px; color: var(--pencil); }
.copy-code { position: absolute; top: 5px; right: 12px; font-family: var(--hand); font-size: 18px; color: var(--pencil); }
.copy-code:hover { color: var(--red); }
.hljs-keyword, .hljs-selector-tag, .hljs-literal { color: #7b3fa0; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #2f7a3b; }
.hljs-number, .hljs-symbol { color: var(--red); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section, .hljs-built_in, .hljs-type { color: #1f5fa8; }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--pencil); font-style: italic; }
:root[data-theme="dark"] .hljs-keyword { color: #d5b3f0; }
:root[data-theme="dark"] .hljs-string { color: #a9dca0; }
:root[data-theme="dark"] .hljs-title, :root[data-theme="dark"] .hljs-built_in, :root[data-theme="dark"] .hljs-type { color: #9cc7f0; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .hljs-keyword { color: #d5b3f0; }
:root:not([data-theme="light"]) .hljs-string { color: #a9dca0; }
:root:not([data-theme="light"]) .hljs-title, :root:not([data-theme="light"]) .hljs-built_in, :root:not([data-theme="light"]) .hljs-type { color: #9cc7f0; }
}
/* gallery */
.justified { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { position: relative; display: block; overflow: hidden; flex: none; cursor: zoom-in; background: var(--polaroid); padding: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.16), 0 6px 14px -8px rgba(0,0,0,.35); text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .4s; }
.tile img.loaded { opacity: 1; }
.tile:hover { transform: rotate(-.6deg); }
.tile-cap { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 18px 10px 6px; display: flex; flex-direction: column; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55)); color: #fff; font-size: 14px; line-height: 1.4; opacity: 0; transition: opacity .2s; }
.tile-cap .cap-main { display: flex; justify-content: space-between; gap: 8px; }
.tile-cap small { opacity: .85; white-space: nowrap; }
.cap-loc, .lb-loc { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.cap-loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-loc svg, .lb-loc svg { width: 13px; height: 13px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap, .tile.has-loc .tile-cap { opacity: 1; }
.tile.has-loc .cap-main { display: none; }
.tile.has-loc:hover .cap-main { display: flex; }
@media (hover: none) { .tile:not(.has-loc) .tile-cap { display: none; } }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: 80px minmax(0, 1fr) 80px; align-items: center; background: rgba(12, 16, 14, .95); color: #ecebe4; touch-action: pan-y; }
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; pointer-events: none; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); background: #fff; padding: 8px; opacity: 0; transition: opacity .25s; pointer-events: auto; }
.lb-figure img.loaded { opacity: 1; }
.lb-figure figcaption { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-family: var(--hand); font-size: 22px; padding: 0 12px; }
.lb-figure figcaption .mono { font-family: var(--serif); font-size: 13px; color: #b3b8ad; }
.lb-loc[hidden] { display: none; }
.lb-btn { justify-self: center; font-family: var(--hand); font-size: 24px; color: #b3b8ad; padding: 6px 10px; }
.lb-btn:hover { color: #f4a49a; }
.lb-close { position: absolute; top: 12px; right: 16px; }
.lb-count { position: absolute; top: 18px; left: 20px; font-family: var(--hand); font-size: 20px; color: #b3b8ad; }
/* =========================================================
Small screens: marginalia fall inline
========================================================= */
@media (max-width: 900px) {
body { font-size: 16.5px; }
.sheet { padding: 20px 18px 64px; }
.sheet::before { left: 10px; }
.row { grid-template-columns: minmax(0, 1fr); }
.wide { grid-column: auto; }
.num { text-align: left; font-size: 24px; padding-top: 0; }
.note { padding: 0 0 8px 14px; border-left: 2px solid var(--margin-line); margin: 4px 0 10px; }
.cols { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fig svg { max-width: 300px; margin: 0 auto; }
.result { padding: 6px 8px; }
.plain li { grid-template-columns: minmax(0, 1fr); margin: 8px 0; }
.set .k { display: block; min-width: 0; }
.toc-side { display: none; }
.pager { grid-template-columns: minmax(0, 1fr); }
.pager .next { grid-column: 1; text-align: left; }
.polaroids { gap: 16px; }
.pola { width: calc(50% - 10px); }
.justified { gap: 8px; }
.tile { padding: 4px; }
.lightbox { grid-template-columns: minmax(0, 1fr); padding: 0 8px; }
.lb-prev, .lb-next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
.refs li.flash { animation: none; }
.tile:hover { transform: none; }
}