.cert-section {
  --cert-mat: #e4ded2;
  background: #f3eee4;
  color: var(--ink);
  padding-block: clamp(2.6rem, 4.5vw, 5rem);
}
.cert-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.05rem, 2.1vw, 2rem); }
.cert-head h2 { font-size: clamp(2.5rem, 3.8vw, 4.6rem); line-height: 1.03; }
.cert-head .section-label { margin-bottom: .35rem; }
.cert-controls { display: flex; gap: .35rem; align-items: center; }
.cert-controls button, .cert-close {
  min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  border: 1px solid #b6a998; border-radius: 3rem; background: transparent; color: #46382b;
}
.cert-controls button:hover, .cert-close:hover { background: #e6dfd2; }
.cert-arrow { display: inline-block; width: 14px; height: 2px; position: relative; background: currentColor; }
.cert-arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.cert-back { transform: rotate(180deg); }
.cert-window { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; overscroll-behavior-inline: contain; }
.cert-window:focus-visible { outline: 2px solid var(--focus-ink); outline-offset: 3px; }
.cert-section.is-ready .cert-window { scrollbar-width: none; }
.cert-section.is-ready .cert-window::-webkit-scrollbar { display: none; }
.cert-track { position: relative; display: flex; gap: clamp(.9rem, 1.55vw, 1.65rem); list-style: none; margin: 0; padding: 0 0 .4rem; }
.cert-card { flex: 0 0 clamp(15rem, 23.8vw, 25.5rem); min-width: 0; }
.cert-card a { display: block; color: inherit; }
.cert-card a:focus-visible { outline-offset: -2px; }
.cert-mat { display: grid; place-items: center; background: var(--cert-mat); aspect-ratio: 1.56; padding: clamp(.55rem, 1.05vw, 1.05rem); }
.cert-mat img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.cert-card figcaption { display: grid; gap: .22rem; margin-top: .65rem; }
.cert-meta, #cert-type { font: 400 .86rem/1.4 var(--sans); color: #645342; }
.cert-card strong { font: 400 clamp(1.55rem, 2vw, 2.1rem)/1.08 var(--serif); letter-spacing: -.018em; }
.cert-card a:is(:hover, :focus-visible) strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.cert-viewer { width: min(68rem, calc(100% - 2rem)); max-width: none; max-height: 92vh; max-height: 92dvh; margin: auto; padding: 0; border: 0; background: var(--paper); color: var(--ink); overflow: auto; }
.cert-viewer::backdrop { background: rgb(27 20 15 / 78%); }
html:has(.cert-viewer[open]) { overflow: hidden; }
.cert-viewer-head { padding: .65rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.cert-viewer-head form { margin: 0; }
.cert-close { padding: .3rem .8rem; font-size: .9rem; }
.cert-close span { font-size: 1.25rem; line-height: 1; }
.cert-viewer-body { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(13rem, 1fr); }
#cert-full { display: grid; place-items: center; min-width: 0; background: var(--cert-mat); padding: clamp(.7rem, 1.55vw, 1.6rem); cursor: zoom-in; }
#cert-large { width: 100%; height: min(60vh, 34rem); object-fit: contain; }
.cert-info { align-self: center; padding: clamp(1.25rem, 3vw, 2.6rem); }
.cert-info h3 { font-size: clamp(2.1rem, 3.2vw, 3.5rem); line-height: 1.03; }
#cert-credit { margin: .65rem 0 1rem; color: #6e543f; font-size: .92rem; }
#cert-note { color: var(--quiet); line-height: 1.6; }
#cert-source { margin-top: 1.4rem; }
@media (max-width: 700px) {
  .cert-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem; }
  .cert-head h2 { font-size: clamp(1.95rem, 8.2vw, 2.8rem); }
  .cert-card { flex-basis: min(76vw, 23rem); }
  .cert-controls { gap: .25rem; }
  .cert-viewer { width: calc(100% - 1rem); }
  .cert-viewer-head { padding: .45rem .8rem; }
  .cert-viewer-body { grid-template-columns: 1fr; }
  #cert-large { height: min(39dvh, 24rem); }
  .cert-info { padding: 1.1rem; }
  #cert-credit { margin: .35rem 0 .6rem; }
  #cert-source { margin-top: .85rem; }
}
