/* Пошук, версія «дивись»: фільм стоїть на місці, текст кадрів їде збоку. Поверх ../../_pk/pack.css і ../page.css */
/* wide screens: the film takes the full width of the window and sits in the middle of its height; other content keeps the 1040 px column */
@media (min-width: 861px) {
  main.watch { max-width: none; padding-left: 32px; padding-right: 32px; }
  .watch > :not(section), .watch section > :not(.scrolly) { margin-left: max(0px, calc((100% - 1040px) / 2)); }
  .watch .lab, .watch footer { max-width: 1040px; }
}
.watch h2 { margin-top: 56px; }
.watch > p.small { max-width: 680px; }
.watch .part-n { font: 500 13px/1 var(--pk-mono); color: var(--pk-muted); display: block; margin-bottom: 8px; }
.scrolly { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); column-gap: 48px; align-items: start; margin-top: 24px; }
.stage { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.stage canvas { display: block; width: min(100%, calc((100vh - 96px) * 16 / 9)) !important; height: auto; margin: 0 auto; aspect-ratio: 16 / 9; background: var(--pk-paper); border: 1px solid var(--pk-rule); }
.stage-bar { display: flex; gap: 14px; align-items: center; justify-content: space-between; width: min(100%, calc((100vh - 96px) * 16 / 9)); margin: 10px auto 0; min-height: 32px; font: 13px/1.3 var(--pk-mono); color: var(--pk-muted); }
.steps { list-style: none; margin: 0; padding: 0; }
.step { min-height: 85vh; padding: 2px 0 0 18px; border-left: 2px solid var(--pk-hair); opacity: .45; transition: opacity .2s, border-color .2s; cursor: pointer; }
.step:first-child { padding-top: 42vh; }
.step:last-child { min-height: 62vh; }
.step.on { opacity: 1; border-left-color: var(--pk-ink); }
.step h3 { margin: 0 0 8px; font: 500 15px/1.3 var(--pk-mono); }
.step h3 .n { color: var(--pk-muted); font-weight: 400; margin-right: 8px; }
.step p { margin: 0; font-size: 18px; line-height: 1.5; max-width: 400px; }
.try-head { font: 500 13px/1 var(--pk-mono); color: var(--pk-muted); margin: 56px 0 -14px; }
/* phone held upright: the film sticks to the top, the text scrolls under it */
@media (max-width: 860px) and (orientation: portrait) {
  .scrolly { display: block; }
  .stage { display: block; height: auto; top: 0; z-index: 2; margin: 0 -16px; background: var(--pk-paper); border-bottom: 1px solid var(--pk-rule); padding-bottom: 8px; }
  .stage canvas { width: 100% !important; border-left: 0; border-right: 0; }
  .stage-bar { width: auto; padding: 0 16px; margin-top: 8px; }
  .step { min-height: 58vh; }
  .step:first-child { padding-top: 12vh; }
  .step p { max-width: 640px; }
  .stage::after { content: attr(data-turn); display: block; padding: 4px 16px 0; font: 12px/1.3 var(--pk-mono); color: var(--pk-muted); }
}
/* phone turned on its side: film on the left at full height, text in a narrow column on the right */
@media (max-width: 960px) and (orientation: landscape) {
  main.watch { padding-left: 12px; padding-right: 12px; }
  .scrolly { grid-template-columns: minmax(0, 1fr) 200px; column-gap: 12px; }
  .stage canvas, .stage-bar { width: min(100%, calc((100vh - 52px) * 16 / 9)) !important; }
  .stage-bar { margin-top: 4px; min-height: 28px; }
  .step { padding-left: 12px; }
  .step p { font-size: 15px; line-height: 1.45; }
  .watch h2 { margin-top: 48px; }
}
/* cover: the film has no frame. The strip behind it takes the film's ground colour (set by scrolly.js as --film-bg),
   so the picture runs edge to edge, and the text of each shot rides over it as a card. */
.scrolly.cover { --film-bg: var(--pk-paper); background: var(--film-bg); transition: background-color .5s; margin-left: -32px; margin-right: -32px; padding: 0 32px; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
.cover .stage canvas { border: 0; background: transparent; width: min(100%, calc((100vh - 64px) * 16 / 9)) !important; }
.cover .stage-bar { position: absolute; left: 0; bottom: 16px; width: auto; margin: 0; padding: 4px 10px; min-height: 0; background: var(--pk-paper); border: 1px solid var(--pk-rule); }
.cover .step, .cover .step:first-child, .cover .step:last-child { min-height: 100vh; padding: 0; border-left: 0; opacity: 1; display: flex; align-items: center; }
/* the text of a shot sits straight on the film's ground, no box: a thin rule on the left, quiet until its shot plays.
   scrolly.js marks a dark ground with data-ground="dark" so the text turns light on charcoal shots. */
.cover .card { background: transparent; border: 0; border-left: 2px solid var(--pk-rule); padding: 2px 0 4px 18px; opacity: .45; transition: opacity .25s, border-color .25s, color .5s; }
.cover .step.on .card { opacity: 1; border-left-color: currentColor; }
.cover .card h3 { color: inherit; opacity: .7; }
.cover .card p { color: inherit; font-size: 17px; line-height: 1.55; }
.scrolly.cover[data-ground="dark"] .card { color: #ebebe7; }
.scrolly.cover[data-ground="light"] .card { color: #141518; }
.cover .stage-bar { gap: 8px; }
.cover .stage-bar .now { margin-right: 6px; }
.cover .stage-bar .ghost { color: var(--pk-ink); border: 1px solid var(--pk-ink); padding: 6px 12px; background: var(--pk-paper); cursor: pointer; }
@media (max-width: 860px) and (orientation: portrait) {
  .scrolly.cover { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .cover .stage { background: var(--film-bg); transition: background-color .5s; border-bottom: 0; padding-bottom: 10px; }
  .cover .stage canvas { width: 100% !important; }
  .cover .stage-bar { position: static; display: inline-flex; margin: 6px 16px 0; }
  .cover .stage::after { display: none; }
  .cover .step, .cover .step:first-child, .cover .step:last-child { min-height: 75vh; align-items: flex-start; }
  .cover .step:first-child { padding-top: 14vh; }
}
@media (max-width: 960px) and (orientation: landscape) {
  .scrolly.cover { margin-left: -12px; margin-right: -12px; padding: 0 12px; grid-template-columns: minmax(0, 1fr) 220px; }
  .cover .stage canvas { width: min(100%, calc((100vh - 16px) * 16 / 9)) !important; }
  .cover .stage-bar { bottom: 6px; }
  .cover .card { padding: 10px 12px 12px; }
}
@media (prefers-reduced-motion: reduce) { .step, .cover .card, .scrolly.cover, .cover .stage { transition: none; } }
@media print { .scrolly.cover { background: none; } .cover .step, .cover .step:first-child, .cover .step:last-child { min-height: 0; display: block; } .stage { position: static; height: auto; display: block; } .step { min-height: 0; opacity: 1; padding: 0 0 12px 18px; } }

/* wide screens, cover mode: the film sits near the top of the window instead of the middle, so a section does not open
   with half a screen of empty paper; controls go under the picture */
@media (min-width: 861px) and (orientation: landscape), (min-width: 961px) {
  .scrolly.cover { margin-top: 20px; }
  .cover .stage { height: auto; top: 16px; justify-content: flex-start; padding: 16px 0 52px; }
  .cover .stage canvas { width: min(100%, calc((100vh - 120px) * 16 / 9)) !important; }
  .cover .stage-bar { bottom: 10px; }
  .cover .step:first-child { min-height: 60vh; align-items: flex-start; padding-top: 48px; }
}

/* the dock: one strip of controls for all films on the page */
.film-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 10px; align-items: center; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--pk-paper); border-top: 1px solid var(--pk-rule); font: 13px/1.3 var(--pk-mono); color: var(--pk-muted); }
.film-dock .dock-btn { font: inherit; color: var(--pk-ink); background: transparent; border: 1px solid var(--pk-ink); border-radius: 0; min-height: 36px; padding: 6px 12px; cursor: pointer; }
.film-dock .dock-btn[aria-pressed="true"] { background: var(--pk-ink); color: var(--pk-paper); }
.film-dock .dock-btn:focus-visible { outline: 2px solid var(--pk-blue, #3a6cbf); outline-offset: 3px; }
.film-dock .dock-now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
body.has-dock { padding-bottom: 64px; }
body.has-dock .stage-bar { display: none; }
@media (min-width: 861px) and (orientation: landscape), (min-width: 961px) {
  body.has-dock .cover .stage { padding-bottom: 16px; }
  body.has-dock .cover .stage canvas { width: min(100%, calc((100vh - 130px) * 16 / 9)) !important; }
}
@media print { .film-dock { display: none; } body.has-dock { padding-bottom: 0; } }

/* top of a watch page: how long it takes and a switch between watching and reading */
.watch-meta { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 18px 0 6px; font: 13px/1.4 var(--pk-mono); color: var(--pk-muted); }
.watch-meta .mode { display: inline-flex; }
.watch-meta .mode .ghost { font: inherit; color: var(--pk-ink); background: transparent; border: 1px solid var(--pk-ink); border-radius: 0; min-height: 36px; padding: 6px 14px; cursor: pointer; }
.watch-meta .mode .ghost + .ghost { border-left: 0; }
.watch-meta .mode .ghost[aria-pressed="true"] { background: var(--pk-ink); color: var(--pk-paper); }
body:not([data-mode="read"]) #script { display: none; }
body[data-mode="read"] .watch section[id^="p"], body[data-mode="read"] .film-dock { display: none; }
body[data-mode="read"] #script h2 { margin-top: 32px; }
.mention-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 28px; max-width: 900px; }
.mention-list li { display: flex; gap: 10px; align-items: center; min-height: 32px; }
.mention-list canvas { width: 24px; height: 24px; image-rendering: pixelated; flex: none; }
.mention-list a { color: var(--pk-blue); text-decoration: none; font: 500 16px/1.4 var(--pk-sans, system-ui); }
.mention-list.m-tools a { color: var(--pk-violet); }
.mention-list a:hover, .mention-list a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
#mentions h3 { font: 500 13px/1.4 var(--pk-mono); color: var(--pk-muted); margin-top: 18px; margin-bottom: 10px; }
.film-dock .dock-help { position: absolute; left: 16px; bottom: calc(100% + 8px); max-width: 420px; padding: 12px 14px; background: var(--pk-paper); border: 1px solid var(--pk-rule); font: 14px/1.5 var(--pk-sans, system-ui); color: var(--pk-ink); }
.film-dock .dock-now { flex: 1; }

/* a term inside running text: its sprite, then the word in the colour of its kind; no box, no line */
a.term { color: var(--pk-blue); text-decoration: none; font-weight: 500; white-space: nowrap; }
a.term.term-tool { color: var(--pk-violet); }
a.term canvas { width: 24px; height: 24px; image-rendering: pixelated; vertical-align: -6px; margin-right: 4px; }
a.term:hover, a.term:focus-visible { text-decoration: underline; text-underline-offset: 4px; }

/* links between films: what to watch first, where to go next, the list of all films */
.film-links { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.film-links a { font: 500 17px/1.4 var(--pk-sans, system-ui); text-decoration: none; }
.film-links a:hover, .film-links a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.film-needs { margin: 14px 0 6px; }
.film-list section { margin-top: 34px; padding-top: 0; min-height: 0; }
.film-list section h2 { margin-bottom: 10px; }

/* the sound switch at the top of a watch page, with a line on what it does */
.sound-cta { display: flex; gap: 16px; align-items: center; margin: 14px 0 6px; max-width: 760px; }
.sound-cta button { flex: none; font: 500 15px/1.2 var(--pk-mono); color: var(--pk-paper); background: var(--pk-ink); border: 1px solid var(--pk-ink); border-radius: 0; min-height: 44px; padding: 10px 18px; cursor: pointer; }
.sound-cta button[aria-pressed="true"] { background: transparent; color: var(--pk-ink); }
.sound-cta button:focus-visible { outline: 2px solid var(--pk-blue, #3a6cbf); outline-offset: 3px; }
.sound-cta p { margin: 0; font: 14px/1.5 var(--pk-sans, system-ui); color: var(--pk-muted); }
body[data-mode="read"] .sound-cta { display: none; }
@media (max-width: 560px) { .sound-cta { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* first-visit note on how a watch page works */
.how-note { margin: 16px 0 6px; max-width: 620px; padding: 14px 16px; border: 1px solid var(--pk-rule); font: 14px/1.55 var(--pk-sans, system-ui); }
.how-note b { font: 500 13px/1.4 var(--pk-mono); }
.how-note ul { margin: 8px 0 12px; padding-left: 18px; }
.how-note button { font: 500 13px/1.2 var(--pk-mono); color: var(--pk-ink); background: transparent; border: 1px solid var(--pk-ink); border-radius: 0; min-height: 36px; padding: 6px 14px; cursor: pointer; }
body[data-mode="read"] .how-note { display: none; }

/* «Читати»: the films as an article, every shot a picture with its text */
body[data-mode="read"] #script .prose { max-width: 760px; }
body[data-mode="read"] #script h3 { font: 700 26px/1.25 var(--pk-mono); margin: 56px 0 8px; }
#script ol { list-style: none; margin: 0; padding: 0; }
#script ol li { margin: 0 0 40px; }
#script ol li p { margin: 0; font: 18px/1.7 var(--pk-sans, system-ui); max-width: 680px; }
#script .shot-n { display: block; font: 500 13px/1.4 var(--pk-mono); color: var(--pk-muted); margin: 0 0 6px; }
#script .shot-pic { margin: 0 0 14px; }
#script .shot-pic img { display: block; width: 100%; height: auto; border: 1px solid var(--pk-rule); }
@media (min-width: 1180px) {
  body[data-mode="read"] #script .prose { max-width: 1120px; }
  #script ol li:has(.shot-pic) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 4px 32px; align-items: start; }
  #script ol li:has(.shot-pic) .shot-pic { grid-row: 1 / span 2; margin: 0; }
  #script ol li:has(.shot-pic) p { font-size: 17px; }
}
body[data-mode="read"] #script > h2 { display: none; }

/* phone held upright: smaller text so more of it fits under the film, tighter top blocks */
@media (max-width: 860px) and (orientation: portrait) {
  .cover .card p, .step p { font-size: 15px; line-height: 1.5; }
  .cover .card h3, .step h3 { font-size: 13px; margin-bottom: 6px; }
  .cover .card { padding-left: 12px; }
  .cover .step, .cover .step:first-child, .cover .step:last-child { min-height: 62vh; }
  .watch h1 { font-size: 30px; line-height: 1.15; }
  .watch .lead { font-size: 16px; line-height: 1.5; }
  .watch section h2 { font-size: 22px; }
  .sound-cta p, .how-note { font-size: 13px; }
  #script ol li p { font-size: 16px; line-height: 1.6; }
  .film-dock .dock-btn { min-height: 34px; padding: 5px 9px; font-size: 12px; }
}
.how-note .turn { display: none; }
@media (max-width: 860px) and (orientation: portrait) { .how-note .turn { display: list-item; font-weight: 500; } }

/* vertical cut of a film for a phone held upright: the frame is 9:16 and fills the screen, the caption sits in its empty lower third */
.vert-link { display: none; }
@media (max-width: 860px) and (orientation: portrait) { .vert-link { display: block; margin: 12px 0 4px; } .vert-link a { display: inline-block; font: 500 14px/1.2 var(--pk-mono); color: var(--pk-paper); background: var(--pk-blue); text-decoration: none; padding: 10px 14px; } }
.scrolly.vert { display: block; max-width: none; }
.scrolly.vert .stage { position: sticky; top: 0; height: calc(100vh - 56px); height: calc(100svh - 56px); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; margin: 0 -12px; padding: 0; background: var(--film-bg, var(--pk-paper)); z-index: 2; }
.scrolly.vert .stage canvas { width: min(100%, calc((100vh - 56px) * 9 / 16)) !important; width: min(100%, calc((100svh - 56px) * 9 / 16)) !important; height: auto; aspect-ratio: 9 / 16; border: 0; background: transparent; margin: 0 auto; }
.scrolly.vert .stage-bar, .scrolly.vert .stage::after { display: none; }
.scrolly.vert .vcap { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: min(100%, calc((100vh - 56px) * 9 / 16)); width: min(100%, calc((100svh - 56px) * 9 / 16)); height: 33.5%; box-sizing: border-box; padding: 4px 14px 6px; overflow: hidden; color: var(--pk-ink); }
.scrolly.vert[data-ground="dark"] .vcap { color: #ebebe7; }
.scrolly.vert .vcap b { display: block; font: 500 12px/1.3 var(--pk-mono); opacity: .7; margin-bottom: 4px; }
.scrolly.vert .vcap p { margin: 0; font: 13.5px/1.4 var(--pk-sans, system-ui); }
.scrolly.vert .vcap a.term canvas { display: inline; width: 18px !important; height: 18px; aspect-ratio: auto; margin: 0 3px 0 0; border: 0; background: none; vertical-align: -4px; }
.scrolly.vert .steps { position: relative; margin-top: calc(-100vh + 56px); margin-top: calc(-100svh + 56px); }
/* svh, not dvh: the frame keeps one size while the browser bar slides away during scrolling, otherwise the film jumps */
.scrolly.vert .stage canvas { will-change: transform; }
.scrolly.vert .step, .scrolly.vert .step:first-child, .scrolly.vert .step:last-child { min-height: 90vh; padding: 0; border: 0; }
.scrolly.vert .step .card { visibility: hidden; }
@media (min-width: 861px) { .scrolly.vert .vcap p { font-size: 16px; } }

/* vertical cut: segments along the top of the frame, one per shot */
.scrolly.vert .vbar { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: min(100%, calc((100vh - 56px) * 9 / 16)); width: min(100%, calc((100svh - 56px) * 9 / 16)); box-sizing: border-box; padding: 0 10px; display: flex; gap: 3px; pointer-events: none; color: var(--pk-ink); }
.scrolly.vert[data-ground="dark"] .vbar { color: #ebebe7; }
.scrolly.vert .vbar span { flex: 1; height: 3px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.scrolly.vert .vbar i { display: block; height: 100%; background: currentColor; transform-origin: left center; transform: scaleX(0); }
.scrolly.vert .stage canvas { cursor: pointer; }
/* phone: four controls fit in one row, the "now playing" text gives way first */
@media (max-width: 560px) { .film-dock { gap: 6px; padding-left: 8px; padding-right: 8px; } .film-dock .dock-btn { padding: 5px 7px; font-size: 11.5px; white-space: nowrap; } .film-dock .dock-now { display: none; } .film-dock [data-act="help"] { margin-left: auto; } }
.draft-note { display: inline-block; margin: 0 0 10px; padding: 4px 10px; font: 500 12px/1.4 var(--pk-mono); color: var(--pk-ink); border: 1px dashed var(--pk-ink); }
