/* THE FILM'S FRAME (ref/spec/one_glacier.md 5; frame owner, 2026-11-18): the widescreen bars and the end credits.
   src/hud/frame/ drives both; this file only places them. */

/* ---------- the widescreen bars (5a) ----------
   2.39:1. Before the script runs the same formula sizes them (closed from the first paint); src/hud/frame/bars.js then
   sets --cn-bar to the exact device-pixel height (0 with no bars) and moves them by transform only.
   Over the canvases and the loader's stage (#loader-gl 15), under #hud (20), the cursor (18 and up) and the loader's
   type (#loader 50). Clicks pass through. The HUD reads --cn-bar to sit wholly inside a closed bar or wholly outside it. */
:root { --cn-bar: clamp(0px, calc((100vh - 100vw / 2.39) / 2), 14vh); }
#cn-bars { position: fixed; inset: 0; z-index: 16; pointer-events: none; contain: strict; }
#cn-bars i {
  position: absolute; left: 0; right: 0; height: var(--cn-bar); display: block;
  background: #000; will-change: transform; backface-visibility: hidden;
}
#cn-bars .cnb-t { top: 0; }
#cn-bars .cnb-b { bottom: 0; }
#cn-bars.cnb-off { display: none; }
/* an upright screen (a tall frame with bars is a stripe) and reduced motion: no bars */
@media (max-aspect-ratio: 6/5), (prefers-reduced-motion: reduce) {
  :root { --cn-bar: 0px; }
  #cn-bars { display: none; }
}

/* ---------- the end credits (5b) ----------
   Film end titles, not a page (11-21 20:41 ruling 5): the people rise over the cliff before the white; once the tower's
   cloud has opened, the licences stand as ONE compact block of role and name pairs, a role and a name on one line, the
   non-affiliation line last, over the dark city left of the tower, gone as the crane
   settles (src/hud/frame/credits.js). Each part sits in a fixed band whose soft head and foot (--cnc-f, the only clip)
   no line of the block ever reaches; the columns move by transform only. On the headings' left margin (css/hud.css
   .cn-chapter), at most 28 % of the width so it stays off the tower, no panel. With no bars (an upright phone, reduced
   motion, an ultrawide) the window still keeps 10 % of the height clear above and below, where the wordmark and the
   Sound toggle stand. */
#cn-credits {
  position: fixed; left: 0; right: 0; top: max(var(--cn-bar, 0px), 10vh); bottom: max(var(--cn-bar, 0px), 10vh); z-index: 16;
  pointer-events: none; display: none; visibility: hidden; contain: strict;
  --cnc-x: max(clamp(20px, 4.4vw, 84px), calc(env(safe-area-inset-left, 0px) + 12px));
  --cnc-w: min(28vw, 520px);
  --cnc-pad: 40px;   /* (room for the type's dark edge inside the band's mask) */
  color: #EDEFF2; font-family: 'IBM Plex Mono', monospace; font-kerning: none; font-variant-ligatures: none;
  /* a subtitle's dark edge, dense at the glyph and soft beyond it: white type that holds on the wet cliff, on the
     falls' spray and over the tower's city and cloud alike, no box */
  text-shadow: 0 0 1px rgba(4, 5, 8, 1), 0 0 2px rgba(4, 5, 8, 0.95), 0 0 5px rgba(6, 8, 12, 0.85), 0 1px 12px rgba(6, 8, 12, 0.7), 0 2px 30px rgba(6, 8, 12, 0.55);
}
/* (laid out and painted while he stands in the gorge's last stretch, its bands at opacity 0 until their window, so no
   text is first painted on a frame of the wrap: r6 p_desk_final, one 50 ms frame as it came in) */
