/* armful, brand "Veil": no colour. Ink on paper, a white veil over the photos, one spring.
   Self-hosted fonts only (site/fonts, OFL 1.1): no request leaves for a font host. */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/bricolage-grotesque-700.aaa4c45478.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/inter-400.48a0c2503a.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/inter-500.a1eab7f497.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/inter-600.9a3d22c436.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* metric-matched local fallbacks: until a webfont arrives the text is set in Arial scaled to the
   webfont's widths and line metrics, so the swap moves nothing (no layout shift) */
@font-face { font-family: "Bricolage Fallback"; font-style: normal; font-weight: 700;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold");
  size-adjust: 99.65%; ascent-override: 93.3%; descent-override: 27.1%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-style: normal; font-weight: 400 500;
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 107.2%; ascent-override: 90.4%; descent-override: 22.5%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; font-style: normal; font-weight: 600 700;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold");
  size-adjust: 100.8%; ascent-override: 96.1%; descent-override: 23.9%; line-gap-override: 0%; }

:root {
  color-scheme: light dark;
  /* the five named colours never change; --ground / --text / --ring / --line / --dim follow the device */
  --ink: #16231F; --paper: #FBFAF7; --cream: #F2EFE8; --body: #4A5754; --stone: #6B7975;
  --ground: #FBFAF7; --text: #16231F; --dim: #4A5754; --ring: #16231F; --line: rgba(22, 35, 31, .12);
  --veil: rgba(255, 255, 255, .75); --veil-blur: 20px; --rail: rgba(251, 250, 247, .5);
  --tile: #F2EFE8; /* an empty photo box, and the skeleton's blocks: cream on paper, a deep grey on the dark ground */
  --chip: rgba(22, 35, 31, .05); /* the resting fill of a filter option */
  --display: "Bricolage Grotesque", "Bricolage Fallback", "Inter", ui-sans-serif, system-ui, sans-serif;
  --sans: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* motion: --spring for anything that moves, --fade for opacity, --press for a tapped face (120ms) */
  --spring: 420ms cubic-bezier(.2, .8, .2, 1); /* older Safari: no linear(); the spring below where supported */
  --fade: 250ms cubic-bezier(.2, 0, 0, 1);
  --press: .94; --press-t: 120ms;
  --face-s: 44px; --gutter: 2px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --head: calc(48px + var(--st)); /* the sticky header's height, the safe area included */
  --under: calc(var(--head) + 44px); /* the header and a stuck day label under it: the open panel stays below both */
}
@supports (transition-timing-function: linear(0, 1)) { :root { --spring: 420ms linear(0, 0.1895, 0.3445, 0.4713, 0.5751, 0.66, 0.7295, 0.7863, 0.8328, 0.8708, 0.902, 0.9274, 0.9483, 0.9653, 0.9793, 0.9907, 1); } }
@media (prefers-color-scheme: dark) {
  :root { --ground: #0D0F0E; --text: #F2EFE8; --dim: rgba(242, 239, 232, .68); --ring: #FBFAF7;
    --line: rgba(242, 239, 232, .14); --veil: rgba(13, 15, 14, .72); --rail: rgba(13, 15, 14, .45); --tile: #1D2220;
    --chip: rgba(242, 239, 232, .07); }
}
@media (min-width: 1000px) { :root { --face-s: 56px; } }

/* moving between the home page and a collection is one plain cross-fade of the whole page (both
   opt in here; the door opts in too). Nothing is shared between the two: a named wordmark would
   travel from the home page's big one into the header's slot, a big logo over an empty header */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* base type: Inter 16/24 for everything; Bricolage only for the wordmark and the one title */
* { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; scroll-padding-top: var(--head); } /* jumps land below the header */
body { margin: 0; color: var(--text); background: var(--ground); font: 400 16px/24px var(--sans);
  font-synthesis: none; -webkit-font-smoothing: antialiased; padding: 0 var(--sr) 0 var(--sl); } /* bottom inset: the footer's */
