/* Artificer Legal digital card — aligned to the homepage hero */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --brand-navy: #1c2128;
  --brand-blue-gray: #2a3038;
  --accent: #87cdde;
  --accent-muted: #5e9fb3;
  --white: #fff;
  --text-soft: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.16);
  --content-pad: clamp(1.25rem, 5vw, 2rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
  min-width: 280px;
  background: var(--brand-navy);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--white);
  background: var(--brand-navy);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-background,
.hero-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.hero-background {
  background:
    linear-gradient(160deg, rgba(28, 33, 40, 0.9) 0%, rgba(10, 12, 16, 0.78) 52%, rgba(28, 33, 40, 0.94) 100%),
    url("./cover.webp") center / cover no-repeat;
  transform: scale(1.025);
}

.hero-texture {
  z-index: 0;
  opacity: 0.8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7'%3E%3Crect width='1' height='1' fill='%23ffffff' fill-opacity='0.08'/%3E%3C/svg%3E");
  background-size: 7px 7px;
  mask-image: linear-gradient(to bottom, #000, transparent 38%, transparent 65%, #000);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 38%, transparent 65%, #000);
}

.page-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 38rem;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(28, 33, 40, 0.32);
  border-inline: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 5rem rgba(0, 0, 0, 0.18);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--content-pad);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: block;
  min-width: 0;
}

.brand img {
  width: clamp(9.5rem, 43vw, 13rem);
  height: auto;
}

.utility-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(28, 33, 40, 0.38);
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.icon-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(135, 205, 222, 0.08);
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(2rem, 6vw, 3rem) var(--content-pad);
  animation: card-enter 0.7s var(--ease) both;
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  flex: 0 0 auto;
  background: var(--accent);
}

.identity {
  display: grid;
  grid-template-columns: clamp(7rem, 33vw, 8.5rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 1.5rem);
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1 / 1.1;
  padding: 3px;
  border: 1px solid var(--accent);
  background: rgba(135, 205, 222, 0.08);
}

.portrait-frame::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 1.75rem;
  height: 1.75rem;
  border-right: 1px solid rgba(135, 205, 222, 0.55);
  border-bottom: 1px solid rgba(135, 205, 222, 0.55);
  pointer-events: none;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  filter: saturate(0.86) contrast(1.02);
}

.profile-name {
  margin: 0 0 0.55rem;
  font-family: "Raleway", sans-serif;
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  font-weight: 200;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: nowrap;
}

.profile-name span {
  font-weight: 200;
}

.profile-name strong {
  color: inherit;
  font-weight: inherit;
}

.role {
  margin: 0;
  color: var(--accent);
  font-family: "Raleway", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.address {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 1rem 0 0;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.65;
}

.address .icon {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.2rem;
  color: var(--accent-muted);
}

.primary-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  min-height: 3.35rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.button .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.button-accent {
  color: var(--accent);
}

.button-accent:hover {
  color: var(--brand-navy);
  background: var(--accent);
  box-shadow: 0 4px 20px rgba(135, 205, 222, 0.2);
  transform: translateY(-2px);
}

.button-light {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.55);
}

.button-light:hover {
  color: var(--brand-navy);
  background: var(--white);
  transform: translateY(-2px);
}

.contact-section,
.social-section {
  margin-top: 2rem;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.61rem;
  letter-spacing: 0.18em;
}

.section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.12);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.contact-action {
  display: flex;
  min-width: 0;
  min-height: 5.25rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(28, 33, 40, 0.45);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}

.contact-action .icon {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent);
}

.contact-action:hover {
  color: var(--white);
  border-color: var(--accent);
  background: rgba(135, 205, 222, 0.09);
  transform: translateY(-2px);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.social-link {
  display: flex;
  min-width: 0;
  min-height: 3.4rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(28, 33, 40, 0.45);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.social-link > .icon:first-child {
  color: var(--accent);
}

.social-link .arrow {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.25s var(--ease);
}

.social-link:hover {
  color: var(--white);
  border-color: var(--accent-muted);
  background: rgba(135, 205, 222, 0.07);
}

.social-link:hover .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.card-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--accent-muted);
  border-radius: 0;
  color: var(--white);
  background: var(--brand-navy);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.55);
}

.card-dialog::backdrop {
  background: rgba(8, 11, 15, 0.82);
  backdrop-filter: blur(5px);
}

.dialog-content {
  position: relative;
  padding: 2.5rem clamp(1.25rem, 6vw, 2.5rem) 2.25rem;
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
}

.dialog-view {
  text-align: center;
}

.dialog-view .eyebrow {
  justify-content: center;
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}

.dialog-view h2 {
  margin: 0 0 0.6rem;
  font-family: "Raleway", sans-serif;
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1.2;
}

.dialog-view > p:not(.eyebrow, .copy-status) {
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 0.8rem;
}

#qr {
  width: min(20rem, 82vw);
  margin: 2rem auto 0;
}

.card-dialog[data-view="qr"] {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
}

.card-dialog[data-view="qr"] .dialog-content {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 2rem var(--content-pad);
}

.card-dialog[data-view="qr"] .dialog-view {
  position: relative;
  width: min(17rem, 74vw);
  margin: 0 auto;
}

/* Title is anchored above the code so the code itself stays dead centre */
.card-dialog[data-view="qr"] .dialog-view h2 {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2rem);
  transform: translateX(-50%);
  width: max-content;
  max-width: 88vw;
  margin: 0;
  font-size: clamp(1.2rem, 5.2vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
  text-align: center;
}

#qr {
  width: 100%;
  margin: 0;
  background: transparent;
}

/* ---------------------------------------------------------------
   Card layout — "Quiet Portrait"
   Hero artwork behind a navy panel, small framed portrait,
   two-column contact actions, 1px dot flare from the top-left.
   --------------------------------------------------------------- */

main {
  padding: clamp(2.25rem, 7vw, 3.25rem) var(--content-pad) 2.25rem;
  animation: none;
}

.icon-button {
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
}

.dot-flare {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Crect width='1' height='1' fill='%23ffffff' fill-opacity='0.22'/%3E%3C/svg%3E");
  background-size: 6px 6px;
  background-position: left top;
  background-repeat: repeat;
  -webkit-mask-image: radial-gradient(62% 40% at 0% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 78%);
  mask-image: radial-gradient(62% 40% at 0% 0%, #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 78%);
}

/* Keep content above the dot flare */
.site-header,
main {
  position: relative;
  z-index: 1;
}

.identity {
  grid-template-columns: clamp(5.5rem, 26vw, 6.75rem) minmax(0, 1fr);
  gap: 1.4rem;
}

.portrait-frame {
  aspect-ratio: 1 / 1;
  padding: 0;
  border-color: var(--accent);
  background: transparent;
}

.portrait-frame::after {
  display: none;
}

.portrait {
  width: 100%;
  height: 100%;
  filter: saturate(0.9);
}

.profile-name {
  margin-bottom: 0.5rem;
  font-size: clamp(1.7rem, 7.5vw, 2.2rem);
  white-space: normal;
}

.role {
  margin: 0;
  font-family: "Raleway", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.5rem;
  margin: 2.4rem 0 0;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.9rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}

.action .icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--accent);
}

.action:hover {
  color: var(--accent);
}

.save-contact {
  width: 100%;
  margin-top: 2rem;
}

@media (max-width: 22rem) {
  .action {
    gap: 0.6rem;
    font-size: 0.66rem;
  }
}