#cn-credits.cnc-ready { display: block; visibility: visible; }
#cn-credits.on { visibility: visible; }
#cn-credits .cnc-band {
  position: absolute; left: calc(var(--cnc-x) - var(--cnc-pad)); width: calc(var(--cnc-w) + 2 * var(--cnc-pad));
  top: 3%; bottom: 3%; opacity: 0; will-change: opacity;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--cnc-f, 32px), #000 calc(100% - var(--cnc-f, 32px)), transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 var(--cnc-f, 32px), #000 calc(100% - var(--cnc-f, 32px)), transparent 100%);
}
#cn-credits .cnc-col { position: absolute; left: var(--cnc-pad); right: var(--cnc-pad); top: 0; will-change: transform; }
#cn-credits p { margin: 0; }
#cn-credits .cnc-g + .cnc-g { margin-top: clamp(18px, 1.15vw, 22px); }
/* names larger than roles */
#cn-credits .cnc-role {
  font: 500 clamp(10.5px, 0.6vw, 11.5px)/1.5 'IBM Plex Mono', monospace; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.72; margin-bottom: 0.3em;
}
#cn-credits .cnc-name { font: 500 clamp(17px, 1.1vw, 21px)/1.3 'IBM Plex Mono', monospace; }
#cn-credits .cnc-note { font: 400 clamp(12px, 0.68vw, 13px)/1.5 'IBM Plex Mono', monospace; margin-top: 0.3em; opacity: 0.9; }
/* the licence block: a role and a name on one line, the roles one column in the roles' caps (credits.js sets --cnc-rw
   to the widest role it measured); never wrapped, never clipped (credits.js takes shorter forms until each line fits) */
#cn-credits .cnc-cr {
  display: flex; align-items: baseline; white-space: nowrap;
  font: 400 clamp(10.5px, 0.6vw, 11.5px)/1.6 'IBM Plex Mono', monospace; opacity: 0.94;
}
#cn-credits .cnc-r {
  flex: none; width: var(--cnc-rw, auto); margin-right: 1.3em;
  font-weight: 500; font-size: 0.92em; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72;
}
#cn-credits .cnc-n { flex: none; }
#cn-credits .cnc-na { margin-top: 0.9em; }
#cn-credits .cnc-na .cnc-r { display: none; }
/* (21:32 ruling 5) the data line in its longest form, the licence's own sentence: no role, beside the notice at the foot */
#cn-credits .cnc-lone { margin-top: 0.9em; }
#cn-credits .cnc-lone .cnc-r { display: none; }
#cn-credits .cnc-lone + .cnc-na { margin-top: 0; }
/* the phones: no type under 11 px (ruling 5) */
@media (max-width: 600px), (max-height: 500px) {
  #cn-credits .cnc-role { font-size: 11px; }
  #cn-credits .cnc-cr { font-size: 11px; line-height: 1.45; }
  #cn-credits .cnc-r { font-size: 11px; letter-spacing: 0.06em; margin-right: 1em; }
  #cn-credits .cnc-na, #cn-credits .cnc-lone { margin-top: 0.6em; }
}
/* a short screen (a landscape phone): the licence block's measure ends well clear of the tower, which rises through the
   frame's middle third (r8 p_land: at 31vw its widest lines came within 9 px of the pod mid-ascent) */
@media (max-height: 500px) {
  #cn-credits { --cnc-w: 31vw; }   /* (the people, over the cliff: 11 px roles need the measure, r8 p_land) */
  #cn-credits .cnc-band-lic { width: calc(29vw + 2 * var(--cnc-pad)); }
}
/* narrow screens (an upright phone): the column takes the width */
@media (max-width: 600px) { #cn-credits { --cnc-w: calc(100vw - 2 * var(--cnc-x)); } }
/* an upright screen: the people rise over the gorge down to just over the Sound toggle; the licence block stands in the
   sky over the tower's pod (it comes up through the lower frame), never over the pod */
@media (max-aspect-ratio: 1/1) {
  #cn-credits { bottom: 7vh; }   /* (r5: the foot just over the Sound toggle) */
  #cn-credits .cnc-band-people { top: 1%; bottom: 0; }
  #cn-credits .cnc-band-lic { top: 0; bottom: auto; height: 26vh; }
  #cn-credits .cnc-cr { line-height: 1.4; }
}