p, h1 { margin: 0; }
h1, .title { font: 700 32px/40px var(--display); letter-spacing: -.03em; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* labels and counts */
.lbl { font: 600 11px/16px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.lbl.light { color: var(--cream); }
.count { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* a face: round, --s across, the photo inside; an optional <b> count sits beside it, not on it */
.face { all: unset; box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; --s: var(--face-s); position: relative; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; gap: 10px; min-height: max(44px, var(--s)); border-radius: 999px; }
.face img { display: block; flex: none; width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover;
  background: var(--cream); transition: transform var(--press-t) ease-out, box-shadow var(--fade), opacity var(--fade); }
.face:active img { transform: scale(var(--press)); }
.face b { font: 600 13px/20px var(--sans); font-variant-numeric: tabular-nums; min-width: 28px; padding: 0 7px;
  border-radius: 999px; text-align: center; background: var(--ink); color: var(--paper); transition: opacity var(--fade); }
.face.held img { box-shadow: 0 0 0 2.5px var(--ground), 0 0 0 5px var(--ring); }
/* dim the photo and the count, not the face: its focus ring stays full contrast */
.face.dim img, .face.dim b { opacity: .3; }
/* the ring is on the face itself, outside the dimmed photo and count */
.face:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 3px; }

/* small round icon buttons and the one primary action */
.icon { all: unset; box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text); background: var(--veil);
  -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur));
  transition: background var(--fade), transform var(--press-t) ease-out; }
.icon svg { width: 22px; height: 22px; }
.icon:active { transform: scale(var(--press)); }
.primary { all: unset; box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; min-height: 48px; padding: 0 22px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--text);
  color: var(--ground); font: 600 15px/20px var(--sans); text-align: center; }
.primary svg { width: 28px; height: 18px; }
.icon:focus-visible, .primary:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 3px; }
@media (hover: hover) { .primary:hover { opacity: .88; } }

/* the header: the wordmark top-left and the collection's numbers beside it. It scrolls away with
   the page; its height is fixed so nothing below moves when the numbers arrive. */
.masthead { display: flex; align-items: center; gap: 14px; height: var(--head); padding: var(--st) 14px 0; }
/* it stays at the top while the wall scrolls: sticky, so it keeps its place in the flow (its height
   is fixed from the first paint; nothing below it moves when it starts to stick). Opaque, over the
   wall and the day labels; under the pill, the panel and the previewer */
.masthead { position: sticky; top: 0; z-index: 8; background: var(--ground); }
.mark { display: flex; align-items: center; min-height: 44px; color: var(--text); line-height: 0; border-radius: 4px; }
.mark svg { width: 72px; height: auto; fill: currentColor; }
/* the numbers sit at the right edge and follow the wall (app.js); reserved width, tabular figures */
.stats { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 172px; }
/* each count: an icon and the number (the words are on the element's aria-label) */
.st { display: inline-flex; align-items: center; gap: 4px; vertical-align: top; }
.st + .st { margin-left: 12px; }
.st svg { width: 11px; height: 11px; fill: currentColor; opacity: .7; flex: none; }

/* the people and the filters: one compact pill bottom-left (every width). Nobody held: three faces,
   the filter icon and a chevron. Someone held: their faces instead of the three. Anything chosen: a
   short line of the filter words beside the icon, and × (clear everything). The pill opens one of two
   views above itself: a narrow rail of faces up the left edge, barely veiled, or the filters card;
   the filter icon swaps between them. The wall stays visible beside them and keeps scrolling and
   taking taps. The pill never moves. */
.panel { position: fixed; z-index: 10; left: 0; bottom: 0; width: 0; height: 0; }
.bar { position: fixed; left: max(14px, var(--sl)); bottom: max(14px, var(--sb)); display: flex; align-items: center;
  gap: 2px; padding: 4px; max-width: calc(100vw - 28px - var(--sl) - var(--sr)); border-radius: 999px;
  background: var(--veil); -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur));
  box-shadow: 0 4px 16px rgba(22, 35, 31, .16); }
.pill { all: unset; box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 4px; border-radius: 999px;
  font: 600 11px/16px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text); white-space: nowrap;
  font-variant-numeric: tabular-nums; transition: transform var(--press-t) ease-out, background var(--fade), color var(--fade); }
