/* Phyein Usul: where the living scenes of scripts/bg-scenes.js sit. Documented in docs/scripts/bg-scenes.md.
   The body is transparent so that scenes placed behind the page (z-index -1) show on the paper colour of <html>. */
body { position: relative; background: transparent; }
canvas.bgs { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* behind the top of a page: header and title stand on it; it fades out downwards */
.bgs-top { position: absolute; top: 0; left: 0; right: 0; height: 560px; z-index: -1; pointer-events: none; overflow: hidden; }
/* fixed to the window, behind everything: used with data-bg-mask="sides", so it lives in the side margins */
.bgs-fixed { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
/* beside the title, in the empty half of the page top (left of the title on Arabic pages); only where that half is empty */
.bgs-aside { position: absolute; top: 76px; height: 300px; left: calc(50% + 70px); width: min(520px, calc(50% - 110px)); z-index: -1; pointer-events: none; overflow: hidden; }
[dir="rtl"] .bgs-aside { left: auto; right: calc(50% + 70px); }
@media (max-width: 1239px) { .bgs-aside { display: none; } }
/* beside a wider title (Lucretius): further out */
.bgs-aside--far { left: calc(50% + 230px); width: min(380px, calc(50% - 250px)); }
[dir="rtl"] .bgs-aside--far { left: auto; right: calc(50% + 230px); }
/* a band of its own, between or after the parts of a page */
.bgs-band { position: relative; height: 260px; pointer-events: none; overflow: hidden; }
.bgs-band--low { height: 170px; }
.bgs-band--tall { height: 320px; }
@media (max-width: 760px) { .bgs-top { height: 420px; } .bgs-band { height: 200px; } .bgs-band--low { height: 130px; } .bgs-band--tall { height: 240px; } }
/* the home forest: from 761 px wide the holder reaches 150 px below the hero, so the trees' roots fill the soil there */
.bgs-top--forest { height: min(100svh, 860px); }
@media (min-width: 761px) { .bgs-top--forest { height: calc(min(100svh, 860px) + 150px); } }
@media print { canvas.bgs, .bgs-top, .bgs-aside, .bgs-fixed, .bgs-band { display: none; } }
/* the scenes page (scenes.html): every scene on its own, in an outlined box, its text beside its controls */
.scn-list { display: grid; gap: 56px; margin: 8px 0 64px; }
.scn h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(26px, 3vw, 34px); margin: 0 0 12px; color: var(--ink); }
.scn__n { font-family: var(--mono); font-size: 13px; letter-spacing: .08em; color: var(--accent); margin-right: 10px; vertical-align: middle; }
.scn__stage { position: relative; height: 340px; border: 1px solid var(--rule); background: var(--paper); overflow: hidden; }
.scn__stage--tall { height: 460px; }
.scn__text { display: block; max-width: 72ch; margin-top: 14px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.scn__text p { margin: 0 0 10px; }
.scn__text code { font-family: var(--mono); font-size: .9em; }
.scn__where, .scn__kh, .scn__stored { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.scn__kh { text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.scn__knobs { margin-top: 6px; padding: 14px 16px; border: 1px solid var(--rule); max-width: 72ch; }
.scn__k { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 220px) 12ch; gap: 12px; align-items: center; margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }
.scn__k i { color: var(--muted); font-style: normal; font-size: 12px; }
.scn__k input { width: 100%; accent-color: var(--accent); }
.scn__k output { font-family: var(--mono); font-size: 12.5px; color: var(--ink); text-align: right; }
.scn__again { margin-top: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; padding: 6px 12px; border: 1px solid var(--rule); background: transparent; color: var(--ink-2); cursor: pointer; }
.scn__again:hover { color: var(--accent); border-color: var(--accent); }
.scn-rm { display: none; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .scn-rm { display: block; } .scn__stage { display: none; } }
@media (max-width: 640px) { .scn__stage { height: 260px; } .scn__stage--tall { height: 380px; } .scn__k { grid-template-columns: 1fr 9ch; } .scn__k span { grid-column: 1 / -1; } }
/* the home page's note on what moves behind it, above the footer */
.bgs-note { max-width: 1100px; margin: 0 auto; padding: 0 32px; font-size: 14.5px; color: var(--ink-3); }
.bgs-note summary { cursor: pointer; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); list-style: none; padding: 10px 0; }
.bgs-note summary::-webkit-details-marker { display: none; }
.bgs-note summary::before { content: '› '; color: var(--accent); }
.bgs-note[open] summary::before { content: '⌄ '; }
.bgs-note summary:hover { color: var(--accent); }
.bgs-note p { margin: 0 0 8px; line-height: 1.6; max-width: 80ch; }
@media (max-width: 760px) { .bgs-note { padding: 0 20px; } }
/* a knob that offers only the values computed on Kaggle (scenes.html, Fig. 17) */
.scn__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.scn__opts button { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 3px 10px; font: 12.5px var(--mono); color: var(--ink-2); cursor: pointer; }
.scn__opts button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
