/* Video archive page: a shelf of tapes (js/snimci.js). Colours come from base.css; the tape colours code the themes. */
.snimci-page {
  --pad: clamp(20px, 3.4vw, 48px);
  --H: max(200px, min(46svh, 31vw, 100svh - 500px));            /* height of one tape; the width of a spine and of a cover follow from it (snimci.js) */
  background: var(--paper); color: var(--ink);
}
.snimci-page button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.snimci-page [hidden] { display: none !important; }

#sn { min-height: 100svh; display: flex; flex-direction: column; padding-bottom: 8px; }
#sn > * { flex-shrink: 0; }

/* ---------- title and themes ---------- */
.sn-head { position: relative; padding: 88px var(--pad) 0; text-align: center; }
.sn-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sn-back {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 99px;
  font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg); text-decoration: none; transition: background .25s ease, color .25s ease;
}
.sn-back:hover { background: var(--ink); color: var(--paper); }
.sn-count { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); }
.sn-head .eyebrow { margin-bottom: .7rem; }
.sn-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.01em; }
.sn-head h1 em { color: var(--acc); }

.sn-tabs { display: flex; justify-content: center; gap: 10px; margin-top: 24px; padding: 0 var(--pad); overflow-x: auto; scrollbar-width: none; }
.sn-tabs::-webkit-scrollbar { display: none; }
.sn-tabs button {
  flex: none; min-height: 40px; padding: 0 15px; border: 1px solid var(--rule); border-radius: 99px;
  font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-soft);
  transition: background .35s ease, color .35s ease, border-color .35s ease;
}
.sn-tabs button:hover { border-color: var(--ink); }
.sn-tabs button[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- the shelf ---------- */
.shelf {
  position: relative; height: calc(var(--H) + 80px); margin-top: clamp(4px, 1.6svh, 20px);
  perspective: 2200px; perspective-origin: 50% 50%; overflow-x: clip;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.shelf:active { cursor: grabbing; }
.shelf:focus-visible { outline: 2px solid var(--acc); outline-offset: -4px; }
.h-probe { position: absolute; left: -9999px; top: 0; width: 1px; height: var(--H); visibility: hidden; pointer-events: none; }
.stage { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.tape { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; cursor: pointer; }

.face {
  position: absolute; top: calc(var(--H) / -2); height: var(--H); box-sizing: border-box; overflow: hidden;
  border-radius: 2px; border: 1px solid rgba(255, 255, 255, .1); backface-visibility: hidden;
}
.face::after { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--shade, 0); pointer-events: none; border-radius: 2px; }
.tone-logori { background: #1d1a18; --accent: #b83b28; }
.tone-sana { background: #1a1f24; --accent: #3d6386; }
.tone-tribunal { background: #161d2e; --accent: #1f3fb0; }
.tone-doc { background: #1f201b; --accent: #82784a; }

/* the spine, facing the room */
.sp {
  width: var(--ws); left: calc(var(--ws) / -2); transform: translateZ(calc(var(--d) / 2));
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 0 0 8px; color: #ede9df;
}
.sp-band { display: block; width: 100%; height: 10px; background: var(--accent); flex: none; }
.sp-num { margin-top: 4px; font-size: 9px; font-weight: 600; letter-spacing: .1em; opacity: .7; }
.sp-title {
  writing-mode: vertical-rl; transform: rotate(180deg); max-height: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--serif); font-size: clamp(10px, calc(var(--H) * .04), 15px); line-height: 1.1;
}
.sp-foot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sp-year { font-size: 9px; font-weight: 600; letter-spacing: .06em; opacity: .8; font-variant-numeric: lining-nums; }
.sp-min { font-size: 9px; font-weight: 600; padding: 2px 4px; border: 1px solid rgba(237, 233, 223, .45); opacity: .85; }

/* the cover, turned away until the tape comes to the middle. No picture from other sites: the year stands in the frame. */
.cv {
  width: var(--d); left: calc(var(--d) / -2); transform: rotateY(90deg) translateZ(calc(var(--ws) / 2));
  display: flex; flex-direction: column; justify-content: space-between; padding: 10px 10px 8px; color: #ede9df;
  border-top: 4px solid var(--accent); box-shadow: 0 30px 60px -28px rgba(20, 16, 10, .55);
}
.cv-top { display: flex; justify-content: space-between; gap: 6px; font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.cv-title {
  margin: 4px 0; font-family: var(--serif); font-size: clamp(11px, calc(var(--H) * .044), 16px); line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cv-frame {
  flex: 1 1 auto; min-height: 0; margin: 4px 0; display: flex; align-items: center; justify-content: center;
  background: #101010 repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 3px);
  border: 1px solid rgba(237, 233, 223, .22); overflow: hidden;
}
.cv-year {
  font-family: var(--serif); font-weight: 500; font-size: calc(var(--H) * .14); line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums;
  color: transparent; -webkit-text-stroke: 1px rgba(237, 233, 223, .55);
}
.cv-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 8px; font-weight: 600; letter-spacing: .08em; opacity: .85; }
.cv-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-min { flex: none; padding: 1px 4px; border: 1px solid rgba(237, 233, 223, .45); white-space: nowrap; }

.play-ring {
  position: absolute; z-index: 300; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; will-change: transform;
  border: 1px solid var(--ink) !important; background: rgba(246, 244, 238, .86) !important; color: var(--ink);
}
.play-ring { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.play-ring svg { transform: translateX(1px); }
.play-ring:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* with a mouse the circle below replaces the button; the button still shows when it has the keyboard focus */
.sn-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .play-ring { opacity: 0; }
  .play-ring:focus-visible { opacity: 1; }
  .shelf.is-cover, .shelf.is-cover .tape { cursor: none; }
  .sn-cursor {
    display: flex; position: fixed; left: 0; top: 0; z-index: 90; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%;
    align-items: center; justify-content: center; pointer-events: none; will-change: transform;
    background: var(--ink); color: var(--paper); box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
    font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
    opacity: 0; scale: .4; transition: opacity .25s ease, scale .4s cubic-bezier(.2, .8, .2, 1);
  }
  .sn-cursor.on { opacity: 1; scale: 1; }
}

/* ---------- caption and arrows ---------- */
.caption { position: relative; display: flex; justify-content: center; padding: 22px 72px 0; min-height: 140px; }
.cap-live { width: min(100%, 720px); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; pointer-events: none; }
.cap-mask { position: relative; overflow: hidden; width: 100%; }
.cap-span { display: block; }
.cap-title { font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.7rem); line-height: 1.14; letter-spacing: -.01em; }
.cap-sub { color: var(--acc); font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; line-height: 1.3; }
.cap-year { font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); font-variant-numeric: lining-nums; }
.arrow { position: absolute; top: 14px; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.arrow-prev { left: 8px; }
.arrow-next { right: 8px; }
.arrow:hover { color: var(--acc); }
.arrow:focus-visible, .sn-tabs button:focus-visible, .sn-back:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.sn-credit { margin: auto auto 0; padding: 28px var(--pad) 20px; max-width: 52ch; text-align: center; font-size: .78rem; line-height: 1.5; color: var(--fg-muted); }

/* ---------- one recording opened ---------- */
#dt {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink); overflow-y: auto; overflow-x: hidden;
}
#dt:not([open]) { display: none; }
html:has(#dt[open]) { overflow: hidden; }
#dt::backdrop { background: var(--paper); }
.dt-x {
  position: fixed; z-index: 3; top: 16px; left: var(--pad); min-height: 44px; padding: 0 18px; border: 1px solid var(--rule) !important; border-radius: 99px;
  background: var(--paper) !important; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
}
.dt-x:hover { background: var(--ink) !important; color: var(--paper); }
.dt-x:focus-visible, .dt-watch:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
.dt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; min-height: 100%; padding: 96px 6vw 56px 7vw; box-sizing: border-box; }
.dt-copy { display: flex; flex-direction: column; gap: 16px; max-width: 540px; }
.d-mask { overflow: hidden; }
.d-line { display: block; }
.dt-sub { color: var(--acc); font-size: .74rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.dt-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 3.2rem); line-height: 1.04; letter-spacing: -.015em; }
.dt-meta { color: var(--fg-muted); font-size: .76rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; font-variant-numeric: lining-nums; }
.dt-note { padding-left: 12px; border-left: 2px solid var(--acc); font-size: .88rem; line-height: 1.45; color: var(--fg-soft); }
.dt-syn { font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; max-width: 44ch; }
.dt-src { font-family: var(--serif); font-style: italic; font-size: .98rem; color: var(--fg-muted); }
.dt-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 6px; }
.dt-watch {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 1px solid var(--ink); border-radius: 99px;
  color: var(--ink); font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; transition: background .3s ease, color .3s ease;
}
.dt-watch:hover { background: var(--ink); color: var(--paper); }
.dt-ext { font-size: .74rem; color: var(--fg-muted); }

/* ---------- the opened tape: its sleeve as a box, the tape half out of it (snimci.js vhs()) ----------
   .vhs is a point in the middle of the sleeve; every face is placed from it. Sizes follow the shelf: --S the height of the sleeve,
   --SW its width (the cover), --SD its depth (the spine). The tape is a little smaller than the inside of the sleeve. */
@property --out { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --lift { syntax: "<number>"; inherits: true; initial-value: 0; }
.dt-poster {
  --HP: min(80svh, 720px); --S: calc(var(--HP) * .68); --H: var(--S); --SW: calc(var(--S) * .527); --SD: calc(var(--S) * .169);
  --CH: calc(var(--S) * .965); --CW: calc(var(--CH) * 100 / 194); --CD: calc(var(--SD) * .78);
  position: relative; justify-self: center; height: var(--HP); width: calc(var(--HP) * .64); max-width: 100%;
  perspective: 1700px; perspective-origin: 50% 30%;
}
.vhs-scene { position: absolute; left: 50%; top: calc(var(--HP) * .99 - var(--S) / 2); transform-style: preserve-3d; animation: vhs-bob 6s ease-in-out infinite alternate; }
.vhs {
  position: absolute; left: 0; top: 0; width: 0; height: 0; background: none; transform-style: preserve-3d;
  transform: rotateX(var(--rx, -12deg)) rotateY(var(--ry, 32deg));
  transition: --lift .8s cubic-bezier(.2, .8, .2, 1);
}
@media (hover: hover) { .dt-poster:hover .vhs { --lift: .08; } }
.dt-poster.lift .vhs { --lift: .08; }   /* a tap on a phone (snimci.js) */
.dt-poster { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* the sleeve */
.vhs .vs { position: absolute; top: calc(var(--S) / -2); height: var(--S); box-sizing: border-box; }
.vhs .vs-front { width: var(--SW); left: calc(var(--SW) / -2); transform: translateZ(calc(var(--SD) / 2)); padding: calc(var(--S) * .028) calc(var(--S) * .028) calc(var(--S) * .022); border-radius: 2px 2px 3px 3px; box-shadow: none; }
.vhs .vs-left { width: var(--SD); left: calc(var(--SD) / -2); transform: rotateY(-90deg) translateZ(calc(var(--SW) / 2)); --shade: .34; padding-bottom: calc(var(--S) * .02); }
.vhs .vs-back { width: var(--SW); left: calc(var(--SW) / -2); transform: translateZ(calc(var(--SD) / -2)); background: #0d0f14; }
.vhs .vs-right { width: var(--SD); left: calc(var(--SD) / -2); transform: rotateY(90deg) translateZ(calc(var(--SW) / 2)); background: #0d0f14; }
.vhs .vs-front .cv-top, .vhs .vs-front .cv-foot { font-size: max(7px, calc(var(--S) * .018)); }
.vhs .vs-front .cv-title { font-size: calc(var(--S) * .042); margin: calc(var(--S) * .012) 0; }
.vhs .vs-front .cv-year { font-size: calc(var(--S) * .15); }
.vhs .vs-left .sp-band { height: calc(var(--S) * .025); }
.vhs .vs-left .sp-num, .vhs .vs-left .sp-year, .vhs .vs-left .sp-min { font-size: max(8px, calc(var(--S) * .02)); }
.vhs .vs-left .sp-title { font-size: calc(var(--S) * .034); }
/* printed card: a little grain, and a sheen that moves as the tape turns (--gx from snimci.js) */
.vhs .vs-front::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vs-gloss {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, .17) 37%, rgba(255, 255, 255, .05) 45%, transparent 58%);
  background-size: 280% 100%; background-position: var(--gx, 62%) 0;
}

/* the tape: it slides up out of the sleeve after the page opens, a little more under the mouse */
.vhs-cas {
  position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d;
  transform: translateY(calc(var(--S) * .5 - var(--CH) * .5 - var(--S) * .012 - (var(--out) + var(--lift)) * var(--CH)));
  animation: vhs-out 1.3s cubic-bezier(.2, .8, .2, 1) .6s both;
}
.vhs .vc { position: absolute; backface-visibility: hidden; }
.vhs .vc-front { width: var(--CW); height: var(--CH); left: calc(var(--CW) / -2); top: calc(var(--CH) / -2); transform: translateZ(calc(var(--CD) / 2)); border-radius: 3px; overflow: hidden; background: #171717; }
.vhs .vc-left {
  width: var(--CD); height: var(--CH); left: calc(var(--CD) / -2); top: calc(var(--CH) / -2); transform: rotateY(-90deg) translateZ(calc(var(--CW) / 2));
  background: repeating-linear-gradient(0deg, #141414 0 3px, #0b0b0b 3px 4px);
}
.vhs .vc-top {
  width: var(--CW); height: var(--CD); left: calc(var(--CW) / -2); top: calc(var(--CD) / -2); transform: rotateX(90deg) translateZ(calc(var(--CH) / 2));
  background: linear-gradient(90deg, #2d2d2d, #1b1b1b 70%, #141414); border-radius: 2px;
}
.vc-svg { display: block; width: 100%; height: 100%; }
.vc-svg .vf-acc { fill: var(--accent); }
.vc-svg .vf-hand { font-family: "Caveat", cursive; fill: #22304d; }
.vc-svg .vf-num { font-family: var(--sans); font-size: 7px; font-weight: 600; letter-spacing: .06em; fill: #22304d; }
.vc-svg .reel { transform-box: fill-box; transform-origin: center; animation: reel 5.5s linear infinite; }

/* the shadow on the floor breathes with the floating tape */
.vhs-floor {
  position: absolute; left: 50%; bottom: calc(var(--HP) * -.015); width: calc(var(--HP) * .5); height: calc(var(--HP) * .07); translate: -42% 0;
  background: radial-gradient(closest-side, rgba(20, 16, 10, .34), rgba(20, 16, 10, 0)); animation: vhs-floor 6s ease-in-out infinite alternate;
}
@keyframes vhs-bob { from { transform: translateY(0); } to { transform: translateY(calc(var(--HP) * -.016)); } }
@keyframes vhs-floor { to { scale: .9; opacity: .75; } }
@keyframes vhs-out { from { --out: 0; } to { --out: .47; } }
@keyframes reel { to { transform: rotate(360deg); } }

/* wide screens: the page is exactly one screen, so the wheel always turns the shelf */
@media (min-width: 768px) {
  #sn { height: 100svh; overflow: hidden; }
  .sn-credit { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; padding: 0 var(--pad); max-width: none; }
}

/* wide screens: the way back and the count sit beside the title, not above it */
@media (min-width: 768px) {
  .sn-row { position: absolute; left: var(--pad); right: var(--pad); top: 84px; margin: 0; pointer-events: none; }
  .sn-row > * { pointer-events: auto; }
}

/* ---------- phones ---------- */
@media (max-width: 767px) {
  .snimci-page { --H: min(76vw, 40svh); }
  .sn-head { padding-top: 72px; }
  .sn-row { margin-bottom: 4px; }
  .sn-head h1 { font-size: 1.75rem; }
  .sn-tabs { justify-content: flex-start; margin-top: 12px; }
  .caption { padding: 14px 52px 0; min-height: 124px; }
  .arrow-prev { left: 2px; top: 8px; }
  .arrow-next { right: 2px; top: 8px; }
  .cap-title { font-size: 1.2rem; }
  .dt-x { top: 10px; }
  .dt-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; padding: 72px 22px 40px; min-height: 0; }
  .dt-poster { order: -1; --HP: min(52svh, 400px); }
  .dt-title { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sn-back, .sn-tabs button, .dt-watch, .dt-x { transition-duration: 1ms !important; }
  .vhs-scene, .vhs-floor, .vc-svg .reel { animation: none; }
  .vhs-cas { animation: none; --out: .47; }
}
