/* ==========================================================================
   Example Credentials — public badge assertion page
   Design tokens live here; change these first when rebranding.
   ========================================================================== */

:root {
  --ink: #2d3b45;
  --ink-soft: #4a5c68;
  --ink-mute: #6b7c85;
  --link: #0374b5;
  --link-hover: #01508e;
  --ok: #0b874b;
  --fail: #b32d2d;
  --bar: #f5f5f5;
  --line: #c7cdd1;
  --line-soft: #e3e6e8;
  --paper: #ffffff;
  --code-bg: #2d3b52;
  --focus: #0374b5;

  --font-ui: "Lato", "Helvetica Neue", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-code: "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --container: 1200px;
  --col-badge: 190px;
  --col-aside: 170px;
  --col-gap: 36px;
  --radius: 3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

img,
svg {
  max-width: 100%;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- top bar */

.topbar {
  background: var(--bar);
  border-bottom: 1px solid var(--line-soft);
}

/* Full-bleed: the brand sits at the left edge of the viewport, not inside
   the centred content column. */
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 52px;
  height: 84px;
  padding: 0 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}

.brand__mark {
  width: 32px;
  height: 36px;
  flex: none;
}

.brand__words {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
}

.brand__line1 {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.brand__line2 {
  font-size: 18px;
  font-weight: 700;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 42px;
}

.topbar__nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
}

.topbar__nav a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------ badge head */

/* Scoped to beat `.container`'s shorthand padding. */
main.container {
  padding-top: 48px;
}

.assertion {
  display: grid;
  grid-template-columns: var(--col-badge) minmax(0, 1fr) var(--col-aside);
  column-gap: var(--col-gap);
  align-items: start;
}

/* All three cells are pinned to row 1 — without an explicit row the sparse
   auto-placement algorithm pushes the body down to row 2. */
.assertion__badge {
  grid-column: 1;
  grid-row: 1;
  padding-top: 6px;
}

.assertion__badge img,
.assertion__badge svg {
  width: 100%;
  height: auto;
  display: block;
}

.assertion__body {
  grid-column: 2;
  grid-row: 1;
}

.assertion__aside {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  padding-top: 10px;
  font-size: 15px;
  color: var(--ink-soft);
}

.assertion__aside .offered-by-label {
  display: block;
  margin-bottom: 8px;
}

.assertion__aside .offered-by-logo {
  width: 96px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
}

.assertion__aside .offered-by-name {
  display: block;
  margin-top: 6px;
  font-size: 17px;
}

.badge-title {
  margin: 0 0 22px;
  font-size: 52px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.badge-description {
  margin: 0 0 32px;
  font-size: 22px;
  line-height: 1.5;
  max-width: 32em;
}

/* ------------------------------------------------------- verified status */

.status {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}

.status__icon {
  width: 30px;
  height: 30px;
  margin-top: 2px;
}

.status__icon circle {
  fill: var(--ok);
  transition: fill 200ms ease;
}

.status--fail .status__icon circle {
  fill: var(--fail);
}

.status--pending .status__icon circle {
  fill: #a4a8ad;
}

.status__label {
  font-size: 21px;
  line-height: 1.3;
}

.status__meta {
  font-size: 19px;
  margin-top: 3px;
}

.status__meta strong {
  font-weight: 700;
}

.btn {
  font: inherit;
  font-size: 19px;
  color: var(--ink);
  background: var(--bar);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 20px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 120ms ease, border-color 120ms ease;
}

.btn:hover {
  background: #eceef0;
  border-color: #aeb5ba;
  color: var(--ink);
}

.btn:active {
  background: #e3e6e8;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.btn--primary {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

.btn--primary:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
  color: #fff;
}

.reverify {
  margin: 0 0 34px 48px;
}

.awarded {
  font-size: 21px;
  margin: 0 0 14px;
}

.awarded strong {
  font-weight: 700;
}

.issued-on {
  font-size: 20px;
  margin: 0;
}

.issued-on strong {
  font-weight: 700;
}

/* ------------------------------------------------------------- criteria */

.criteria {
  display: grid;
  grid-template-columns: var(--col-badge) minmax(0, 1fr) var(--col-aside);
  column-gap: var(--col-gap);
  margin-top: 90px;
}

.criteria__label {
  grid-column: 1;
  text-align: right;
}

/* Right-aligned and nowrap, so a long heading overflows leftward into the
   empty gutter instead of wrapping inside the narrow label column. */
.criteria__label h2 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.criteria__label p {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.criteria__body {
  grid-column: 2;
}

.criteria__body p {
  margin: 4px 0 26px;
  font-size: 21px;
  line-height: 1.5;
}

.link-external {
  font-weight: 700;
  font-size: 21px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.icon-external {
  width: 19px;
  height: 19px;
  flex: none;
}

/* ---------------------------------------------------------------- issue */

.issue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 125px;
  flex-wrap: wrap;
}

.issue-row__left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 21px;
}

.issue-row__left .link-external {
  gap: 7px;
}

.ob-mark {
  width: 26px;
  height: 26px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
  margin-top: 50px;
  padding-bottom: 70px;
}

/* The rule spans the content column, not the viewport. */
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 19px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}

.site-footer__links ul,
.site-footer__links li {
  list-style: none;
}

.site-footer__links ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-footer__links a {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.site-footer__links li + li {
  border-left: 1px solid var(--line);
}

.site-footer__links li:last-child a {
  padding-right: 0;
}

.site-footer a {
  font-weight: 700;
}

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 59, 69, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 20px;
  overflow-y: auto;
  z-index: 50;
  animation: fade-in 140ms ease-out;
}

.modal-backdrop[hidden] {
  display: none;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 720px;
  border-radius: var(--radius);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
  animation: rise-in 190ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.modal--wide {
  max-width: 800px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line-soft);
}

.modal__header h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 700;
}

