/* Portfolio V2: the gallery (the live site's menu, on the site's porcelain, in the site's type) */
/* one ground for all three views, porcelain like the rest of the site (Adam, 28 Nov: it was white, and white pictures vanished on it):
   List and Memory sit on it too, and the frosted header bar is made of it */
body.gal { --gal-ground: rgb(237, 238, 241); --bar-ground: var(--gal-ground); background: var(--gal-ground); transition: background-color .5s; overflow: hidden; height: 100vh; height: 100dvh; }
.gal__host { position: fixed; inset: 0; z-index: 0; }
.gal__host canvas { display: block; width: 100vw; height: 100vh; height: 100lvh; touch-action: none; cursor: grab;
  opacity: 0; filter: blur(14px); transform: scale(1.05); transition: opacity 1s var(--pour), filter 1.2s var(--pour), transform 1.4s var(--pour); }
.is-ready .gal__host canvas { opacity: 1; filter: none; transform: none; }
#scene-label { position: fixed; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.gal__cap { position: fixed; z-index: 5; left: var(--m); bottom: clamp(20px, 4vh, 44px); max-width: min(520px, calc(100vw - var(--m) * 2)); pointer-events: none;
  display: grid; gap: 6px; padding: 18px 24px 20px; border-radius: 22px;
  background: color-mix(in srgb, var(--porcelain) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 24px 50px -28px rgba(15, 17, 21, .35);
  opacity: 0; transform: translateY(10px); transition: opacity .9s var(--pour) .5s, transform 1.1s var(--pour) .5s; }
.is-ready .gal__cap { opacity: 1; transform: none; }
.gal__cap b { font: 600 clamp(26px, 2.6vw, 40px) / 1 var(--display); letter-spacing: -.035em; text-wrap: balance; transition: opacity .14s, filter .14s; }
.gal__cap span { font-size: 15px; line-height: 1.4; color: var(--mute); transition: opacity .14s; }
.gal__cap.is-swap b { opacity: 0; filter: blur(6px); }
.gal__cap.is-swap span { opacity: 0; }
.is-opening .gal__cap { opacity: 0; transition: opacity .3s; }

/* without WebGL the gallery is a list */
.gal__list { display: none; }
.no-gl.gal { overflow: auto; height: auto; }
.no-gl .gal__host, .no-gl .gal__cap { display: none; }
.no-gl .gal__list, html:not(.js) .gal__list { display: block; position: relative; z-index: 1; padding: 120px var(--m) 80px; max-width: 900px; }
.gal__list h1 { font: 600 clamp(40px, 6vw, 80px) / 1 var(--display); letter-spacing: -.04em; margin-bottom: 32px; }
.gal__list a { display: grid; gap: 2px; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; }
.gal__list b { font: 600 20px/1.2 var(--display); letter-spacing: -.02em; }
.gal__list span { color: var(--mute); font-size: 15px; }

/* header links switch with what's behind them (ui.js) */
.gal .top a, .gal .top button { transition: color .3s ease; }
.gal .top a[data-bg-theme="light"], .gal .top button[data-bg-theme="light"] { color: var(--pearl); }
/* the cursor carries the project's name, so the corner card only gives the hint until the first rollover */
.gal.has-hovered .gal__cap { opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .5s; }
@media (hover: none), (pointer: coarse) { .gal__cap span { font-size: 14px; } }
#curtain-test, #globe-test, #overview-test { display: none !important; }

