/* The archive room (the footage code, 2026-10-21; js/archive.js; D-052): a dark room of screens on the table, not a sheet
   of paper. Each screen is a button: its poster, its loop once it plays (the poster is the loop's first frame, so the
   change is a cut that does not show), a glass sheen, and its line, shown on hover, focus or a press. The viewer is a
   modal dialog: the clip larger (never larger than it was made), its kind and line, and its controls.
   The type pass (2026-11-12, docs/design/TYPE.md): the room's heading and its introduction are the story's voice; a
   screen's line is the record's; the counts and the viewer's kind are what the room's screens show, so they alone here
   are the screens' voice. Every size is site.css's scale. */
.archive-inner { max-width: 1440px; }
.archive { color: var(--text); padding: 4px 4px 24px; }
.archive-head { align-items: center; }
.archive-head h1 { color: var(--text); }
.archive-intro { margin: 2px 0 8px; max-width: 28em; font-family: var(--story); font-size: var(--fs-lede); font-weight: 420; font-variation-settings: var(--fv-lede); line-height: 1.3; text-wrap: pretty; }
.archive-how { margin: 0 0 6px; max-width: 62ch; font-size: var(--fs-body); color: var(--text-soft); }
.archive .archive-scenario { color: var(--text-soft); }
.archive :focus-visible { outline-color: var(--focus); }
.archive-kinds ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 8px 0 4px; padding: 0; }
/* the ways to each kind: quiet buttons, by another name */
.archive-kinds a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 15px; border-radius: 4px; border: 1.5px solid rgba(244, 236, 224, 0.42); background: rgba(20, 16, 12, 0.62); color: var(--text); text-decoration: none; font-family: var(--record); font-weight: 700; font-size: var(--fs-small); }
.archive-kinds a:hover { background: rgba(48, 38, 28, 0.85); border-color: rgba(244, 236, 224, 0.8); }
.archive-kinds .n, .archive-kind h2 .n { color: var(--cold); font-family: var(--screens); font-size: var(--fs-screen); font-weight: 400; font-variation-settings: normal; letter-spacing: 0.04em; }
.archive-kind { margin-top: 28px; }
.archive-kind h2 { margin: 0 0 14px; padding-top: 16px; border-top: 1px solid rgba(244, 236, 224, 0.16); font-family: var(--story); font-size: var(--fs-lede); font-weight: 600; font-variation-settings: var(--fv-lede); line-height: 1.15; scroll-margin-top: calc(var(--bar-h) + 8px); }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.archive-grid > li { min-width: 0; }
.tile { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; margin: 0; border: 0; border-radius: var(--radius); overflow: hidden; background: #0d1620; color: #fff; cursor: pointer; text-align: left; font: inherit; box-shadow: 0 0 0 1px rgba(244, 236, 224, 0.12), 0 6px 16px rgba(0, 0, 0, 0.45); scroll-margin: calc(var(--bar-h) + 8px) 0 12px; }
.tile-poster, .tile-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-loop { opacity: 0; }
.tile.live .tile-loop { opacity: 1; }
.tile::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(158deg, rgba(255, 240, 210, 0.10) 0%, rgba(255, 255, 255, 0) 40%), radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.32) 100%); }
.tile-line { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 26px 10px 8px; background: linear-gradient(to top, rgba(8, 7, 6, 0.94) 0%, rgba(8, 7, 6, 0.78) 55%, rgba(8, 7, 6, 0) 100%); font-family: var(--record); font-size: var(--fs-note); line-height: 1.32; opacity: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; transition: opacity 0.15s ease; }
.tile:hover .tile-line, .tile:focus-visible .tile-line, .tile[aria-pressed="true"] .tile-line { opacity: 1; }
.tile[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--lamp), 0 6px 16px rgba(0, 0, 0, 0.45); }
.archive-foot { margin-top: 28px; }
.archive-foot p { display: block; }
.archive-foot p + p::before { content: none; }

.archive-viewer { padding: 0; border: 0; background: transparent; color: var(--text); width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); overflow: auto; }
.archive-viewer::backdrop { background: rgba(8, 6, 4, 0.88); }
.viewer-inner { background: #0b0907; border-radius: 6px; padding: 14px 14px 16px; box-shadow: 0 0 0 1px rgba(244, 236, 224, 0.14), 0 20px 60px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 12px; }
.viewer-frame { position: relative; width: 100%; max-width: var(--w, 960px); margin: 0 auto; aspect-ratio: 16 / 9; background: #000; border-radius: 2px; overflow: hidden; }
.viewer-still, .viewer-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewer-clip { opacity: 0; }
.viewer-frame.playing .viewer-clip { opacity: 1; }
.viewer-words { display: flex; flex-direction: column; gap: 5px; max-width: 46em; }
.viewer-kind { margin: 0; font-family: var(--screens); font-size: var(--fs-screen); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cold); }
.viewer-line { margin: 0; font-family: var(--record); font-size: var(--fs-witness); line-height: 1.38; }
.viewer-line:focus { outline: none; }
.viewer-row { justify-content: flex-end; }
.viewer-row .btn:disabled { opacity: 0.38; }
.archive-viewer :focus-visible { outline-color: var(--focus); }

html.narrow .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html.narrow .tile-line { padding: 22px 7px 6px; -webkit-line-clamp: 5; }
html.narrow .archive-viewer { width: calc(100vw - 12px); }
html.narrow .viewer-inner { padding: 10px 10px 12px; }
html.narrow .viewer-row { justify-content: space-between; }
html.reduced .tile-line { transition: none; }
