.certificate {
  background: #fff;
  box-shadow: 0 18px 50px rgb(16 24 32 / 16%);
  color: var(--ink);
  margin: 50px auto 32px;
  max-width: 1100px;
  padding: 14px;
}

.certificate,
.certificate * {
  box-sizing: border-box;
}

.cert-border {
  background-color: #f8fbfa;
  background-image:
    repeating-linear-gradient(45deg, rgb(0 107 98 / 2.5%) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgb(11 60 93 / 2%) 0 1px, transparent 1px 9px);
  border: 3px double var(--accent);
  min-height: 720px;
  outline: 1px solid rgb(0 107 98 / 55%);
  outline-offset: -10px;
  overflow: hidden;
  padding: 54px 72px 38px;
  position: relative;
  text-align: center;
}

.cert-border::before,
.cert-border::after {
  border: 1px solid rgb(0 107 98 / 28%);
  content: "";
  pointer-events: none;
  position: absolute;
}

.cert-border::before { inset: 16px; }

.cert-border::after {
  border-left: 0;
  border-right: 0;
  inset: 22px 16px;
}

.cert-corner {
  border: 2px solid var(--accent);
  height: 30px;
  position: absolute;
  transform: rotate(45deg);
  width: 30px;
  z-index: 1;
}

.cert-corner::after {
  border: 1px solid rgb(0 107 98 / 45%);
  content: "";
  inset: 5px;
  position: absolute;
}

.cert-corner-top-left { left: 10px; top: 10px; }
.cert-corner-top-right { right: 10px; top: 10px; }
.cert-corner-bottom-left { bottom: 10px; left: 10px; }
.cert-corner-bottom-right { bottom: 10px; right: 10px; }

.cert-heading,
.cert-border > h1,
.cert-border > h2,
.cert-border > h3,
.cert-border > p,
.cert-name-rule,
.cert-ceremony,
.cert-record {
  position: relative;
  z-index: 2;
}

.cert-heading {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.cert-mark {
  align-items: center;
  background: var(--ink);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ink);
  color: #fff;
  display: flex;
  font: 500 1.3rem/1 "IBM Plex Mono";
  height: 42px;
  justify-content: center;
  margin: 0 0 14px;
  padding: 0;
  width: 42px;
}

.cert-brand {
  color: var(--accent);
  font: 600 0.67rem/1.3 "IBM Plex Mono";
  letter-spacing: 0.18em;
}

.cert-type {
  color: var(--accent2);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  margin-top: 8px;
  text-transform: uppercase;
}

.cert-border > h1 {
  color: var(--accent2);
  font-size: 3.4rem;
  font-size: clamp(2.3rem, 5vw, 4rem);
  letter-spacing: -0.035em;
  margin: 30px auto 20px;
  max-width: 850px;
}

.cert-border .presented {
  color: var(--muted);
  margin: 0 0 10px;
}

.cert-border > h2 {
  color: var(--accent);
  display: inline-block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-style: italic;
  font-weight: 400;
  margin: 0;
  padding: 0 36px 8px;
}

.cert-name-rule {
  background: linear-gradient(90deg, transparent, var(--accent) 18%, var(--accent) 82%, transparent);
  height: 1px;
  margin: 0 auto 18px;
  max-width: 650px;
}

.cert-border > h3 {
  color: var(--accent2);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.cert-statement {
  margin: 0 auto;
  max-width: 660px;
}

.cert-ceremony {
  align-items: end;
  display: grid;
  gap: 38px;
  grid-template-columns: 1fr 132px 1fr;
  margin: 34px auto 28px;
  max-width: 800px;
}

.cert-issued,
.cert-signature {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.cert-issued strong,
.cert-signature > strong {
  color: var(--accent2);
  font-size: 0.78rem;
}

.cert-issued strong {
  border-bottom: 1px solid var(--accent);
  padding: 0 14px 7px;
}

.cert-issued span {
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 6px;
}

.cert-seal {
  background: linear-gradient(145deg, #0a8176, #004d47);
  border: 4px double rgb(255 255 255 / 78%);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent), 0 5px 13px rgb(16 24 32 / 20%);
  color: #fff;
  height: 118px;
  padding: 8px;
  width: 118px;
}

.cert-seal-inner {
  align-items: center;
  border: 1px dashed rgb(255 255 255 / 72%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.cert-seal-inner span { font: 500 1.45rem/1 "IBM Plex Mono"; }

.cert-seal-inner strong {
  font: 600 0.58rem/1.4 "IBM Plex Mono";
  letter-spacing: 0.12em;
  margin-top: 6px;
}

.cert-seal-inner small {
  color: rgb(255 255 255 / 78%);
  font: 500 0.45rem/1.4 "IBM Plex Mono";
  letter-spacing: 0.12em;
}

.cert-signature-script {
  color: var(--accent);
  font-family: "Brush Script MT", "Segoe Script", cursive;
  font-size: 1.8rem;
  font-style: italic;
  line-height: 1;
  transform: rotate(-3deg);
}

.cert-signature-line {
  background: var(--accent);
  height: 1px;
  margin: 6px 0;
  max-width: 190px;
  width: 100%;
}

.cert-record {
  border-top: 1px solid rgb(0 107 98 / 26%);
  display: grid;
  gap: 28px;
  grid-template-columns: 0.8fr 1.2fr;
  margin-top: 12px;
  padding-top: 17px;
  text-align: left;
}

.cert-record span {
  color: var(--muted);
  display: block;
  font: 500 0.55rem/1.4 "IBM Plex Mono";
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.cert-record strong {
  color: var(--accent2);
  display: block;
  font: 500 0.65rem/1.45 "IBM Plex Mono";
  overflow-wrap: anywhere;
}

@media print {
  @page { margin: 8mm; size: landscape; }

  body { background: #fff; }

  .certificate {
    box-shadow: none;
    margin: 0;
    max-width: none;
    padding: 0;
    width: 100%;
  }

  .cert-border {
    min-height: 180mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .cert-border > h1 { font-size: 3.4rem; }
  .cert-border > h2 { font-size: 3rem; }
}
