/* Completion certificate (sample on the waitlist page).
   Sizes use cqw so the whole certificate scales like an image. */

.cert-wrap { container-type: inline-size; perspective: 1400px; }

.cert {
  --g1: #f5c542; --g2: #fff1b8; --g3: #b8860b;
  position: relative; overflow: hidden;
  aspect-ratio: 1.414 / 1;
  border-radius: 1.6cqw;
  padding: 7.4cqw 8.6cqw 6.4cqw;
  display: flex; flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(120% 90% at 50% 0%, #1b1838 0%, #0d0c1d 55%, #07070f 100%);
  box-shadow:
    0 0 0 1px rgba(245, 197, 66, .55),
    0 40px 90px rgba(0, 0, 0, .65),
    0 0 80px rgba(245, 197, 66, .08);
  transform-style: preserve-3d;
  animation: cert-float 8s ease-in-out infinite;
}
@keyframes cert-float {
  0%, 100% { transform: rotateX(4deg) rotateY(-6deg) translateY(0); }
  50% { transform: rotateX(1deg) rotateY(-2deg) translateY(-1.6cqw); }
}

.cert-guilloche { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .32; pointer-events: none; }

/* double gold frame */
.cert-frame {
  position: absolute; inset: 2.2cqw; border-radius: .8cqw; pointer-events: none;
  border: .25cqw solid transparent;
  background: linear-gradient(120deg, var(--g3), var(--g1), var(--g2), var(--g1), var(--g3)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.cert-frame::after {
  content: ""; position: absolute; inset: .9cqw; border-radius: .5cqw;
  border: 1px solid rgba(245, 197, 66, .28);
}
.corner { position: absolute; width: 5cqw; height: 5cqw; border-color: var(--g1); border-style: solid; border-width: 0; pointer-events: none; }
.c1 { top: 3.6cqw; right: 3.6cqw; border-top-width: .45cqw; border-right-width: .45cqw; }
.c2 { top: 3.6cqw; left: 3.6cqw; border-top-width: .45cqw; border-left-width: .45cqw; }
.c3 { bottom: 3.6cqw; right: 3.6cqw; border-bottom-width: .45cqw; border-right-width: .45cqw; }
.c4 { bottom: 3.6cqw; left: 3.6cqw; border-bottom-width: .45cqw; border-left-width: .45cqw; }

/* holographic sweep */
.cert-shine {
  position: absolute; top: -50%; bottom: -50%; left: -60%; width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 241, 184, .14), rgba(120, 113, 205, .14), transparent);
  transform: rotate(20deg); pointer-events: none; mix-blend-mode: screen;
  animation: cert-shine 6s ease-in-out infinite;
}
@keyframes cert-shine { 0%, 35% { left: -60%; } 75%, 100% { left: 130%; } }

/* head */
.cert-head { position: relative; display: flex; justify-content: space-between; align-items: center; }
.cert-head img { height: 4.2cqw; width: auto; }
.cert-en { direction: ltr; font-size: 1.55cqw; letter-spacing: .38em; color: rgba(245, 197, 66, .85); font-weight: 500; }

/* body */
.cert-body { position: relative; text-align: center; margin: auto 0; }
.cert-k {
  display: inline-block; font-size: 1.9cqw; font-weight: 700; color: var(--ink);
  background: linear-gradient(120deg, var(--g3), var(--g1), var(--g2), var(--g1));
  padding: .5cqw 2.2cqw; border-radius: 99px; margin-bottom: 1.6cqw;
}
.cert-small { font-size: 1.75cqw; line-height: 1.7; color: var(--muted); }
.cert-name {
  font-size: 6.4cqw; font-weight: 800; line-height: 1.45; margin: .2cqw 0 .6cqw; padding-bottom: .15em;
  background: linear-gradient(180deg, #ffffff 0%, #e9e4ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cert-course {
  font-size: 3cqw; font-weight: 800; line-height: 1.6; margin-top: .3cqw; padding-bottom: .12em;
  background: linear-gradient(100deg, var(--g1) 0%, var(--g1) 40%, var(--g2) 50%, var(--g1) 60%, var(--g1) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 4.5s ease-in-out infinite;
}
.cert-meta {
  list-style: none; display: flex; justify-content: center; gap: 4.5cqw;
  margin-top: 2.6cqw; padding-top: 1.8cqw;
  border-top: 1px solid rgba(245, 197, 66, .2);
}
.cert-meta li { display: grid; gap: .2cqw; }
.cert-meta b { font-size: 1.3cqw; font-weight: 500; color: var(--muted); }
.cert-meta span { font-size: 1.7cqw; font-weight: 700; }

/* foot: signature · seal · QR */
.cert-foot { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
.sig { display: grid; justify-items: center; gap: .5cqw; justify-self: start; }
.sig img { height: 4cqw; width: auto; opacity: .95; }
.sig i { display: block; width: 17cqw; height: 1px; background: linear-gradient(90deg, transparent, var(--g1), transparent); }
.sig span { font-size: 1.35cqw; color: var(--muted); }

.seal {
  position: relative; width: 13cqw; height: 13cqw; margin-bottom: -.6cqw;
  display: grid; place-items: center;
  filter: drop-shadow(0 .6cqw 1.4cqw rgba(0, 0, 0, .6));
}
.seal::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, var(--g2), var(--g1) 40%, var(--g3) 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 38%, #000 39% 100%);
          mask: radial-gradient(circle, transparent 0 38%, #000 39% 100%);
}
.seal-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: seal-spin 24s linear infinite; }
.seal-ring text { font: 700 8.6px "Graphik Arabic", sans-serif; fill: #2b1f02; direction: ltr; unicode-bidi: plaintext; }
@keyframes seal-spin { to { transform: rotate(360deg); } }
.seal-core {
  position: relative; width: 64%; height: 64%; border-radius: 50%;
  display: grid; place-items: center; align-content: center;
  background: radial-gradient(circle at 40% 30%, #2a2552, #0f0e22);
  border: .25cqw solid var(--g1);
}
.seal-core span { font-size: 2.4cqw; color: var(--g1); line-height: 1; animation: glow 3s ease-in-out infinite; }
.seal-core b { font-size: 1.45cqw; font-weight: 800; color: var(--g1); }

.qr-box { justify-self: end; display: grid; justify-items: center; gap: .6cqw; }
.qr-box img { width: 9.5cqw; height: 9.5cqw; background: #fff; border-radius: .8cqw; padding: .8cqw; }
.qr-box span { font-size: 1.3cqw; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .cert { transform: rotateX(2deg) rotateY(-4deg); }
}
