/* Sign-in that holds: three machined lock plates, each running its scene */
.lk { display: grid; gap: var(--space-6); padding-block: var(--space-6) var(--space-8); }
@media (min-width: 62rem) { .lk { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; } }
.lk-plate { position: relative; display: grid; gap: var(--space-4); align-content: start; padding: var(--space-6) var(--space-5) var(--space-5); border-radius: var(--radius-l); background: linear-gradient(var(--lk-angle), var(--color-raised-2), var(--color-ground)); box-shadow: inset 0 var(--hairline) 0 var(--color-glass-hi), 0 0 0 var(--hairline) var(--color-line-strong), var(--shadow); }
/* Two screw heads, so each plate reads as a fitted part */
.lk-plate::before, .lk-plate::after { content: ""; position: absolute; top: var(--space-3); width: var(--lk-screw); height: var(--lk-screw); border-radius: 50%; background: linear-gradient(var(--lk-slot), transparent var(--lk-slot-a), var(--color-line-strong) var(--lk-slot-a), var(--color-line-strong) var(--lk-slot-b), transparent var(--lk-slot-b)), var(--color-raised); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.lk-plate::before { left: var(--space-3); }
.lk-plate::after { right: var(--space-3); }
.lk-scene { margin: 0 calc(var(--space-2) * -1); padding: var(--space-3); border-radius: var(--radius-m); background: var(--color-ground); box-shadow: inset 0 0 0 var(--hairline) var(--color-line); }
.lk-svg { display: block; width: 100%; height: auto; overflow: visible; }
.lk-h { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-lead); font-stretch: var(--stretch-semi); font-weight: 400; line-height: var(--leading-snug); }
.lk-n { display: inline-grid; place-items: center; flex: none; width: var(--lk-n); height: var(--lk-n); border-radius: 50%; border: var(--hairline) solid var(--color-accent); color: var(--color-accent); font-size: var(--text-small); font-weight: 600; }
.lk-plate p { color: var(--color-ink-soft); }
.lk .d-t { display: none; }
body:has(#rd-tech:checked) .lk .d-p { display: none; }
body:has(#rd-tech:checked) .lk .d-t { display: block; font-family: var(--font-mono); font-size: var(--text-small); color: var(--color-cool); }
.lk-figs { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin-top: auto; padding-top: var(--space-4); border-top: var(--hairline) solid var(--color-line); }
.lk-figs div { display: grid; gap: var(--space-1); }
.lk-figs dd { order: -1; font-size: var(--text-h2); font-stretch: var(--stretch-wide); font-weight: 300; line-height: 1; color: var(--color-accent); }
.lk-figs dt { font-size: var(--text-small); color: var(--color-ink-faint); max-width: var(--lk-fig-w); }

/* The drawings */
.lk-tx { fill: var(--color-ink-soft); font-size: var(--lk-tx); text-anchor: middle; }
.lk-l { text-anchor: start; }
.lk-dev { fill: var(--color-raised); stroke: var(--color-line-strong); stroke-width: 1.2; }
.lk-dim { fill: var(--color-ink-faint); opacity: 0.5; }
.lk-keyring, .lk-keystem { fill: none; stroke: var(--color-accent); stroke-width: 2.4; stroke-linecap: round; }
.lk-doorf { fill: var(--color-raised); stroke: var(--color-line-strong); stroke-width: 1.6; }
.lk-knob { fill: var(--color-ink-faint); }
.lk-yes { fill: none; stroke: var(--color-good); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.lk-none { fill: var(--color-refuse); opacity: 0; }
.lk-pips circle { fill: transparent; stroke: var(--color-line-strong); stroke-width: 1.4; }
.lk-shackle { fill: none; stroke: var(--color-hold); stroke-width: 3; stroke-linecap: round; translate: 0 var(--lk-lift); }
.lk-body { fill: var(--color-raised-2); stroke: var(--color-hold); stroke-width: 1.6; }
.lk-other { stroke: var(--color-refuse); }
.lk-tokf { fill: var(--color-accent); }
.lk-tok-b { opacity: 0; }
.lk-no { fill: none; stroke: var(--color-refuse); stroke-width: 3; stroke-linecap: round; opacity: 0; }
.lk-out { fill: var(--color-refuse); text-anchor: start; opacity: 0; }

/* The key fits the real door, then the look-alike asks and gets nothing */
.lk-key { animation: lk-key var(--lk-door) var(--ease) infinite; }
.lk-real .lk-doorf { animation: lk-open var(--lk-door) linear infinite; }
.lk-yes { animation: lk-yes var(--lk-door) linear infinite; }
.lk-none { animation: lk-ask var(--lk-door) linear infinite; }
@keyframes lk-key { 0%, 8% { translate: 0 0; } 30%, 50% { translate: var(--lk-key-x) var(--lk-key-y); } 62%, 100% { translate: 0 0; } }
@keyframes lk-open { 0%, 30% { stroke: var(--color-line-strong); } 34%, 52% { stroke: var(--color-good); } 58%, 100% { stroke: var(--color-line-strong); } }
@keyframes lk-yes { 0%, 32% { stroke-dashoffset: 30; } 40%, 52% { stroke-dashoffset: 0; } 58%, 100% { stroke-dashoffset: 30; } }
@keyframes lk-ask { 0%, 64% { opacity: 0; } 70%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* Tries fill the rows. The owner's lock shuts at 3, everyone else's at 10 */
.lk-pips circle { animation: lk-pip var(--lk-trip) linear infinite both; }
@keyframes lk-pip { 0% { fill: transparent; } 1%, 86% { fill: var(--color-hold); } 92%, 100% { fill: transparent; } }
.lk-pips-o circle:nth-child(2) { animation-delay: var(--lk-step); }
.lk-pips-o circle:nth-child(3) { animation-delay: calc(var(--lk-step) * 2); }
.lk-pips-s circle { animation-delay: var(--lk-staff); }
.lk-pips-s circle:nth-child(2) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s)); }
.lk-pips-s circle:nth-child(3) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 2); }
.lk-pips-s circle:nth-child(4) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 3); }
.lk-pips-s circle:nth-child(5) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 4); }
.lk-pips-s circle:nth-child(6) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 5); }
.lk-pips-s circle:nth-child(7) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 6); }
.lk-pips-s circle:nth-child(8) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 7); }
.lk-pips-s circle:nth-child(9) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 8); }
.lk-pips-s circle:nth-child(10) { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 9); }
.lk-pad .lk-shackle { animation: lk-shut var(--lk-trip) var(--ease) infinite both; }
.lk-pad-o .lk-shackle { animation-delay: calc(var(--lk-step) * 3); }
.lk-pad-s .lk-shackle { animation-delay: calc(var(--lk-staff) + var(--lk-step-s) * 10); }
@keyframes lk-shut { 0% { translate: 0 var(--lk-lift); } 3%, 80% { translate: 0 0; } 86%, 100% { translate: 0 var(--lk-lift); } }