.pill:active { transform: scale(var(--press)); }
.pill:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; }
.bar.held #people { display: none; } /* the held faces stand in for the three */
.stack { display: flex; flex: none; }
.stack img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--cream); box-shadow: 0 0 0 2px var(--ground); }
.stack img + img, .stack .sk + .sk { margin-left: -10px; }
.stack .sk { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); box-shadow: 0 0 0 2px var(--ground); }
.chev { display: grid; transition: transform var(--spring); }
.chev svg { width: 18px; height: 18px; }
/* the chevron: its own target (open / fold); the panel opens upward, the chevron points the way it will go */
.chevb { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 44px; min-height: 44px; border-radius: 999px;
  color: var(--text); touch-action: manipulation; -webkit-tap-highlight-color: transparent; position: relative; flex: none; }
/* open, the chevron is the pill's only control on the right (× hides: a tap meant to fold never
   clears); clear all moves into the panel, a quiet word at its top, there only while anything is
   chosen (its place is kept, so it never moves the faces or the rows) */
.clearAll { all: unset; box-sizing: border-box; cursor: pointer; min-height: 28px; padding: 0 8px; border-radius: 999px;
  font: 500 12px/28px var(--sans); color: var(--dim); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.clearAll:not(.on) { visibility: hidden; pointer-events: none; }
.clearAll:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 0; }
.list > .clearAll { align-self: flex-start; }
.filters > .clearAll { position: absolute; top: 8px; right: 10px; z-index: 1; }
.chevb:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 0; }
.chevb .chev { transform: rotate(180deg); }
.chevb[aria-expanded="true"] .chev { transform: none; }
/* the view on screen: its button sits on a quiet disc */
.bar .pill[aria-expanded="true"] { background: var(--line); }
/* the filter icon, and the words of what is chosen (truncated; the panel spells them out) */
.fbtn { flex: 0 1 auto; min-width: 44px; justify-content: center; padding: 0 12px; gap: 6px; overflow: hidden;
  font: 600 13px/20px var(--sans); letter-spacing: 0; text-transform: none; }
.fbtn .fi { width: 20px; height: 20px; flex: none; }
.terms { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the rail: as wide as a face and its count, from just above the pill up to the top safe area at
   most; it scrolls inside itself */
.list { position: fixed; left: max(8px, var(--sl)); bottom: calc(max(14px, var(--sb)) + 60px);
  max-height: calc(100vh - max(14px, var(--sb)) - 60px - var(--under));
  max-height: calc(100dvh - max(14px, var(--sb)) - 60px - var(--under));
  display: flex; flex-direction: column; gap: 6px; width: max-content; padding: 6px;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border-radius: 28px;
  background: linear-gradient(90deg, var(--rail), transparent); }
.list::-webkit-scrollbar { display: none; }
/* the rail (and the filters card) rises in on the spring as it opens (a CSS entry transition, not a
   view transition: during one the browser sends every tap to the root, and the wall beside the rail
   must stay live); it folds at once. Swapping between the two is app.js's: one fold, one unfold */
.list, .filters { transition: transform var(--spring), opacity var(--fade); }
@starting-style { .panel:not(.swap) .list, .panel:not(.swap) .filters { transform: translateY(18px); opacity: 0; } }
.list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; align-items: center; gap: 6px; }
.list .face img { box-shadow: 0 1px 4px rgba(13, 15, 14, .28); }
.list .face.held img { box-shadow: 0 0 0 2.5px var(--ground), 0 0 0 5px var(--ring); }
.count { font: 600 13px/20px var(--sans); font-variant-numeric: tabular-nums; min-width: 28px; padding: 0 7px; border-radius: 999px;
  text-align: center; background: var(--text); color: var(--ground); transition: opacity var(--fade); }
