/* lock screen: sits over the desktop until any key, click or tap */
.lock {
  position: fixed; inset: 0; z-index: 10000;
  color: #fff; background: #000; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  user-select: none; -webkit-user-select: none; cursor: default;
}
.lock[hidden] { display: none; }
.lock__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
/* darken top and bottom so the clock and the hint stay readable over the reel */
.lock__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 38%),
    linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 36%);
}

.lock__status {
  position: absolute; top: max(calc(14 * var(--u)), 10px); right: max(calc(28 * var(--u)), 16px);
  display: flex; align-items: center; gap: max(calc(18 * var(--u)), 12px);
}
.lock__status img { height: max(calc(20 * var(--u)), 14px); filter: brightness(0) invert(1); opacity: 0.95; }
.lock__status .lock__battery { height: max(calc(24 * var(--u)), 17px); }

.lock__time {
  position: relative; text-align: center;
  margin-top: clamp(48px, 9vh, 120px);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.lock__date { font-weight: 600; font-size: clamp(16px, calc(30 * var(--u)), 30px); opacity: 0.92; }
.lock__clock {
  font-weight: 700; letter-spacing: -0.02em; line-height: 1;
  font-size: clamp(84px, calc(190 * var(--u)), 210px);
}

.lock__user {
  position: relative; margin-top: auto; margin-bottom: clamp(36px, 8vh, 96px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.lock__avatar {
  width: clamp(60px, calc(90 * var(--u)), 90px); aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: rgba(199, 230, 255, 0.85);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.lock__avatar img { width: 72%; margin-bottom: -14%; }
.lock__name { font-weight: 600; font-size: clamp(15px, calc(19 * var(--u)), 19px); }
.lock__hint {
  font-size: clamp(12px, calc(15 * var(--u)), 15px); font-weight: 500;
  padding: 0.45em 1.05em; border-radius: 999px;
  white-space: nowrap; line-height: 1.3;
  transition: font-size 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: lock-pulse 2.4s ease-in-out infinite;
}
@keyframes lock-pulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

/* unlocking: the lock screen dissolves and zooms past you while the desktop zooms out into place */
.lock.is-unlocking {
  pointer-events: none;
  animation: lock-out 0.95s cubic-bezier(0.55, 0, 0.2, 1) forwards;
}
.lock.is-unlocking .lock__time,
.lock.is-unlocking .lock__user { animation: lock-ui-out 0.4s ease-in forwards; }
@keyframes lock-out {
  0%   { opacity: 1; transform: scale(1); filter: blur(0); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.18); filter: blur(18px); }
}
@keyframes lock-ui-out { to { opacity: 0; transform: translateY(-12px) scale(0.96); } }

.desktop.is-locked { transform: scale(1.12); filter: blur(10px); }
.desktop.is-entering { animation: desk-in 1.05s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
@keyframes desk-in {
  0%   { transform: scale(1.12); filter: blur(10px); }
  100% { transform: scale(1); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lock__hint { animation: none; opacity: 0.85; }
  .lock.is-unlocking { animation-duration: 0.3s; }
  .desktop.is-locked { transform: none; filter: none; }
  .desktop.is-entering { animation: none; }
}

/* phones: "tap" instead of "press any key" */
.lock__hint .on-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .lock__hint .on-key { display: none; }
  .lock__hint .on-touch { display: inline; }
}
