.vc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.4s ease, backdrop-filter 0.4s ease;
  pointer-events: none;
}
.vc-overlay.vc-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}
[data-theme="light"] .vc-overlay.vc-visible {
  background: rgba(0, 0, 0, 0.45);
}

.vc-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}
.vc-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.vc-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  transform: translateY(30px) scale(0.92);
  opacity: 0;
  animation: vc-content-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s forwards;
  z-index: 1;
}
@keyframes vc-content-in {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.vc-badge-wrap {
  position: relative;
  animation: vc-badge-glow 2s ease-in-out 0.8s infinite alternate;
}
@keyframes vc-badge-glow {
  0% { filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.15)); }
  100% { filter: drop-shadow(0 0 28px rgba(255, 215, 0, 0.35)); }
}

.vc-badge-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  background: var(--bg-card, #1a1a1a);
  border: 1px solid var(--border, #333);
}

.vc-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vc-title {
  font-family: "Roobert", sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: #f5f5f4;
  margin: 0;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.5s forwards;
}
.vc-module-name {
  font-family: "Roobert", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: rgba(245, 245, 244, 0.7);
  margin: 0;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.6s forwards;
}
.vc-subtitle {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 245, 244, 0.45);
  margin: 0;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.7s forwards;
}
@keyframes vc-text-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vc-dismiss-btn {
  margin-top: 8px;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.85s forwards;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.vc-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.vc-particle {
  position: absolute;
  opacity: 0;
  animation: vc-particle-burst 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--pdelay) forwards;
}
.vc-particle-circle {
  border-radius: 50%;
  background: var(--pcolor);
}
.vc-particle-rect {
  border-radius: 2px;
  background: var(--pcolor);
}
.vc-particle-star {
  background: none;
  border-left: calc(var(--psize) / 2) solid transparent;
  border-right: calc(var(--psize) / 2) solid transparent;
  border-bottom: var(--psize) solid var(--pcolor);
}

@keyframes vc-particle-burst {
  0% {
    opacity: var(--popacity);
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  50% {
    opacity: var(--popacity);
  }
  100% {
    opacity: 0;
    transform: translate(var(--ptx), var(--pty)) rotate(var(--pspin)) scale(0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-content {
    animation: none;
    transform: none;
    opacity: 1;
  }
  .vc-badge-wrap {
    animation: none;
    filter: none;
  }
  .vc-title,
  .vc-module-name,
  .vc-subtitle,
  .vc-dismiss-btn {
    animation: none;
    opacity: 1;
  }
  .vc-particle {
    animation: none;
    display: none;
  }
}

@media (max-width: 480px) {
  .vc-title {
    font-size: 22px;
  }
  .vc-badge-wrap svg {
    width: 160px;
    height: 160px;
  }
}

/* ---------- Certification Earned celebration overlay ----------
   Built on the same .vc-overlay scaffolding as the badge celebration
   (particles, dismiss button, close button) but renders a large, HD
   .ce-cred credential card with download + LinkedIn share controls. */
.ccc-overlay.vc-visible {
  /* Allow scrolling on small screens — the cred card is large. */
  align-items: flex-start;
  padding: 48px 24px;
  overflow-y: auto;
}
.ccc-content {
  gap: 18px;
  max-width: 820px;
  width: 100%;
}
.ccc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 245, 244, 0.65);
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.4s forwards;
}
.ccc-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF4A1C;
  box-shadow: 0 0 8px rgba(255, 74, 28, 0.6);
}
.ccc-title {
  font-size: 36px;
}
.ccc-module-name {
  font-size: 18px;
  color: rgba(245, 245, 244, 0.85);
}
.ccc-cred-wrap {
  width: 100%;
  max-width: 720px;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  animation: ccc-cred-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s forwards;
  filter: drop-shadow(0 30px 80px rgba(0, 0, 0, 0.55));
}
@keyframes ccc-cred-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Force a generous, captureable size for the embedded cred card so the
   raster is high-DPI regardless of viewport scaling. */
.ccc-cred-wrap .ce-cred {
  width: 100%;
  /* Existing cert.css gives .ce-cred aspect-ratio: 4/3, which keeps the
     card proportions stable when html-to-image takes a snapshot. */
}
.ccc-meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 4px;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 0.95s forwards;
}
.ccc-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.ccc-meta .k {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 245, 244, 0.45);
}
.ccc-meta .v {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: #f5f5f4;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ccc-verify-link {
  color: #FF4A1C;
  text-decoration: none;
}
.ccc-verify-link:hover { text-decoration: underline; }

.ccc-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 1.05s forwards;
}
.ccc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-family: "Roobert", sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms, transform 150ms;
  white-space: nowrap;
}
.ccc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ccc-btn-primary {
  background: #FF4A1C;
  color: #fff;
}
.ccc-btn-primary:hover:not(:disabled) {
  background: #ff5f37;
  transform: translateY(-1px);
}
.ccc-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f4;
  border-color: rgba(255, 255, 255, 0.16);
}
.ccc-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}
.ccc-hint {
  max-width: 560px;
  font-family: "Roobert", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(245, 245, 244, 0.55);
  margin: 0 auto;
  opacity: 0;
  animation: vc-text-up 0.4s ease-out 1.15s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .ccc-eyebrow,
  .ccc-cred-wrap,
  .ccc-meta-row,
  .ccc-actions,
  .ccc-hint {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .ccc-overlay.vc-visible { padding: 24px 12px; }
  .ccc-title { font-size: 26px; }
  .ccc-meta .v { max-width: 220px; }
}

/* The .ce-cred card relies on CSS vars defined on .view-cert (--paper,
   --paper-2, --ink, --ink-muted, --divider). When we render it inside
   the celebration overlay there is no .view-cert ancestor, so we
   redeclare the dark palette here. The cred card is always rendered
   in its dark/credential treatment regardless of the page theme — the
   cert page itself does the same via `[data-theme="light"] .ce-cred`. */
.ccc-overlay .ce-cred {
  --divider: #262626;
  --paper: #111111;
  --paper-2: #0D0D0D;
  --ink: #EDEDED;
  --ink-muted: #A3A3A3;
  --border-hover: #2A2A2A;
  --white: #F5F5F4;
}
