.certificate {
  container-type: inline-size;
  aspect-ratio: 22/17;
  width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  color: #352515;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f7efda;
  box-shadow: 0 4px 14px #140e0b38;
}
.cert-sheet {
  position: absolute;
  inset: 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 25% 20%, #fff9e7, transparent 66%),
    linear-gradient(115deg, #f3e9cb, #f9f1da 52%, #e8dcba);
  overflow: hidden;
}
.cert-sheet:before,
.cert-sheet:after {
  content: "";
  position: absolute;
  width: 63%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-radial-gradient(
    ellipse at 52% 48%,
    transparent 0 3.2%,
    #8c6d3626 3.3% 3.5%,
    transparent 3.6% 4.5%
  );
  transform: rotate(-27deg) scaleY(0.63);
  left: -31%;
  bottom: -28%;
}
.cert-sheet:after {
  left: auto;
  bottom: auto;
  right: -34%;
  top: -29%;
  transform: rotate(22deg) scaleY(0.74);
}
.cert-frame {
  position: absolute;
  inset: 4.3% 3.5%;
  border: 1px solid #826c42;
  outline: 1px solid #ae9160;
  outline-offset: 2px;
}
.cert-frame:after {
  content: "";
  position: absolute;
  inset: 1.5%;
  border: 1px solid #a88b555e;
}
.cert-corners {
  position: absolute;
  inset: 4.3% 3.5%;
  background:
    linear-gradient(135deg, #9f783d 0 0.9%, transparent 1%) top left,
    linear-gradient(315deg, #9f783d 0 0.9%, transparent 1%) bottom right;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.cert-brand {
  position: absolute;
  top: 11%;
  left: 30%;
  right: 30%;
  height: 8%;
  display: grid;
  place-items: center;
}
.cert-brand img {
  max-width: 76%;
  max-height: 100%;
}
.cert-title {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 24%;
  font:
    normal 8.9cqw/0.9 Georgia,
    serif;
  letter-spacing: -0.045em;
}
.cert-title em {
  display: block;
  font-weight: 400;
  font-size: 0.62em;
  letter-spacing: 0;
  margin-top: 0.24em;
}
.cert-recipient {
  position: absolute;
  top: 49%;
  left: 10%;
  right: 10%;
  height: 18%;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.1cqw;
  border-bottom: 1px solid #9b784e71;
}
.cert-recipient small,
.cert-foot > span {
  font:
    750 1.5cqw/1 Manrope,
    Arial,
    sans-serif;
  letter-spacing: 0.17em;
  color: #735833;
}
.cert-recipient strong {
  font:
    700 var(--name-size)/1.1 Barlow,
    "Arial Narrow",
    sans-serif;
  color: #362c20;
  margin-bottom: 0.6cqw;
  white-space: nowrap;
}
.cert-note {
  position: absolute;
  top: 69%;
  width: 100%;
  margin: 0;
  font:
    italic 2.1cqw/1.1 Georgia,
    serif;
  color: #654f35;
}
.cert-foot {
  position: absolute;
  bottom: 9%;
  left: 12%;
  right: 12%;
  height: 13%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
}
.cert-foot > span {
  font-size: 1.38cqw;
  flex: 1;
  border-top: 1px solid #a58a5f88;
  padding-top: 1.1cqw;
}
.cert-seal {
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from 2deg, #c69f5c 0deg 5deg, #e6c787 5deg 8deg);
  display: grid;
  place-items: center;
}
.cert-seal b {
  width: 76%;
  height: 76%;
  border: 1px solid #8f6b36;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ddbf83;
  font:
    700 3.6cqw/1 Barlow,
    sans-serif;
  color: #755226;
}
#certificate-corner {
  position: absolute;
  top: 14vh;
  left: 4vw;
  width: min(32vw, 350px);
  pointer-events: none;
}
#certificate-corner[data-corner="right"] {
  left: auto;
  right: 4vw;
}
#certificate-corner .certificate {
  animation: paper-in 0.35s ease-out both;
}
#certificate-corner .cert-title {
  font-size: 7.3cqw;
  top: 21%;
}
#certificate-corner .cert-title em {
  display: inline;
  margin-left: 0.22em;
  font-size: 0.8em;
}
#certificate-corner .cert-recipient {
  top: 34%;
  height: 29%;
  left: 7%;
  right: 7%;
}
#certificate-corner .cert-recipient strong {
  font-size: min(calc(var(--name-size) * 1.16), 13cqw);
}
#certificate-corner .cert-note {
  top: 66%;
}
#certificate-corner .cert-brand {
  top: 10%;
}
@keyframes paper-in {
  from {
    opacity: 0.3;
    translate: 0 3%;
  }
  to {
    opacity: 1;
    translate: 0;
  }
}
@media (min-aspect-ratio: 1/1) {
  #certificate-corner {
    top: 5vh;
    width: min(20vw, 310px);
    left: 3vw;
  }
  #certificate-corner[data-corner="right"] {
    right: 3vw;
  }
}
@media (prefers-reduced-motion: reduce) {
  #certificate-corner .certificate {
    animation: none;
  }
}