.face.dim + .count { opacity: .3; }
.face img[style*="background-image"] { background-repeat: no-repeat; } /* the CSS crop of a rotated photo */
/* the held faces, overlapping */
.pair { all: unset; box-sizing: border-box; display: flex; align-items: center; min-height: 44px; padding-left: 0; cursor: pointer;
  border-radius: 999px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pair[hidden] { display: none; }
.pair:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; }
.pair .face { --s: 36px; min-height: 36px; cursor: inherit; transition: margin var(--spring); }
.pair .face.held img { box-shadow: 0 0 0 2px var(--ground); }
.pair.tight .face + .face { margin-left: -14px; }
.pair .more { margin-left: 6px; font: 600 13px/20px var(--sans); font-variant-numeric: tabular-nums; }
.x { all: unset; box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  cursor: pointer; color: var(--text); touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.x svg { width: 24px; height: 24px; padding: 3px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.x:focus-visible { outline: 2.5px solid var(--ring); outline-offset: -2px; }
/* a tapped face on its way into the pill */
.arc { position: fixed; z-index: 40; margin: 0; border-radius: 50%; object-fit: cover; pointer-events: none; transform-origin: 0 0;
  background-color: var(--cream); background-repeat: no-repeat; }
/* the filters: a veiled card where the rail is, three rows; each option says the files tapping it
   would give, given everything else; a zero fades and takes no tap */
.filters { position: fixed; left: max(14px, var(--sl)); bottom: calc(max(14px, var(--sb)) + 62px);
  width: min(362px, calc(100vw - 28px - var(--sl) - var(--sr)));
  max-height: calc(100vh - max(14px, var(--sb)) - 62px - var(--under));
  max-height: calc(100dvh - max(14px, var(--sb)) - 62px - var(--under));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 14px; padding: 14px 12px 12px; border-radius: 24px;
  background: var(--veil); -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur));
  box-shadow: 0 4px 16px rgba(22, 35, 31, .16); }
.filters::-webkit-scrollbar { display: none; }
.frow { display: flex; flex-direction: column; gap: 6px; }
.frow > .lbl { padding: 0 4px 2px; }
.opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.opts.days { grid-auto-flow: row; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); }
.opt { all: unset; box-sizing: border-box; position: relative; min-height: 48px; padding: 4px 2px; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: var(--chip); color: var(--text); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--fade), opacity var(--fade), transform var(--press-t) ease-out, background var(--fade); }
.opt .v { display: inline-flex; align-items: center; gap: 4px; font: 600 14px/20px var(--sans); white-space: nowrap; }
.opt .v svg { width: 16px; height: 16px; }
.opt .c { font: 500 11px/14px var(--sans); font-variant-numeric: tabular-nums; color: var(--dim); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--ring); background: transparent; }
.opt[aria-pressed="true"] .c { color: var(--text); }
.opt.zero { opacity: .3; cursor: default; }
.opt:active:not(.zero) { transform: scale(var(--press)); }
.opt:focus-visible { outline: 2.5px solid var(--ring); outline-offset: 2px; }
/* morning / afternoon / evening: there once a day is picked, unfolding on the spring */
.partsWrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows var(--spring), opacity var(--fade); }
.partsWrap.on { grid-template-rows: 1fr; opacity: 1; }
.partsWrap > div { min-height: 0; overflow: hidden; }
#empty p { color: var(--text); }
#empty .pill { min-height: 36px; padding: 0 14px; color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); }
@media (min-width: 1000px) {
  .bar { left: max(18px, var(--sl)); bottom: max(18px, var(--sb)); }
  .list { left: max(12px, var(--sl)); bottom: calc(max(18px, var(--sb)) + 60px);
    max-height: calc(100vh - max(18px, var(--sb)) - 60px - var(--under)); max-height: calc(100dvh - max(18px, var(--sb)) - 60px - var(--under)); }
  .masthead { padding: 0 14px 0 18px; }
  /* faces are bigger here: the count, the rings and the held pair scale with them */
  .list li { gap: 8px; }
  .count { font-size: 15px; line-height: 30px; min-width: 36px; padding: 0 9px; }
  .face.held img, .list .face.held img { box-shadow: 0 0 0 3px var(--ground), 0 0 0 6.5px var(--ring); }
  .face:focus-visible { outline-width: 3px; outline-offset: 4px; }
  .pair .face { --s: 44px; min-height: 44px; }
  .pair .face.held img { box-shadow: 0 0 0 2px var(--ground); }
  .pair.tight .face + .face { margin-left: -17px; }
  .filters { left: max(18px, var(--sl)); bottom: calc(max(18px, var(--sb)) + 62px); max-height: calc(100vh - max(18px, var(--sb)) - 62px - var(--under)); max-height: calc(100dvh - max(18px, var(--sb)) - 62px - var(--under)); }
}