/* A session works where it began. A copy elsewhere is refused */
.lk-tok-a { animation: lk-go var(--lk-travel) var(--ease) infinite; }
.lk-tok-b { animation: lk-copy var(--lk-travel) var(--ease) infinite; }
.lk-no, .lk-out { animation: lk-refused var(--lk-travel) linear infinite; }
@keyframes lk-go { 0%, 6% { translate: 0 0; opacity: 1; } 24%, 36% { translate: var(--lk-tok-x) 0; opacity: 1; } 42%, 100% { translate: var(--lk-tok-x) 0; opacity: 0; } }
@keyframes lk-copy { 0%, 46% { translate: 0 0; opacity: 0; } 50% { opacity: 1; } 64% { translate: var(--lk-tok-xb) 0; opacity: 1; } 70%, 100% { translate: var(--lk-tok-xb) 0; opacity: 0; } }
@keyframes lk-refused { 0%, 64% { opacity: 0; } 68%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* Holding still: the end of each scene, all at once */
@media (prefers-reduced-motion: reduce) {
  .lk-key, .lk-real .lk-doorf, .lk-yes, .lk-none, .lk-pips circle, .lk-pad .lk-shackle, .lk-tok-a, .lk-tok-b, .lk-no, .lk-out { animation: none; }
  .lk-real .lk-doorf { stroke: var(--color-good); }
  .lk-yes { stroke-dashoffset: 0; }
  .lk-none, .lk-no, .lk-out { opacity: 1; }
  .lk-pips circle { fill: var(--color-hold); }
  .lk-shackle { translate: 0 0; }
}
