:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --print-w: 280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: linear-gradient(172deg, #f8faf7 0%, #f4f6f3 40%, #e8eae7 70%, #d9dad8 100%) fixed;
  color: var(--ink);
  font: 400 12px/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

#info {
  position: fixed;
  right: max(32px, env(safe-area-inset-right));
  bottom: max(28px, env(safe-area-inset-bottom));
  text-align: right;
  user-select: none;
  -webkit-user-select: none;
}

#info p {
  margin: 0 0 0.9em;
}

#info p:last-child {
  margin: 0;
}

#info .small {
  color: #6b6b6b;
}

#info a {
  color: inherit;
  text-decoration: none;
}

#info a:hover {
  text-decoration: underline;
}

#desk {
  position: fixed;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.print {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--print-w);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.print.live {
  will-change: transform;
}

.print.out {
  visibility: hidden;
}

.paper {
  position: relative;
  padding: calc(var(--print-w) * 0.035);
  background: #fcfcfa;
  box-shadow:
    0 0.5px 1px rgb(0 0 0 / 0.18),
    0 2px 6px rgb(0 0 0 / 0.08);
  transition:
    transform 0.18s ease,
    opacity 0.18s;
}

.print.anim {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lifted shadow lives on a pseudo-element so picking a print up only fades
   opacity instead of repainting a large blur every frame. */
.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    0 18px 40px rgb(0 0 0 / 0.22),
    0 5px 12px rgb(0 0 0 / 0.12);
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}

.photo {
  background: var(--c);
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  -webkit-user-drag: none;
}

.photo img.loaded {
  opacity: 1;
}

.print.lifted {
  cursor: grabbing;
}

.print.lifted .paper {
  transform: scale(1.035);
}

.print.lifted .paper::after,
.print.inspecting .paper::after {
  opacity: 1;
}

.print:focus-visible .paper {
  outline: 2px solid #1a5cff;
  outline-offset: 3px;
}

.print.inspecting {
  z-index: 99999 !important;
  cursor: zoom-out;
}

#backdrop {
  position: absolute;
  inset: 0;
  z-index: 99998;
  background: rgb(18 18 18 / 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#backdrop.open {
  opacity: 1;
  pointer-events: auto;
  cursor: zoom-out;
}

@media (max-width: 600px) {
  body {
    font-size: 10.5px;
  }
  #info {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .paper,
  .paper::after,
  #backdrop {
    transition: none;
  }
}
