/* Hero Pill Popovers (GitHub & LinkedIn) */
.pop-anchor {
  position: relative;
  display: inline-flex;
}

.hover-popover {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  width: 320px;
  transform: translateX(-50%) translateY(8px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  z-index: 90;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.22s ease-out;
  filter: blur(3px);
  perspective: 1000px;
}

.hover-popover.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  filter: blur(0px);
}

/* Invisible bridge so mouse moving from pill to card doesn't close it */
.hover-popover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px;
}

.popover-card {
  position: relative;
  width: 100%;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  color: var(--fg);
  transform-style: preserve-3d;
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.1s ease-out;
}

html.dark .popover-card {
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-color: var(--line-2);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* GitHub Card specifics */
.gh-card-body {
  padding: 16px;
  --c-0: #ebebe7;
  --c-1: #c8c8c2;
  --c-2: #8f8f87;
  --c-3: #4a4a44;
  --c-4: #121210;
}

html.dark .gh-card-body {
  --c-0: #1c1c1c;
  --c-1: #323232;
  --c-2: #5c5c5c;
  --c-3: #9e9e9e;
  --c-4: #ededed;
}

.gh-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.gh-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.gh-card-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.gh-card-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.gh-card-user {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s;
  margin-top: 2px;
}

.gh-card-user:hover {
  color: var(--fg);
}

.gh-grid-wrap {
  position: relative;
  margin: 0 auto;
  user-select: none;
}

.gh-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  grid-auto-columns: 10px;
  gap: 3px;
  justify-content: center;
}

.gh-cell {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--c-0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s;
  cursor: pointer;
}

.gh-cell:hover {
  transform: scale(1.35);
  background-color: var(--live) !important;
  z-index: 10;
}

.gh-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(15, 15, 15, 0.94);
  color: #fff;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 30;
}

.gh-tooltip.on {
  opacity: 1;
}

.gh-card-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* LinkedIn Card specifics */
.li-card-banner {
  position: relative;
  height: 72px;
  background: linear-gradient(135deg, #0077b5 0%, #004182 100%);
  overflow: hidden;
}

html.dark .li-card-banner {
  background: linear-gradient(135deg, #0d2744 0%, #173860 100%);
}

.li-card-banner-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.6;
}

.li-card-body {
  position: relative;
  padding: 0 18px 18px;
}

.li-card-top {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: -34px;
  margin-bottom: 12px;
}

.li-card-avatar-frame {
  position: relative;
  z-index: 10;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: var(--card);
  border: 1px solid var(--line-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.li-card-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--card);
}

.li-card-icon-wrap {
  margin-top: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.li-card-icon {
  width: 24px;
  height: 24px;
  color: #0A66C2;
  fill: currentColor;
  display: block;
}

.li-card-info {
  text-align: left;
}

.li-card-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}

.li-card-headline {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-2);
}

.li-card-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--sans);
}

.li-card-conn {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg);
}

@media (max-width: 560px) {
  .hover-popover {
    display: none !important;
  }
}
