.card-page {
  --card-night: #09192b;
  --card-ink: #172536;
  --card-paper: #f8f6f1;
  --card-muted: #4a5a66;
  --card-line: #d5d9d9;
  --card-amber: #ffb55d;
  --card-green: #087744;
  --card-ease: cubic-bezier(.23, 1, .32, 1);
  padding: clamp(18px, 6vw, 80px) clamp(12px, 4vw, 48px);
  background: radial-gradient(ellipse at 23% 24%, #1c3850, var(--card-night) 62%);
  color: var(--card-ink);
}

.card-page :is(a, button):focus-visible {
  outline: 3px solid #9b4309;
  outline-offset: 3px;
}

.digital-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(100%, 1050px);
  border: 1px solid #ffffff26;
  border-radius: 19px;
  background: var(--card-paper);
  box-shadow: 0 28px 80px #020a15a0;
}

.card-identity {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 5.2vw, 76px);
  overflow: hidden;
  background: linear-gradient(137deg, #ffd392 0%, var(--card-amber) 58%, #e98a38 100%);
  color: var(--card-ink);
}

/* Offset traces echo the routes on a circuit board. */
.card-identity::before,
.card-identity::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.card-identity::before {
  inset: 0;
  background:
    radial-gradient(circle, transparent 3px, #1725364a 3px 4px, transparent 4.5px) right 44px top 48px / 9px 9px no-repeat,
    linear-gradient(#17253635, #17253635) right 48px top 57px / 1px 72px no-repeat,
    linear-gradient(#17253635, #17253635) right top 128px / 49px 1px no-repeat,
    radial-gradient(circle, transparent 3px, #1725364a 3px 4px, transparent 4.5px) right 72px top 82px / 9px 9px no-repeat,
    linear-gradient(#17253635, #17253635) right 76px top 91px / 1px 60px no-repeat,
    linear-gradient(#17253635, #17253635) right top 150px / 77px 1px no-repeat;
}

.card-identity::after {
  right: -2%;
  bottom: -55%;
  width: 78%;
  aspect-ratio: 1;
  border: 1px solid #17253635;
  border-radius: 22px;
  box-shadow: 0 0 0 21px #ffb55d, 0 0 0 22px #17253635, 0 0 0 43px #ffb55d, 0 0 0 44px #17253635;
  transform: rotate(45deg);
  opacity: .55;
}

.card-identity .card-logo {
  width: clamp(60px, 8vw, 85px);
  height: auto;
  margin: 0 0 clamp(24px, 4vw, 52px);
  border-width: 2px;
  box-shadow: 0 7px 18px #41220822;
}

.card-identity h1 {
  margin: 0;
  font-size: clamp(3rem, 6.2vw, 6.2rem);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -.082em;
  overflow-wrap: anywhere;
}

.card-profession {
  max-width: 19ch;
  margin: 18px 0 24px;
  font-size: clamp(1.1rem, 2.1vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.033em;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #243244;
  font-size: .9375rem;
  line-height: 1.3;
  font-weight: 630;
}

.card-location svg { flex: none; width: 19px; height: 19px; }

.card-actions {
  align-content: center;
  gap: 14px;
  padding: clamp(24px, 4.3vw, 60px);
}

.card-contact-title {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 2.55vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -.05em;
}

.card-contact-actions,
.card-utility-actions,
.card-share-actions {
  display: grid;
  gap: 8px;
}

.card-share-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 112px), 1fr));
}

.card-actions :is(.card-action, .card-share, .card-install-link) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 47px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--card-line);
  border-radius: 7px;
  background: #fffefa;
  color: var(--card-ink);
  font: 650 .9375rem/1.25 system-ui, sans-serif;
  text-align: left;
  text-decoration: none;
  touch-action: manipulation;
}

.card-actions svg { flex: none; width: 20px; height: 20px; }

.card-actions .card-primary {
  min-height: 57px;
  padding-inline: 15px;
  border-color: transparent;
  background: var(--card-green);
  color: #fff;
  font-size: 1rem;
  font-weight: 740;
}

.card-actions .card-primary svg { width: 23px; height: 23px; }
.card-actions :is(.card-primary, .card-call):hover { border-color: #7a827e; }
.card-actions .card-primary:hover { background: #06613a; }
.card-actions .card-call:hover { background: #f2efe7; }

.card-utility-actions {
  gap: 0;
  padding-block: 2px;
}

.card-actions .card-utility-actions .card-action {
  min-height: 44px;
  padding-inline: 4px;
  border: 0;
  background: transparent;
}

.card-utility-actions .card-action:hover span { text-decoration: underline; text-underline-offset: 4px; }
.card-utility-actions .card-action svg { color: #8a420e; }

.card-share-group {
  padding-top: 14px;
  border-top: 1px solid var(--card-line);
}

.card-share-group h2 {
  margin: 0 0 10px;
  color: var(--card-muted);
  font-size: .875rem;
  font-weight: 700;
}

.card-actions .card-share-group :is(.card-action, .card-share) {
  background: #edece6;
  border-color: transparent;
}

.card-actions .card-share-group :is(.card-action, .card-share):hover {
  background: #e6e5db;
  border-color: #a5aca8;
}

.card-actions .card-install-link {
  width: 100%;
  padding-inline: 4px;
  border: 0;
  background: transparent;
  color: var(--card-muted);
}

.card-install-link:hover span { text-decoration: underline; text-underline-offset: 4px; }

#card-status {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid #9b4309;
  background: #fff1d9;
  font-size: .9rem;
  line-height: 1.45;
}

#card-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
}

.card-qr-dialog {
  width: min(92vw, 428px);
  max-height: calc(100% - 24px);
  padding: 0;
  border: 1px solid #fff;
  border-radius: 15px;
  background: var(--card-paper);
  color: var(--card-ink);
  box-shadow: 0 20px 70px #020a1590;
}

.card-qr-dialog::backdrop { background: #071525c7; }

.card-qr-content {
  position: relative;
  padding: 23px clamp(16px, 5vw, 30px) 23px;
  text-align: center;
}

.card-qr-dialog h2 { margin: 6px 36px 14px; font-size: 1.35rem; line-height: 1.15; }

.card-qr-dialog img {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--card-line);
  border-radius: 8px;
  background: #fff;
  image-rendering: pixelated;
}

.card-qr-dialog p { margin: 13px auto 0; color: var(--card-muted); font-size: .9375rem; max-width: 31ch; }

.card-qr-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--card-ink);
  font-size: 1.5rem;
  cursor: pointer;
  touch-action: manipulation;
}

.card-qr-close:hover { background: #e8e5dc; }

@media (max-width: 720px) {
  .card-page { padding-block: clamp(14px, 4vw, 28px); }
  .digital-card { grid-template-columns: minmax(0, 1fr); max-width: 470px; }
  .card-identity { padding: 23px clamp(18px, 6vw, 36px); }
  .card-identity .card-logo { width: 54px; margin-bottom: 13px; }
  .card-identity h1 { font-size: clamp(2.75rem, 12vw, 4.5rem); }
  .card-profession { max-width: unset; margin: 10px 0 13px; font-size: 1.05rem; }
  .card-identity::after { width: 65%; bottom: -86%; }
  .card-actions { padding: 20px clamp(16px, 5.2vw, 29px) 15px; gap: 10px; }
  .card-contact-title { margin-bottom: 2px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card-identity::before { animation: card-traces-in 460ms var(--card-ease) both; }

  .card-actions :is(.card-action, .card-share, .card-install-link) {
    transition: scale 140ms var(--card-ease), background-color 140ms ease, border-color 140ms ease;
  }

  .card-actions :is(.card-action, .card-share, .card-install-link):active { scale: .98; }

  .card-qr-dialog[open] { animation: card-dialog-in 210ms var(--card-ease) both; }

  @keyframes card-traces-in {
    from { opacity: .25; }
    to { opacity: 1; }
  }

  @keyframes card-dialog-in {
    from { opacity: .65; transform: translateY(6px) scale(.985); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-actions :is(.card-action, .card-share, .card-install-link):active { opacity: .8; }
}