/* the wall: whole photos in time order, in justified rows, full-bleed, 2px gutters; one section per
   day of the trip (and one for files without a time, last), each starting a new row. app.js packs
   each day's rows (2 across on a phone, 4 from 1000px, 5 from 1600px) and gives each tile its row's
   --S (sum of the row's aspect ratios) and --n (tiles in a row); width follows from the wall's
   width, height from aspect-ratio, so every box is reserved before any image arrives. A row of
   panoramas on a phone would be thinner than 100px: min-height holds it there and the photos crop a
   little. */
/* Safari < 16 has no container units: the viewport width less a little slack (flex-grow, by aspect
   ratio, hands the slack back in proportion, so rows still reach the edge and keep one height) */
.wall { container-type: inline-size; }
.day { position: relative; margin-bottom: var(--gutter); }
.rows { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gutter); }
/* the day's label: it lies on the day's first row, takes no height, sticks while the day scrolls
   by and is pushed out by the next one. Left-anchored, so a new word never moves it */
.tag { position: sticky; top: var(--head); z-index: 3; height: 38px; margin-bottom: -38px; pointer-events: none; }
.tag span.yield { visibility: hidden; } /* under the open panel (app.js) */
.tag span { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--veil); -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur));
  font: 600 11px/16px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
/* the day scrubber: a hairline up the right edge, a tick per day (its length: that day's files in
   the current filter) and a thumb for where the screen is. It fades in while the wall moves and out
   1.2s after; only then does it take touches. Everything in it moves by transform */
.scrub { position: fixed; z-index: 9; right: max(0px, var(--sr)); top: calc(max(8px, var(--st)) + 48px); bottom: calc(max(14px, var(--sb)) + 64px);
  width: 44px; opacity: 0; pointer-events: none; transition: opacity var(--fade); touch-action: none; cursor: ns-resize; }
.scrub.on { opacity: 1; pointer-events: auto; }
body.lbOpen .scrub { visibility: hidden; }
.scrub .track { position: absolute; right: 8px; top: 0; bottom: 0; width: 2px; border-radius: 1px; background: var(--line); }
.scrub .tk { position: absolute; top: 0; right: 8px; width: 16px; height: 2px; border-radius: 1px; background: var(--text); opacity: .55; transform-origin: 100% 50%; }
.scrub .thumb { position: absolute; top: 0; right: 6px; width: 6px; height: 20px; border-radius: 3px; background: var(--text); transform-origin: 50% 0; will-change: transform; }
/* fixed width: a longer day name never moves its edge */
.scrub .bubble { position: absolute; top: 0; right: 26px; width: 188px; height: 28px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; text-align: center;
  background: var(--veil); -webkit-backdrop-filter: blur(var(--veil-blur)); backdrop-filter: blur(var(--veil-blur)); color: var(--text);
  box-shadow: 0 4px 16px rgba(22, 35, 31, .16); opacity: 0; transition: opacity var(--fade); pointer-events: none; }
