:root {
  color-scheme: dark;
  background: #191b1b;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.album-detail { min-height: 100vh; min-height: 100svh; }
.photo-grid { position: relative; width: 100%; aspect-ratio: var(--shape2); }
.photo-print {
  position: absolute;
  top: var(--y2);
  left: var(--x2);
  width: var(--w2);
  display: block;
  overflow: hidden;
  border-radius: clamp(9px, 1.15vw, 19px);
  background: #2e302d;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.photo-print picture, .photo-print img { display: block; width: 100%; height: 100%; }
.photo-print img { object-fit: cover; }
@media (min-width: 680px) {
  .photo-grid { aspect-ratio: var(--shape3); }
  .photo-print { width: var(--w3); left: var(--x3); top: var(--y3); }
}
@media (min-width: 1080px) {
  .photo-grid { aspect-ratio: var(--shape4); }
  .photo-print { width: var(--w4); left: var(--x4); top: var(--y4); }
}

.glass {
  position: fixed;
  inset-inline: 0;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: max-content;
  max-width: calc(100% - 18px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid rgb(255 255 255 / 33%);
  border-radius: 50px;
  color: #fff;
  background: rgb(32 34 34 / 88%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 3px 14px rgb(0 0 0 / 20%);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass {
    background: linear-gradient(135deg, rgb(48 49 50 / 62%), rgb(20 22 23 / 52%));
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
  }
}
.album-dock { z-index: 1; overflow: hidden; }
.album-dock h1 {
  max-width: 47vw;
  overflow: hidden;
  margin: 0;
  padding: 0 7px 0 2px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.control {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .control:hover { background: rgb(255 255 255 / 13%); }
}
:focus-visible { outline: 2px solid white; outline-offset: -4px; }
.motion-toggle { position: relative; }
.motion-toggle::before, .viewer-original::before {
  content: '';
  position: absolute;
  left: -1px;
  height: 16px;
  border-left: 1px solid rgb(255 255 255 / 26%);
}
.pause-icon { width: 11px; height: 13px; border-inline: 3px solid currentColor; }
.play-icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border: solid transparent;
  border-width: 7px 0 7px 11px;
  border-left-color: currentColor;
}
.motion-toggle[aria-pressed='true'] .play-icon,
.motion-toggle[aria-pressed='false'] .pause-icon { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .album-dock[data-moving]::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(110deg, transparent 25%, rgb(255 255 255 / 9%) 50%, transparent 75%);
    animation: glass-drift 14s ease-in-out infinite alternate;
  }
  @keyframes glass-drift { from { transform: translateX(-48%); } to { transform: translateX(48%); } }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .glass { background: #292b2c; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

html:has(.photo-viewer[open]) { overflow: hidden; }
.photo-viewer[open] {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: #111313;
  color: white;
  overflow: hidden;
}
.photo-viewer::backdrop { background: #111313; }
.viewer-stage { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; width: 100%; height: 100%; touch-action: pan-y pinch-zoom; }
.viewer-image { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.viewer-count { min-width: 54px; text-align: center; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; }
.viewer-original { position: relative; }
