/* Locked project cards ("Coming soon"). js/project-lock.js marks a card with
   .is-locked and adds .pl-lock (a dither veil + pixel lock + label) on top of
   its media. Shown on mouse hover, keyboard focus, or a tap (.pl-open).
   - veil: 2px checker of ink at 78% / 46%, the play button's dither;
   - lock: 24-grid pixel icon at 48px (2px per icon pixel), ecru;
   - label: Departure Mono 22px (2px font pixels) on an ink tag with a 2px
     notched outline and a hard 2px shadow;
   - reveal in 2 steps of 40ms; a click shakes the lock 2px (6 frames, 40ms);
   - reduced motion: no shake, instant reveal. */

/* Blocked cursor: C3 pixel set (same ring as c3-info, slash for the "i"),
   27px with a centred 13 13 hotspot, a 2x file for retina, not-allowed as the
   fallback. html + * so card text, links and [title] rules can't win back the
   pointer, ibeam or info cursor on a locked card. */
html .is-locked,
html .is-locked * {
  cursor: url("/images/cursors/c3-blocked.svg") 13 13, not-allowed;
  cursor: -webkit-image-set(url("/images/cursors/c3-blocked.svg") 1x, url("/images/cursors/c3-blocked@2x.svg") 2x) 13 13, not-allowed;
  cursor: image-set(url("/images/cursors/c3-blocked.svg") 1x, url("/images/cursors/c3-blocked@2x.svg") 2x) 13 13, not-allowed;
}
.is-locked :is(.project-wrapper-img, .suggested-project-image-wrap) { position: relative; }

.pl-lock {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: repeating-conic-gradient(
      color-mix(in srgb, var(--swatch--neutral-100) 78%, transparent) 0 25%,
      color-mix(in srgb, var(--swatch--neutral-100) 46%, transparent) 0 50%
    ) 0 0 / 4px 4px;
  color: var(--swatch--ecru-10);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 80ms steps(2, end), visibility 0s linear 80ms;
}

.pl-lock__icon {
  display: block;
  width: 48px;
  height: 48px;
  shape-rendering: crispEdges;
}

.pl-lock__label {
  position: relative;
  isolation: isolate;
  padding: 6px 14px 8px;
  font-family: var(--site-font, 'Departure Mono', monospace);
  font-size: 22px;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--swatch--ecru-10);
  white-space: nowrap;
  -webkit-font-smoothing: none;
}
.pl-lock__label::before,
.pl-lock__label::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
}
.pl-lock__label::before { z-index: -2; translate: 2px 2px; background: var(--swatch--ecru-50); }
.pl-lock__label::after {
  z-index: -1;
  background:
    linear-gradient(var(--swatch--ecru-10), var(--swatch--ecru-10)) left 2px top 2px / 2px 2px no-repeat,
    linear-gradient(var(--swatch--ecru-10), var(--swatch--ecru-10)) right 2px top 2px / 2px 2px no-repeat,
    linear-gradient(var(--swatch--ecru-10), var(--swatch--ecru-10)) left 2px bottom 2px / 2px 2px no-repeat,
    linear-gradient(var(--swatch--ecru-10), var(--swatch--ecru-10)) right 2px bottom 2px / 2px 2px no-repeat,
    linear-gradient(var(--swatch--neutral-100), var(--swatch--neutral-100)) 2px 2px / calc(100% - 4px) calc(100% - 4px) no-repeat,
    var(--swatch--ecru-10);
}

/* Show: hover (mouse), keyboard focus, or tapped open. */
@media (hover: hover) and (pointer: fine) {
  .is-locked:hover .pl-lock { opacity: 1; visibility: visible; transition: opacity 80ms steps(2, end), visibility 0s; }
}
.is-locked:focus-visible .pl-lock,
.is-locked.pl-open .pl-lock { opacity: 1; visibility: visible; transition: opacity 80ms steps(2, end), visibility 0s; }

/* The card's own title overlay steps back while the lock shows. */
@media (hover: hover) and (pointer: fine) {
  .is-locked:hover .card-overlay { opacity: 0; }
}
.is-locked:focus-visible .card-overlay,
.is-locked.pl-open .card-overlay { opacity: 0; }

/* Click / tap / Enter: the lock shakes, 2px each way, 40ms frames. */
@keyframes pl-shake {
  0%, 100% { translate: 0 0; }
  16.66% { translate: -2px 0; }
  33.33% { translate: 2px 0; }
  50% { translate: -2px 0; }
  66.66% { translate: 2px 0; }
  83.33% { translate: 0 0; }
}
.is-locked.pl-shake .pl-lock__icon { animation: pl-shake 240ms steps(1, end); }

html.dark-mode .pl-lock__label::before {
  background: repeating-conic-gradient(var(--swatch--neutral-60) 0 25%, transparent 0 50%) 0 0 / 2px 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pl-lock, .is-locked:hover .pl-lock, .is-locked:focus-visible .pl-lock, .is-locked.pl-open .pl-lock { transition: none; }
  .is-locked.pl-shake .pl-lock__icon { animation: none; }
}
