/* The start screen over the gallery (title.js), from home-v/08. Layers inside .ts: attract print (0) · screens (1) · footer (2)
   · wipe (5) · flying blocks (4). The whole sits under the header (z 6). Every class is .ts-*. */
.ts { position: fixed; inset: 0; z-index: 5; user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; }
.ts[hidden] { display: none; }
.ts.out { pointer-events: none; }
.ts-fly { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 4; image-rendering: pixelated; pointer-events: none; }
body.on-title .c-label, body.on-title .l-foot, body.on-title .r-about, body.on-title #stage, body.on-title #item { visibility: hidden !important; }
/* the attract backdrop: the projects' videos through a heavy 1-bit print, in a quiet tone of the ink */
.ts-att { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; image-rendering: pixelated; pointer-events: none; }
.ts-wipe { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; image-rendering: pixelated; pointer-events: none; display: none; }

.ts-scr { position: fixed; inset: 0; z-index: 1; }
.ts-scr[hidden] { display: none; }

/* ---------- title ---------- */
.ts-lock { position: absolute; left: 0; right: 0; top: 51%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; }
.ts-logo { display: block; image-rendering: pixelated; }
.ts-sub { position: relative; margin-top: 22px; font-size: 15px; }
.ts-act { position: relative; margin-top: 52px; width: 100%; height: 218px; }

/* Press Start: steps on and off (no fade) */
.ts-start { all: unset; position: absolute; left: 50%; top: 0; transform: translateX(-50%); cursor: pointer; font-size: 24px; letter-spacing: -.72px; line-height: 1.13; white-space: nowrap; padding: 6px 10px; }
.ts-start .ts-stk { position: relative; display: inline-block; }
.ts-start.blink .ts-stk { animation: ts-blink 1.06s steps(1, end) infinite; }
.ts-start.go .ts-stk { animation: ts-blink .1s steps(1, end) infinite; }
@keyframes ts-blink { 0%, 55% { visibility: visible; } 56%, 100% { visibility: hidden; } }
.ts-start:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.ts-start[hidden] { display: none; }

