/* ============================================================
   KOKI TAKAMATSU — the "+" and the zoom view (js/zoom.js)
   The same on both pages: the illustration page's works and the front page's
   photos with a "+". Where a "+" sits on its picture: css/illustration.css for
   a work, below for a photo.
   ============================================================ */

/* "+" — a 4.5pt cross. It never moves: it only fades — in as its picture appears, out the
   moment the picture is opened, and back in once it has returned to its place. It inverts
   the picture beneath it with the cursor's inverse (#DCCBC3, difference), so it reads on
   any picture, light or dark.
   Every edge of it on a whole device pixel: its size and bar thickness come in whole device
   pixels (--plus-s / --plus-w, js/zoom.js) and the bars are centred by layout, not by
   half-bar transforms. A half-covered edge pixel over a bright picture would fold through
   black inside the cursor's square (css/anim.css). */
.plus{position:absolute;width:var(--plus-s,calc(4.5 * var(--k)));height:var(--plus-s,calc(4.5 * var(--k)));mix-blend-mode:difference}
.plus::before,.plus::after{content:"";position:absolute;background:#dccbc3;transition:background-color .25s cubic-bezier(.215,.61,.355,1)}
.plus::before{left:0;width:100%;height:var(--plus-w,max(.75px,calc(.6 * var(--k))));top:calc(50% - var(--plus-w,max(.75px,calc(.6 * var(--k)))) / 2)}
.plus::after{top:0;height:100%;width:var(--plus-w,max(.75px,calc(.6 * var(--k))));left:calc(50% - var(--plus-w,max(.75px,calc(.6 * var(--k)))) / 2)}
/* hover highlight: the "+" turns a solid whitish grey (the band grey, #f2f1ef) while the
   pointer is on the "+" itself — colour only, it never moves. (Not on the whole picture: a
   highlighted "+" far from the pointer read as left behind.) Inside the cursor's square it
   shows inverted, as a dark slate. Real-hover devices only, so a tap on a phone can't
   leave it stuck; keyboard focus on its picture gets the same highlight. */
@media (hover:hover){
  .plus:hover{mix-blend-mode:normal}
  .plus:hover::before,.plus:hover::after{background:var(--band)}
}
:focus-visible > .plus{mix-blend-mode:normal}
:focus-visible > .plus::before,:focus-visible > .plus::after{background:var(--band)}

/* ---- the front page's photos with a "+" (index.html) -------------------------------
   The whole photo is the button (as a work is), laid over the holder's picture; the
   holder itself is untouched (figure[data-slot]: js/photos.js, the console). */
.ph-open{
  position:absolute;inset:0;display:block;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;
  -webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;
}
.ph-open:focus{outline:none}
/* its focus ring: red and unmoved, as a work's — drawn just inside the photo, since a photo
   that reaches the page's edge would have the ring cut off outside it */
.ph-open:focus-visible{outline:max(1px,calc(.4 * var(--k))) solid var(--red);outline-offset:calc(-1 * max(1px,calc(.4 * var(--k))))}
/* its "+": centred --px / --py points in from the photo's top-left corner (.r: its top-right),
   where the page has always had it */
.ph-open .plus{left:calc(var(--px) * var(--k) - var(--plus-s,calc(4.5 * var(--k))) / 2);top:calc(var(--py) * var(--k) - var(--plus-s,calc(4.5 * var(--k))) / 2)}
.ph-open .plus.r{left:auto;right:calc(var(--px) * var(--k) - var(--plus-s,calc(4.5 * var(--k))) / 2)}
/* while a photo is up in the zoom its place is empty, as a work's in the row — only the
   picture is hidden, so its "+" can fold away and later draw itself back in */
.box.is-zoomed{background:none}
.box.is-zoomed > img{visibility:hidden}

/* ---- the zoom view: the band grey, the picture centred with the same 12pt margin on
   opposite sides (the illustration file's second row) ---------------------------------- */
/* Beneath the hamburger and its menu (z 89–90, css/anim.css): they stay the top layer, so a picture
   flies in and home under the hamburger, which never vanishes and reappears. While a picture is up
   (html.zoom-open, js/zoom.js) the zoom has the input: a click on the hamburger closes it, as a click
   anywhere does, and the page's scrollbar (above the menu) steps aside — the page under the grey
   doesn't scroll. The hamburger holds still meanwhile (js/menu.js), and its tint from the BACK GROUND
   picture fades with the grey (js/menu-shade.js). */
.zoom{position:fixed;inset:0;z-index:88;visibility:hidden;pointer-events:none;outline:none;touch-action:none}
html.zoom-open .menu-btn{pointer-events:none}
html.zoom-open .cscroll-rail.show,html.zoom-open .cscroll-thumb.show{opacity:0;pointer-events:none}
.zoom.is-open{visibility:visible;pointer-events:auto;cursor:pointer}
.zoom-bg{position:absolute;inset:0;background:var(--band);opacity:0}
/* Under the cursor's square the grey is drawn as its mirror about #DCCBC3 (#c6a597 —
   the very same colour once the square inverts it), a patch that follows the square
   (js/cursor.js). Fading in over the page's mirrored paper, the plain grey would pass
   through #DCCBC3 and flash the square black (css/anim.css). */
.zoom-bg .cursor-fold{background:#c6a597;mix-blend-mode:normal;z-index:0}
/* the chevrons: one beside each side of the picture, a hamburger box's width out from its edge (or centred
   in the margin where that is narrower: js/zoom.js places them, and in a step they glide to the next picture's
   edges with it, on its clock and curve). As tall as the hamburger's grey box (--mk, css/anim.css), cut
   like a heavy "<" (half its width the stroke). Beneath the pictures, so in a step a wipe passes over
   and past them as over the grey. A click / tap steps to the picture before / after. Part of the grey,
   so they fade in and out with it — one clock. The hamburger's grey (--ph), darker than #DCCBC3, so their soft diagonal edges never
   fold (css/anim.css). The one with nothing past it (the row's end) fades away in a step, on its clock and
   curve (js/zoom.js; a CSS transition would put it on a layer of its own for the fade, its edges folding
   meanwhile). (Keyboard: the arrows, and .zoom-ui.) */
.zoom-nav{position:absolute;left:0;top:calc(50% - 12 * var(--k));width:calc(12 * var(--k));height:calc(24 * var(--k));cursor:pointer}
.zoom-nav::before{content:"";position:absolute;left:calc(50% - var(--mk,4) * 4.7px * var(--nav-s,1));top:calc(50% - var(--mk,4) * 6px * var(--nav-s,1));width:calc(var(--mk,4) * 9.4px * var(--nav-s,1));height:calc(var(--mk,4) * 12px * var(--nav-s,1));background:var(--ph)}
.zoom-nav.prev::before{clip-path:polygon(50% 0,100% 0,50% 50%,100% 100%,50% 100%,0 50%)}
.zoom-nav.next::before{clip-path:polygon(0 0,50% 0,100% 50%,50% 100%,0 100%,50% 50%)}
.zoom-nav.is-end{pointer-events:none}
.zoom-fig{position:absolute;margin:0;transform-origin:0 0;background:var(--ph)}
.zoom-fig.has-img{background:none}
/* the picture in its frame, filling it exactly, so every edge of it lies on the frame's, on whole device
   pixels (the frame has the picture's shape to within a pixel: fit(); "contain" would leave it up to a
   pixel short, its edge soft between pixels — and a soft edge folds inside the cursor's square) */
.zoom-fig img{display:block;width:100%;height:100%;object-fit:fill}
/* A layer of its own (will-change) only while the frame flies in or back (.flies, js/zoom.js); at rest and
   in a step the picture is drawn in place. On a layer the browser resamples a picture differently — a little
   softer, its edges too — and a layer that has been scaled can stay drawn at not quite its size once still,
   its edges soft between pixels (measured: a soft bottom edge, at 1x and 2x). Drawn in place it is crisp, and
   a step's drift still glides between pixels, looking the same from a standstill to a standstill. */
.zoom-fig.flies{will-change:transform}
/* drawn too faint to see, ahead of time: a picture's first drawing at its size here decodes it (warm()) */
.zoom-fig.is-warm{opacity:.004;pointer-events:none}
/* keyboard / screen-reader controls: invisible until focused. In the middle of the top margin
   (6.4pt tall, the 12pt margin the picture always keeps clear): focused, a control never lies
   over the picture or its edge. On a layer of their own, so their letters are smoothed in grey
   like all the site's text: over the opaque grey the browser would smooth them in colour
   (subpixel), and those coloured edges fold through black inside the cursor's square. */
.zoom-ui{position:absolute;right:calc(12 * var(--k));top:calc(2.8 * var(--k));display:flex;gap:calc(4 * var(--k));will-change:transform}
.zoom-ui button{
  position:relative;opacity:0;pointer-events:none;
  font-family:"GothicCap","Gothic",sans-serif;font-size:calc(4 * var(--k));line-height:1;color:var(--ink);
  background:none;border:0;padding:calc(1.2 * var(--k)) calc(2.4 * var(--k));cursor:pointer;
}
.zoom-ui button:focus-visible{opacity:1;pointer-events:auto;outline:max(1px,calc(.4 * var(--k))) solid var(--red)}
