/* Coordinates match the paper insert in the generated 1024 × 1536 image.
   The layout box crops transparent side margins without changing the image. */
.badge {
  --badge-progress: 0;
  position: fixed;
  z-index: 40;
  top: auto;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: clamp(16px, 2.3vw, 36px);
  width: min(clamp(208px, 18vw, 260px), calc(92svh * 616 / 1536));
  aspect-ratio: 616 / 1536;
  color: #151818;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-120vh);
  will-change: transform;
  container-type: inline-size;
}
.badge[data-visible="true"] { visibility: visible; }
.badge[data-ready="true"] .idcard { pointer-events: auto; }
.badge-toggle { display: none; }
.badge-swing { position: relative; width: 100%; height: 100%; transform-origin: 50% 0; }
.badge-art {
  position: absolute; top: 0; left: -33.117%;
  width: 166.234%; height: 100%; max-width: none;
  user-select: none; pointer-events: none;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .24));
}
.idcard {
  position: absolute; left: 5.844%; top: 45.182%; width: 88.474%; height: 51.172%;
  padding: 6cqw 4cqw 4cqw;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.2;
}
.id-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 2cqw; padding-bottom: 2.8cqw; border-bottom: 1px solid #2b3030; }
.id-title { font-size: 11cqw; font-weight: 900; letter-spacing: -.065em; line-height: .9; }
.id-year { font-size: 4cqw; font-weight: 700; }
.id-role { margin-top: 2.8cqw; font-size: 3.55cqw; font-weight: 700; text-transform: uppercase; letter-spacing: -.04em; white-space: nowrap; }
.id-photo {
  position: relative; width: 35cqw; height: 41cqw; margin: 5cqw auto 5cqw;
  overflow: hidden; border-radius: 2cqw; background: #dedfdb;
}
.id-photo img { display: block; width: 100%; height: auto; }
.id-rows { margin: 0; }
.id-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1cqw;
  padding: 1.7cqw 0; border-bottom: 1px solid #a8aeaa;
  font-size: 3.4cqw; font-weight: 600; text-transform: uppercase;
}
.id-row dt, .id-row dd { margin: 0; }
.id-row dd { text-align: right; overflow-wrap: anywhere; }
.id-row a { text-transform: none; }
.id-row a:hover { text-decoration: underline; }
.id-row a:focus-visible { outline-color: #202a25; outline-offset: 2px; }

@media (min-width: 1100px) {
  :root { --badge-room: clamp(0px, 1840px - 100vw, 300px); }
}

/* A compact bottom-right badge on touch screens; expand it to read the card.
   Its control remains outside the artwork and never moves page content. */
@media (max-width: 1099px) {
  .badge {
    right: 12px;
    bottom: max(56px, calc(env(safe-area-inset-bottom) + 44px));
    width: 96px;
    transition: width .55s cubic-bezier(.22, 1, .36, 1);
  }
  .badge.open { width: min(200px, calc((100svh - 150px) * 616 / 1536)); }
  .badge-toggle {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 96px; min-height: 36px; padding: 6px 12px;
    border-radius: 999px; background: #f6f7fb; color: #070a18;
    box-shadow: 0 6px 24px #0005;
    font-size: 12px; font-weight: 600;
  }
  .badge[data-ready="true"] .badge-toggle { pointer-events: auto; }
  .badge:not(.open) .idcard { pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .badge { will-change: auto; transition: none; }
}