/* choosing a tile: the image travels to the case study's lead position and the page forms around it */
.gal__next { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
/* the case study's heading comes into focus as the image lands: the inverse of the tiles receding */
.gal__next .cs__head > * { opacity: 0; }   /* gallery.js brings each line into focus */
.gal__next .pic { background: none !important; }
.is-opening .gal__cap { opacity: 0 !important; transition: opacity .3s; }
.gal.is-page .top a, .gal.is-page .top a[data-bg-theme], .gal.is-page .top button, .gal.is-page .top button[data-bg-theme] { color: var(--ink); }



/* The gallery has its own entrance (the canvas comes into focus) and no pictures to share with other pages, so it
   takes no part in page-to-page transitions: Safari replayed its entrance when one ended. */
@view-transition { navigation: none; }
/* the List | Gallery switch reads as one piece over the sheet: a frosted backing, ink on both options, whatever tile is behind */
.gal .view { background: color-mix(in srgb, var(--porcelain) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); color: var(--ink); }
.gal a.view__o, .gal a.view__o[data-bg-theme] { color: var(--ink); }
.gal .top .top__ask, .gal .top .top__ask[data-bg-theme] { color: var(--ink); background: color-mix(in srgb, var(--porcelain) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); }

/* Portfolio V2: the List | Gallery viewer (viewer.js). The list is a copy of the Work page's
   Selected work and More work, laid over the sheet; pictures fly between the two. */
.gv { position: fixed; inset: 0; z-index: 2; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--gal-ground); opacity: 0; transition: opacity .6s var(--pour); }
.gv[hidden] { display: none; }
.gv.is-open { opacity: 1; }
.gv__in { padding-top: 24px; }
.gv .pic.is-flown { opacity: 0 !important; transition: none !important; }
.gv.is-arriving :is(.sec__h, .wk__txt, .ix__t, .ix__h, .ix__d) { opacity: 0; }
.gv.is-arriving.from-game .ix__p { opacity: 0; }   /* from Memory the thumbnails come into focus with their rows (viewer.js) */
.gal__host { transition: opacity .6s var(--pour); }
.gal__host.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .6s var(--pour), visibility 0s .6s; }
.gv-fly { position: fixed; z-index: 30; overflow: hidden; pointer-events: none; background: var(--tint); }
.gv-fly img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gv-fly__b { opacity: 0; }
.gal.is-list .gal__cap { opacity: 0 !important; }
.gal.is-list .top::before { opacity: 1; }
@media (min-width: 761px) { html:not([data-tone-fixed]) body.gal :is(.top__name, .top__nav)::before { opacity: 1; } }   /* the soft blur (site.css) behind the name and links, in every view (Adam, 28 Nov evening) */
@media (min-width: 761px) { .gal.is-list .top > .view, .gal.is-game.is-gmend .top > .view { background-color: var(--bar-ground, var(--porcelain)); } }   /* solid on desktop, where the bar used to show */
.gal.is-list .top a, .gal.is-list .top a[data-bg-theme], .gal.is-list .top button, .gal.is-list .top button[data-bg-theme] { color: var(--ink); }
/* the List's category filter: small pills in the switch's glass; the pressed one is filled */
.gv__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(28px, 3vw, 44px); }
.gv__cats button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  background: color-mix(in srgb, var(--ink) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent);
  transition: background-color .4s var(--pour), color .4s var(--pour), box-shadow .4s var(--pour); }
.gv__cats button:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent); }
.gv__cats button[aria-pressed="true"] { background: var(--ink); color: var(--porcelain); box-shadow: none; }
.gv__cats { position: relative; }
.gv__cats .glide { background: var(--ink); }
.gv__cats.has-glide button[aria-pressed="true"] { background: transparent; }
.gv .ixs { margin-top: 24px; }
.gv li[hidden] { display: none; }

/* Portfolio V2: Game, the viewer's third view (game.js, Adam 27 Nov): holographic cards on the Work page's white table, seen from
   above, drawn in three.js. The note and Shuffle sit in the view switch's pill at the foot of the table. */
.gm { position: fixed; inset: 0; z-index: 2; background: var(--gal-ground); opacity: 0; transition: opacity .6s var(--pour); touch-action: manipulation; }
.gm[hidden] { display: none; }
.gm.is-open { opacity: 1; }
.gm__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the note (Adam, 27 Nov evening: minimal, an existing pattern): the view switch's pill, mirrored at the foot of the
   table. One line: "Find the pairs", or the latest pair as a filled link to its case, then Shuffle. Only the pill
   catches the pointer; cards around it stay in reach */
