/* Certificate of completion (page and print). Markup: certificate-markup.js.
   Everything inside the certificate is sized in cqw (1% of the certificate's width), so it looks the
   same on a phone, a laptop or an A4 page. */

.certificate-page { padding-top: 2rem; }
.certificate-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.certificate-actions .crumb { color: var(--fg-muted); margin: 0; }
.certificate-page .notice { margin-bottom: 1.5rem; }
.cert-congrats { margin: 0 0 1.25rem; }
.cert-congrats h1 { margin: 0 0 0.35rem; }
.cert-congrats p { margin: 0; color: var(--fg-muted); max-width: 60ch; }
.cert-hint { margin: 1rem auto 0; text-align: center; font-size: 0.85rem; color: var(--fg-subtle); }

.cert-wrap { container-type: inline-size; max-width: 1120px; margin: 0 auto; }
.certificate {
  position: relative;
  aspect-ratio: 1414 / 1000;
  overflow: hidden;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 2px 4px rgba(8, 57, 64, 0.12), 0 18px 50px rgba(8, 57, 64, 0.28);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.cert-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.cert-body {
  position: absolute;
  inset: 7.2cqw 9cqw 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cert-body p { margin: 0; }
.cert-eyebrow {
  font: 800 1.05cqw/1 var(--font-ui);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--abyss);
}
.cert-eyebrow span { color: var(--sun); letter-spacing: 0; padding: 0 0.6em; }
.cert-title {
  margin: 1.6cqw 0 0;
  font: 400 6.9cqw/0.9 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding-left: 0.07em;
  background: linear-gradient(180deg, #ffe28f 0%, #e3b02c 38%, #b8860b 62%, #e8bd45 82%, #a87a08 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0.12cqw 0 rgba(8, 57, 64, 0.35));
}
.cert-subtitle {
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  margin-top: 1.1cqw !important;
  font: 800 1.35cqw/1 var(--font-ui);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  text-transform: uppercase;
  color: var(--abyss);
}
.cert-subtitle::before,
.cert-subtitle::after { content: ''; width: 9cqw; height: 0.14cqw; background: linear-gradient(90deg, transparent, #d9a315); }
.cert-subtitle::after { background: linear-gradient(90deg, #d9a315, transparent); }

.cert-presented { margin-top: 2.6cqw !important; font: italic 400 1.45cqw/1.2 var(--font-ui); color: var(--fg-muted); }
.cert-name {
  margin-top: 0.6cqw !important;
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 7.6cqw;
  line-height: 1;
  color: var(--abyss);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cert-name.long { font-size: 6.2cqw; }
.cert-name.longer { font-size: 4.9cqw; }
.cert-name.longest { font-size: 3.8cqw; white-space: normal; overflow-wrap: anywhere; }
.cert-flourish { width: 38cqw; height: auto; margin-top: -0.4cqw; display: block; }

.cert-has { margin-top: 1.3cqw !important; font: italic 400 1.45cqw/1.2 var(--font-ui); color: var(--fg-muted); }
.cert-course {
  margin-top: 0.9cqw !important;
  font: 400 4.6cqw/1 var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--abyss);
}
.cert-with { margin-top: 1cqw !important; font: 600 1.4cqw/1.2 var(--font-ui); color: var(--ink); }
.cert-meta {
  margin-top: 1.1cqw !important;
  font: 800 1cqw/1 var(--font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--surf-deep);
}
.cert-meta span { color: var(--sun); padding: 0 0.5em; letter-spacing: 0; }

.cert-footer {
  position: absolute;
  left: 9.5cqw;
  right: 9.5cqw;
  bottom: 7.4cqw;
  display: grid;
  grid-template-columns: 1fr 14cqw 1fr;
  align-items: end;
  gap: 3cqw;
}
.cert-sig { display: flex; flex-direction: column; align-items: center; padding-bottom: 0.4cqw; }
.cert-sig-hand {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 3.3cqw;
  line-height: 1;
  color: var(--abyss);
  transform: rotate(-3deg);
  margin-bottom: 0.3cqw;
}
.cert-sig-name {
  width: 100%;
  max-width: 26cqw;
  border-top: 0.12cqw solid #b8860b;
  padding-top: 0.7cqw;
  font: 800 1cqw/1 var(--font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}
.cert-sig-role { margin-top: 0.5cqw; font: italic 400 1cqw/1.2 var(--font-ui); color: var(--fg-muted); }
.cert-seal {
  width: 14cqw;
  height: auto;
  display: block;
  margin-bottom: -3cqw;
  filter: drop-shadow(0 0.35cqw 0.5cqw rgba(8, 57, 64, 0.35));
}
.seal-text { font: 800 11.5px var(--font-ui); fill: #ffe28f; letter-spacing: 1px; }
.seal-star { font: 400 11px var(--font-ui); fill: #ffe28f; }

/* Confetti on arrival (see certificate.js); skipped when reduced motion is preferred. */
.cert-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff; margin: 0; padding: 0; }
  .site-header, .site-footer, .no-print, .skip-link, .toasts, .mini-player, .cert-confetti { display: none !important; }
  .main { min-height: 0; }
  .certificate-page { padding: 0; margin: 0; max-width: none; width: 100vw; }
  .cert-wrap { width: 100vw; max-width: none; }
  .certificate { width: 100vw; height: 100vh; aspect-ratio: auto; box-shadow: none; break-inside: avoid; }
}
