/* Certifications — extends existing theme tokens / patterns */

.section-certifications .cert-grid {
  row-gap: 24px;
}

.section-certifications .cert-grid > [class*="col-"] {
  display: flex;
}

.cert-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--Bg-linear-2);
  padding: 28px 24px;
  z-index: 1;
  width: 100%;
  height: 100%;
  transition: border-color 0.3s ease;
}

.cert-card:hover {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cert-card__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 2;
  height: 100%;
}

.cert-card__media {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 16px;
  display: block;
  overflow: hidden;
  cursor: zoom-in;
  transform-style: preserve-3d;
  will-change: transform;
  box-shadow:
    0 10px 36px rgba(255, 255, 255, 0.14),
    0 2px 10px rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cert-card__media:hover {
  box-shadow:
    0 14px 44px rgba(255, 255, 255, 0.2),
    0 4px 14px rgba(255, 255, 255, 0.1),
    0 22px 48px rgba(0, 0, 0, 0.4);
}

.cert-card__media:focus-visible {
  outline: 2px solid var(--Primary);
  outline-offset: 4px;
}

.cert-card__media-glow {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--Primary) 28%, transparent) 0%,
    transparent 70%
  );
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

.cert-card__badge {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  border-radius: 16px;
}

.cert-card__body {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
}

.cert-card__meta .tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  background-color: var(--Primary);
  color: var(--Text-primary);
  border-radius: 24px;
  margin-bottom: 16px;
}

.cert-card__title {
  margin-bottom: 12px;
  line-height: 1.35;
}

.cert-card__desc {
  margin-bottom: 20px;
  line-height: 1.65;
  max-width: 720px;
  margin-inline: auto;
}

.cert-card__skills {
  margin-bottom: 36px;
}

.cert-card__skills .skill-badge-list {
  justify-content: center;
}

.cert-skill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--Text-light);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.cert-skill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--Primary) 55%, transparent);
  background: color-mix(in srgb, var(--Primary) 12%, transparent);
}

.cert-card__cta {
  display: inline-flex;
  margin-top: auto;
}

.dark-mode .cert-card {
  box-shadow: 0px 5px 5px 0px rgba(28, 36, 51, 0.1019607843);
}

.dark-mode .cert-card__media {
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode .cert-skill {
  border-color: rgba(18, 18, 18, 0.1);
  background: rgba(18, 18, 18, 0.04);
  color: #121212;
}

/* Cert image lightbox */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  pointer-events: none;
}

.cert-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.cert-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cert-modal.is-open .cert-modal__backdrop {
  opacity: 1;
}

.cert-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100dvh - 32px);
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 40px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cert-modal.is-open .cert-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cert-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}

.cert-modal__close:hover {
  background: var(--Primary);
  color: var(--Text-primary);
  transform: rotate(90deg);
}

.cert-modal__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}

.cert-modal__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  background: #0d0d0d;
}

.cert-modal__caption {
  padding: 16px 20px;
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.cert-modal-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .cert-card__skills {
    margin-bottom: 40px;
  }

  .cert-card__desc {
    max-width: none;
  }
}

@media (max-width: 767px) {
  .cert-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .cert-card__media,
  .cert-card__badge {
    border-radius: 14px;
  }

  .cert-card__skills {
    margin-bottom: 28px;
  }

  .cert-skill {
    height: 32px;
    font-size: 11px;
    padding: 0 10px;
  }

  .cert-modal__dialog {
    border-radius: 18px;
  }
}
