.certificate-page {
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 253, 241, 0.9), rgba(255, 253, 241, 0.9)),
    repeating-linear-gradient(0deg, #dce9d5 0 24px, #eef5ea 24px 48px);
}

.certificate-main {
  padding-top: 78px;
}

.certificate-section {
  padding: 34px 0 90px;
}

.certificate-breadcrumb {
  margin-bottom: 24px;
}

.certificate-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
  align-items: start;
  gap: 34px;
}

.certificate-paper {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 5px solid #26372b;
  color: #26372b;
  background: #fffdf1;
  box-shadow: 12px 12px 0 rgba(38, 55, 43, 0.2);
}

.certificate-paper.certificate-artwork {
  position: sticky;
  top: 104px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #fff;
  box-shadow: 12px 12px 0 rgba(38, 55, 43, 0.2);
}

.certificate-paper.certificate-artwork::before,
.certificate-paper.certificate-artwork::after {
  display: none;
}

.certificate-artwork img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 877 / 620;
  object-fit: contain;
  background: #fff;
}

.certificate-paper::before,
.certificate-paper::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border: 5px solid #26372b;
  background: #f6c84b;
}

.certificate-paper::before {
  top: -5px;
  left: -5px;
  border-right: 0;
  border-bottom: 0;
}

.certificate-paper::after {
  right: -5px;
  bottom: -5px;
  border-top: 0;
  border-left: 0;
}

