/* Hartvig as the postman, with a key card for a new colleague and at the door
   when someone comes back (hartvig-social.mjs). */
.hartvig-s-figure { display: block; pointer-events: none; }
.hartvig-s-figure svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes hartvig-s-pop { from { opacity: 0; transform: scale(.85) translateY(8px); } to { opacity: 1; transform: none; } }
.is-leaving.hartvig-s-post, .is-leaving.hartvig-s-colleague, .is-leaving.hartvig-s-back { opacity: 0; transform: scale(.97); transition: opacity .3s ease, transform .3s ease; }

/* 5. The postman by the Messages button. */
.hartvig-s-post { position: fixed; z-index: 61; width: 92px; height: 92px; }
.hartvig-s-postman { width: 100%; height: 100%; filter: drop-shadow(0 10px 16px rgba(240,68,145,.3)); animation: hartvig-s-walk-in .9s cubic-bezier(.3,1.15,.5,1) both; }
.hartvig-s-post[data-side="right"] .hartvig-s-postman { animation-name: hartvig-s-walk-in-right; }
@keyframes hartvig-s-walk-in { from { opacity: 0; transform: translateX(110px); } 30% { opacity: 1; } to { transform: none; } }
@keyframes hartvig-s-walk-in-right { from { opacity: 0; transform: translateX(-110px); } 30% { opacity: 1; } to { transform: none; } }
.hartvig-s-letter { transform-box: view-box; transform-origin: 175px 57px; animation: hartvig-s-wave .4s .9s ease-in-out 4 alternate; }
@keyframes hartvig-s-wave { to { transform: rotate(-22deg); } }
.hartvig-s-post-bubble {
  position: absolute; bottom: calc(100% + 6px); inset-inline-end: -40px; display: grid; gap: 8px; width: max-content; max-width: min(240px, calc(100vw - 24px)); padding: 10px 12px;
  border: 1px solid rgba(240,68,145,.45); border-radius: 14px 14px 4px 14px; background: #241a2c; color: #f7f4fa; box-shadow: 0 12px 28px rgba(0,0,0,.4);
  font-size: 13px; font-weight: 600; line-height: 1.35; text-align: start; animation: hartvig-s-pop .4s .7s cubic-bezier(.3,1.5,.5,1) both;
}
.hartvig-s-post[data-side="right"] .hartvig-s-post-bubble { inset-inline-end: auto; inset-inline-start: -40px; border-radius: 14px 14px 14px 4px; }
.hartvig-s-post .hartvig-s-post-open {
  justify-self: start; padding: 6px 12px; border: 0 !important; border-radius: 999px; background: linear-gradient(90deg, #f04491, #b14cff) !important; color: #fff !important;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.hartvig-s-post .hartvig-s-post-open:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
html[data-theme="light"] .hartvig-s-post-bubble { background: #fff; color: #1e1424; box-shadow: 0 12px 26px rgba(60,20,60,.16); }
@media (max-width: 560px) { .hartvig-s-post { width: 72px; height: 72px; } }

/* 8. The key card by a new colleague's card. */
.employee-directory-item:has(> .hartvig-s-colleague) { position: relative; }
.employee-directory-item.hartvig-s-newcard { box-shadow: 0 0 0 2px #f04491, 0 14px 30px rgba(240,68,145,.18); }
html[data-theme="light"] .employee-directory-item.hartvig-s-newcard { box-shadow: 0 0 0 2px #f04491, 0 14px 30px rgba(240,68,145,.14); }
.hartvig-s-colleague { position: absolute; z-index: 3; inset-inline-end: -8px; bottom: -14px; width: 84px; height: 84px; pointer-events: none; }
.hartvig-s-keyholder { width: 100%; height: 100%; filter: drop-shadow(0 8px 14px rgba(240,68,145,.28)); animation: hartvig-s-pop .45s cubic-bezier(.3,1.4,.5,1) both; }
.hartvig-s-keycard { transform-box: view-box; transform-origin: 175px 57px; animation: hartvig-s-offer .6s .2s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes hartvig-s-offer { from { transform: translate(-20px, 30px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.hartvig-s-colleague-say {
  position: absolute; bottom: calc(100% + 2px); inset-inline-end: 6px; width: max-content; max-width: 220px; padding: 7px 11px; border-radius: 14px 14px 4px 14px;
  border: 1px solid rgba(240,68,145,.45); background: #241a2c; color: #f7f4fa; font-size: 12.5px; font-weight: 600; line-height: 1.35; box-shadow: 0 10px 22px rgba(0,0,0,.35);
  animation: hartvig-s-pop .4s .3s cubic-bezier(.3,1.5,.5,1) both;
}
html[data-theme="light"] .hartvig-s-colleague-say { background: #fff; color: #1e1424; box-shadow: 0 10px 22px rgba(60,20,60,.14); }

/* 9. Welcome back on the dashboard. */
.hartvig-s-back {
  position: relative; display: flex; align-items: center; gap: 18px; width: min(680px, 100%); margin: 18px auto 4px; padding: 14px 52px 14px 16px; overflow: hidden;
  border: 1px solid rgba(240,68,145,.4); border-radius: 22px; text-align: start; color: #f7f4fa;
  background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.22), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(96,165,250,.14), transparent 55%), #1d1724;
  box-shadow: 0 18px 44px rgba(0,0,0,.35); animation: hartvig-s-pop .45s cubic-bezier(.3,1.4,.5,1);
}
.hartvig-s-back-scene { position: relative; flex: none; width: 150px; height: 118px; }
.hartvig-s-door { position: absolute; left: 8px; bottom: 0; width: 56px; height: 100px; border-radius: 28px 28px 4px 4px; background: linear-gradient(180deg, #7c3aed, #5b21b6); box-shadow: inset 0 0 0 5px #a78bfa; }
.hartvig-s-door::after { content: ''; position: absolute; right: 10px; top: 54px; width: 7px; height: 7px; border-radius: 50%; background: #fde047; }
.hartvig-s-traveller { position: absolute; left: 34px; bottom: 0; width: 108px; height: 108px; filter: drop-shadow(0 10px 16px rgba(240,68,145,.28)); animation: hartvig-s-arrive 1s cubic-bezier(.3,1.2,.5,1) both; }
@keyframes hartvig-s-arrive { from { opacity: 0; transform: translateX(-36px) scale(.8); } 50% { opacity: 1; } to { transform: none; } }
.hartvig-s-case { transform-box: view-box; transform-origin: 38px 150px; animation: hartvig-s-bob .25s ease-in-out 4 alternate; }
@keyframes hartvig-s-bob { to { transform: rotate(-6deg); } }
.hartvig-s-back-copy { position: relative; z-index: 1; display: grid; gap: 6px; justify-items: start; min-width: 0; }
.hartvig-s-back-title { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.hartvig-s-back-text, .hartvig-s-back-hearts { margin: 0; color: #cfc6d8; font-size: 13.5px; line-height: 1.5; }
.hartvig-s-back-hearts { color: #ff8cc0; font-weight: 600; }
.hartvig-s-back .hartvig-s-back-go {
  margin-top: 4px; padding: 8px 16px; border: 0 !important; border-radius: 999px; background: linear-gradient(90deg, #f04491, #b14cff) !important; color: #fff !important;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.hartvig-s-back .hartvig-s-back-close {
  position: absolute; z-index: 2; top: 10px; inset-inline-end: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16) !important; background: rgba(255,255,255,.05) !important; color: #cfc6d8 !important; font-size: 13px; cursor: pointer;
}
.hartvig-s-back .hartvig-s-back-close:hover { color: #fff !important; background: rgba(255,255,255,.1) !important; }
.hartvig-s-back .hartvig-s-back-go:focus-visible, .hartvig-s-back .hartvig-s-back-close:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
html[data-theme="light"] .hartvig-s-back { color: #1e1424; background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.14), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(96,165,250,.1), transparent 55%), #fff; box-shadow: 0 16px 36px rgba(60,20,60,.12); }
html[data-theme="light"] .hartvig-s-back-text { color: #5d5066; }
html[data-theme="light"] .hartvig-s-back-hearts { color: #c0266f; }
html[data-theme="light"] .hartvig-s-back .hartvig-s-back-close { border-color: rgba(42,23,48,.16) !important; background: #fff !important; color: #5d5066 !important; }
@media (max-width: 640px) {
  .hartvig-s-back { flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 16px 16px; text-align: center; }
  .hartvig-s-back-scene { align-self: center; }
  .hartvig-s-back-copy { justify-items: center; }
}

/* Reduced motion: everything stands still and just appears. */
.hartvig-s-post.is-still, .hartvig-s-post.is-still *, .hartvig-s-colleague.is-still, .hartvig-s-colleague.is-still *, .hartvig-s-back.is-still, .hartvig-s-back.is-still * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .hartvig-s-post, .hartvig-s-post *, .hartvig-s-colleague, .hartvig-s-colleague *, .hartvig-s-back, .hartvig-s-back * { animation: none !important; transition: none !important; }
}