.modal__close {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--link);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}

.modal__close:hover {
  background: #f0f7fc;
}

.modal__close svg {
  width: 22px;
  height: 22px;
}

.modal__body {
  padding: 32px 30px 38px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 36px;
}

.modal__head h3 {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 700;
  max-width: 9em;
}

.modal__head .modal__badge {
  width: 150px;
  flex: none;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 20px 30px;
  background: var(--bar);
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
}

.modal__footer .btn {
  min-width: 140px;
  padding: 13px 26px;
  font-size: 20px;
  text-align: center;
}

/* ------------------------------------------------- verify modal details */

.check-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  column-gap: 14px;
  align-items: start;
  min-height: 120px;
}

.check-row__icon {
  width: 28px;
  height: 28px;
  margin-top: 3px;
}

.check-row__icon circle {
  fill: var(--ok);
}

.check-row--fail .check-row__icon circle {
  fill: var(--fail);
}

/* While checking, the status disc is replaced by a spinner. */
.check-row--pending .check-row__icon {
  display: none;
}

.spinner {
  width: 26px;
  height: 26px;
  margin-top: 4px;
  border: 3px solid var(--line);
  border-top-color: var(--link);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: none;
}

.check-row--pending .spinner {
  display: block;
}

/* The settled icon pops in once the check resolves. */
.check-row--settled .check-row__icon {
  animation: pop 260ms cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

.detail {
  margin: 0 0 24px;
  animation: row-in 260ms ease-out both;
}

.detail:last-child {
  margin-bottom: 0;
}

.detail dt {
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 3px;
}

.detail dd {
  margin: 0;
  font-size: 20px;
  line-height: 1.45;
}

.detail dd .muted {
  color: var(--ink-soft);
  font-size: 18px;
}

.detail--fail dt {
  color: var(--fail);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal,
  .detail,
  .check-row--settled .check-row__icon {
    animation: none;
  }

  .spinner {
    animation-duration: 2s;
  }
}

/* ----------------------------------------------------------- json modal */

.json-intro {
  margin: 0 0 22px;
  font-size: 21px;
  line-height: 1.45;
  max-width: 34em;
}

.json-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
}

