/* ==========================================================================
   Welcome layer — the macOS-style lock screen on first visit and the CV
   notification that slides in 30 s later. Behaviour: js/welcome.js.
   Rebuilt in CSS (no Apple artwork). Sizes follow the macOS login window /
   Notification Centre banner; under 810 px the iPhone versions are used.
   ========================================================================== */

:root{
  --lock-ink:#FFFFFF;
  --lock-ink-soft:rgba(255,255,255,.78);
  --lock-field:rgba(255,255,255,.2);
  --lock-field-line:rgba(255,255,255,.28);
  --lock-ease:cubic-bezier(.22,1,.36,1);      /* fast start, soft landing */
  --notif-bg:rgba(246,246,246,.74);
  --notif-line:rgba(0,0,0,.1);
  --notif-title:#000000;
  --notif-text:rgba(0,0,0,.84);
  --notif-meta:#6B6B70;                       /* 4.9:1 on the glass */
}

/* Until the lock screen is built the desktop stays hidden (no flash of the desktop). */
.pd-locked .desktop{opacity:0}

/* ---------- Lock screen ---------- */
.lock{
  position:fixed;inset:0;z-index:1000;
  display:flex;flex-direction:column;align-items:center;
  color:var(--lock-ink);
  font-family:var(--font);
  -webkit-user-select:none;user-select:none;
  touch-action:manipulation;
  overflow:hidden;
}
.lock__bg{
  /* exactly the geometry of .wallpaper (styles.css): no inset, no zoom, no blur,
     so the black-and-white portrait sits pixel-on-pixel over the colour one */
  position:absolute;inset:0;
  background:#E4E4E4 center / cover no-repeat;
  filter:var(--wall-filter,none);
}
.lock__bg::after{
  /* a soft vignette so white type stays readable on any wallpaper */
  content:"";position:absolute;inset:0;
  background:
    radial-gradient(120% 80% at 50% 40%,rgba(0,0,0,.18),rgba(0,0,0,.5)),
    rgba(0,0,0,.12);
}

.lock__top{
  position:relative;
  margin-top:max(9.2vh,52px);
  text-align:center;
}
/* Date and time copy the macOS Sonoma lock screen: SF Pro (the system font on Apple
   devices), semibold, translucent white. */
.lock__date,.lock__time{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display",system-ui,"Segoe UI",Roboto,sans-serif;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  color:rgba(255,255,255,.86);
}
.lock__date{
  font-size:clamp(18px,1.65vw,26px);line-height:1.2;letter-spacing:.005em;
}
.lock__time{
  margin-top:-.04em;
  font-size:clamp(72px,8vw,132px);line-height:1;letter-spacing:-.012em;
}
.lock__date{color:rgba(255,255,255,.88)}
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  /* frosted numerals: nearly solid at the top, the background shows through towards the bottom */
  .lock__time{
    color:transparent;
    background:linear-gradient(180deg,rgba(255,255,255,.96) 0%,rgba(255,255,255,.86) 45%,rgba(255,255,255,.64) 100%);
    -webkit-background-clip:text;background-clip:text;
  }
}

.lock__user{
  position:relative;
  flex:1;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  padding-bottom:max(7.4vh,44px);
}
.lock__avatar{
  /* macOS login: a small round photo low on the screen with a thin light ring */
  display:block;width:clamp(44px,3.4vw,64px);height:clamp(44px,3.4vw,64px);border-radius:50%;
  object-fit:cover;background:#4A4A4C;
  box-shadow:0 0 0 2px rgba(255,255,255,.5),0 1px 6px rgba(0,0,0,.18);
}
.lock__name{
  margin-top:9px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,"Segoe UI",Roboto,sans-serif;
  font-size:14px;font-weight:600;letter-spacing:0;line-height:1.2;
  text-shadow:0 1px 3px rgba(0,0,0,.25);
}
.lock__role{display:none}