.scrub.drag .bubble { opacity: 1; }
.tile { --n: 2; --S: 3; --g: 1; position: relative; display: block; box-sizing: border-box; overflow: hidden;
  /* 1px of slack keeps rounding from wrapping a row; flex-grow (by aspect ratio) takes it back */
  flex: calc(var(--ar) * var(--g)) 0 calc((100cqw - (var(--n) - 1) * var(--gutter) - 1px) * var(--ar) / var(--S));
  aspect-ratio: var(--ar); min-width: 0; min-height: 100px; background: var(--tile);
  transform-origin: 0 0; transition: transform var(--spring), opacity var(--fade);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@supports not (width: 1cqw) {
  .tile { flex-basis: calc((100vw - var(--sl) - var(--sr) - (var(--n) - 1) * var(--gutter) - 24px) * var(--ar) / var(--S)); }
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0;
  transition: opacity var(--fade); transition-delay: var(--d, 0ms); }
.tile img.ok { opacity: 1; }
.tile:focus-visible { outline: 2.5px solid var(--ring); outline-offset: -2.5px; z-index: 1; }
/* a thumbnail Drive would not give: a thin ink hairline, nothing in it, tap to try again */
.tile.failed { background: none; box-shadow: inset 0 0 0 1px var(--text); }
.tile.failed img, .tile.failed .play { visibility: hidden; }
.tile .retry { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); pointer-events: none; }
.tile .retry svg { width: 22px; height: 22px; }
.tile .play { position: absolute; left: 8px; bottom: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(13, 15, 14, .6); color: var(--paper); display: grid; place-items: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tile .play svg { width: 18px; height: 18px; }

/* the first paint (static HTML, before any script or data): the header's numbers, the pill and
   the wall as quiet blocks of the shapes they will take. The wall's blocks use the tiles' own row
   rule (2 across on a phone, 4 from 1000px, 5 from 1600px; each block carries its row's aspect
   sum for each width, and --G<n>: 0 where that row is a short last row) and fill the first screen.
   The build (bin/build-dist.mjs) writes each collection's blocks from its own data.json, so every
   block has exactly the box of the tile that replaces it: nothing moves when the data arrives.
   They breathe a little; under reduced motion they hold still. */
.skel { container-type: inline-size; height: calc(100vh - 48px - var(--st)); height: calc(100dvh - 48px - var(--st)); overflow: hidden; }
.skel section { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gutter); margin-bottom: var(--gutter); }
.skel i { --n: 2; --S: var(--S2); --g: var(--G2, 1); flex: calc(var(--ar) * var(--g)) 0 calc((100cqw - (var(--n) - 1) * var(--gutter) - 1px) * var(--ar) / var(--S));
  aspect-ratio: var(--ar); min-width: 0; min-height: 100px; background: var(--tile); }
@supports not (width: 1cqw) {
  .skel i { flex-basis: calc((100vw - var(--sl) - var(--sr) - (var(--n) - 1) * var(--gutter) - 24px) * var(--ar) / var(--S)); }
}
@media (min-width: 1000px) { .skel i { --n: 4; --S: var(--S4); --g: var(--G4, 1); } }
@media (min-width: 1600px) { .skel i { --n: 5; --S: var(--S5); --g: var(--G5, 1); } }
#stats:empty::before { content: ""; display: inline-block; vertical-align: middle;
  height: 8px; border-radius: 4px; background: var(--tile); }
