/* Works page film (owner requests 14.10.2026). The canvas lies over the page's atmosphere and under
   its glass edges and header; the caption and controls ride above the glass so they stay crisp.
   The page's own list (and the footer) return with the list switch. On a phone held upright the
   film runs from top to bottom and parts under the centred work for its caption. */
html.works-film-on,html.works-film-on body{overflow:hidden;overscroll-behavior:none}
html.works-film-on .work-section,html.works-film-on #site-footer{display:none}
.works-film[hidden],.works-film-ui[hidden],.works-film-back[hidden]{display:none}

.works-film{position:fixed;inset:0;z-index:3;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;cursor:grab;opacity:0;transition:opacity 1s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film.is-ready{opacity:1}
.works-film.is-dragging{cursor:grabbing}
.works-film.is-hovering{cursor:pointer}
.works-film-canvas{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:2}
.works-film-grain{position:absolute;inset:0;z-index:1;pointer-events:none;background-repeat:repeat;background-size:256px 256px}

.works-film-ui{position:fixed;inset:0;z-index:27;pointer-events:none;opacity:0;transition:opacity 1s var(--ease-out,cubic-bezier(.23,1,.32,1)) .2s}
.works-film-ui.is-ready{opacity:1}
/* Opening a work: the caption steps back while the picture pours up into the project's hero
   (works-film.js), over the film and under the glass edges and the header — where the project page's
   hero will lie when its water opening continues from there. */
.works-film.is-opening~.works-film-ui{opacity:0;transition-duration:.3s;transition-delay:0s}
.works-film.is-opening{cursor:default}
.works-film-pour{position:fixed;inset:0;z-index:20;pointer-events:none;will-change:clip-path}
.works-film-pour>img{position:absolute;display:block;max-width:none;max-height:none;object-fit:cover;transform-origin:50% 50%;will-change:transform}

/* The centred work: number, name and field, changing softly as the film moves. */
.works-film-caption{position:absolute;left:50%;top:var(--film-caption-top,62vh);width:min(92vw,820px);transform:translateX(-50%);text-align:center}
.works-film-slides{position:relative;height:clamp(92px,9.6vw,124px)}
.works-film-slide{position:absolute;inset:0 0 auto;display:grid;justify-items:center;gap:9px;opacity:0;transform:translateY(12px);
  transition:opacity .5s var(--ease-out,cubic-bezier(.23,1,.32,1)),transform .7s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-slide.is-in{opacity:1;transform:none}
.works-film-slide.is-out{opacity:0;transform:translateY(-10px);transition-duration:.28s,.4s}
.works-film-number{font-size:14px;letter-spacing:.3em;color:var(--muted);font-variant-numeric:tabular-nums;direction:ltr}
.works-film-title{pointer-events:auto;touch-action:none;-webkit-user-drag:none;color:var(--ink);text-decoration:none;font-size:clamp(30px,3.5vw,56px);line-height:1;letter-spacing:.015em;padding:2px 10px;border-radius:8px}
.works-film-title:focus-visible{outline:2px solid var(--gold);outline-offset:6px}
.works-film-field{font-size:clamp(13px,1.05vw,16px);color:var(--muted);max-width:44ch}

/* Thirteen quiet marks: where the film stands in the loop (a click glides there). */
.works-film-ticks{touch-action:none;display:flex;justify-content:center;gap:2px;margin-top:20px;pointer-events:auto;direction:ltr}
html[dir=rtl] .works-film-ticks{flex-direction:row-reverse}
.works-film-tick{position:relative;width:22px;height:20px;padding:0;border:0;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.works-film-tick::before{content:'';position:absolute;inset-inline:5px;top:50%;height:2px;margin-top:-1px;border-radius:2px;background:var(--line);transition:background-color .35s ease,transform .45s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-tick:hover::before{background:var(--muted)}
.works-film-tick.is-active::before{background:var(--ink);transform:scaleX(1.8)}

/* First visit: how to move the film, quietly, until the first move. */
.works-film-hint{max-width:none;margin:14px auto 0;color:var(--muted);font-size:14px;letter-spacing:.06em;text-align:center;opacity:0;transform:translateY(4px);transition:opacity .8s ease,transform .8s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-hint.is-visible{opacity:.85;transform:none}
/* Controls: glass pills in the corners, above the bottom glass. */
.works-film-list,.works-film-back{pointer-events:auto;color:var(--ink);border:1px solid var(--line);
  background:color-mix(in srgb,var(--paper) 76%,transparent);-webkit-backdrop-filter:blur(16px) saturate(1.25);backdrop-filter:blur(16px) saturate(1.25)}
.works-film-list,.works-film-back{display:inline-flex;align-items:center;gap:10px;padding:10px 18px 10px 16px;border-radius:999px;cursor:pointer;transition:background-color .25s ease,border-color .25s ease,transform .3s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-list:hover,.works-film-back:hover{border-color:color-mix(in srgb,var(--ink) 34%,transparent)}
.works-film-list:active,.works-film-back:active{transform:scale(.97)}
.works-film-list:focus-visible,.works-film-back:focus-visible,.works-film-tick:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.works-film-list svg,.works-film-back svg{width:18px;height:18px;flex:none}
/* The glass decoration makes its buttons position:relative inline, so the corner is a wrapper. */
.works-film-corner{position:absolute;inset-inline-start:var(--gutter,24px);bottom:clamp(20px,3.4vh,36px);pointer-events:none}
.works-film-corner>.works-film-list{pointer-events:auto}
.works-film-back{margin-block-end:18px}
/* Down a phone the caption sits in the film's own gap; the film itself shows the way to move. While the
   works pass through the gap the caption steps aside, and returns when the film rests. */
.works-film-ui.is-vertical .works-film-hint{display:none}
.works-film-ui.is-vertical .works-film-caption{transition:opacity .45s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-ui.is-vertical.is-moving .works-film-caption{opacity:0;transition-duration:.16s}
.works-film-ui.is-vertical .works-film-ticks{transform:translateY(calc(var(--film-slack,0px)*-1))}

@media(max-width:760px){
  .works-film-slides{height:96px}
  .works-film-title{font-size:clamp(28px,8.4vw,40px)}
  .works-film-ticks{margin-top:14px}
  .works-film-tick{width:20px}
  .works-film-list{padding:11px;gap:0}
  .works-film-list span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
@media(max-height:520px) and (min-width:761px){
  .works-film-slides{height:62px}.works-film-title{font-size:26px}.works-film-field,.works-film-ticks,.works-film-hint{display:none}
}
/* Optional film on touch screens: readable native scrolling remains the
   default page, and its film controls keep a full finger-sized hit area. */
@media(max-width:800px),(pointer:coarse){
  .works-film-ticks{justify-content:flex-start;gap:0;max-width:100%;min-height:44px;margin-inline:auto;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;scrollbar-width:none}
  .works-film-ticks::-webkit-scrollbar{display:none}
  .works-film-tick{flex:0 0 44px;width:44px;min-width:44px;height:44px}
  .works-film-tick::before{inset-inline:14px}
  .works-film-list,.works-film-back{min-width:44px;min-height:44px}
}
@media(max-width:800px){
  /* The list's jump control keeps its label and select together. The optional
     film action gets its own row instead of competing for a phone's width. */
  body[data-site-page=projects] .work-index{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;justify-content:start;gap:10px;width:100%;min-width:0}
  body[data-site-page=projects] .work-index>label{grid-row:1;min-width:0}
  body[data-site-page=projects] .work-index>select{grid-row:2;width:100%;min-width:0;min-height:48px}
  body[data-site-page=projects] .work-index>.works-film-back{grid-row:3;justify-self:start;max-width:100%;margin:8px 0 0;white-space:nowrap}
}
@media(max-width:360px){
  html[lang=ru] body.projects-page .work-top h1{font-size:clamp(44px,13.75vw,48px)}
  html[lang=ru] body.projects-page .work-top h1 .reveal-word{white-space:nowrap;overflow-wrap:normal}
}
@media(prefers-reduced-motion:reduce){.works-film-hint,.works-film,.works-film-ui,.works-film-slide,.works-film-tick::before{transition:none}}
@media print{.works-film,.works-film-ui{display:none}html.works-film-on .work-section,html.works-film-on #site-footer{display:block}}

/* A blurred projection of the actual cover fills the film's paper. Its sampled pigments reach
   farther out, while the lower falloff leaves the title and controls on a calm reading surface. */
.works-film-ambient{position:absolute;left:0;top:0;width:0;height:0;z-index:0;pointer-events:none;isolation:isolate;opacity:0;
  --film-glow-a:.46;--film-glow-b:.38;--film-glow-c:.22;--film-cover-opacity:.76;
  -webkit-mask-image:linear-gradient(to bottom,transparent 0%,#000 18%,#000 82%,transparent 100%);
  mask-image:linear-gradient(to bottom,transparent 0%,#000 18%,#000 82%,transparent 100%)}
.works-film-ambient[data-ready=true]{opacity:1}
.works-film-ambient[data-theme=dark]{--film-glow-a:.58;--film-glow-b:.49;--film-glow-c:.28;--film-cover-opacity:.66}
.works-film-ambient-layer{position:absolute;inset:0;opacity:0;pointer-events:none;
  background:radial-gradient(ellipse 48% 48% at 34% 44%,rgb(var(--film-hue-1,0 0 0) / var(--film-glow-a)) 0%,rgb(var(--film-hue-1,0 0 0) / calc(var(--film-glow-a)*.4)) 35%,transparent 78%),
    radial-gradient(ellipse 46% 44% at 67% 43%,rgb(var(--film-hue-2,0 0 0) / var(--film-glow-b)) 0%,rgb(var(--film-hue-2,0 0 0) / calc(var(--film-glow-b)*.35)) 34%,transparent 79%),
    radial-gradient(ellipse 43% 46% at 51% 30%,rgb(var(--film-hue-3,0 0 0) / var(--film-glow-c)) 0%,transparent 75%);
  transition:opacity .7s var(--ease-out,cubic-bezier(.23,1,.32,1))}
.works-film-ambient-layer::before{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:var(--film-cover-image,none);background-size:cover;background-position:50% 50%;
  opacity:var(--film-cover-opacity);filter:saturate(1.35);transform:scale(1.1) rotate(-7deg)}
.works-film-ambient::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(to bottom,transparent 40%,color-mix(in srgb,var(--paper) 55%,transparent) 54%,color-mix(in srgb,var(--paper) 55%,transparent) 72%,color-mix(in srgb,var(--paper) 18%,transparent) 100%)}
/* The stronger image field needs the same ink contrast as the project name. */
html.works-film-on .works-film-number,html.works-film-on .works-film-field{color:var(--ink)}
@media(prefers-reduced-motion:reduce){.works-film-ambient-layer{transition:none}}

/* R53 (22.11.2026) · the way to the list and the two round buttons.
   The film's own button sits in the corner where a round button floats (WhatsApp in Hebrew, accessibility in English
   and Russian), and the two lay one over the other. Where the film runs sideways (a desk, a tablet, a phone lying
   down) the round button of that corner now waits above the film's button, as it already does on the archive and on
   the questions page (r49-float.css). On an upright phone the film is now the first face of the page and runs down
   the screen (works-film.js marks that on the page: works-film-upright). There the film's button moves to the
   middle of the foot of the screen, between the two round buttons. */
html.works-film-on[dir=rtl] body{--r49-right:max(calc(var(--r49-base,24px) + 64px),calc(clamp(20px,3.4vh,36px) + 58px))}
html.works-film-on:not([dir=rtl]) body{--r49-left:max(calc(var(--r49-base,24px) + 64px),calc(clamp(20px,3.4vh,36px) + 58px))}
html.works-film-on.works-film-upright[dir] body{--r49-left:var(--r49-base,18px);--r49-right:var(--r49-base,18px)}
html.works-film-upright .works-film-corner{inset-inline:0;display:flex;justify-content:center;bottom:var(--r49-base,18px)}
/* A phone lying down: the film runs sideways there, and its caption keeps to the number and the name, as it already
   does on a short wide screen, so that it stands whole above the foot of the screen. */
@media(max-height:520px) and (max-width:760px) and (orientation:landscape){
  .works-film-slides{height:62px}.works-film-title{font-size:26px}.works-film-field,.works-film-ticks,.works-film-hint{display:none}
}
/* On the shortest of them the name of the work stands alone, so that it is whole above the foot of the screen. */
@media(max-height:340px) and (orientation:landscape){.works-film-number{display:none}}
/* Down a phone the hint stays under the marks when they rise toward a short caption (English and Russian). */
.works-film-ui.is-vertical .works-film-hint{translate:0 calc(var(--film-slack,0px)*-1)}
