/*
 * "Visual Operator Identification": the ID card that introduces VjTorz at the
 * top of the home page. A laminated badge, tilted on the desk, with the same
 * grimy dither, scanlines and acid colours as the rest of the site.
 */

.id-card {
  --ink: #f1f1ea;
  --rule: rgba(241, 241, 234, 0.28);
  --card: #0b0b0b;
  --acid: #7dff3a;
  --stamp: #e3202a;
  perspective: 1100px;
}

.id-card__inner {
  position: relative;
  height: 100%;
  border-radius: 14px 14px 18px 12px;
  overflow: hidden;
  background: var(--card);
  color: var(--ink);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    -2px 10px 18px rgba(0, 0, 0, 0.75),
    0 2px 0 #9a9d96;
  transform: rotateZ(-2.2deg) rotateY(-5deg) rotateX(2deg);
  transform-origin: 50% 60%;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.id-card:hover .id-card__inner {
  transform: rotateZ(-1deg) rotateY(-1deg) rotateX(0deg);
}

/* Card stock: the skull-head Photoshop piece, faded into the black, under
   scanlines. */
.id-card__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 3px),
    url('../assets/img/image-d4a682a5-46c7-4bdd-9d6c-a2a5a8efa4fa-5d633089.png') 50% 40% / cover;
  opacity: 0.32;
  transition:
    opacity 0.6s ease,
    transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.6s ease;
  pointer-events: none;
}

/* On hover the skulls push forward and the card goes dark red, with a short
   CRT flicker as they surface. */
.id-card:hover .id-card__inner::before {
  opacity: 0.6;
  transform: scale(1.06);
  filter: contrast(1.35) brightness(0.9);
  animation: id-card-flicker 0.45s steps(1) 1;
}

/* Blood-red light and a vignette closing in from the edges. The text sits
   above this layer, so only the card stock darkens. */
.id-card__inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 85% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.88) 100%),
    linear-gradient(rgba(120, 0, 10, 0.55), rgba(40, 0, 4, 0.55));
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.id-card:hover .id-card__inner::after {
  opacity: 1;
}

@keyframes id-card-flicker {
  0% { opacity: 0.15; transform: scale(1.06) translateX(-4px); }
  20% { opacity: 0.7; transform: scale(1.06) translateX(3px); }
  40% { opacity: 0.25; transform: scale(1.06) translateX(0); }
  60% { opacity: 0.75; transform: scale(1.06) translateX(-2px); }
  80% { opacity: 0.45; transform: scale(1.06); }
}

/* --- header bar --------------------------------------------------------------- */

.id-card__bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 38px;
  padding: 0 16px;
  background: linear-gradient(#f4f4ee, #c9cbc4);
  color: #050505;
  font: 600 21px/38px Oswald, sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.id-card__title {
  margin: 0;
  font: inherit;
}

.id-card__title b {
  padding: 0 5px;
  background: var(--acid);
  font-weight: 700;
}

.id-card__warn {
  font-size: 19px;
  font-weight: 500;
  transform: skewX(-6deg);
}

/* --- body --------------------------------------------------------------------- */

.id-card__body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 146px 1fr;
  column-gap: 16px;
  padding: 10px 16px 0 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.id-card__photo {
  position: relative;
  margin: 0;
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 3px #2a2a2a,
    0 0 0 4px #8d908a,
    inset 0 0 18px rgba(0, 0, 0, 0.9);
}

.id-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  filter: grayscale(1) contrast(1.15);
}

/* Halftone dots over the photo, like a cheap badge printer. */
.id-card__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.35) 0.8px, transparent 1.3px) 0 0 / 3px 3px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.id-card__stamp {
  position: absolute;
  left: 8px;
  top: 92px;
  z-index: 1;
  padding: 0 7px;
  border: 3px double var(--stamp);
  border-radius: 4px;
  color: var(--stamp);
  font: 700 25px/30px Oswald, sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transform: rotate(-24deg);
  opacity: 0.9;
}

.id-card__mail {
  grid-column: 1;
  grid-row: 2;
  margin-top: 5px;
  font: 500 13px/16px Oswald, sans-serif;
  letter-spacing: 0.6px;
  text-align: center;
  text-transform: uppercase;
}

.id-card__mail:hover,
.id-card__mail:focus-visible {
  color: var(--stamp);
}

.id-card dl,
.id-card dd {
  margin: 0;
}

.id-card dt,
.id-card dd {
  display: inline;
}

.id-card__info {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

/* Name, origin, location: big condensed caps. */
.id-card__main {
  padding-right: 92px;
  font: 500 21px/25px Oswald, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.id-card__main dt {
  margin-right: 6px;
}

.id-card__main dd {
  font-weight: 400;
}

.id-card__redact {
  display: inline-block;
  width: 98px;
  height: 18px;
  margin-right: 2px;
  vertical-align: -1px;
  background: var(--ink);
  transform: rotate(-0.6deg);
}

/* The ruled "favourites" lines. */
.id-card__rows {
  margin-top: 7px;
  border-top: 1px solid var(--rule);
}

.id-card__rows > div {
  padding: 3px 4px 4px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.2));
  font: 400 11px/14px Roboto, Arial, sans-serif;
}

/* Leave room for the marks in the bottom-right corner. */
.id-card__rows > div:last-child {
  padding-right: 92px;
}

.id-card__rows dt {
  margin-right: 5px;
  font: 600 12px/14px Oswald, sans-serif;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* --- emblem, marks and wordmark ------------------------------------------------ */

.id-card__emblem {
  position: absolute;
  top: 46px;
  right: 8px;
  z-index: 1;
  width: 92px;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.6));
  transform: rotate(-6deg);
}

.id-card__marks {
  position: absolute;
  right: 14px;
  bottom: 8px;
  z-index: 1;
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.id-card__marks li {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font: 700 7.5px/8px Oswald, sans-serif;
  text-align: center;
  letter-spacing: 0.2px;
}

.id-card__marks li:first-child {
  border-radius: 4px;
}

/* The glitch wordmark, stuck on the bottom-left corner like a brand sticker. */
.id-card__logo {
  position: absolute;
  left: 14px;
  bottom: -11px;
  z-index: 1;
  color: var(--acid);
  font: 400 28px/44px Arial, sans-serif;
  letter-spacing: 3px;
  -webkit-text-stroke: 1.5px #0b2300;
  text-shadow: 2px 2px 0 #000, -1px 0 0 #ff2bd6;
  transform: rotate(-4deg) skewX(-12deg);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .id-card__inner,
  .id-card__inner::before,
  .id-card__inner::after {
    transition: none;
    animation: none !important;
  }
}
