Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
477 lines (456 loc) · 33.5 KB
/
Copy pathstyles.css
File metadata and controls
477 lines (456 loc) · 33.5 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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
@font-face { font-family: 'Baloo 2'; src: url(fonts/baloo2.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(fonts/andika-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url(fonts/andika-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
:root {
--night: #1b1f52;
--night-2: #2c2f7a;
--paper: #fffaf0;
--ink: #232a66;
--sun: #ffd24d;
--coral: #ff7a59;
--display: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', sans-serif;
--body: 'Andika', 'Segoe UI', Verdana, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
font-family: var(--body); color: #fff;
background: var(--bg, var(--night));
transition: background-color .6s;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
/* ---------- top bar ---------- */
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 64px; }
.bar-title { flex: 1; margin: 0; font: 800 1.25rem/1.1 var(--display); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; gap: 8px; margin-left: auto; }
.pill, .tog {
display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
border: 2px solid rgba(255, 255, 255, .35); border-radius: 22px; background: rgba(255, 255, 255, .08);
font-weight: 700; font-size: .95rem;
}
.pill svg, .tog svg, .round svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tog[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); color: #2a2350; }
.tog .off { display: none; }
#tSound[aria-pressed="false"] .on { display: none; }
#tSound[aria-pressed="false"] .off { display: inline; }
.pill:hover, .tog:hover { border-color: #fff; }
/* ---------- shelf ---------- */
main { flex: 1; display: flex; flex-direction: column; }
#shelf {
flex: 1; padding: 8px 20px 40px; text-align: center;
background:
radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
radial-gradient(2px 2px at 82% 12%, #fff 50%, transparent 51%),
radial-gradient(1.5px 1.5px at 30% 8%, #fff 50%, transparent 51%),
radial-gradient(1.5px 1.5px at 64% 22%, #fff 50%, transparent 51%),
radial-gradient(2px 2px at 93% 34%, #fff 50%, transparent 51%),
radial-gradient(1.5px 1.5px at 5% 40%, #fff 50%, transparent 51%),
linear-gradient(var(--night), var(--night-2));
}
h1 {
margin: 0; font: 800 clamp(2.6rem, 8vw, 5.2rem)/.95 var(--display); letter-spacing: -.01em; color: var(--paper);
text-shadow: 0 3px 0 var(--coral), 0 6px 0 #c2253a, 0 9px 0 rgba(0, 0, 0, .25);
}
.lede { margin: 18px auto 0; font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 34ch; color: #dcdcff; }
.books { display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: center; gap: clamp(18px, 4vw, 48px); margin: clamp(28px, 5vh, 56px) auto 28px; }
.book {
position: relative; display: flex; flex-direction: column; padding: 0; border: 0; text-align: left;
background: var(--paper); color: var(--ink); border-radius: 6px 18px 18px 6px;
box-shadow: inset 12px 0 0 var(--ink), inset 15px 0 0 rgba(255, 255, 255, .35), 0 3px 0 #d9d2c0, 0 6px 0 #c2bba8, 0 22px 30px rgba(0, 0, 10, .45);
rotate: var(--tilt); transition: rotate .25s, translate .25s;
overflow: hidden;
}
.book:hover, .book:focus-visible { rotate: 0deg; translate: 0 -8px; }
.cover { display: block; aspect-ratio: 4 / 3.6; margin-left: 12px; overflow: hidden; }
.cover .scene { width: 100%; height: 100%; display: block; }
.label { display: block; padding: 14px 16px 6px 28px; }
.label .t { display: block; font: 800 1.45rem/1.05 var(--display); }
.label .p { display: block; margin-top: 6px; font-size: .92rem; opacity: .8; }
.progress { display: flex; align-items: center; gap: 4px; padding: 8px 16px 16px 28px; font-size: .82rem; }
.progress span { margin-left: 6px; opacity: .8; }
.medal { width: 22px; height: 22px; color: rgba(40, 40, 90, .22); flex: none; }
.medal.on { color: #f2a81d; }
.link { background: none; border: 0; padding: 12px; color: #dcdcff; text-decoration: underline; text-underline-offset: 4px; font-size: 1rem; }
/* ---------- reader ---------- */
#reader { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px 12px; --sheet-h: min(calc(100dvh - 176px), calc((100vw - 32px) * .45)); }
.stage { display: grid; perspective: 3400px; width: fit-content; max-width: 100%; margin: auto; }
.sheet {
grid-area: 1 / 1; display: grid; grid-template-columns: auto clamp(300px, 34vw, 500px);
height: var(--sheet-h); background: var(--paper); color: var(--ink);
border-radius: 10px 22px 22px 10px; overflow: hidden;
box-shadow: 0 3px 0 rgba(255, 255, 255, .5), 0 7px 0 rgba(255, 255, 255, .25), 0 26px 40px rgba(0, 0, 0, .4);
transform-origin: left center; backface-visibility: hidden; outline: none;
}
.pic { position: relative; height: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #cfe3e6; }
.scene { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.words {
padding: clamp(18px, 2.2vw, 32px); overflow-y: auto; display: flex; flex-direction: column;
font-size: clamp(.9rem, calc(var(--sheet-h) * .034), 1.5rem); line-height: 1.5;
background: linear-gradient(90deg, rgba(0, 0, 0, .09), transparent 22px);
}
.words h2 { margin: 0 0 .5em; font: 800 1.7em/1 var(--display); color: var(--accent); outline: none; }
.words p { margin: 0 0 .55em; }
.tip { margin-top: .4em !important; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 700; font-size: .9em; }
.ask { font: 800 1.2em/1.15 var(--display); margin-top: .3em !important; }
.choices { display: grid; gap: 12px; padding-bottom: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 6px; font-size: .85em; }
.choice, .btn {
display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 16px 6px 8px; text-align: left;
border: 0; border-radius: 18px; background: var(--accent, #7a5cd6); color: #fff; font: 800 1.05em/1.15 var(--display);
box-shadow: 0 5px 0 color-mix(in srgb, var(--accent, #7a5cd6) 60%, #000);
transition: translate .1s, box-shadow .1s;
}
.choice:active, .btn:active { translate: 0 4px; box-shadow: 0 1px 0 color-mix(in srgb, var(--accent, #7a5cd6) 60%, #000); }
.choice svg { width: 46px; height: 46px; flex: none; background: rgba(0, 0, 0, .25); border-radius: 14px; }
.btn { padding: 6px 12px; justify-content: center; text-align: center; min-height: 50px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2.5px currentColor; }
.btn.ghost:active { box-shadow: inset 0 0 0 2.5px currentColor; }
.theend { margin-top: auto; padding-top: .3em; display: grid; gap: 6px; }
.fin { font: 800 1.6em/1 var(--display); color: var(--accent); margin: 0 !important; }
.got { font-size: .88em; margin: 0 0 4px !important; }
.caption {
position: absolute; left: 50%; top: 14px; translate: -50% -12px; margin: 0; max-width: 88%; width: max-content;
padding: 10px 20px; border-radius: 22px; background: #fff; color: #232a66; text-align: center;
font: 800 clamp(1rem, .7rem + .8vw, 1.35rem)/1.2 var(--display);
box-shadow: 0 5px 0 rgba(0, 0, 0, .18); opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s;
}
.caption.show { opacity: 1; translate: -50% 0; }
/* ---------- page nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, 760px); padding-top: 14px; min-height: 86px; }
.round { width: 64px; height: 64px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.round svg { width: 32px; height: 32px; stroke-width: 3; }
.round.next { background: var(--sun); color: #2a2350; box-shadow: 0 5px 0 #c9971a; }
.round.next:active { translate: 0 4px; box-shadow: 0 1px 0 #c9971a; }
.round:disabled { opacity: .3; cursor: default; }
.round[hidden] { display: grid !important; visibility: hidden; }
.mid { display: grid; justify-items: center; gap: 6px; }
.dots { display: flex; gap: 7px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.dots i.on { background: #fff; }
.finds { display: flex; align-items: center; gap: 3px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: rgba(255, 255, 255, .12); font-weight: 700; font-size: .95rem; }
.finds .medal { color: rgba(255, 255, 255, .3); }
.finds .medal.on { color: var(--sun); }
.finds span { margin-left: 6px; }
/* ---------- dialog ---------- */
dialog { max-width: min(640px, calc(100vw - 32px)); border: 0; border-radius: 22px; padding: 28px; color: var(--ink); background: var(--paper); font-size: 1.02rem; line-height: 1.55; }
dialog::backdrop { background: rgba(10, 10, 40, .7); }
dialog h2 { margin: 0 0 8px; font: 800 1.8rem/1 var(--display); }
dialog h3 { margin: 18px 0 2px; font: 800 1.15rem/1.1 var(--display); }
dialog p { margin: 0 0 10px; }
dialog form { display: flex; justify-content: flex-end; margin-top: 16px; }
#storyWords summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
/* ---------- page turning ---------- */
.turn-out { z-index: 2; animation: turn-out .85s ease-in-out forwards; }
.turn-in { z-index: 2; animation: turn-out .85s ease-in-out reverse both; }
@keyframes turn-out {
0% { transform: rotateY(0); filter: brightness(1); }
100% { transform: rotateY(-94deg); filter: brightness(.6); }
}
/* ---------- paper layers ---------- */
/* ponytail: one drop-shadow per layer (max 6); drop it first if a slow tablet stutters */
.layer { transform: translate(calc(var(--px, 0) * var(--z) * 3.500px), calc(var(--py, 0) * var(--z) * 1.500px)); transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.layer:not(:first-child) { filter: drop-shadow(0 4px 2px rgba(20, 20, 60, .28)); }
.cover .layer { filter: none; }
.pop { transform-origin: 400px 640px; animation: pop .75s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--i) * 110ms + 300ms); }
.layer:first-child .pop, .cover .pop { animation: none; }
@keyframes pop { from { transform: translateY(70px) scaleY(.55); opacity: 0; } }
/* ---------- things to find ---------- */
.find { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.find-in, .blink, .ripple, .flap, .flame, .boil, .fan, .spin-slow, .twinkle, .bob, .zzz { transform-box: fill-box; transform-origin: center; }
.find:focus-visible .find-in { filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 7px #ffd24d) drop-shadow(0 0 2px #ffd24d); }
.find:hover .find-in { filter: brightness(1.08); }
.find.hint .find-in { animation: hint 1s ease 2; }
.find.go .find-in { animation: wiggle .8s ease; }
.find.go[data-anim="hop"] .find-in { animation-name: hop; }
.find.go[data-anim="jump"] .find-in { animation: jump 1s ease; }
.find.go[data-anim="spin"] .find-in { animation: spin .9s ease; }
.find.go[data-anim="shake"] .find-in { animation: shake .7s linear; }
.find.go[data-anim="pop"] .find-in, .find.go[data-anim="grow"] .find-in { animation: grow .8s ease; }
.find.go[data-anim="shrink"] .find-in { animation: shrink 1.2s ease; }
.find.go[data-anim="fly"] .find-in { animation: fly 1.6s ease; }
.find.go[data-anim="drop"] .find-in { animation: drop 1.6s ease-in; }
.find.go[data-anim="dance"] .find-in { animation: dance 1.6s ease; }
.find.go[data-anim="row"] .find-in { animation: row 1s ease; }
@keyframes hint { 50% { transform: scale(1.14); filter: drop-shadow(0 0 8px #fff); } }
@keyframes wiggle { 20% { transform: rotate(-7deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(4deg); } }
@keyframes hop { 30% { transform: translateY(-34px) scale(1.06, .96); } 55% { transform: translateY(0) scale(.96, 1.05); } 75% { transform: translateY(-12px); } }
@keyframes jump { 40% { transform: translateY(-90px) rotate(-30deg); } 80% { transform: translateY(6px) rotate(10deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 15% { transform: translateX(-9px); } 30% { transform: translateX(9px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(7px); } 80% { transform: translateX(-3px); } }
@keyframes grow { 45% { transform: scale(1.35); } }
@keyframes shrink { 50% { transform: scale(.72); } }
@keyframes fly { 50% { transform: translate(60px, -60px); } }
@keyframes drop { 55% { transform: translateY(240px); opacity: 1; } 70% { transform: translateY(240px); opacity: 0; } 71% { transform: none; opacity: 0; } }
@keyframes dance { 15% { transform: rotate(-9deg) translateY(-12px); } 35% { transform: rotate(9deg); } 55% { transform: rotate(-9deg) translateY(-12px); } 75% { transform: rotate(9deg); } }
@keyframes row { 50% { transform: rotate(-22deg) translateX(-14px); } }
/* ---------- ambient motion ---------- */
.wave { animation: wave 5s ease-in-out infinite alternate; }
@keyframes wave { to { transform: translateX(34px); } }
.ripple { animation: ripple 2.4s ease-out infinite; }
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.rain { animation: rain 1.1s linear infinite; }
@keyframes rain { to { transform: translateY(600px); } }
.twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.7); } }
.spin-slow { animation: spin 50s linear infinite; }
.sway { animation: sway 5s ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-2.500deg); } to { transform: rotate(2.500deg); } }
.blink { animation: blink 4.500s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.bob { animation: bob 3.600s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(-6px); } to { transform: translateY(6px); } }
.flap { animation: flap .5s ease-in-out infinite alternate; }
@keyframes flap { to { transform: scaleY(.3); } }
.oar { animation: oar 1s ease-in-out infinite alternate; }
@keyframes oar { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }
.flame { transform-origin: center bottom; animation: flame .5s ease-in-out infinite alternate; }
@keyframes flame { to { transform: scale(.9, 1.12); } }
.glow { animation: twinkle 2.400s ease-in-out infinite; }
.boil { transform-origin: center bottom; animation: boil .7s ease-in-out infinite alternate; }
@keyframes boil { from { transform: scale(.9); } to { transform: scale(1.1) translateY(-4px); } }
.fan { transform-origin: center bottom; animation: fan 1.2s cubic-bezier(.2, .9, .3, 1.2) .9s both, sway 2.5s ease-in-out 2.1s infinite alternate; }
@keyframes fan { from { transform: scale(.1); } }
.zzz { animation: zzz 3s ease-in-out infinite; }
@keyframes zzz { from { opacity: 0; transform: translate(-10px, 14px) scale(.6); } 40% { opacity: 1; } to { opacity: 0; transform: translate(14px, -22px) scale(1.1); } }
.kloop { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1s ease; }
.kloop.show { stroke-dashoffset: 0; }
.kborder { transition-duration: 2.200s; }
/* ---------- calm motion ---------- */
[data-motion="calm"] .scene *, [data-motion="calm"] .book { animation: none !important; transition: none !important; }
[data-motion="calm"] .layer { transform: none; }
[data-motion="calm"] .turn-out, [data-motion="calm"] .turn-in { animation: fade .25s linear forwards; }
[data-motion="calm"] .turn-in { animation-direction: reverse; }
@keyframes fade { to { opacity: 0; } }
[data-motion="calm"] .find.go .find-in, [data-motion="calm"] .find.hint .find-in { animation: flash .6s linear !important; }
@keyframes flash { 50% { opacity: .35; } }
/* ---------- small and tall screens ---------- */
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
.tog span, .pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tog, .pill { padding: 0 11px; }
.bar-title { font-size: 1.05rem; text-align: left; }
.books { grid-template-columns: minmax(0, 340px); }
.book { rotate: 0deg; }
#reader { padding-bottom: 100px; }
.stage { width: 100%; max-width: 640px; margin-top: 0; }
.sheet { grid-template-columns: 1fr; height: auto; border-radius: 18px; transform-origin: left top; }
.pic { height: auto; width: 100%; }
.words { overflow: visible; background: none; font-size: clamp(1.1rem, 4.4vw, 1.4rem); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--ink) 88%, #000); z-index: 5; }
.round { width: 56px; height: 56px; }
}
@media (min-width: 901px) and (max-height: 620px) {
.words { font-size: 1rem; }
}
/* Read-aloud controls share the book's quiet paper-and-ink palette. */
.narration { width: min(100%, 960px); margin: 0 auto 18px; font-size: .9rem; }
.read-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.narration label { display: inline-flex; align-items: center; gap: 8px; }
.narration select { font: inherit; min-height: 44px; max-width: 100%; border-radius: 12px; padding: 6px 10px; color: var(--night); background: var(--paper); }
.narration details { margin-top: 8px; }
.narration summary { cursor: pointer; min-height: 44px; display: list-item; padding: 12px 0; }
.narration details > label { display: flex; margin: 8px 0; }
.narration details p { max-width: 65ch; }
.narration input { width: 22px; height: 22px; flex: none; }
#readVoice { min-width: 0; }
#readStatus { min-height: 1.5em; margin: 4px 0 0; }
.reading-now { background: #ffe9a6; color: #29234f; border-radius: 5px; box-shadow: -4px 0 0 #d29418; }
#reader { --sheet-h: min(calc(100dvh - 300px), calc((100vw - 32px) * .45)); }
@media (max-width: 900px), (max-aspect-ratio: 1/1) {
.narration .pill { padding: 0 14px; }
.bar { flex-wrap: wrap; }
.bar-title { min-width: 0; }
}
@media (min-width: 901px) and (max-height: 750px) {
#reader { --sheet-h: 440px; }
}
/* The refreshed entrance and illustrated editions. Original scene rules stay intact. */
#shelf { background: #fbf5e8; color: #304b38; position: relative; isolation: isolate; padding: 0 0 40px; }
#shelf::before, #shelf::after { content: none; }
#shelf h1 { color: #2d4937; text-shadow: none; font-size: clamp(3.2rem, 6.5vw, 5.6rem); line-height: .98; font-weight: 700; letter-spacing: -.025em; margin: 0; }
#shelf .lede { color: #3d513b; font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.65; max-width: 34ch; margin: 24px 0 28px; }
.books { row-gap: 54px; padding: 4px 0 20px; }
.book { box-shadow: inset 12px 0 0 var(--ink), inset 15px 0 0 #ffffff50, 0 5px 0 #c6bca8, 0 22px 32px #0005; }
.sound-panel { margin: 0 16px 12px auto; max-width: min(600px, calc(100% - 32px)); font-size: .9rem; }
.sound-panel summary { min-height: 44px; cursor: pointer; padding: 10px 4px; text-align: right; }
.sound-panel > div { background: #fff5e4; color: #253742; padding: 16px 20px; border-radius: 14px; }
.sound-panel label { display: flex; justify-content: space-between; gap: 18px; align-items: center; min-height: 44px; }
.sound-panel input { accent-color: #77503c; width: min(200px, 45vw); }
.sound-panel .pill { border-color: #77503c; background: transparent; margin-top: 8px; }
.sound-panel p { margin-bottom: 0; max-width: 56ch; }
[data-edition="illustrated"] .layer { transform: none; filter: none; }
[data-edition="illustrated"] .pop { animation: illustration-arrive .65s cubic-bezier(.16,1,.3,1) both; animation-delay: 0s; transform-origin: center; }
[data-edition="illustrated"] .layer:first-child .pop { animation: illustration-arrive .65s cubic-bezier(.16,1,.3,1) both; }
[data-edition="illustrated"] .find.go .find-in { animation: discovery-answer .7s ease-out; }
[data-edition="illustrated"] .turn-out, [data-edition="illustrated"] .turn-in { animation-name: illustration-page; animation-duration: .45s; }
.discovery-ring { fill: #263d3dcc; stroke: #fff1d9; stroke-width: 2; }
.illustrated-details .find:hover .discovery-ring, .illustrated-details .find:focus-visible .discovery-ring { fill: #8a4a30; stroke-width: 4; }
.cover .illustrated-details { display: none; }
@keyframes illustration-arrive { from { opacity: .6; filter: brightness(.85); } to { opacity: 1; filter: brightness(1); } }
@keyframes illustration-page { to { opacity: 0; transform: translateX(-12px); } }
@keyframes discovery-answer { 50% { opacity: .45; } }
[data-motion="calm"] [data-edition="illustrated"] .pop { animation: none !important; }
[data-motion="calm"] [data-edition="illustrated"] .turn-out, [data-motion="calm"] [data-edition="illustrated"] .turn-in { animation: fade .25s linear forwards; }
[data-motion="calm"] [data-edition="illustrated"] .turn-in { animation-direction: reverse; }
@media (max-width: 900px) { #shelf { padding-top: 20px; } .sound-panel { margin-bottom: 6px; } .books { row-gap: 34px; } }
.lamp-breath { animation: lamp-breath 4.8s ease-in-out infinite alternate; }
@keyframes lamp-breath { from { opacity: .45; } to { opacity: .8; } }
.wind-trail { opacity: 0; stroke-dasharray: 240; stroke-dashoffset: 240; }
.wind-trail.show { animation: passing-breeze 2.5s ease-out both; }
@keyframes passing-breeze { 15% { opacity: .6; } 80% { stroke-dashoffset: 0; opacity: .3; } 100% { stroke-dashoffset: 0; opacity: 0; } }
[data-motion="calm"] .lamp-breath { animation: none; opacity: .6; }
[data-motion="calm"] .wind-trail { display: none; }
/* A continuous cream page and a painted doorway into the library. */
body[data-view="library"] { background: #fbf5e8; color: #304b38; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 700 1.3rem/1 var(--display); flex: none; }
.wordmark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
[data-view="reader"] .wordmark { display: none; }
[data-view="library"] .bar { padding: 16px clamp(20px, 4vw, 64px) 8px; gap: 16px; }
[data-view="library"] .bar-title { display: none; }
[data-view="library"] .tog { border: 1px solid #8c9b7d; background: transparent; color: #304b38; border-radius: 10px; }
[data-view="library"] .tog[aria-pressed="true"] { background: #e5eacf; border-color: #e5eacf; }
[data-view="library"] .tog:hover { background: #e5eacf; }
[data-view="library"] .sound-panel { margin: 0 clamp(20px, 4vw, 64px) 0 auto; }
[data-view="library"] .sound-panel summary { min-height: 32px; padding: 3px 0 8px; }
[data-view="library"] .sound-panel > div { background: #eee9d8; }
.library-hero { position: relative; min-height: clamp(380px, 38vw, 570px); display: flex; align-items: center; text-align: left; background: #efe7cf url('assets/stories/library.webp') center 55% / cover no-repeat; }
.library-hero::after { content: ''; position: absolute; inset: auto 0 0; height: 72px; background: linear-gradient(transparent, #fbf5e8); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; width: min(620px, 60%); margin-left: max(5vw, calc((100vw - 1180px) / 2)); padding: 34px 0 62px; }
.library-start { display: inline-flex; align-items: center; gap: 22px; color: #fff9ea; background: #36543b; padding: 14px 24px; min-height: 52px; border-radius: 10px; text-decoration: none; font-weight: 700; transition: background .2s; }
.library-start:hover { background: #243d29; }
.library-start svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.library-heading { padding: 40px 20px 0; scroll-margin-top: 20px; }
.library-heading h2 { font: 700 clamp(1.8rem, 3vw, 2.5rem)/1.1 var(--display); margin: 0 0 12px; }
.library-heading p { color: #56634b; margin: 0; line-height: 1.6; }
#shelf .books { max-width: 1100px; grid-template-columns: repeat(3,minmax(0,310px)); gap: 54px 42px; padding: 0 30px 16px; margin-top: 36px; }
#shelf .book { rotate: 0deg; border-radius: 5px 12px 12px 5px; box-shadow: inset 10px 0 var(--ink), 0 4px 0 #d9ceb9, 0 15px 25px #503e2026; transition: translate .25s cubic-bezier(.16,1,.3,1), box-shadow .25s; }
#shelf .book:hover { translate: 0 -6px; box-shadow: inset 10px 0 var(--ink), 0 4px 0 #d9ceb9, 0 20px 28px #503e2033; }
#shelf .cover { aspect-ratio: 4 / 3; }
#shelf .label .t { font-size: 1.5rem; line-height: 1.12; font-weight: 700; }
#shelf .progress { font-size: .72rem; line-height: 1.5; padding-top: 12px; }
#shelf .link { color: #43583a; margin-top: 12px; }
[data-view="library"] :focus-visible { outline-color: #a55434; }
[data-view="library"] ::selection { color: #233c2b; background: #e4c68d; }
html { scroll-behavior: smooth; scrollbar-color: #8d9579 #f5eddc; }
/* Spacious short verses belong only to the three illustrated editions. */
[data-edition="illustrated"] { --sheet-h: clamp(400px, calc(100dvh - 245px), 640px) !important; }
[data-edition="illustrated"] .stage { width: min(1320px,100%); margin: 0 auto; }
[data-edition="illustrated"] .sheet { width: 100%; height: auto; min-height: var(--sheet-h); grid-template-columns: minmax(0,1.3fr) minmax(340px,1fr); border-radius: 12px; box-shadow: 0 14px 32px #0003; }
[data-edition="illustrated"] .pic { align-self: center; width: 100%; height: auto; aspect-ratio: 4/3; background: var(--paper); }
[data-edition="illustrated"] .words { font-size: clamp(1.2rem, 1.65vw, 1.5rem); line-height: 1.65; padding: clamp(26px,3.5vw,50px); overflow: visible; justify-content: center; background: none; }
[data-edition="illustrated"] .words h2 { font-size: 1.4em; font-weight: 700; line-height: 1.12; margin-bottom: .8em; text-wrap: balance; }
[data-edition="illustrated"] .words p { margin-bottom: .6em; white-space: pre-line; }
[data-edition="illustrated"] .ask { font-size: 1em; }
[data-edition="illustrated"] .choice { border-radius: 10px; box-shadow: none; min-height: 54px; font-size: .95em; }
[data-edition="illustrated"] .choice svg { width: 34px; height: 34px; border-radius: 8px; }
[data-edition="illustrated"] .btn { border-radius: 10px; box-shadow: none; font-size: .92em; }
[data-edition="illustrated"] .btn.ghost { box-shadow: inset 0 0 0 1px currentColor; }
[data-edition="illustrated"] .theend { margin-top: 12px; }
[data-edition="illustrated"] .got { font-size: .7em; }
[data-edition="illustrated"] .two { margin-top: 8px; }
@media (max-width: 900px) {
[data-view="library"] .bar { flex-wrap: nowrap; }
.wordmark { font-size: 1.1rem; }
[data-view="library"] .tog { padding: 0 10px; }
.library-hero { min-height: 420px; background-position: 58% center; }
.hero-copy { width: 62%; margin-left: 6vw; }
#shelf h1 { font-size: clamp(2.8rem,7.5vw,4.6rem); }
#shelf .books { gap: 32px 22px; grid-template-columns: repeat(2,minmax(0,310px)); }
[data-edition="illustrated"] .stage { max-width: 640px; }
[data-edition="illustrated"] .sheet { grid-template-columns: 1fr; min-height: 0; }
[data-edition="illustrated"] .words { font-size: clamp(1.2rem,3.8vw,1.45rem); padding: 28px; }
}
@media (max-width: 540px) {
[data-view="library"] .bar { padding: 14px 16px 6px; gap: 8px; }
.wordmark { gap: 6px; max-width: 140px; line-height: 1.05; }
.wordmark svg { width: 25px; flex: none; }
[data-view="library"] .controls { gap: 5px; }
[data-view="library"] .tog { padding: 0 9px; }
[data-view="library"] .sound-panel { margin-right: 18px; }
.library-hero { min-height: 530px; align-items: flex-start; background-position: 71% bottom; background-size: auto 370px; background-color: #f1e8d3; }
.hero-copy { width: calc(100% - 40px); margin: 0 20px; padding: 28px 0 170px; }
#shelf h1 { font-size: 3rem; max-width: 10ch; }
#shelf .lede { font-size: 1rem; margin: 18px 0; max-width: 30ch; }
.library-start { padding: 11px 18px; gap: 15px; min-height: 48px; }
.library-heading { padding: 25px 22px 0; }
.library-heading h2 { font-size: 1.9rem; }
.library-heading p { font-size: .95rem; max-width: 30ch; margin: auto; }
#shelf .books { grid-template-columns: minmax(0,350px); padding: 0 28px; margin-top: 30px; gap: 34px; }
[data-edition="illustrated"] .words { padding: 24px; font-size: 1.18rem; }
[data-edition="illustrated"] .words h2 { font-size: 1.5em; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Living Pages owns only the picture. The original scene keeps its discoveries. */
.living-camera { position: absolute; inset: 0; background: center / contain no-repeat; transform-origin: center; will-change: transform; }
.living-camera > .scene { position: absolute; inset: 0; z-index: 4; }
.living-camera .painting { opacity: 0; }
[data-edition="illustrated"] .living-camera .pop { animation: none; }
.living-warp, .living-particles, .living-clip, .living-edit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.living-warp { z-index: 1; }
.living-clip { z-index: 2; object-fit: contain; opacity: 0; transition: opacity .65s linear; transform-origin: center; }
.living-clip.is-playing { opacity: 1; }
.living-particles { z-index: 3; }
.living-edit { z-index: 5; overflow: visible; }
.living-edit ellipse { fill: #17372b18; stroke: #fff4d7; stroke-width: 1.5; stroke-dasharray: 5 4; }
.living-edit circle { fill: #faf2be; stroke: #163e37; stroke-width: 2; }
.living-edit text { fill: #fff9ea; stroke: #15382c; stroke-width: 3; paint-order: stroke; font: 14px Andika, sans-serif; }
.living-replay { position: absolute; z-index: 6; right: 12px; bottom: 12px; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 10px; color: #fff9ea; background: #304b38; font: 700 .9rem Andika, sans-serif; cursor: pointer; }
.living-replay:hover { background: #203b29; }
.living-replay:focus-visible { outline: 3px solid #fff3ce; outline-offset: -5px; }
.pic > .caption { z-index: 7; }
[data-motion="calm"] .living-camera { transform: none !important; }
/* The paper edition opens on a pop-up spread, with its figures standing in the fold. */
.library-hero { isolation: isolate; }
[data-art="paper"] .library-hero {
overflow: hidden;
background: radial-gradient(ellipse at 79% 48%,#ffedcb 0%,transparent 54%),#f8efdf;
border-block: 1px solid #ddceb3;
}
#paperPanorama { position: absolute; width: min(58%,820px); right: max(1%,calc((100vw - 1440px)/2)); inset-block: 0; }
#paperPanorama .grove-art { width: 100%; height: 100%; overflow: visible; }
[data-art="painted"] #paperPanorama { display: none; }
[data-art="paper"] .library-hero::after, .pic:has(.scene):not(:has(.painting))::after {
content: ''; position: absolute; inset: 0; height: auto; z-index: 1; pointer-events: none;
opacity: .09; mix-blend-mode: multiply;
background: url('assets/paper-grain.svg') repeat; background-size: 140px;
}
[data-art="paper"] .hero-copy { width: 39%; padding-block: 42px; }
#shelf h1 em { font-family: Georgia,serif; font-weight: 500; font-size: 1.06em; color: #9c5039; }
#shelf .hero-copy .lede { max-width: 32ch; line-height: 1.52; margin: 18px 0 22px; }
.library-start { border-radius: 24px 22px 21px 16px; }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: auto; max-width: 1074px; padding-inline: 30px; }
.library-heading h2 { margin: 0; }
.editions { position: relative; display: inline-flex; gap: 3px; padding: 4px; margin: 0; border: 1px solid #b6b8a2; background: #f0ebdd; border-radius: 25px; }
.editions legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.editions label { position: relative; min-height: 44px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 22px; color: #3f503f; font-weight: 700; cursor: pointer; }
.editions input { position: absolute; opacity: 0; }
.editions label:has(:checked) { background: #345743; color: #fff9e8; box-shadow: 0 2px 3px #293b2326; }
.editions label:has(:focus-visible) { outline: 3px solid #a55434; outline-offset: 2px; }
.editions small { font-size: .74rem; font-weight: 400; }
#shelf .books { margin-top: 24px; }
.narration > summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.paper-kite { transform-box: fill-box; transform-origin: 52% 31%; animation: kite-tug 4.8s ease-in-out infinite alternate; }
@keyframes kite-tug { from { transform: translate(-4px,4px) rotate(-6deg); } to { transform: translate(5px,-7px) rotate(8deg); } }
[data-edition="original"] .words { justify-content: safe center; }
[data-edition="original"] .words h2 { color: color-mix(in srgb,var(--ink) 58%,var(--accent)); text-wrap: balance; }
@media (min-width: 901px) and (min-aspect-ratio: 1/1) {
[data-edition="original"] .stage { width: min(1160px,100%); }
[data-edition="original"] .sheet { height: auto; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); }
[data-edition="original"] .pic { align-self: center; width: 100%; height: auto; }
[data-edition="original"] .words { padding: clamp(24px,3vw,46px); font-size: clamp(1.1rem,1.55vw,1.4rem); }
}
@media (max-width: 720px) {
.library-heading { flex-direction: column; }
[data-art="paper"] .library-hero { min-height: 0; display: flex; flex-direction: column; }
[data-art="paper"] .hero-copy { width: auto; margin: 0 7%; padding: 25px 0 0; align-self: flex-start; }
[data-art="paper"] #shelf h1 br { display: none; }
[data-art="paper"] #shelf h1 { max-width: none; font-size: clamp(2.5rem,9vw,3.3rem); }
[data-art="paper"] #shelf h1 em::before { content: ' '; }
[data-art="paper"] #paperPanorama { position: relative; order: 1; width: min(94%,470px); align-self: center; right: auto; margin: -8px 0 0; }
#paperPanorama .grove-art { height: auto; }
.editions label { padding-inline: 10px; gap: 5px; font-size: .91rem; }
}