/* The portrait itself is the shutter; touch screens get a quiet invitation. */
.identity-block { display: flex; flex-direction: column; align-items: flex-start; gap: 23px; }
.portrait-printer { position: relative; display: block; width: 72px; height: 72px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; background: transparent; isolation: isolate; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.portrait-invitation { position: absolute; left: calc(100% + 14px); top: 50%; width: max-content; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; white-space: nowrap; pointer-events: none; clip-path: inset(0 0 0 var(--portrait-hint-cut, 0px)); }
.portrait-invitation-content { display: flex; align-items: center; gap: 7px; opacity: 0; transform: translateX(-6px); clip-path: inset(0 100% 0 0); transition: opacity 120ms cubic-bezier(.22, 1, .36, 1), transform 260ms cubic-bezier(.22, 1, .36, 1), clip-path 260ms cubic-bezier(.22, 1, .36, 1); }
.portrait-invitation svg { width: 16px; height: 13px; }
.portrait-printer:focus-visible .portrait-invitation-content, .portrait-printer[data-hint-printing] .portrait-invitation-content { opacity: 1; transform: translateX(0); clip-path: inset(0); }
.portrait-printer[data-hint-printing] .portrait-invitation-content { transition: none; }
.portrait-printer[data-hint-erased] .portrait-invitation-content { opacity: 0; }
.portrait-printer:disabled .portrait-invitation { display: none; }
.portrait-printer:disabled { cursor: default; }
.portrait-printer .shelf-portrait { transition: opacity 260ms cubic-bezier(.22, 1, .36, 1), transform 400ms cubic-bezier(.22, 1, .36, 1), filter 260ms ease; }
.camera-shutter { position: absolute; inset: 1px; display: grid; place-items: center; padding: 6px; border: 1px solid #9a9a9a; border-radius: 50%; color: #555; background: conic-gradient(from 25deg, #f8f8f8, #aaa 14%, #f5f5f5 26%, #bbb 40%, #ededed 53%, #929292 65%, #f9f9f9 80%, #b7b7b7 91%, #f8f8f8); box-shadow: inset 0 1px 1px #fff, inset 0 -2px 2px #0004, 0 2px 2px #0002, 0 5px 9px #0002; opacity: 0; transform: scale(.86) rotate(-12deg); transition: opacity 260ms ease, transform 400ms cubic-bezier(.22, 1, .36, 1), box-shadow 160ms ease; }
.camera-shutter::before { content: ''; position: absolute; inset: 3px; border: 1px solid #ffffffa6; border-radius: inherit; box-shadow: 0 0 0 1px #0002; }
.camera-shutter-core { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border: 1px solid #8d8d8d; border-radius: inherit; background: radial-gradient(ellipse at 35% 12%, #fff9, transparent 60%), repeating-linear-gradient(0deg, #ffffff0a 0 1px, #00000006 1px 2px), linear-gradient(#ececec, #c4c4c4); box-shadow: inset 0 1px 2px #fff, 0 2px 3px #0005; transition: transform 120ms ease, box-shadow 120ms ease; }
.camera-shutter svg { width: 29px; height: 29px; filter: drop-shadow(0 1px 0 #fffc); }
.portrait-printer:is(:focus-visible, [data-printing]) .shelf-portrait { opacity: 0; transform: scale(.88); filter: blur(3px); }
.portrait-printer:is(:focus-visible, [data-printing]) .camera-shutter { opacity: 1; transform: scale(1) rotate(0); }
@media (hover: hover) {
  .portrait-printer:not(:disabled):hover .portrait-invitation-content { opacity: 1; transform: translateX(0); clip-path: inset(0); }
  .portrait-printer[data-hint-erased]:hover .portrait-invitation-content { opacity: 0; }
  .portrait-printer:not(:disabled):hover .shelf-portrait { opacity: 0; transform: scale(.88); filter: blur(3px); }
  .portrait-printer:not(:disabled):hover .camera-shutter { opacity: 1; transform: scale(1) rotate(0); }
}
.portrait-printer:active .camera-shutter-core, .portrait-printer[data-pressed] .camera-shutter-core { transform: translateY(1.5px) scale(.965); box-shadow: inset 0 2px 4px #0003, 0 0 1px #fff; }
/* Paper covers page controls and keyboard selection (layers 100–102). */
.polaroid-stage { position: fixed; z-index: 200; inset: 0 0 auto; width: 100%; height: 100vh; pointer-events: none; overflow: hidden; contain: strict; }
/* Measure the unobstructed viewport even while the animation canvas is hidden.
   The falling sheet continues into Safari's translucent bottom toolbar area. */
.polaroid-viewport { position: fixed; top: 0; left: 0; width: 0; height: 100vh; height: calc(100lvh + env(safe-area-inset-bottom, 0px)); visibility: hidden; pointer-events: none; contain: strict; }
/* Document-positioned layers scroll natively, with no canvas redraw or JS offset.
   Each sheet owns its pushpin so overlapping prints share the same depth order. */
.polaroid-pinned { position: absolute; z-index: 199; inset: 0; overflow: clip; pointer-events: none; isolation: isolate; }
.polaroid-pinned-paper { position: absolute; width: 324px; height: 364px; pointer-events: none; transform: translateZ(0); }
.polaroid-pinned .polaroid-grab, .polaroid-pinned .polaroid-pin { position: absolute; }
.polaroid-pinned .polaroid-grab { pointer-events: auto; }
/* The guide sits behind the page; photos remain above it while being handled. */
.portfolio-layout { position: relative; z-index: 1; }
.polaroid-rail { overflow: hidden; position: absolute; z-index: 0; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid var(--line); border-radius: 3px; background: color-mix(in srgb, var(--paper) 88%, var(--surface)); color: var(--muted); box-shadow: inset 0 1px 0 #ffffff0d; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 120ms cubic-bezier(.22, 1, .36, 1), transform 260ms cubic-bezier(.22, 1, .36, 1), border-color 160ms ease, background 160ms ease; }
.polaroid-rail[data-visible] { opacity: 1; transform: translateY(0); transition-duration: 260ms; }
.polaroid-rail[data-ready] { border-color: var(--muted); background: var(--surface); }
.polaroid-rail-label { position: absolute; z-index: 203; width: max-content; max-width: calc(100vw - 32px); padding: 2px 4px; background: var(--paper); color: var(--muted); font-size: 11px; line-height: 12px; letter-spacing: .015em; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 120ms ease; }
.polaroid-rail-label[data-visible] { opacity: 1; }
.polaroid-guide { position: absolute; top: 0; left: 0; width: 5px; height: 5px; margin: -2.5px; border: 1px solid var(--muted); border-radius: 50%; background: var(--paper); opacity: 0; transition: opacity 120ms ease; }
.polaroid-rail[data-ready] .polaroid-guide { opacity: .7; }
.polaroid-grab { position: fixed; z-index: 201; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.polaroid-grab:focus-visible { outline: none; background: #00000006; box-shadow: inset 0 0 0 2px var(--muted); }
.polaroid-grab[data-phase="dragging"], .polaroid-dragging, .polaroid-dragging * { cursor: grabbing !important; }
.polaroid-dragging { user-select: none; -webkit-user-select: none; }
/* A small graphite pushpin: bright head, turned collar, steel point. Its
   attachment sits in the 10px white margin, leaving the photograph untouched. */
.polaroid-pin { position: fixed; z-index: 202; width: 8px; height: 11px; margin: -11px 0 0 -4px; border-radius: 3px 3px 4px 4px; background: linear-gradient(90deg, #353535, #a7a7a7 32%, #747474 53%, #353535 90%); box-shadow: inset 0 0 0 .5px #0005, 1px 2px 2px #0004; pointer-events: none; transform-origin: 50% 100%; animation: polaroid-pin-in 280ms cubic-bezier(.22, 1, .36, 1) both; }
.polaroid-pin::before { content: ''; position: absolute; width: 2px; height: 5px; left: 3px; top: 9px; background: linear-gradient(90deg, #777, #eee 50%, #777); transform: rotate(-17deg); transform-origin: top; box-shadow: 1px 1px 1px #0003; }
.polaroid-pin::after { content: ''; position: absolute; width: 13px; height: 8px; top: -3px; left: -2.5px; border-radius: 50%; border: .5px solid #444; background: radial-gradient(ellipse at 35% 22%, #e5e5e5, #969696 38%, #626262 74%, #454545); box-shadow: inset 0 1px 1px #ffffffb3, 0 1px 1px #0005; }
@keyframes polaroid-pin-in { 0% { opacity: 0; transform: translate(3px, -10px) scale(1.35) rotate(12deg); } 65% { opacity: 1; transform: translate(0, 1px) scale(.95) rotate(-3deg); } 100% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); } }
.print-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width: 800px) {
  .identity-block { gap: 18px; }
  .portrait-printer { width: 64px; height: 64px; }
  .polaroid-rail { padding: 0 10px; }
  .polaroid-rail-label { font-size: 10px; }
}
@media (hover: none), (pointer: coarse) {
  .portrait-invitation-content { opacity: 1; transform: translateX(0); clip-path: inset(0); }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-printer *, .portrait-printer *::before { transition: none !important; }
  .polaroid-rail, .polaroid-rail-label, .polaroid-guide { transition: none; }
  .polaroid-pin { animation: none; }
}
@media print { .polaroid-stage, .polaroid-viewport, .polaroid-pinned, .polaroid-rail, .polaroid-rail-label, .polaroid-grab, .polaroid-pin, .portrait-invitation { display: none; } }
