.darwin-nft-cover {
  container-type: inline-size;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4%;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 7%;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
}

.nft-cover-brand {
  display: flex;
  align-items: center;
  gap: 2cqw;
  font: 600 6cqw/1 var(--font-serif);
}

.nft-cover-brand svg {
  display: block;
  width: 6cqw;
  height: 6cqw;
}

.nft-cover-board {
  --quiet-trace: var(--rule);
  --prior-trace: var(--ghost);
  --grid-line: color-mix(in srgb, var(--ink) 11%, var(--paper));
  position: relative;
  border: 1px solid var(--rule);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    var(--wash);
  background-size: 8% 10%;
}

.nft-cover-wire,
.nft-cover-contact {
  position: absolute;
  inset-inline-start: var(--x);
  inset-block-start: var(--y);
  color: var(--ink);
}

.nft-cover-wire { --trace-width: max(1px, .8cqw); --trace-style: solid; }
.nft-cover-wire.quiet { --trace-width: max(1px, .32cqw); color: var(--quiet-trace); }
.nft-cover-wire.prior { --trace-width: max(1px, .5cqw); --trace-style: dashed; color: var(--prior-trace); }

.nft-cover-wire.horizontal {
  width: var(--length);
  border-top: var(--trace-width) var(--trace-style) currentColor;
  translate: 0 -50%;
}

.nft-cover-wire.vertical {
  height: var(--length);
  border-left: var(--trace-width) var(--trace-style) currentColor;
  translate: -50% 0;
}

.nft-cover-contact {
  width: 4cqw;
  aspect-ratio: 1;
  border: max(1px, .38cqw) solid currentColor;
  background: var(--paper);
  translate: -50% -50%;
}

.nft-cover-contact.quiet { width: 2.5cqw; color: var(--quiet-trace); }
.nft-cover-contact.prior { color: var(--prior-trace); }
.nft-cover-contact.fork { width: 3cqw; }
.nft-cover-contact.active { background: var(--ink); }

.nft-cover-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4%;
  white-space: nowrap;
}

.nft-cover-label span:first-child {
  font: 600 12cqw/1 var(--font-serif);
  letter-spacing: .035em;
}

.nft-cover-label span:last-child { font: 400 5cqw/1 var(--font-mono); }

.nft-cover-signal { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .nft-cover-animated { --nft-cover-cycle: 6s; }

  .nft-cover-signal {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    pointer-events: none;
  }

  .nft-cover-pulse {
    stroke: color-mix(in srgb, var(--ink) 62%, var(--paper));
    stroke-width: 1;
    stroke-linejoin: round;
    stroke-dasharray: 15 100;
    stroke-dashoffset: 15;
    opacity: 0;
    animation: nft-cover-feed var(--nft-cover-cycle) linear;
    animation-play-state: var(--nft-cover-playing, paused);
  }

  .nft-cover-pulse.branch { animation-name: nft-cover-branch; }
  .nft-cover-pulse.prior { stroke: var(--ink); }

  .nft-cover-animated :is(.origin, .fork, .prior, .active).nft-cover-contact::after {
    position: absolute;
    inset: -1px;
    border: 1px solid var(--ink);
    content: "";
    opacity: 0;
    animation: nft-cover-contact-pulse var(--nft-cover-cycle) ease-out var(--signal-delay, 0s);
    animation-play-state: var(--nft-cover-playing, paused);
  }

  .nft-cover-animated .nft-cover-contact.fork { --signal-delay: 1.2s; }
  .nft-cover-animated[data-nft-cover-visible] { --nft-cover-playing: running; }
  .nft-cover-animated :is(.prior, .active).nft-cover-contact { --signal-delay: 2.85s; }

  @keyframes nft-cover-feed {
    0%, 3% { opacity: 0; stroke-dashoffset: 15; }
    5%, 23% { opacity: 1; }
    25%, 100% { opacity: 0; stroke-dashoffset: -100; }
  }

  @keyframes nft-cover-branch {
    0%, 22% { opacity: 0; stroke-dashoffset: 15; }
    24%, 52% { opacity: 1; }
    54%, 100% { opacity: 0; stroke-dashoffset: -100; }
  }

  @keyframes nft-cover-contact-pulse {
    0% { opacity: 0; scale: 1; }
    3% { opacity: .65; }
    13%, 100% { opacity: 0; scale: 1.7; }
  }
}
