/* erceau.com, scene "baies" (Skills in racks): three racks of units and the links between them.
   The shared frame of the scenes (.scene-*) is in main.css. Behaviour: assets/js/scene-baies.js.
   The page carries the drawing three times (phone .bs-p, tablet .bs-m, wide .bs-w): this sheet shows one.
   The base state is the complete, still image: it is what shows without JavaScript and in reduced motion. */
.bs { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 2.5rem; }
.bs .scene-freeze { justify-self: start; margin-top: .875rem; }
.bs .scene-state { margin-top: .625rem; min-height: 14.125rem; max-width: 60em; }
.bs .scene-state b { font-family: var(--f-display); font-weight: 700; color: #f0d08a; }
.bs .scene-key { margin-top: .75rem; }
.bs .scene-note { margin-top: .375rem; }
.bs .scene-roles { margin-top: .5rem; }
.bs .scene-roles h4 { margin-top: 1rem; font-family: var(--f-display); font-stretch: 85%; font-weight: 700; font-size: 1.125rem; color: var(--brass); }
.bs .scene-roles dl { max-width: 52em; }

/* The status block keeps the height of its longest sentence, measured width by width in both languages (nine lines at
   280 px, two from 900 px): nothing moves when a unit speaks, and the height is the same without the script. */
@media (min-width: 18.75rem) { .bs .scene-state { min-height: 12.75rem; } }
@media (min-width: 21rem) { .bs .scene-state { min-height: 11.3125rem; } }
@media (min-width: 22.5rem) { .bs .scene-state { min-height: 9.875rem; } }
@media (min-width: 26.5rem) { .bs .scene-state { min-height: 8.5rem; } }
@media (min-width: 31.5rem) { .bs .scene-state { min-height: 7.0625rem; } }
@media (min-width: 40rem) { .bs .scene-state { min-height: 5.625rem; } }
@media (min-width: 57.5rem) { .bs .scene-state { min-height: 4.1875rem; } }

/* Legend swatches: the colour is named in the text beside each */
.bs .scene-key li::before { content: ""; flex: none; width: 1.375rem; border-top: 2px solid var(--cue); forced-color-adjust: none; }
.bs .scene-key li:nth-child(2)::before { border-color: var(--brass); }
.bs .scene-key li:nth-child(3)::before { border-color: var(--chalk); }
.bs .scene-key li:nth-child(4)::before { border-top-style: dashed; }
.bs .scene-key li:nth-child(5)::before { width: .5625rem; height: .5625rem; border: 0; border-radius: 50%; background: #5ccf8b; }

/* The figure: one drawing on show, the light canvas over it with room for the halos */
.bs-fig { position: relative; justify-self: center; width: 100%; max-width: 27.5rem; margin-top: .5rem; aspect-ratio: 356 / 672; }
.bs-defs { position: absolute; }
.bs-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; font-family: var(--f-display); }
.bs-m, .bs-w { display: none; }
.bs .scene-light { left: -1rem; top: -1rem; width: calc(100% + 2rem); height: calc(100% + 2rem); }

/* A rack: its reflection on the floor, its edge, its top, its frame, its name band and its green light */
.bs-side { fill: #0f2219; stroke: rgb(122 168 234 / .6); stroke-width: 1.2; }
.bs-top { fill: #1d3d2e; stroke: rgb(122 168 234 / .8); stroke-width: 1.2; }
.bs-frame { fill: var(--pocket); stroke: #a9c8f2; stroke-width: 2.2; }
.bs-band { fill: var(--felt-3); stroke: rgb(122 168 234 / .5); }
.bs-rl { font-weight: 700; font-size: 13px; fill: #9cc0f2; }
.bs-ok { fill: #5ccf8b; }

/* A unit: a button of the scene. The ring shows the keyboard focus and widens the target */
.bs-u { cursor: pointer; outline: none; -webkit-user-select: none; user-select: none; }
.bs-ring { fill: none; stroke: var(--brass); stroke-width: 2; stroke-opacity: 0; pointer-events: all; }
.bs-u:focus-visible .bs-ring { stroke-opacity: 1; }
.bs-box { fill: var(--felt-2); stroke: #8fb8f0; stroke-width: 1.5; }
.bs-slit { fill: none; stroke: rgb(122 168 234 / .55); stroke-width: 2; }
.bs-led { fill: #5d86c4; }
.bs-u[data-r="aut"] .bs-led { fill: #b08c45; }
.bs-n { font-weight: 600; font-size: 13px; fill: var(--chalk); }
.bs-n2 { font-weight: 500; fill: var(--chalk-dim); }

/* A link: a halo, a core, an end square. Blue for migration, brass for scripts, chalk for identity, dashed for the base */
.bs-l { fill: none; }
.bs-lh { stroke: var(--cue); stroke-width: 4; stroke-opacity: .5; }
.bs-lc { stroke: #cfe0fa; stroke-width: 1.6; }
.bs-lh[data-k="adm"] { stroke: var(--brass); }
.bs-lc[data-k="adm"] { stroke: #f6dea6; }
.bs-lh[data-k="id"] { stroke: var(--chalk); stroke-opacity: .35; }
.bs-lc[data-k="id"] { stroke: #f7f3ea; }
.bs-lh[data-k="soc"] { stroke-opacity: .25; }
.bs-lc[data-k="soc"] { stroke: #a9c8f2; stroke-dasharray: 5 4; }

/* A unit on show (pointer, focus or choice): it and its neighbours stay lit, the rest steps back */
.bs.is-sel .bs-u:not(.is-rel) :is(.bs-box, .bs-slit, .bs-led) { opacity: .45; }
.bs.is-sel .bs-u:not(.is-rel) .bs-n { opacity: .75; }
.bs.is-sel .bs-l { opacity: .12; }
.bs.is-sel .bs-l.is-rel { opacity: 1; }
.bs.is-sel .bs-lc.is-rel { stroke-width: 2.4; }
.bs-u.is-cur .bs-box { stroke: var(--brass); fill: #2b2a16; }
.bs-u.is-cur :is(.bs-n, .bs-n2, .bs-led) { fill: #f0d08a; }

/* The smallest phones: the names grow and tighten, so that none is under 12 px */
@media (max-width: 23.0625rem) {
  .bs-svg { font-stretch: 78%; }
  .bs-n, .bs-rl { font-size: 15.5px; }
}
@media (min-width: 48rem) {
  .bs { grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; }
  .bs > * { grid-column: 1 / -1; }
  .bs .scene-title, .bs .scene-lead { grid-column: 1; }
  .bs .scene-freeze { grid-area: 1 / 2 / 3 / 3; align-self: end; margin-top: 0; }
  .bs-fig { max-width: 57.5rem; aspect-ratio: 780 / 520; }
  .bs-p { display: none; }
  .bs-m { display: block; }
  .bs-n { font-size: 14px; }
  .bs-n2 { font-size: 13px; }
  .bs-rl { font-size: 15px; }
}
@media (min-width: 70rem) {
  .bs-fig { max-width: none; aspect-ratio: 1240 / 470; }
  .bs-m { display: none; }
  .bs-w { display: block; }
}

/* Motion: the colours of a choice glide; at the opening the script lights the units, the green lights and the links one
   after the other (.is-on), then says the opening is over (.is-done). Before it, they wait dark. */
@media screen and (prefers-reduced-motion: no-preference) {
  .bs-box { transition: stroke .25s, fill .25s; }
  .bs-n { transition: fill .25s; }
  .bs-l { transition: opacity .4s; }
  .bs.is-live:where(:not(.is-done)) .bs-l:where(:not(.is-on)) { opacity: 0; }
  .bs.is-live:where(:not(.is-done)) :is(.bs-u:where(:not(.is-on)) .bs-led, .bs-ok:where(:not(.is-on))) { fill: var(--felt-3); filter: none; }
}
/* In forced colours there is no canvas: the still image stays whole, in its own colours on its own felt. */
@media (forced-colors: active) {
  .bs-fig { forced-color-adjust: none; background: var(--felt); }
}
