.linkedin-popup {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(1rem, 2.5vw, 2rem);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
}

.linkedin-popup.is-visible {
  visibility: visible;
  opacity: 1;
}

.linkedin-popup-card {
  position: relative;
  width: min(350px, calc(100vw - 2rem));
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(88, 63, 157, 0.16);
  border-radius: 14px;
  background: #ffffff !important;
  box-shadow: 0 24px 64px rgba(6, 12, 30, 0.3);
  color: #111827;
  font-family: var(--body-font, Arial, sans-serif);
  pointer-events: auto;
  transform: translateY(24px) scale(0.98);
  transition: transform 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.linkedin-popup.is-visible .linkedin-popup-card {
  transform: translateY(0) scale(1);
}

.linkedin-popup-cover {
  display: block;
  width: 100%;
  height: 82px;
  object-fit: cover;
  object-position: right center;
  background: #16033b;
}

.linkedin-popup-logo {
  position: absolute;
  top: 48px;
  left: 16px;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(11, 18, 38, 0.2);
}

.linkedin-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  display: grid;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(14, 12, 15, 0.8);
  color: #ffffff;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.linkedin-popup-close:hover {
  background: rgba(7, 6, 27, 0.92);
  transform: scale(1.06);
}

.linkedin-popup-body {
  padding: 40px 16px 16px;
}

.linkedin-popup-title {
  margin: 0 0 0.65rem;
  font-family: var(--heading-font, Arial, sans-serif);
  font-size: clamp(1.08rem, 0.7vw + 0.94rem, 1.24rem);
  font-weight: 800;
  line-height: 1.12;
  color: #111827;
}

.dark-scheme .linkedin-popup-title {
  background: none;
  color: #111827;
  -webkit-background-clip: border-box;
  -webkit-text-fill-color: #111827;
}

.linkedin-popup-description {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #60646c;
}

.dark-scheme .linkedin-popup-description {
  color: #60646c;
}

.linkedin-popup-link {
  display: inline-flex;
  min-height: 42px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1rem;
  border: 1px solid #075aa8;
  border-radius: 999px;
  background: #0a66c2;
  box-shadow: 0 8px 18px rgba(10, 102, 194, 0.22);
  color: #ffffff;
  font-family: var(--heading-font, Arial, sans-serif);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.linkedin-popup-link:hover {
  background: #084f96;
  box-shadow: 0 10px 24px rgba(10, 102, 194, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.dark-scheme .linkedin-popup-link,
.dark-scheme .linkedin-popup-link:visited,
.dark-scheme .linkedin-popup-link:hover,
.dark-scheme .linkedin-popup-link:focus-visible {
  color: #ffffff;
}

.linkedin-follow-mark {
  display: inline-grid;
  width: 24px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 3px;
  background: #ffffff;
  color: #0a66c2;
  font-family: Arial, sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.linkedin-popup-close:focus-visible,
.linkedin-popup-link:focus-visible {
  outline: 3px solid rgba(124, 77, 255, 0.42);
  outline-offset: 3px;
}

.dark-scheme .linkedin-popup-link:focus-visible {
  outline-color: #ffffff;
}

@media (max-width: 576px) {
  .linkedin-popup {
    justify-content: center;
    padding: 1rem;
  }

  .linkedin-popup-card {
    width: min(350px, calc(100vw - 2rem));
  }
}

@media (max-width: 420px) {
  .linkedin-popup-cover {
    height: 78px;
  }

  .linkedin-popup-logo {
    top: 46px;
    width: 64px;
    height: 64px;
  }

  .linkedin-popup-body {
    padding-top: 38px;
  }

  .linkedin-popup-description {
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .linkedin-popup,
  .linkedin-popup-card,
  .linkedin-popup-close,
  .linkedin-popup-link {
    transition: none;
  }
}
