/* Our own picture viewer. Paper behind, flat type for the words, frosted glass for the controls, the rope's four colours for where you are. */
@font-face { font-family:"Hub Display"; src:url(./assets/hub-display.woff2) format("woff2"); font-weight:800; font-display:swap; }

/* On the page: the picture itself is the button. */
.work-piece { display:block; width:100%; border:0; padding:0; background:none; color:inherit; cursor:zoom-in; border-radius:2px; transition:transform .5s cubic-bezier(.22,.8,.24,1), box-shadow .5s cubic-bezier(.22,.8,.24,1); }
.work-piece img { display:block; width:100%; height:auto; }
@media (hover:hover) { .work-piece:hover { transform:translateY(-3px); box-shadow:0 18px 40px rgba(12,8,24,.16); } }
.work-piece:focus-visible { outline:3px solid currentColor; outline-offset:4px; }

/* The viewer fills the window. The page stays faintly there behind frosted paper. */
html.lens-open { overflow:hidden; }
.lens { --lens-ground:var(--ground,#f6f2ea); --lens-ink:var(--ink,#171019); --lens-fade:1;
  position:fixed; inset:0; box-sizing:border-box; width:100%; max-width:none; height:100%; max-height:none; margin:0; padding:0; border:0; overflow:hidden;
  color:var(--lens-ink); background:transparent; font:400 16px/1.45 "Helvetica Neue",Helvetica,"Hub Display",Arial,sans-serif;
  -webkit-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent;
  border-radius:0; box-shadow:none; transform:none; -webkit-backdrop-filter:none; backdrop-filter:none; }  /* the worlds style every dialog as a small glass card: none of that here */
.lens button { min-height:0; filter:none; box-shadow:none; }
.lens[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.lens::backdrop { background:transparent; }
.lens::before { content:""; position:absolute; inset:0; z-index:-1; opacity:0; pointer-events:none;
  background:color-mix(in srgb, var(--lens-ground) 84%, transparent); -webkit-backdrop-filter:blur(30px) saturate(1.35); backdrop-filter:blur(30px) saturate(1.35);
  transition:opacity .42s cubic-bezier(.22,.8,.24,1); }
.lens.shown::before { opacity:var(--lens-fade); }
.lens-top, .lens-foot { opacity:0; transition:opacity .36s ease .08s, transform .46s cubic-bezier(.22,.8,.24,1) .04s; }
.lens-top { transform:translateY(-8px); } .lens-foot { transform:translateY(10px); }
.lens.shown .lens-top, .lens.shown .lens-foot { opacity:var(--lens-fade); transform:none; }
.lens.leaving .lens-top, .lens.leaving .lens-foot { transition-delay:0s; transition-duration:.2s; }

.lens-top { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.lens-count { margin:0; font:700 .75rem/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace; letter-spacing:.02em; }

/* The stage: the picture sits in the middle at its fitted size, and moves only by transform. */
.lens-stage { position:relative; overflow:hidden; touch-action:none; cursor:zoom-in; outline:none; }
.lens-stage:focus-visible { box-shadow:inset 0 0 0 3px var(--lens-ink); }
.lens-stage.zoomed { cursor:grab; } .lens-stage.held { cursor:grabbing; }
.lens-track { position:absolute; inset:0; will-change:transform; }
.lens-slide { position:absolute; top:0; width:100%; height:100%; margin:0; will-change:transform; }
.lens-slide img { position:absolute; left:50%; top:50%; display:block; max-width:none; transform-origin:50% 50%; will-change:transform;
  box-shadow:0 1px 2px rgba(12,8,24,.08), 0 26px 70px rgba(12,8,24,.18); }

/* Words, controls and the strand. Words are flat type, the same family as the hub's big name. */
.lens-foot { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"words bar" "strand strand"; align-items:end; gap:.9rem 2rem;
  padding:0 max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.lens-words { grid-area:words; min-width:0; max-width:46rem; max-height:26vh; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; -webkit-user-select:text; user-select:text; }
.lens-title { margin:0; font:800 clamp(1.6rem,3.2vw,3.25rem)/.94 "Helvetica Neue",Helvetica,"Hub Display",Arial,sans-serif; letter-spacing:-.045em; text-wrap:balance; }
.lens-about { margin:.55rem 0 0; max-width:38em; font-size:clamp(.95rem,1.05vw,1.1rem); line-height:1.45; }
.lens-bar { grid-area:bar; display:flex; gap:.5rem; justify-content:flex-end; }
.lens-strand { grid-area:strand; display:flex; gap:3px; align-items:center; height:14px; }
.lens .lens-strand button { flex:1; min-width:0; height:4px; padding:0; border:0; border-radius:4px; cursor:pointer; background:var(--tint); opacity:.32; transition:height .3s cubic-bezier(.22,.8,.24,1), opacity .3s ease; }
.lens .lens-strand button:hover { opacity:.6; }
.lens .lens-strand button.here { height:10px; opacity:1; }

/* Every control is our glass pill, tinted with one of the rope's colours. */
.lens .lens-pill { --tint:var(--lens-ink); display:inline-flex; align-items:center; justify-content:center; gap:.45rem; min-width:44px; min-height:44px; padding:0 1rem; margin:0;
  font:700 .75rem/1 ui-monospace,"SF Mono",Menlo,Consolas,monospace; color:var(--lens-ink); cursor:pointer; white-space:nowrap; border-radius:999px;
  background:linear-gradient(140deg, color-mix(in srgb, var(--lens-ground) 88%, transparent), color-mix(in srgb, var(--lens-ground) 70%, transparent)), color-mix(in srgb, var(--tint) 24%, transparent);
  -webkit-backdrop-filter:blur(14px) saturate(1.5); backdrop-filter:blur(14px) saturate(1.5); border:1px solid rgba(255,255,255,.55);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.55), 0 6px 16px rgba(12,8,24,.12); transition:background .3s ease, transform .2s ease, opacity .2s ease; }
.lens .lens-pill em { font-style:normal; }
.lens .lens-pill .lens-glyph { font:700 1rem/1 "Helvetica Neue",Helvetica,Arial,sans-serif; }
.lens .lens-pill:hover { background:linear-gradient(140deg, color-mix(in srgb, var(--lens-ground) 82%, transparent), color-mix(in srgb, var(--lens-ground) 60%, transparent)), color-mix(in srgb, var(--tint) 40%, transparent); }
.lens .lens-pill:active { transform:scale(.96); }
.lens .lens-pill:disabled { opacity:.38; cursor:default; transform:none; }
.lens .lens-pill:focus-visible { outline:3px solid var(--lens-ink); outline-offset:3px; }
.lens .lens-level { min-width:4.6rem; font-variant-numeric:tabular-nums; }
.lens .lens-close { color:var(--lens-ground); background:var(--lens-ink); border-color:transparent; -webkit-backdrop-filter:none; backdrop-filter:none; }
.lens .lens-close:hover { background:color-mix(in srgb, var(--lens-ink) 86%, var(--lens-ground)); }
.lens-live { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; margin:0; }
.lens [hidden] { display:none !important; }

/* Phones: words above, a full row of controls under them, glyphs only for moving and zooming. */
@media (max-width:760px) {
  .lens-foot { grid-template-columns:minmax(0,1fr); grid-template-areas:"words" "strand" "bar"; gap:.7rem; }
  .lens-words { max-height:22vh; }
  .lens-bar { justify-content:space-between; }
  .lens-bar .lens-pill { flex:1; padding:0 .4rem; }
  .lens-bar .lens-pill em { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .lens-title { font-size:clamp(1.35rem,6.4vw,2rem); }
}

/* Comfort settings the hub already offers, honoured here too. */
body.solid .lens::before, body.strong .lens::before { background:var(--lens-ground); -webkit-backdrop-filter:none; backdrop-filter:none; }
body.solid .lens-pill:not(.lens-close), body.strong .lens-pill:not(.lens-close) { background:var(--lens-ground); -webkit-backdrop-filter:none; backdrop-filter:none; }
body.strong .lens .lens-pill { border:2px solid var(--lens-ink); }
@media (prefers-reduced-transparency:reduce) { .lens::before { background:var(--lens-ground); -webkit-backdrop-filter:none; backdrop-filter:none; } .lens-pill:not(.lens-close) { background:var(--lens-ground); -webkit-backdrop-filter:none; backdrop-filter:none; } }
@media (prefers-contrast:more) { .lens .lens-pill { border:2px solid var(--lens-ink); } .lens .lens-strand button { opacity:.6; } .lens .lens-strand button.here { opacity:1; } }
/* Pause Motion: everything arrives and leaves at once. */
.lens.calm::before, .lens.calm .lens-top, .lens.calm .lens-foot, .lens.calm .lens-pill, .lens.calm .lens-strand button { transition:none !important; }
@media (prefers-reduced-motion:reduce) { .lens::before, .lens-top, .lens-foot, .lens-pill, .lens-strand button, .work-piece { transition:none !important; } }
@media (forced-colors:active) { .lens::before { background:Canvas; } .lens .lens-pill { border:1px solid ButtonText; background:ButtonFace; color:ButtonText; forced-color-adjust:none; } .lens-strand button { forced-color-adjust:none; background:CanvasText; } .lens .lens-strand button.here { background:Highlight; } }