.certificate-frame {
  min-height: 540px;
  padding: 44px 48px 38px;
  display: flex;
  flex-direction: column;
  border: 3px solid #8a6a24;
  background:
    linear-gradient(90deg, rgba(246, 200, 75, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(246, 200, 75, 0.09) 1px, transparent 1px),
    #fffdf1;
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 8px #fffdf1, inset 0 0 0 10px #d6b65a;
}

.certificate-heading {
  text-align: center;
}

.certificate-brand {
  margin-bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.certificate-brand-mark {
  width: 38px;
  height: 38px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  border: 3px solid #26372b;
  background: #3c8e34;
  box-shadow: 4px 4px 0 rgba(38, 55, 43, 0.2);
}

.certificate-brand-mark i {
  display: block;
  background: #d9f06a;
}

.certificate-brand-mark i:nth-child(1) {
  height: 45%;
}

.certificate-brand-mark i:nth-child(2) {
  height: 100%;
}

.certificate-brand-mark i:nth-child(3) {
  height: 70%;
}

.certificate-brand strong,
.certificate-brand small {
  display: block;
  text-align: left;
}

.certificate-brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.certificate-brand small {
  margin-top: 3px;
  color: #657169;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.certificate-eyebrow {
  margin: 0 0 8px;
  color: #6a5732;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.certificate-heading h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.08em;
}

.certificate-award {
  margin: auto 0;
  padding: 30px 0 26px;
  text-align: center;
}

.certificate-award > p {
  max-width: 600px;
  margin: 0 auto 13px;
  color: #4f5c53;
  font-size: 13px;
  line-height: 1.75;
}

.certificate-recipient {
  margin: 0 auto 18px;
  display: table;
  padding: 0 22px 8px;
  border-bottom: 4px solid #f6c84b;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0.01em;
}

.certificate-project-name {
  margin: 18px 0 0;
  color: #2e782c;
  font-family: "Courier New", monospace;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.04em;
}

.certificate-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
}

.certificate-signature {
  padding-top: 11px;
  border-top: 2px solid #768178;
}

.certificate-signature:last-child {
  text-align: right;
}

.certificate-signature span,
.certificate-signature strong {
  display: block;
}

.certificate-signature span {
  color: #6c766f;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.certificate-signature strong {
  margin-top: 4px;
  font-size: 11px;
}

.certificate-seal {
  width: 82px;
  height: 82px;
  display: grid;
  place-content: center;
  border: 5px solid #2e782c;
  outline: 3px dashed #2e782c;
  outline-offset: 4px;
  color: #fffdf1;
  background: #3c8e34;
  text-align: center;
  transform: rotate(-4deg);
}

.certificate-seal strong,
.certificate-seal span {
  display: block;
}

.certificate-seal strong {
  font-family: "Courier New", monospace;
  font-size: 20px;
}

.certificate-seal span {
  margin-top: 2px;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.certificate-details {
  padding: 28px;
  border: 4px solid #26372b;
  background: #fffdf1;
  box-shadow: 8px 8px 0 rgba(38, 55, 43, 0.18);
}

.certificate-verified {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  padding: 6px 9px;
  border: 2px solid #216b2c;
  color: #216b2c;
  background: #e1f4d3;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.certificate-verified::before {
  content: "✓";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2e782c;
}

.certificate-details h1 {
  margin-bottom: 7px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.certificate-creator {
  margin-bottom: 4px;
  color: #657169;
  font-size: 13px;
  font-weight: 800;
}

.certificate-builder-note {
  margin-bottom: 18px;
  color: #657169;
  font-size: 12px;
  font-weight: 600;
}

.certificate-description {
  margin-bottom: 24px;
  color: #4f5c53;
  font-size: 14px;
  line-height: 1.7;
}

.certificate-facts {
  margin: 0 0 24px;
  border-top: 3px dashed #c6cbbd;
}

.certificate-facts > div {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 12px;
  border-bottom: 1px solid #d5d8cd;
}

.certificate-facts dt {
  color: #6d776f;
  font-size: 11px;
}

.certificate-facts dd {
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.certificate-facts .certificate-fact-qr {
  align-items: start;
}

.project-qr-link {
  width: min(100%, 156px);
  display: block;
  border: 3px solid #26372b;
  background: #fff;
  box-shadow: 5px 5px 0 rgba(38, 55, 43, 0.16);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.project-qr-link:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 rgba(38, 55, 43, 0.2);
}

.project-qr-link:focus-visible {
  outline: 4px solid #f6c84b;
  outline-offset: 4px;
}

.project-qr {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1;
}

.certificate-actions {
  display: grid;
  gap: 10px;
}

.certificate-actions .button {
  width: 100%;
}

.certificate-feedback {
  min-height: 18px;
  margin: 12px 0 0;
  color: #216b2c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.certificate-back {
  margin-top: 18px;
  display: inline-flex;
  color: #4d5c51;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .certificate-layout {
    grid-template-columns: 1fr;
  }

  .certificate-paper.certificate-artwork {
    position: static;
  }
}

@media (max-width: 640px) {
  .certificate-main {
    padding-top: 64px;
  }

  .certificate-section {
    padding-top: 24px;
  }

  .certificate-paper {
    padding: 9px;
    box-shadow: 7px 7px 0 rgba(38, 55, 43, 0.2);
  }

  .certificate-frame {
    min-height: 0;
    padding: 32px 20px 26px;
    box-shadow: inset 0 0 0 5px #fffdf1, inset 0 0 0 7px #d6b65a;
  }

  .certificate-award {
    padding: 28px 0 34px;
  }

  .certificate-bottom {
    grid-template-columns: 1fr 70px 1fr;
    gap: 10px;
  }

  .certificate-seal {
    width: 62px;
    height: 62px;
  }

  .certificate-seal strong {
    font-size: 15px;
  }

  .certificate-details {
    padding: 23px;
  }
}

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

  .site-header,
  .site-footer,
  .certificate-breadcrumb,
  .certificate-details {
    display: none !important;
  }

  .certificate-main,
  .certificate-section {
    padding: 0;
  }

  .certificate-layout {
    display: block;
  }

  .certificate-paper {
    width: 100%;
    box-shadow: none;
    break-inside: avoid;
  }

  .certificate-paper.certificate-artwork {
    position: static;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .certificate-paper,
  .certificate-seal,
  .project-qr-link {
    scroll-behavior: auto;
    transition: none;
  }
}