/* the menu: 24px items, one column round the screen's middle; the red square marks the pick */
.ts-menu { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ts-menu[hidden] { display: none; }
.ts-mi { all: unset; position: relative; display: flex; align-items: baseline; gap: 14px; padding: 3px 0 3px 30px; cursor: pointer; font-size: 24px; letter-spacing: -.72px; line-height: 1.13; white-space: nowrap; }
.ts-mi .ts-t { position: relative; opacity: var(--dim); }
.ts-mi.on .ts-t { opacity: 1; }
.ts-mi .ts-note { position: relative; font-size: 13px; letter-spacing: -.39px; opacity: 0; }
.ts-mi.on .ts-note { opacity: var(--dim); }
.ts-mi.off .ts-t { opacity: .22; }
.ts-mi.off { cursor: default; }
.ts-mi:focus-visible { outline: none; }
.ts-mi .ts-ch { opacity: 0; }
.ts-mi .ts-ch.on { opacity: 1; }
/* the cursor: the site's red square caret, stepped to the picked item; it blinks while it waits */
.ts-cur { position: absolute; left: 0; top: 0; width: 12px; height: 22px; background: var(--accent); pointer-events: none; display: none; }
.ts-cur.show { display: block; }
.ts-cur.idle { animation: ts-blink 1.06s steps(1, end) infinite; }
/* typed text: letters appear behind the red square caret */
.ts-caret { position: absolute; left: 0; top: .14em; width: .42em; height: .84em; background: var(--accent); opacity: 0; pointer-events: none; }
.ts-caret.on { opacity: 1; }

/* ---------- Work: the level select ---------- */
.ts-work { --top: 168px; }
.ts-wside { position: absolute; left: var(--m); top: var(--top); width: calc(5 * var(--col) + 4 * var(--g)); }
.ts-wlabel { position: relative; display: inline-block; font-size: 13px; opacity: var(--dim); }
.ts-wlist { list-style: none; margin-top: 28px; display: flex; flex-direction: column; gap: 4px; }
.ts-row { position: relative; display: grid; grid-template-columns: 40px 1fr; align-items: baseline; cursor: pointer; padding: 3px 0 3px 30px; }
.ts-row .ts-n { font-size: 13px; opacity: var(--dim); font-variant-numeric: tabular-nums; }
.ts-row .ts-t { font-size: 24px; letter-spacing: -.72px; line-height: 1.13; opacity: var(--dim); white-space: nowrap; }
.ts-row.on .ts-t, .ts-row.on .ts-n { opacity: 1; }
.ts-row .ts-ch { opacity: 0; } .ts-row .ts-ch.on { opacity: 1; }
.ts-wback { all: unset; cursor: pointer; margin-top: 40px; font-size: 13px; opacity: var(--dim); padding-left: 30px; }
.ts-wback:hover, .ts-wback:focus-visible { opacity: 1; }
.ts-wback:focus-visible span { outline: 1px solid currentColor; outline-offset: 2px; }
.ts-row:focus-visible { outline: none; }

/* the preview: a 16:10 print of the still that clears in squares onto the playing video (cols 5–12) */
.ts-wprev { position: absolute; left: calc(var(--m) + 5 * (var(--col) + var(--g))); top: var(--top);
  width: min(calc(7 * var(--col) + 6 * var(--g)), calc((100vh - var(--top) - 170px) * 1.6)); aspect-ratio: 16 / 10; overflow: hidden;
  background: color-mix(in srgb, var(--bg) 90%, var(--fg)); }
.ts-wprev img, .ts-wprev video, .ts-wprev canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-wprev canvas { image-rendering: pixelated; }
.ts-wprev video { opacity: 0; } .ts-wprev video.on { opacity: 1; }
/* the live moment: a red square in the corner while the video plays (steps on, steps off) */
.ts-wrec { position: absolute; right: 12px; top: 12px; width: 8px; height: 8px; background: var(--accent); display: none; }
.ts-wrec.on { display: block; animation: ts-blink 1.06s steps(1, end) infinite; }

.ts-wname { position: absolute; left: calc(var(--m) + 5 * (var(--col) + var(--g))); top: calc(var(--top) + var(--ph, 520px) + 28px); margin: 0; font-size: 42px; line-height: 1.13; white-space: nowrap; pointer-events: none; }
.ts-wname .ts-nm { position: relative; display: block; }
.ts-wname .ts-ch { opacity: 0; } .ts-wname .ts-ch.on { opacity: 1; }
.ts-wmeta { position: absolute; left: calc(var(--m) + 9 * (var(--col) + var(--g))); top: calc(var(--top) + var(--ph, 520px) + 34px); display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.ts-wkind, .ts-wserv { position: relative; display: inline-block; align-self: flex-start; }
.ts-wserv { opacity: var(--dim); }
.ts-wview { position: absolute; right: var(--m); top: calc(var(--top) + var(--ph, 520px) + 34px); font-size: 15px; text-decoration: underline; text-underline-offset: 2px; }

/* the dither screens the small lines open and close through (paper dots, crisp) */
.l-screen { position: absolute; image-rendering: pixelated; pointer-events: none; }

/* ---------- footer ---------- */
.ts-foot { position: fixed; left: var(--m); right: var(--m); bottom: var(--m); z-index: 6; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; font-size: 13px; pointer-events: none; }
.ts-copy { opacity: var(--dim); }
.ts-hint { position: relative; justify-self: center; white-space: nowrap; }
.ts-hint kbd { font: inherit; opacity: var(--dim); margin-right: 6px; }
.ts-hint kbd + kbd { margin-left: -2px; }
.ts-hint .ts-gap { display: inline-block; width: 22px; }
.ts-demo { position: relative; justify-self: end; white-space: nowrap; opacity: var(--dim); }

@media (max-width: 860px) {
  .ts-lock { top: calc(50% + 84px); }
  .ts-sub { margin-top: 16px; font-size: 13px; }
  .ts-act { margin-top: 32px; height: 204px; }
  .ts-start, .ts-mi { font-size: 22px; }
  .ts-work { --top: 204px; }
  .ts-wprev { left: var(--m); width: calc(100vw - 2 * var(--m)); }
  .ts-wname { left: var(--m); font-size: 30px; top: calc(var(--top) + var(--ph, 200px) + 16px); }
  .ts-wmeta { left: var(--m); top: calc(var(--top) + var(--ph, 200px) + 62px); }
  .ts-wview { top: calc(var(--top) + var(--ph, 200px) + 62px); }
  .ts-wside { top: calc(var(--top) + var(--ph, 200px) + 124px); width: auto; right: var(--m); }
  .ts-wlabel { display: none; }
  .ts-wlist { margin-top: 0; gap: 0; }
  .ts-row .ts-t { font-size: 20px; }
  .ts-wback { margin-top: 16px; }
  .ts-hint { display: none; }
  .ts-foot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) and (max-height: 700px) { .ts-row .ts-t { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .ts-cur.idle, .ts-wrec.on, .ts-start.blink .ts-stk, .ts-start.go .ts-stk { animation: none; } }

.ts-wview { all: unset; cursor: pointer; position: absolute; right: var(--m); font-size: 15px; text-decoration: underline; text-underline-offset: 2px; transition: color .25s cubic-bezier(.16, 1, .3, 1); }
.ts-wview { top: calc(var(--top) + var(--ph, 520px) + 34px); }
.ts-wview:hover, .ts-wview:focus-visible { color: var(--accent); }
.ts-credits { font-size: 15px; line-height: 1.35; padding: 2px 0 14px 30px; max-width: min(460px, calc(100vw - 2 * var(--m))); white-space: normal; }
.ts-credits p { position: relative; margin: 0; }
@media (max-width: 860px) { .ts-wview { top: calc(var(--top) + var(--ph, 200px) + 62px); } }
.ts-act { height: 270px; } .ts-lock { top: 50%; }
/* options: the graphics looks, one a row; the one in use keeps the red square, the cursor there is only its outline */
.ts-mi.head { margin-top: 12px; padding-left: 30px; } .ts-mi.head .ts-t { font-size: 15px; letter-spacing: -.3px; opacity: .5; }
.ts-mi.sub { padding-left: 58px; } .ts-mi.sub::before { content: ""; position: absolute; left: 30px; top: 50%; width: 12px; height: 20px; margin-top: -10px; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--fg) 35%, transparent); }
.ts-mi.mk::before { background: var(--accent); border-color: var(--accent); } .ts-mi.mk .ts-t { opacity: 1; }
.ts-menu.opts .ts-cur { background: none; border-left: 2px solid var(--fg); width: 2px; left: 12px; box-sizing: border-box; }
.ts-mi.sub { padding-left: 30px; } .ts-mi.sub::before { left: 0; } .ts-menu.opts .ts-cur { left: -14px; }
.ts-credits { font-size: 13px; line-height: 16px; padding-bottom: 10px; } .ts-act { height: 320px; }
.ts-warn { font-size: 15px; line-height: 20px; max-width: min(380px, calc(100vw - 2 * var(--m))); padding-bottom: 16px; }
/* short screens (a phone on its side) */
@media (max-height: 520px) { .ts-lock { top: 50% !important; } .ts-sub { margin-top: 8px; font-size: 13px; } .ts-act { margin-top: 14px; height: 176px; } .ts-start, .ts-mi { font-size: 18px; } .ts-mi { padding-top: 1px; padding-bottom: 1px; } .ts-credits { font-size: 11px; line-height: 13px; columns: 2; max-width: 80vw; } .ts-foot { bottom: 10px; } }