#stats:empty::before { width: 132px; }
.skel, #stats:empty::before, .stack .sk { animation: breathe 1.6s ease-in-out infinite alternate; }
@keyframes breathe { to { opacity: .6; } }
body:not([data-phase="skeleton"]) .skel { display: none; }
@media (prefers-color-scheme: dark) { .stack .sk { background: #2A2F2D; } }
body[data-phase="error"] #stats::before, body[data-phase="error"] #panel { display: none; }

/* the status line: only for screen readers while the blocks are up; if data.json fails, the
   message and Try again take the blocks' place */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 56px 16px; text-align: center; color: var(--dim); }
body[data-phase="skeleton"] #loading { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
body[data-phase="error"] #loading { min-height: calc(100vh - 48px - var(--st)); min-height: calc(100dvh - 48px - var(--st)); }
#loading p:not(.sr) { color: var(--text); }
.symbol { width: 56px; height: 56px; fill: var(--text); }
.symbol .top { transform-box: fill-box; transform-origin: center; animation: pulse 1.4s cubic-bezier(.2, 0, 0, 1) infinite alternate; }
@keyframes pulse { from { opacity: 1; transform: none; } to { opacity: .25; transform: scale(.86); } }
@keyframes fadein { from { opacity: 0; } }

footer a { color: inherit; text-underline-offset: 3px; }
footer { margin: 44px auto 0; padding: 18px 16px calc(96px + var(--sb)); /* the last words clear the pill */ border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px; line-height: 20px; text-align: center; }
/* the collection page's footer waits (inert) until the wall is drawn: out of layout until then, so the
   wall arriving above it moves nothing */
footer[inert] { display: none; }

/* the previewer closing: its photo travels back into its tile while the dark fades (app.js) */
.ghost { position: fixed; z-index: 31; margin: 0; pointer-events: none; transform-origin: 0 0; object-fit: cover; }
.ghostGround { position: fixed; inset: 0; z-index: 30; background: #0D0F0E; pointer-events: none; }
/* the previewer: one photo or video, large, over the page; always dark */
body.lbOpen { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 30; background: #0D0F0E; color: var(--cream); touch-action: pinch-zoom;
  --ground: #0D0F0E; --text: #F2EFE8; --ring: #FBFAF7; animation: fadein var(--fade); }
.lbStage { --mw: calc(100vw - 208px); --mh: calc(100vh - 32px); --mh: calc(100dvh - 32px);
  position: absolute; inset: 0; display: grid; place-items: center; }
.lbStage.back { transition: transform var(--spring), opacity var(--fade); }
/* the incoming photo: it travels on the spring and fades in on the 250ms fade */
.lbStage.in-next > * { animation: inNext var(--spring), inFade var(--fade); }
.lbStage.in-prev > * { animation: inPrev var(--spring), inFade var(--fade); }
@keyframes inNext { from { transform: translateX(36px); } }
@keyframes inPrev { from { transform: translateX(-36px); } }
@keyframes inFade { from { opacity: .3; } }
.lbStage img { display: block; max-width: var(--mw); max-height: var(--mh); width: auto; height: auto;
  object-fit: contain; background: #1A1F1D; user-select: none; -webkit-user-select: none;
  -webkit-user-drag: none; -webkit-touch-callout: default; }
/* the small thumbnail stands in, at the photo's final size, until the large image has loaded */
.lbStage img.soft { width: min(var(--mw), calc(var(--mh) * var(--ar))); height: auto; aspect-ratio: var(--ar); }
/* a video: the wall's thumbnail, dimmed, and the loading mark until Drive's player has loaded;
   then the player fades in over them */
.lbStage .vid { position: relative; overflow: hidden; background: #1A1F1D; aspect-ratio: var(--ar);
  width: min(var(--mw), calc((100vh - 136px) * var(--ar))); width: min(var(--mw), calc((100dvh - 136px) * var(--ar)));
  max-height: calc(100dvh - 136px); }
.lbStage .vid .poster { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover;
  filter: blur(6px) brightness(.62); transform: scale(1.06); }
.vid .symbol { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; fill: var(--paper);
  opacity: .9; transition: opacity var(--fade); }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; opacity: 0; transition: opacity var(--fade); }
.vid.ready iframe { opacity: 1; }
.vid.ready .symbol { opacity: 0; }
/* chrome: ink discs, paper glyphs, 44px */
.lb .icon { width: 44px; height: 44px; background: rgba(22, 35, 31, .72); color: var(--paper);
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.lb .icon:focus-visible { outline-color: var(--paper); }
.lbNav { position: absolute; top: 50%; margin-top: -22px; }
.lbNav[disabled] { opacity: .25; cursor: default; pointer-events: none; }
.lbPrev { left: max(16px, var(--sl)); }
.lbNext { right: max(16px, var(--sr)); }
.lbTop { position: absolute; top: max(14px, var(--st)); left: max(16px, var(--sl)); right: max(16px, var(--sr));
  display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.lbTop > * { pointer-events: auto; }
.lbCount { margin: 0 auto 0 0; padding: 14px 4px; font-variant-numeric: tabular-nums; pointer-events: none;
  text-shadow: 0 1px 6px rgba(13, 15, 14, .6); }
#lbDrive { position: absolute; right: 0; top: 54px; } /* wide screens: download sits under close, clear of the photo */
/* the held faces, small at the bottom centre */
.lbHold { position: absolute; left: 50%; bottom: calc(max(18px, var(--sb)) + 4px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 136px); }
.lbHold[hidden] { display: none; }
#lbLine { overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(13, 15, 14, .6); }
.lbHold .face { --s: 36px; cursor: default; }
.lbHold .face.held img { box-shadow: 0 0 0 2px var(--ground), 0 0 0 3.5px var(--paper); }
.lbHold .pair.tight .face + .face { margin-left: -14px; }

@media (max-width: 999px) {
  /* previewer: the photo edge to edge, arrows low where the thumb is */
  .lbStage { --mw: 100vw; --mh: 100vh; --mh: 100dvh; }
  .lbNav { top: auto; bottom: max(18px, var(--sb)); margin-top: 0; }
  .lbTop { top: max(10px, var(--st)); left: max(12px, var(--sl)); right: max(12px, var(--sr)); align-items: center; }
  #lbDrive { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --spring: 0s linear; --fade: 0s linear; --press: 1; --press-t: 0s; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