.lock__field{
  position:relative;
  display:flex;align-items:center;
  width:136px;height:22px;margin:9px 0 0;padding:0 24px 0 10px;
  border-radius:11px;
  background:rgba(255,255,255,.26);
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.22);
  -webkit-backdrop-filter:blur(20px) saturate(1.8);backdrop-filter:blur(20px) saturate(1.8);
}
.lock__placeholder{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,"Segoe UI",Roboto,sans-serif;
  font-size:13px;color:rgba(255,255,255,.62);white-space:nowrap;
  transition:opacity 120ms linear;
}
.lock__dots{
  position:absolute;left:10px;top:50%;
  display:flex;gap:4px;transform:translateY(-50%);
}
.lock__dot{
  width:6px;height:6px;border-radius:50%;background:#FFFFFF;
  animation:lock-dot 180ms var(--lock-ease) both;
}
@keyframes lock-dot{from{transform:scale(.2);opacity:0}to{transform:none;opacity:1}}
.lock__field.has-text .lock__placeholder{opacity:0}

/* The eye: reveals the self-typed "password" (keep creating art). */
.lock__field{transition:width 260ms var(--lock-ease)}
.lock__field.is-ready{width:146px;padding-right:44px}          /* room for the eye, with a gap after the 7 dots */
.lock__field.is-revealed{width:162px}                          /* room for "keep creating art" */
.lock__secret{
  position:absolute;left:10px;top:50%;transform:translateY(-50%);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text",system-ui,"Segoe UI",Roboto,sans-serif;
  font-size:13px;line-height:1;color:#FFFFFF;white-space:nowrap;
  opacity:0;transition:opacity 160ms linear;pointer-events:none;
}
.lock__field.is-revealed .lock__secret{opacity:1}
.lock__field.is-revealed .lock__dots{opacity:0}
.lock__dots{transition:opacity 160ms linear}
.lock__peek{
  position:absolute;right:26px;top:2px;
  display:grid;place-items:center;
  width:18px;height:18px;padding:0;border:0;border-radius:50%;
  background:transparent;color:rgba(255,255,255,.7);cursor:pointer;
  opacity:0;pointer-events:none;transition:opacity 220ms linear,color 150ms linear;
}
.lock__peek::after{content:"";position:absolute;inset:-12px -6px}
.lock__peek svg{width:13px;height:13px}
.lock__field.is-ready .lock__peek{opacity:1;pointer-events:auto}
.lock__field.is-revealed .lock__peek{color:#FFFFFF}
@media (hover:hover){.lock__peek:hover{color:#FFFFFF}}
.lock__peek:focus-visible{outline:2px solid #FFFFFF;outline-offset:2px}

.lock__go{
  position:absolute;right:2px;top:2px;
  display:grid;place-items:center;
  width:18px;height:18px;padding:0;border:0;border-radius:50%;
  background:rgba(255,255,255,.92);color:#1D1D1F;
  cursor:pointer;
  opacity:0;transform:scale(.5);
  transition:opacity 220ms linear,transform 420ms var(--spring),background-color 150ms linear;
}
.lock__go::after{content:"";position:absolute;inset:-15px;border-radius:50%}   /* 48 px touch target */
.lock__go svg{width:10px;height:10px}
.lock__field.is-ready .lock__go{opacity:1;transform:none}
.lock__field.is-ready .lock__go::before{
  content:"";position:absolute;inset:0;border-radius:50%;
  box-shadow:0 0 0 0 rgba(255,255,255,.55);
  animation:lock-ring 1.8s 400ms ease-out 2;
}
@keyframes lock-ring{to{box-shadow:0 0 0 10px rgba(255,255,255,0)}}
@media (hover:hover){.lock__go:hover{background:#FFFFFF}}
.lock__go:active{transform:scale(.92)}
.lock__go:focus-visible{outline:2px solid #FFFFFF;outline-offset:3px}

/* the macOS screen has no hint line; kept for screen readers only */
.lock__hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.lock__bar{display:none}

/* entrance */
.lock .lock__top,.lock .lock__user{transition:opacity 500ms linear,transform 700ms var(--lock-ease)}
.lock.is-pre .lock__top{opacity:0;transform:translateY(-14px)}
.lock.is-pre .lock__user{opacity:0;transform:scale(.96)}

/* unlock: UI lifts away, blur clears, the desktop settles in from a slight zoom */
.lock.is-out{pointer-events:none}
.lock.is-out .lock__top,.lock.is-out .lock__user{
  opacity:0;transform:scale(1.08);
  transition:opacity 300ms linear,transform 520ms var(--lock-ease);
}
/* the portrait stays put and only turns into colour: the grey picture fades out over
   the colour desktop wallpaper, which is already in place underneath (no zoom) */
.lock.is-out .lock__bg{opacity:0;transition:opacity 700ms 80ms linear}
.desktop.is-arriving > :not(.wallpaper){opacity:0}
.desktop.is-landing > :not(.wallpaper){transition:opacity 450ms 380ms linear}

/* wrong-password shake is never needed, but the field nods once when the arrow is pressed */
@keyframes lock-press{50%{transform:scale(.97)}}
.lock.is-out .lock__field{animation:lock-press 200ms ease-out}

/* ---------- Phone: iPhone lock screen ---------- */
@media (max-width:809.98px){
  .lock__top{margin-top:max(calc(env(safe-area-inset-top) + 34px),56px)}
  .lock__date{font-size:19px}
  .lock__time{font-size:clamp(76px,24vw,96px)}
  .lock__user{padding-bottom:calc(env(safe-area-inset-bottom) + 64px)}
  .lock__avatar{width:56px;height:56px}
  .lock__name{font-size:16px}
  .lock__field{width:200px;height:32px;border-radius:16px;padding:0 34px 0 14px}
  .lock__placeholder{font-size:16px}
  .lock__dots{left:14px}
  .lock__go{width:26px;height:26px;top:3px;right:3px}
  .lock__go svg{width:14px;height:14px}
  .lock__field.is-ready{width:200px;padding-right:64px}
  .lock__field.is-revealed{width:216px}
  .lock__secret{left:14px;font-size:16px}
  .lock__peek{width:26px;height:26px;top:3px;right:36px}
  .lock__peek svg{width:16px;height:16px}
  .lock__bar{
    display:block;position:absolute;left:50%;bottom:calc(env(safe-area-inset-bottom) + 8px);
    width:134px;height:5px;margin-left:-67px;border-radius:3px;background:rgba(255,255,255,.9);
  }
}

/* ---------- CV notification ---------- */
.notif{
  position:fixed;top:12px;right:12px;z-index:900;
  width:344px;max-width:calc(100vw - 24px);
  font-family:var(--font);
  transform:translateX(calc(100% + 24px));
  transition:transform 560ms var(--spring),opacity 300ms linear;
  touch-action:pan-y;
}
.notif.is-in{transform:none}
.notif.is-gone{transform:translateX(calc(100% + 24px));transition:transform 380ms cubic-bezier(.4,0,1,1)}
.notif.is-dragging{transition:none}

.notif__card{
  position:relative;
  display:flex;align-items:flex-start;gap:10px;
  padding:11px 14px 12px 11px;
  border-radius:16px;
  background:var(--notif-bg);
  -webkit-backdrop-filter:blur(26px) saturate(1.8);backdrop-filter:blur(26px) saturate(1.8);
  box-shadow:
    inset 0 0 0 .5px rgba(255,255,255,.6),
    0 0 0 .5px var(--notif-line),
    0 10px 30px rgba(0,0,0,.16),
    0 2px 6px rgba(0,0,0,.08);
  color:var(--notif-text);text-decoration:none;
  cursor:pointer;
  -webkit-user-select:none;user-select:none;
  -webkit-user-drag:none;
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .notif__card{background:rgba(246,246,246,.97)}
}
.notif__card:focus-visible{outline:2px solid #3B82F6;outline-offset:2px}

.notif__icon{position:relative;flex:none;width:38px;height:38px}
.notif__avatar{display:block;width:38px;height:38px;border-radius:50%;object-fit:cover;background:#D8D8D8}
.notif__badge{
  position:absolute;right:-4px;bottom:-4px;width:20px;height:20px;
  border-radius:5px;object-fit:contain;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.18));
}
.notif__body{flex:1;min-width:0;padding-top:1px}
.notif__head{display:flex;align-items:baseline;gap:8px}
.notif__title{flex:1;min-width:0;font-size:13px;font-weight:600;color:var(--notif-title);line-height:1.3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.notif__time{flex:none;font-size:12px;color:var(--notif-meta);font-variant-numeric:tabular-nums}
.notif__text{display:block;margin-top:1px;font-size:13px;line-height:1.3;color:var(--notif-text)}
.notif__action{
  display:flex;width:fit-content;align-items:center;gap:4px;margin-top:6px;
  font-size:13px;font-weight:600;color:#0A5BD6;   /* 5.6:1 on the glass */
}
.notif__action svg{width:12px;height:12px}

.notif__close{
  position:absolute;left:-7px;top:-7px;z-index:2;
  display:grid;place-items:center;
  width:20px;height:20px;padding:0;border:0;border-radius:50%;
  background:rgba(246,246,246,.96);color:#3C3C43;
  box-shadow:0 0 0 .5px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.14);
  cursor:pointer;
  opacity:0;transform:scale(.8);
  transition:opacity 150ms linear,transform 200ms var(--lock-ease);
}
.notif__close::after{content:"";position:absolute;inset:-10px;border-radius:50%}
.notif__close svg{width:9px;height:9px}
.notif:hover .notif__close,.notif:focus-within .notif__close{opacity:1;transform:none}
.notif__close:focus-visible{outline:2px solid #3B82F6;outline-offset:2px}
@media (hover:none){.notif__close{opacity:1;transform:none}}

@media (max-width:809.98px){
  .notif{
    top:max(env(safe-area-inset-top),8px);left:8px;right:8px;width:auto;max-width:none;
    transform:translateY(calc(-100% - 24px));
  }
  .notif.is-in{transform:none}
  .notif.is-gone{transform:translateY(calc(-100% - 24px))}
  .notif__card{padding:13px 14px 14px 13px;border-radius:22px;gap:12px}
  .notif__icon,.notif__avatar{width:40px;height:40px}
  .notif__title{font-size:16px}
  .notif__time{font-size:14px}
  .notif__text,.notif__action{font-size:16px}
  .notif__close{left:auto;right:-4px;top:-6px;width:26px;height:26px}
  .notif__close svg{width:10px;height:10px}
}

/* ---------- Reduce motion: crossfades only ---------- */
@media (prefers-reduced-motion:reduce){
  .lock .lock__top,.lock .lock__user,.lock.is-pre .lock__top,.lock.is-pre .lock__user,
  .lock.is-out .lock__top,.lock.is-out .lock__user{transform:none}
  .lock.is-out .lock__top,.lock.is-out .lock__user,.lock.is-out .lock__bg{transition:opacity 220ms linear}
  .lock.is-out .lock__field,.lock__dot,.lock__field.is-ready .lock__go::before{animation:none}
  .lock__go{transform:none;transition:opacity 150ms linear}
  .desktop.is-landing > :not(.wallpaper){transition:opacity 220ms linear}
  .notif,.notif.is-gone{transform:none;opacity:0;transition:opacity 220ms linear}
  .notif.is-in{opacity:1}
  @media (max-width:809.98px){.notif,.notif.is-gone{transform:none}}
}
