/* The gallery: landing.css supplies the tokens, menu and grain.
   This is one screen with no page scroll: a dark work table you drag around, with loose
   prints thrown across the gallery's name. gallery.js moves everything. */

.menu-item[aria-current="page"] { color: var(--accent); }
html:has(.gallery-page), .gallery-page { height: 100%; }
.gallery-page { overflow: hidden; }
.gallery-page button { color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mask { display: block; overflow: hidden; }
.line { display: block; transition: transform 0.6s var(--ease-out); transition-delay: calc(var(--i, 0) * 50ms); }

/* The table: a dotted cutting mat with registration crosses, like the homepage portrait's.
   The mat is its own oversized layer that slides by one tile and wraps, so dragging the
   table never repaints the screen. */
.table-stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--bg);
}
.table-mat {
  position: absolute;
  inset: -432px;
  will-change: transform;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='432' height='432'%3E%3Cpath d='M207 216h18M216 207v18' stroke='%237ef0b2' stroke-opacity='.4'/%3E%3C/svg%3E"),
    radial-gradient(circle, rgba(232, 230, 224, 0.13) 1px, transparent 1.4px);
  background-size: 432px 432px, 36px 36px;
}
.table-stage:focus { outline: none; }
.table-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(10, 12, 11, 0.85)); }
.table-under { position: absolute; left: 50%; top: 50%; width: 0; height: 0; will-change: transform; }

/* The name lies on the table under the prints and drifts a little slower than they do. */
.table-name {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0 0.06em 0.14em;
  overflow: hidden;
  transform: translate(-50%, -54%);
  white-space: nowrap;
  font: 400 clamp(110px, 25vw, 430px)/0.9 var(--serif);
  letter-spacing: -0.045em;
  color: rgba(232, 230, 224, 0.2);
  transition: opacity 0.6s ease;
}
.table-name b { font-style: normal; font-weight: 400; color: var(--accent); }
.table-name i { display: inline-block; font-style: inherit; animation: name-rise 1s var(--ease-out) both; animation-delay: calc(var(--i) * 50ms); }
@keyframes name-rise { from { transform: translateY(112%); } }
.is-grid .table-name, .is-viewing .table-name { opacity: 0; }

.table-note {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(480px, 100% - var(--gutter) * 2);
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}
.table-note strong { display: block; margin-bottom: 10px; color: var(--ink); font: italic 400 34px/1.1 var(--serif); }
.table-note code { color: var(--accent); }

/* Every print is drawn on this one canvas (see gallery.js): shadows, tags, the focus ring
   and the dimming of the others are all painted there. */
.table-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.table-list { list-style: none; }

/* Top row: the count, where the table has been dragged to, and how the prints lie.
   The right side stays clear for the menu circle. */
.table-top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 14px;
  min-height: calc(var(--menu-top) + var(--menu-size));
  padding: var(--menu-top) calc(var(--gutter) + var(--menu-size) + 16px) 0 var(--gutter);
  pointer-events: none;
}
.table-top > * { pointer-events: auto; }
.table-brand p { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.table-brand .table-coords { color: var(--accent); font-variant-numeric: tabular-nums; white-space: pre; }
.table-tools { display: flex; align-items: center; gap: 8px; }
/* No backdrop blur here: the canvas redraws under these pills, and a blur would be redone every frame. */
.table-pill { display: flex; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; background: rgba(10, 12, 11, 0.86); }
.gallery-page .table-pill button { min-height: 38px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; transition: color 0.25s, background 0.35s var(--ease-out); }
.gallery-page .table-pill button[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.gallery-page .table-pill button:not([aria-pressed="true"]):hover { color: var(--ink); }
.table-pill button:focus-visible { outline-offset: 2px; }

.table-corner { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 5; margin: 0; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; transition: opacity 0.4s; }
.table-hint { left: var(--gutter); pointer-events: none; }
.table-hint::before { content: "✥ "; color: var(--accent); }
.table-mail { right: var(--gutter); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-transform: none; letter-spacing: 0.04em; }
.table-mail a { color: var(--accent); }
.is-viewing .table-corner { opacity: 0; pointer-events: none; }

/* Plate: sets under the print you lifted. */
.plate {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  width: min(860px, 100% - var(--gutter) * 2);
  transform: translateX(-50%);
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}
.is-viewing .plate { visibility: visible; transition: none; }
.plate-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.plate-count { margin: 0; color: var(--accent); font-size: 10px; letter-spacing: 0.2em; }
.plate-title { margin: 0; font: italic 400 clamp(30px, 3.6vw, 52px)/1.04 var(--serif); letter-spacing: -0.02em; }
.plate-title .mask { padding-bottom: 0.12em; }
.plate-meta { margin: 0; color: #c4cfc7; font-size: 11px; line-height: 1.7; }
.plate-source { color: var(--accent); font-size: 11px; opacity: 0; transition: opacity 0.3s; }
.is-viewing .plate-source { opacity: 1; transition-delay: 0.4s; }
.plate .line { transform: translateY(115%); transition-duration: 0.22s; transition-delay: 0s; }
.is-viewing .plate:not(.is-swapping) .line { transform: none; transition-duration: 0.7s; transition-delay: calc(0.15s + var(--i, 0) * 60ms); }
.plate-controls { display: flex; gap: 8px; opacity: 0; transition: opacity 0.3s; }
.is-viewing .plate-controls { opacity: 1; transition-delay: 0.25s; }
.gallery-page .plate-button { min-width: 48px; min-height: 48px; padding: 0 16px; border: 1px solid var(--rule); border-radius: 999px; background: rgba(10, 12, 11, 0.7); font-size: 14px; transition: border-color 0.25s, color 0.25s; }
.gallery-page .plate-button:hover, .gallery-page .plate-button:focus-visible { border-color: var(--accent); color: var(--accent); }
.gallery-page .plate-close { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }

@media (max-width: 760px) {
  .table-top { flex-direction: column; align-items: flex-start; justify-content: center; }
  .gallery-page .table-pill button { padding: 0 13px; }
  .table-hint { display: none; }
  .table-mail { left: var(--gutter); right: auto; align-items: flex-start; }
  .plate { flex-direction: column; align-items: stretch; bottom: max(14px, env(safe-area-inset-bottom)); }
  .plate-controls .plate-close { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-page *, .gallery-page *::before, .gallery-page *::after { animation: none !important; transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
