/* Certifications (7 Oct 2026). The real certificates, as objects.
   Homepage: the eight certificates lie stacked and fan out into an arc as
   the section comes in; the one under the pointer (or focus) rises out of
   the fan and the caption names it; a click opens it full size.
   About page: the register, grouped by issuer; a row shows its certificate
   beside the pointer and opens it on click. One dialog serves both.
   Layout only; type, colour and buttons come from the editorial system. */

.certs { overflow: clip; }
.certs__grid { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; margin-top: clamp(2rem, 4vw, 3rem); }

/* The anchor: one oversized numeral, the issuers under it. */
.certs__count { display: grid; gap: .25rem; }
.certs__num { font-size: clamp(5rem, 11vw, 8.5rem); line-height: .9; letter-spacing: -.06em; font-weight: 500; color: var(--ed-ink, #121417); font-variant-numeric: tabular-nums; }
.certs__num-label { font-size: 1.0625rem; color: var(--ed-muted, #51565e); }
.certs__issuers { display: grid; gap: .75rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.certs__issuers li { display: flex; align-items: center; gap: .75rem; font-size: .9375rem; color: var(--ed-ink, #121417); }
.certs__issuers img { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 50%; }
.certs__issuers b { font-weight: 500; }
.certs__issuers span { color: var(--ed-muted, #51565e); }
.certs__more { margin-top: 1.75rem; }

/* The fan. Cards sit on one pivot below the stage; --i runs 0 to 7. */
/* The fan is sized from its own column (container units), so it always
   spans the column edge to edge, whatever the viewport. */
.certs__stage { display: grid; gap: 1.25rem; min-width: 0; container-type: inline-size; }
.certs__fan:not(.certs__fan--row) { --cw: 30cqw; --step: calc((84cqw - var(--cw)) / 7); }
.certs__fan { position: relative; height: calc(31cqw * .72 + 7.5rem); margin: 0; padding: 0; list-style: none; }
.certs__card { --k: calc(var(--i) - 3.5); position: absolute; left: 50%; bottom: 4.5rem; width: var(--cw); margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 160%; transform: translate3d(calc(var(--k) * 4px), calc(var(--k) * -2px), 0) rotate(calc(var(--k) * .6deg));
  transition: transform 900ms cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 45ms), filter 300ms ease; z-index: var(--i); }
.certs__fan.is-open .certs__card { transform: translate3d(calc(var(--k) * var(--step)), calc(var(--k) * var(--k) * .28rem), 0) rotate(calc(var(--k) * 4deg)); }
.certs__card button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; }
.certs__card img { display: block; width: 100%; height: auto; border-radius: 4px; background: #eef0f3;
  box-shadow: 0 1px 2px rgb(18 20 23 / .08), 0 18px 40px -18px rgb(18 20 23 / .45); }
.certs__fan.is-open .certs__card.is-up { z-index: 20; transition-delay: 0ms; transform: translate3d(calc(var(--k) * var(--step)), -2.25rem, 0) rotate(0deg) scale(1.12); }
.certs__fan.is-open.has-up .certs__card:not(.is-up) { filter: saturate(.6) brightness(.97); }
.certs__card button:focus-visible { outline: 2px solid var(--brand, #0052f8); outline-offset: 4px; }

/* The caption under the fan names the raised certificate. */
.certs__caption { display: flex; justify-content: center; align-items: center; gap: .75rem; min-height: 2.25rem; text-align: left; font-size: .9375rem; color: var(--ed-muted, #51565e); }
.certs__caption img { width: 2.25rem; height: 2.25rem; border-radius: 50%; flex: none; }
.certs__caption b { display: block; font-weight: 500; color: var(--ed-ink, #121417); }

/* Phones: no fan, a row the thumb can swipe. */
@media (max-width: 760px) {
  .certs__grid { grid-template-columns: 1fr; }
  .certs__fan { height: auto; display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 1rem; margin-inline: calc(var(--ed-gutter, 1.5rem) * -1); padding-inline: var(--ed-gutter, 1.5rem); scrollbar-width: none; perspective: none; }
  .certs__card, .certs__fan.is-open .certs__card, .certs__fan.is-open .certs__card.is-up { position: static; flex: 0 0 78%; margin: 0; transform: none; transition: none; scroll-snap-align: center; filter: none; }
  .certs__caption { display: none; }
}

/* ---------- About page: one row (round 3, 7 Oct) ----------
   The About bento language (ed-frame, ed-card, ed-number) in a single row:
   the count, the eight certificates overlapping in one strip, the blue
   validity tile. The strip reuses the fan's raise and caption. */
.certs-band__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr) minmax(0, 1fr); gap: .75rem; margin-top: clamp(2rem, 4vw, 3rem); }
.certs-band__count, .certs-band__accent { display: flex; flex-direction: column; }
.certs-band__count .ed-number { font-size: clamp(4.5rem, 7vw, 6.5rem); letter-spacing: -.06em; }
.certs-band__accent { background: var(--brand, #0052f8); color: #fff; }
.certs-band__accent .ed-card-label, .certs-band__accent p { color: rgb(255 255 255 / .78); }
.certs-band__accent .ed-number { font-size: clamp(2.75rem, 4.4vw, 4rem); }
.certs-band__accent p { margin-top: auto; padding-top: 1rem; font-size: .9375rem; line-height: 1.45; }
/* The three seals as stickers (shared .stickers, footer-closing.css). */
.certs-band__seals { --s: 3rem; margin-top: auto; padding-top: 1rem; }
.certs-band__sheets { display: grid; gap: 1rem; align-content: center; overflow: hidden; }

/* The strip: sheets overlap; as the row comes in they slide apart. */
.certs__fan--row { --w: clamp(5.5rem, 8vw, 7.5rem); height: auto; display: flex; justify-content: center; align-items: center; padding: 1.75rem 0 .5rem; }
.certs__fan--row .certs__card, .certs__fan--row.is-open .certs__card { position: relative; left: auto; bottom: auto; flex: none; width: var(--w); margin: 0; transform-origin: 50% 50%; }
.certs__fan--row .certs__card + .certs__card { margin-left: calc(var(--w) * -.5); }
.certs__fan--row .certs__card { transform: translateX(calc(var(--k) * -1.75rem)) rotate(calc(var(--k) * 1.5deg)); }
.certs__fan--row.is-open .certs__card { transform: rotate(calc(var(--k) * 1.5deg)); }
.certs__fan--row.is-open .certs__card.is-up { transform: translateY(-1.25rem) rotate(0deg) scale(1.22); }
.certs-band__sheets .certs__caption { justify-content: center; min-width: 0; font-size: .875rem; }
.certs-band__sheets .certs__caption > span { min-width: 0; }

@media (max-width: 1023px) {
  .certs-band__grid { grid-template-columns: 1fr 1fr; }
  .certs-band__sheets { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 760px) {
  .certs-band__grid { grid-template-columns: 1fr 1fr; }
  .certs-band__count, .certs-band__accent { padding: 1.25rem; }
  .certs-band__count .ed-number { font-size: 4rem; }
  .certs-band__accent .ed-number { font-size: 2.5rem; }
  .certs-band__accent p { font-size: .875rem; }
  .certs__fan--row { justify-content: flex-start; padding: 0 0 .5rem; margin-inline: -1.5rem; padding-inline: 1.5rem; }
  .certs__fan--row .certs__card, .certs__fan--row.is-open .certs__card, .certs__fan--row.is-open .certs__card.is-up { flex: 0 0 70%; width: auto; transform: none; }
  .certs__fan--row .certs__card + .certs__card { margin-left: 0; }
}

/* ---------- The full-size view ---------- */
.certs-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(92vw, 64rem); max-height: 92vh; padding: 0; border: 0; border-radius: 6px; background: #fff; color: var(--ed-ink, #121417); box-shadow: 0 40px 80px -30px rgb(0 0 0 / .6); }
.certs-dialog::backdrop { background: rgb(18 20 23 / .72); backdrop-filter: blur(6px); }
.certs-dialog img { display: block; width: 100%; height: auto; max-height: calc(92vh - 5rem); object-fit: contain; background: #eef0f3; }
.certs-dialog__bar { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.certs-dialog__bar img { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: none; flex: none; }
.certs-dialog__text { flex: 1; min-width: 0; font-size: .9375rem; color: var(--ed-muted, #51565e); }
.certs-dialog__text b { display: block; font-weight: 500; color: var(--ed-ink, #121417); }
.certs-dialog[open] { animation: certs-in 320ms cubic-bezier(.2, .8, .2, 1); }
@keyframes certs-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Version B: square corners, like the rest of B. */
html[data-style="industrial"] :is(.certs__card button, .certs__card img, .certs-dialog) { border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .certs__card, .certs__fan.is-open .certs__card { transition: none; }
  .certs__fan.is-open .certs__card.is-up { transform: translate3d(calc(var(--k) * var(--step)), calc(var(--k) * var(--k) * .28rem), 0) rotate(calc(var(--k) * 4deg)); }
  .certs__fan--row.is-open .certs__card.is-up { transform: rotate(0deg); }
  .certs-dialog[open] { animation: none; }
}