.json-tab {
  font: inherit;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 4px solid var(--link);
  padding: 8px 22px 12px;
  cursor: default;
}

.json-box {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
}

.json-box pre {
  margin: 0;
  padding: 18px 20px;
  max-height: 340px;
  overflow: auto;
  scrollbar-color: rgba(255, 255, 255, 0.42) transparent;
  scrollbar-width: thin;
  color: #f4f6f8;
  font-family: var(--font-code);
  font-size: 15px;
  line-height: 1.55;
  tab-size: 2;
}

.json-box pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: transparent;
}

.json-box pre::-webkit-scrollbar-track,
.json-box pre::-webkit-scrollbar-corner {
  background: transparent;
}

.json-box pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.42);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: 999px;
}

.json-box pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.62);
  background-clip: padding-box;
}

.json-box code {
  white-space: pre;
}

.json-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 20px;
}

.json-links a {
  font-weight: 700;
}

.copy-state {
  font-size: 18px;
  color: var(--ok);
  margin-right: auto;
  align-self: center;
  opacity: 0;
  transition: opacity 160ms ease;
}

.copy-state[data-shown="true"] {
  opacity: 1;
}

/* ---------------------------------------------------------- simple page */

.simple {
  padding: 72px 0 96px;
  max-width: 40em;
}

.simple h1 {
  font-size: 40px;
  margin: 0 0 14px;
  line-height: 1.15;
}

.simple p {
  font-size: 21px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.simple code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background: var(--bar);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 2px 7px;
  color: var(--ink);
  word-break: break-all;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 960px) {
  :root {
    --col-badge: 150px;
    --col-gap: 28px;
  }

  .assertion,
  .criteria {
    grid-template-columns: var(--col-badge) minmax(0, 1fr);
  }

  /* Stacked above the badge, laid out as one row instead of three blocks. */
  .assertion__aside {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: left;
    padding: 0 0 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .assertion__aside .offered-by-label {
    margin-bottom: 0;
  }

  .assertion__aside .offered-by-name {
    margin-top: 0;
  }

  .assertion__badge,
  .assertion__body {
    grid-row: 2;
  }

  .criteria {
    margin-top: 60px;
  }

  .issue-row {
    margin-top: 70px;
  }

  .badge-title {
    font-size: 40px;
  }

  .badge-description {
    font-size: 20px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 18px;
  }

  .topbar__inner {
    gap: 24px;
    height: 70px;
    padding: 0 16px;
  }

  .topbar__nav {
    gap: 22px;
  }

  .topbar__nav a {
    font-size: 17px;
  }

  .assertion,
  .criteria {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 22px;
  }

  /* Every cell must be re-pointed at column 1 — the base rules place them in
     columns 2 and 3, which would otherwise generate implicit columns and
     squeeze the explicit one to zero width. */
  .assertion__badge,
  .assertion__body,
  .assertion__aside,
  .criteria__label,
  .criteria__body {
    grid-column: 1 / -1;
  }

  .assertion__badge {
    width: 150px;
    grid-row: 2;
  }

  .assertion__body {
    grid-row: 3;
  }

  .criteria__label {
    text-align: left;
  }

  .badge-title {
    font-size: 34px;
  }

  .reverify {
    margin-left: 0;
  }

  .modal__header h2 {
    font-size: 28px;
  }

  .modal__body {
    padding: 24px 20px 28px;
  }

  .modal__header,
  .modal__footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .modal__head {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 20px;
  }

  .modal__head h3 {
    font-size: 30px;
  }

  .json-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .site-footer__links a {
    padding-left: 0;
  }

  .site-footer__links li + li a {
    padding-left: 16px;
  }
}