.gm__n { position: fixed; z-index: 3; left: 0; right: 0; bottom: clamp(20px, 4vh, 40px); display: flex; justify-content: center; pointer-events: none; transition: opacity .4s var(--pour); }
.gm__n.is-over { opacity: 0; }   /* the round is over: Shuffle goes, the list's own button deals again */
.gm__n.is-over .gm__bar { pointer-events: none; }
.gm__bar { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; max-width: calc(100vw - 32px); pointer-events: auto;
  color: var(--ink); background: color-mix(in srgb, var(--porcelain) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.gm__t { display: flex; min-width: 0; transition: opacity .16s, filter .16s; }
.gm__t.is-swap { opacity: 0; filter: blur(6px); }
.gm__o { display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding: 5px 13px; border: 0; border-radius: 999px; background: none; color: inherit;
  font: inherit; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: opacity .5s var(--pour), background-color .5s var(--pour); }
.gm__o span { overflow: hidden; text-overflow: ellipsis; }
.gm__o .ico { width: 16px; height: 16px; flex: none; }
/* a found pair's link: the Gallery's project label (black, pearl type, an arrow to the right), seated in the pill */
.gm__go { position: relative; overflow: hidden; padding: 5px 12px 5px 15px; background: var(--ink); color: var(--pearl); font-weight: 500; letter-spacing: -.01em;
  box-shadow: 0 10px 24px -12px rgba(15, 17, 21, .5); cursor: pointer; }
.gm__go::after { display: none; }
.gm__go .ico { transition: transform .3s var(--pour); }
.gm__go:hover .ico, .gm__go:focus-visible .ico { transform: translateX(3px); }
/* every pair found: Shuffle steps forward to deal again */
.gm__n.is-done .gm__sh { opacity: 1; }
.gm__sh { padding: 5px 13px 5px 10px; opacity: .6; cursor: pointer; }
.gm__sh:hover, .gm__sh:focus-visible { opacity: 1; }
.gm__sh[aria-disabled="true"] { opacity: .3; }
/* the round's end (Adam, 28 Nov): the List's own section and rows (viewer's .gv), laid over the table, which stays
   the ground; the cards fly in as the List's pictures do (.gv-fly), the round's detail giving way to the lead */
.gm__end { background: none; }
.gm__end.is-arriving :is(.gm__again, .gm__more) { opacity: 0; }
.gm__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.gm__head .gm__again { margin-bottom: .4em; flex: none; }
.gm__fly canvas { position: absolute; left: 0; top: 50%; width: 100%; height: auto; transform: translateY(-50%); display: block; }
.gm__more { margin-top: clamp(32px, 4vw, 56px); }
.gm__again { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--porcelain); font: inherit; font-size: 16px; letter-spacing: -.01em; box-shadow: 0 10px 24px -12px rgba(15, 17, 21, .5);
  transition: transform .5s var(--pour); }
.gm__again .ico { width: 18px; height: 18px; flex: none; }
.gm__again:hover, .gm__again:focus-visible { transform: scale(1.03); }
.gal.is-game.is-gmend .top::before { opacity: 1; }   /* the list scrolls under the header, as in the List */
.gm__px { position: fixed; z-index: 3; overflow: hidden; pointer-events: none; }
.gm__px img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm__px .gm__cut { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gal.is-game .gal__cap { opacity: 0 !important; }
/* the header over the table (white like List and Gallery, Adam 27 Nov), where cards run under it: ink type */
.gal.is-game .top::before { opacity: 0; }   /* no bar: the links sit straight on the table (Adam, 27 Nov, to try) */
.gal.is-game .top a, .gal.is-game .top a[data-bg-theme], .gal.is-game .top button, .gal.is-game .top button[data-bg-theme] { color: var(--ink); }
/* cards run under the header: a tap on the bar between its links reaches the card beneath */
.gal.is-game .top { pointer-events: none; }
.gal.is-game .top a, .gal.is-game .top button, .gal.is-game .top .view { pointer-events: auto; }
@media (max-width: 760px) {   /* phones: the same size as the view switch, stacked just above it */
  .gm__n { bottom: calc(18px + 46px + 10px + env(safe-area-inset-bottom)); }
  .gm__bar { padding: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent), 0 8px 28px rgba(13, 15, 21, .18); }
  .gm__o { padding: 10px 16px; font-size: 15px; gap: 6px; }
  .gm__go { padding: 10px 14px 10px 17px; }
  .gm__sh { padding: 10px 18px 10px 15px; }
  .gm__o .ico { width: 19px; height: 19px; }
}

/* the project label in the Gallery (cursor and touch) carries an arrow to the right: it opens a case (Adam, 27 Nov evening) */
#cursor .cursor-label, #mobile-label { gap: 6px; padding: 0 13px 0 16px; }
#cursor .cursor-label .ico, #mobile-label .ico { width: 15px; height: 15px; flex: none; }
