/* site.css — KKS Bolash public pages (work page mosaic + lexicon index). */
:root {
  --ground: #262a4d;          /* the navy of the original compositions */
  --ink: #1d1b1a;
  --paper: #efece6;
  --muted: #5b5852;
  --rust: #7a3f22;
  --hair: #555a86;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--paper); }
body { font: 17px/1.5 var(--serif); }
a { color: inherit; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 16px; top: 8px; background: #fff; color: #000; padding: 6px; z-index: 9; }

header.bar, footer.derivation {
  font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  padding: 12px 16px; color: #c9c7d6;
}
header.bar .house { font-weight: 500; color: #fff; text-decoration: none; letter-spacing: .12em; }
header.bar .crumb a { text-decoration: none; } header.bar .crumb a:hover { text-decoration: underline; }
header.bar nav { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
button.ctl, a.ctl {
  font: inherit; color: #e6e4f0; background: transparent; border: 1px solid var(--hair);
  padding: 5px 10px; border-radius: 2px; cursor: pointer; text-decoration: none;
}
button.ctl[aria-pressed="true"] { background: #e6e4f0; color: var(--ground); }
button.ctl:focus-visible, a.ctl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- the mosaic (work pages) ---------- */
.mosaic { display: grid; gap: 1px; padding: 0 16px; }
.mosaic > * { min-width: 0; min-height: 0; }
.cell { overflow: hidden; position: relative; margin: 0; }
.cell img, .cell video { width: 100%; height: 100%; display: block; object-fit: cover; }
.cell--video { background: #000; }
.cell--video video { object-fit: contain; }
.cell--text { color: var(--ink); background: var(--paper); padding: 14px 16px; overflow: hidden; }
.cell--text h1 { font-size: clamp(30px, 3.4vw, 56px); line-height: 1; margin: 0 0 6px; font-weight: 600; letter-spacing: -.01em; }
.cell--text h2 { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 8px; color: var(--rust); }
.cell--text h3 { font-size: 17px; margin: .4em 0 .2em; }
.cell--text p, .cell--text ul { margin: 0 0 .6em; }
.cell--text ul { padding-left: 1.1em; }
.cell--text .dek { font-style: italic; color: var(--muted); }
.cell--text .byline { font: 12px var(--mono); color: var(--muted); }
.cell figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font: 11px var(--mono);
  background: linear-gradient(transparent, rgb(0 0 0 / .6)); color: #fff; opacity: 0; transition: opacity .2s; }
.cell:hover figcaption, .cell:focus-within figcaption { opacity: 1; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; font-size: 15px; }
dl.facts dt { font: 11px/1.9 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
dl.facts dd { margin: 0; }
.matrix { font: 12px var(--mono); color: var(--muted); word-spacing: .2em; }
.matrix a { text-decoration: none; } .matrix a:hover { text-decoration: underline; }
ul.perf { list-style: none; margin: 0; padding: 0; }
ul.perf button { all: unset; cursor: pointer; display: block; padding: 3px 0; border-bottom: 1px dotted #0004; width: 100%; }
ul.perf button[aria-current="true"] { font-weight: 600; }
ul.perf button:focus-visible { outline: 2px solid var(--ground); }
ol.steps { margin: 0; padding-left: 1.2em; font-size: 15px; }
ol.steps .when { font: 11px var(--mono); color: var(--muted); }
blockquote { margin: 0 0 .5em; font-style: italic; }
.orn { pointer-events: none; }

.note { display: none; font: 13px/1.4 var(--serif); color: var(--muted); border-left: 2px solid #aa5533; padding-left: 8px; margin: 6px 0; }
body.notes .note { display: block; }
.note b { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #aa5533; display: block; }

body.tree .mosaic > * { outline: 1px dashed rgb(255 255 255 / .55); outline-offset: -1px; }
body.tree .mosaic > [data-path]::after {
  content: attr(id) " " attr(data-path); position: absolute; top: 0; right: 0; z-index: 2;
  font: 10px var(--mono); background: #000c; color: #fff; padding: 1px 4px;
}

.mosaic--flow { display: block; padding: 0 16px; }
.mosaic--flow > .cell { margin: 1px 0; }
.mosaic--flow > .cell--video { aspect-ratio: 3 / 2; }
.mosaic--flow > .cell--image { aspect-ratio: 4 / 3; }
.mosaic--flow > .orn--strip { gap: 1px; margin: 1px 0; }

::view-transition-group(*) { animation-duration: .7s; animation-timing-function: cubic-bezier(.3,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*) { animation: none; } }

footer.derivation { flex-direction: column; align-items: flex-start; padding: 18px 16px 40px; }
footer.derivation code { color: #fff; word-break: break-word; font-size: 12px; }
footer.derivation pre { margin: 0; color: #a9a7c0; font: 11px/1.55 var(--mono); white-space: pre-wrap; }

.draft-banner { background: #aa5533; color: #fff; font: 12px var(--mono); padding: 6px 16px; }

/* ---------- the lexicon (index) ---------- */
.lex-head { padding: 8px 16px 18px; max-width: 70ch; }
.lex-head h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1; margin: 0 0 10px; font-weight: 600; }
.lex-head p { margin: 0; color: #d6d4e3; }
.filters { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; font: 12px var(--mono); }
.filters .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters .lbl { color: #9c9ab5; width: 7em; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--hair); color: #e6e4f0;
  padding: 4px 8px; text-decoration: none; border-radius: 2px; }
.chip.plus { background: #e6e4f0; color: var(--ground); }
.chip.minus { border-style: dashed; color: #d9a08a; text-decoration: line-through; }
.chip:hover { border-color: #fff; }
.query { font: 12px var(--mono); color: #fff; padding: 0 16px 12px; }
.query a { color: #c9c7d6; margin-left: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1px; padding: 0 16px 40px; }
.card { background: var(--paper); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; min-height: 100%; }
.card .thumb { aspect-ratio: 4 / 3; background: #c9c5bb center / cover no-repeat; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.card h2 { font-size: 20px; line-height: 1.15; margin: 0; }
.card .meta { font: 11px var(--mono); color: var(--muted); }
.card:hover h2, .card:focus-visible h2 { text-decoration: underline; }
.card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.empty { padding: 20px 16px; color: #d6d4e3; }

/* ---------- jukebox ---------- */
ol.tracks { list-style: none; margin: 0 0 14px; padding: 0; columns: 15em; column-gap: 18px; }
ol.tracks li { break-inside: avoid; }
ol.tracks button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 2px; border-bottom: 1px dotted #0003; font-size: 15px; }
ol.tracks .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; box-shadow: 0 0 0 2px #0001; }
ol.tracks .t { flex: 1; } ol.tracks .d { font: 11px var(--mono); color: var(--muted); }
ol.tracks button:hover .t { text-decoration: underline; }
ol.tracks button[aria-current="true"] { font-weight: 600; }
ol.tracks button[aria-current="true"] .dot { box-shadow: 0 0 0 3px #fff, 0 0 10px 3px var(--c); }
ol.tracks button:focus-visible { outline: 2px solid var(--ground); }
.np { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: rgb(20 22 44 / .94); backdrop-filter: blur(6px); border-top: 2px solid var(--accent, #d48800);
  box-shadow: 0 -6px 30px color-mix(in srgb, var(--accent, #d48800) 35%, transparent); font-family: var(--mono); color: #e6e4f0; }
.np[hidden] { display: none; }
.np .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent, #d48800); display: block; }
.np #np-title { font: 600 17px var(--serif); color: #fff; }
.np-what { min-width: 0; flex: 0 1 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-bar { flex: 1; height: 6px; background: #ffffff22; border-radius: 3px; cursor: pointer; }
.np-bar #np-fill { height: 100%; width: 0; background: var(--accent, #d48800); border-radius: 3px; }
body:has(.np:not([hidden])) footer.derivation { padding-bottom: 90px; }
@media (max-width: 720px) { #np-meter { display: none; } .np-what { flex-basis: 140px; } }

/* ---------- series members ---------- */
.cell a.member { display: block; width: 100%; height: 100%; position: relative; text-decoration: none; background: var(--paper); color: var(--ink); }
.cell a.member img { width: 100%; height: 100%; object-fit: cover; }
.cell a.member .label { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; font: 13px var(--serif);
  background: rgb(239 236 230 / .92); color: var(--ink); }
.cell a.member:hover .label b, .cell a.member:focus-visible .label b { text-decoration: underline; }
.cell a.member:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }

/* ---------- home: one bar, the lexicon folded into it ---------- */
.bar--home { position: relative; gap: 10px 22px; padding: 14px 16px 12px; }
.house--big { font: 600 clamp(22px, 2.6vw, 34px)/1 var(--serif) !important; letter-spacing: .18em !important; }
details.lex { position: static; }
details.lex > summary { list-style: none; cursor: pointer; display: inline-flex; gap: 8px; align-items: baseline; border: 1px solid var(--hair); padding: 6px 10px; border-radius: 2px; color: #e6e4f0; }
details.lex > summary::-webkit-details-marker { display: none; }
details.lex > summary .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #9c9ab5; }
details.lex > summary .q { color: #fff; }
details.lex[open] > summary { background: #e6e4f0; color: var(--ground); } details.lex[open] > summary .q { color: var(--ground); }
details.lex[open] .chev { display: inline-block; transform: rotate(180deg); }
details.lex .filters { position: absolute; left: 16px; right: 16px; top: 100%; z-index: 40; padding: 14px 16px 16px;
  background: rgb(30 33 62 / .97); backdrop-filter: blur(6px); border: 1px solid var(--hair); box-shadow: 0 20px 50px #0008; }
.lex-note { margin: 0 0 6px; font: 14px var(--serif); color: #d6d4e3; max-width: 70ch; }
.cell a.member .label .matrix { display: block; font-size: 10px; margin-top: 2px; opacity: .8; }
.cell a.member.featured .label { font-size: 17px; }
.cell a.member:not(:has(img)) { background: repeating-linear-gradient(135deg, #e9e5dc 0 8px, #e2ddd2 8px 16px); }

/* ---------- piece view: one piece on a neutral wall, still inside its series ---------- */
.cell a.piece-link { display: block; width: 100%; height: 100%; cursor: zoom-in; }
.cell a.piece-link:focus-visible { outline: 3px solid var(--paper); outline-offset: -3px; }
dialog.piece-view {
  --wall: #e7e5e0; --wall-ink: #2b2926;
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--wall); color: var(--wall-ink);
  display: none; grid-template-rows: 6px auto minmax(0, 1fr) auto auto; grid-template-columns: minmax(0, 1fr);
}
dialog.piece-view[open] { display: grid; }
dialog.piece-view::backdrop { background: rgb(20 20 24 / .6); }
.pv-band { background: var(--ground); }
.pv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 16px 6px; font: 13px var(--mono); }
.pv-back { color: var(--wall-ink); text-decoration: none; font-size: 15px; }
.pv-back:hover, .pv-back:focus-visible { text-decoration: underline; }
.pv-back span { font: 600 18px/1.2 'Newsreader', serif; letter-spacing: .01em; }
.pv-count { color: #6a665f; }
.pv-stage { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-height: 0; padding: 8px 56px; touch-action: pan-y; }
.pv-stage:focus { outline: none; }
.pv-stage img { grid-area: 1 / 1; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; min-width: 0; min-height: 0;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 10px 30px rgb(0 0 0 / .14); user-select: none; -webkit-user-drag: none; }
.pv-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 64px; display: grid; place-items: center;
  font: 40px/1 'Newsreader', serif; color: var(--wall-ink); text-decoration: none; border-radius: 4px; }
.pv-nav:hover, .pv-nav:focus-visible { background: rgb(0 0 0 / .07); }
.pv-prev { left: 6px; } .pv-next { right: 6px; }
.pv-caption { margin: 0; padding: 8px 16px 4px; text-align: center; font: 16px/1.4 'Newsreader', serif; min-height: 1.4em; }
.pv-credit { display: inline-block; margin-left: .6em; font: 12px var(--mono); color: #6a665f; }
.pv-strip { padding: 6px 16px 12px; overflow-x: auto; scrollbar-width: thin; }
.pv-strip ol { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 6px; width: max-content; }
.pv-strip a { display: block; height: 56px; border: 2px solid transparent; border-radius: 2px; opacity: .62; transition: opacity .15s; }
.pv-strip a:hover, .pv-strip a:focus-visible { opacity: 1; }
.pv-strip a[aria-current] { opacity: 1; border-color: var(--wall-ink); }
.pv-strip img { height: 100%; width: auto; display: block; }
@media (max-width: 720px) {
  .pv-stage { padding: 4px 8px; }
  .pv-nav { width: 36px; height: 48px; font-size: 32px; background: rgb(231 229 224 / .7); }
  .pv-strip a { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .pv-strip a { transition: none; } }

/* ---------- theater: one film on a dark stage, its episodes beneath ---------- */
dialog.theater { --wall: #0e0e10; --wall-ink: #e9e6e0; }
dialog.theater::backdrop { background: rgb(0 0 0 / .85); }
.theater .pv-count, .theater .pv-credit { color: #9a958c; }
.theater .pv-nav:hover, .theater .pv-nav:focus-visible { background: rgb(255 255 255 / .08); }
/* the film at its own shape, as large as the stage allows: --ar is width/height */
.theater .pv-stage { container-type: size; }
.theater .pv-stage video { grid-area: 1 / 1; display: block; background: #000; --ar: 4 / 3;
  aspect-ratio: var(--ar); width: min(100cqw, calc(100cqh * (var(--ar)))); height: auto; max-height: 100cqh; }
.theater .pv-stage video:focus { outline: none; }
.theater .pv-caption b { font-weight: 600; }
.th-strip a { height: auto; width: 150px; display: flex; flex-direction: column; gap: 4px; color: var(--wall-ink); text-decoration: none; font: 12px/1.3 var(--mono); }
.th-strip img { width: 100%; height: 84px; object-fit: cover; background: #222; }
.th-strip span { display: block; padding: 0 2px 2px; white-space: normal; }
.theater .pv-strip a[aria-current] { border-color: var(--wall-ink); }
.cell--video { position: relative; }
a.to-theater { position: absolute; top: 8px; right: 8px; padding: 3px 8px; font: 12px var(--mono); color: #fff; background: rgb(0 0 0 / .55);
  border-radius: 3px; text-decoration: none; opacity: .75; }
a.to-theater:hover, a.to-theater:focus-visible { opacity: 1; background: rgb(0 0 0 / .8); }
a.to-theater::before { content: "⤢ "; }
ul.perf a.film-link { display: block; padding: 3px 0; border-bottom: 1px dotted #0004; color: inherit; text-decoration: none; } ul.perf a.film-link:hover { text-decoration: underline; } ul.perf a.film-link::after { content: " ⤢"; opacity: .5; }
@media (max-width: 720px) { .th-strip a { width: 116px; } .th-strip img { height: 66px; } }

/* ---------- series: a refrain speaks for its members on the home page ---------- */
.cell a.member .label .series { font-variant: small-caps; letter-spacing: .06em; white-space: nowrap; }
.cell a.member .label .series::before { content: "❐ "; font-variant: normal; }

/* ---------- the gallery wall: every piece of the series hung whole, below the mosaic ---------- */
.cell--text .to-wall { margin: 10px 0 0; font: 12px var(--mono); }
.cell--text .to-wall a { text-decoration: none; border-bottom: 1px solid currentColor; }
.wall { --wall: #e7e5e0; --wall-ink: #2b2926; margin: 28px 16px 0; background: var(--wall); color: var(--wall-ink); scroll-margin-top: 12px; }
.wall-band { height: 6px; background: var(--ground); }
.wall h2 { margin: 0; padding: 22px clamp(16px, 4vw, 56px) 4px; font: 600 26px/1.2 var(--serif); }
.wall h2 small { font: 13px var(--mono); color: #6a665f; margin-left: 6px; }
/* justified rows: each picture grows in proportion to its width/height, so a row of different shapes keeps one height */
.hang { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px clamp(20px, 3vw, 48px); padding: 24px clamp(16px, 4vw, 56px) 56px; }
.hang::after { content: ""; flex: 1e4 1 0; }  /* the last row is not stretched */
.hang figure { margin: 0; flex: calc(var(--ar) * 100) 1 calc(var(--ar) * 240px); max-width: calc(var(--ar) * 72vh); min-width: 0; }
.hang a { display: block; }
.hang img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: contain; background: #d9d6cf;
  box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 6px 18px rgb(0 0 0 / .12); }
.hang a:hover img, .hang a:focus-visible img { box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 10px 28px rgb(0 0 0 / .2); }
.hang a:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }
.hang figcaption { margin-top: 10px; font: 13px/1.4 var(--mono); color: #4a4741; }
.hang figcaption b { font: 600 16px/1.3 var(--serif); color: var(--wall-ink); }
.hang figcaption .no { display: inline-block; min-width: 2.2em; color: #8a867e; }
@media (max-width: 700px) {
  .wall { margin: 20px 0 0; }
  .hang { gap: 32px; }
  .hang figure { flex: 1 1 100%; max-width: none; }
}

/* ---------- the view switch: mosaic · plain ---------- */
.views { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.views a { color: #c9c7d6; text-decoration: none; padding: 5px 2px; border-bottom: 1px solid transparent; }
.views a:hover { color: #fff; border-bottom-color: currentColor; }
.views a.on { color: #fff; border-bottom-color: #fff; }
.views a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hang .hang-sec { flex: 1 0 100%; margin: 12px 0 -16px; font: 600 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #6a665f; }
.hang .hang-sec:first-child { margin-top: 0; }
