/* Identidad KYP: tinta, papel, lacre solo en acentos, gris de apoyo. */
:root {
  --kyp-ink: #0b0d10;
  --kyp-paper: #fafaf7;
  --kyp-lacre: #e0141e;
  --kyp-gray: #8a8f98;
  /* Gris de texto secundario con contraste AA sobre el papel (el #8A8F98 queda para líneas). */
  --kyp-muted: #50555d;
  --kyp-line: #dcdcd6;
  --kyp-card: #ffffff;
  --ok: #1d6b3a;
  --warn: #8a5a00;
  --radius: 10px;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: var(--kyp-ink);
  background: var(--kyp-paper);
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--kyp-paper);
  color: var(--kyp-ink);
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: var(--kyp-ink);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--kyp-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--kyp-ink);
  color: var(--kyp-paper);
  padding: 8px 12px;
  z-index: 10;
}

.skip:focus {
  top: 8px;
}

.top {
  border-bottom: 1px solid var(--kyp-line);
  background: var(--kyp-card);
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brand__mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--kyp-lacre);
  flex: none;
}

.brand__sep {
  color: var(--kyp-gray);
}

.lang {
  display: flex;
  gap: 4px;
  flex: none;
}

.lang a {
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--kyp-line);
}

.lang a[aria-current='true'] {
  background: var(--kyp-ink);
  color: var(--kyp-paper);
  border-color: var(--kyp-ink);
}

h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.2;
  margin: 24px 0 12px;
}

h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

h3 {
  font-size: 1rem;
  margin: 20px 0 8px;
}

.intro ul {
  padding-left: 1.2em;
  margin: 0 0 16px;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--kyp-lacre);
  background: var(--kyp-card);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.notice strong {
  display: block;
}

.panel {
  background: var(--kyp-card);
  border: 1px solid var(--kyp-line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}

.panel--warn {
  border-color: var(--kyp-lacre);
}

.hint {
  color: var(--kyp-muted);
  margin-top: 0;
}

pre {
  background: var(--kyp-ink);
  color: var(--kyp-paper);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
}

code,
.hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.hash {
  word-break: break-all;
}

.doc__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.doc__peid {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}

.doc__qr {
  width: 120px;
  height: 120px;
}

.doc__qr svg {
  width: 100%;
  height: 100%;
}

dl.facts {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr;
  gap: 8px 16px;
  margin: 16px 0;
}

dl.facts dt {
  color: var(--kyp-muted);
  font-weight: 600;
}

dl.facts dd {
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid currentColor;
}

.badge--signed,
.badge--attested {
  color: var(--ok);
}

.badge--degraded {
  color: var(--warn);
}

.badge--rejected {
  color: var(--kyp-lacre);
}

.small {
  color: var(--kyp-muted);
  font-size: 0.9rem;
}

.findings {
  list-style: none;
  padding: 0;
  margin: 0;
}

.findings li {
  padding: 8px 0;
  border-top: 1px solid var(--kyp-line);
}

.sev {
  font-weight: 700;
  margin-right: 6px;
}

.sev--reject {
  color: var(--kyp-lacre);
}

.sev--fail,
.sev--warn {
  color: var(--warn);
}

.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stages li {
  border: 1px solid var(--kyp-line);
  border-radius: 6px;
  padding: 6px 10px;
}

.stages li.done::before {
  content: '✓ ';
  color: var(--ok);
  font-weight: 700;
}

.views {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.views figure {
  margin: 0;
}

.views img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--kyp-line);
}

.views figcaption {
  font-size: 0.8rem;
  color: var(--kyp-muted);
}

.btn {
  font: inherit;
  font-weight: 700;
  background: var(--kyp-lacre);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  margin-top: 16px;
}

.foot {
  padding-top: 8px;
  padding-bottom: 32px;
  color: var(--kyp-muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.foot p {
  flex-basis: 100%;
  margin: 0;
}

@media (max-width: 560px) {
  .doc__head {
    grid-template-columns: 1fr;
  }

  dl.facts {
    grid-template-columns: 1fr;
  }

  dl.facts dd {
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
