:root {
  color-scheme: light;
  --paper: #f6f3eb;
  --ink: #1c2724;
  --green: #203d33;
  --muted: #69716b;
  --line: #d9d8cc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100svh; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; }
button, a, code { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--green); }
[hidden] { display: none !important; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: 0 0 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.namecard {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.profile { --profile-padding: 12px; display: flex; justify-content: flex-start; align-items: flex-start; gap: 16px; padding-bottom: var(--profile-padding); border-bottom: 1px solid var(--line); }
.profile-copy { min-width: 0; }
.profile-copy .eyebrow { margin-bottom: 5px; }
.profile-photo { flex: 0 0 154px; width: 154px; height: calc(154px + var(--profile-padding)); object-fit: contain; object-position: 50% 100%; align-self: flex-end; margin-bottom: calc(-1 * var(--profile-padding)); }
.eyebrow { margin: 0; font-size: 10px; letter-spacing: 0.21em; line-height: 1.5; text-transform: uppercase; font-weight: 500; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 13vw, 54px); font-weight: 400; letter-spacing: -0.065em; line-height: 1.04; margin: 0 0 6px -2px; }
h1 > span { color: var(--green); }
.role { font-size: 12px; line-height: 1.5; margin: 0 0 2px; font-weight: 500; }
.company { font-size: 12px; line-height: 1.5; margin: 0; color: var(--muted); letter-spacing: 0.01em; }
.company a { color: inherit; text-decoration: none; white-space: nowrap; }
.company-brand-mark { width: 14px; height: 14px; margin-right: 4px; vertical-align: -3px; }
.company-link-icon { width: 11px; height: 11px; margin-left: 3px; vertical-align: -1px; }
.company span[aria-hidden] { padding: 0 5px; }
.company .location { display: block; margin-top: 2px; }
.role-inline { font-weight: 500; color: var(--ink); }
.tagline { max-width: 22ch; margin: 0 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.35; letter-spacing: -0.015em; color: var(--green); }
.primary-contact { display: flex; justify-content: center; align-items: center; gap: 12px; background: var(--green); color: #fffdf6; padding: 13px 16px; margin: 14px 0 10px; min-height: 54px; border-radius: 9px; font-size: 16px; font-weight: 500; text-decoration: none; transition: background 160ms ease; --linkedin-glyph: var(--green); }
.primary-contact .icon { width: 23px; height: 23px; flex-basis: 23px; }
.primary-contact .primary-arrow { width: 18px; height: 18px; flex-basis: 18px; }
.primary-contact:focus-visible { outline-offset: 4px; }
.messaging, .contacts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.messaging .contact-row { min-height: 58px; border-color: #aab5ac; }
.messaging .contact-label { font-weight: 500; }
.other-contacts { margin-top: 20px; }
.section-label { font-family: inherit; font-size: 10px; line-height: 1.4; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; color: var(--muted); margin: 0 0 9px; }
.other-contacts .contact-row { border-color: #e1dfd5; height: 100%; align-self: center; }
.other-contacts .contact-label { font-size: 13px; }
.other-contacts .contact-row > .icon:first-child { width: 18px; height: 18px; flex-basis: 18px; color: var(--muted); }
.email-contact { flex-direction: column; gap: 4px; }
.email-contact .contact-detail { font-size: 10px; }
.email-contact .contact-label { display: flex; align-items: center; justify-content: center; gap: 5px; }
.email-label-icon { width: 1em; height: 1em; flex: 0 0 1em; color: var(--muted); }
.contact-row { display: flex; justify-content: center; align-items: center; width: 100%; gap: 10px; padding: 7px 10px; min-height: 48px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; text-align: center; cursor: pointer; transition: background 160ms ease, border-color 160ms ease; }
.contact-row > .icon:first-child { color: var(--green); width: 20px; height: 20px; flex-basis: 20px; }
.contact-text { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.contact-label { font-size: 14px; line-height: 1.25; }
.contact-detail { font-size: 11px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.row-arrow { display: none; }
.wechat-contact .contact-row { height: 100%; }
.wechat-fallback { cursor: auto; }
.footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 9px; line-height: 1.6; letter-spacing: 0.08em; }
.footer a { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--green); }

dialog { width: min(400px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 100px #17271f40; }
dialog::backdrop { background: #15282065; backdrop-filter: blur(4px); }
.dialog-panel { position: relative; padding: 48px 24px 18px; }
.close-dialog { position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 44px; height: 44px; background: none; border: 0; border-radius: 50%; cursor: pointer; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 400; letter-spacing: -0.04em; line-height: 1.2; margin: 0 0 10px; }
#wechat-instructions { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
/* Display the QR region with its white quiet zone; save the untouched original image. */
.wechat-qr-frame { position: relative; overflow: hidden; width: min(100%, 280px, max(170px, calc(100dvh - 310px))); aspect-ratio: 1; margin: 0 auto 14px; background: #fff; border-radius: 8px; }
.wechat-qr { position: absolute; width: 130.588235%; max-width: none; height: auto; left: -15.294118%; top: -40%; }
.save-qr { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 9px; background: var(--green); color: #fffdf6; font-size: 14px; text-decoration: none; }
.save-qr .icon, .copy-id .icon { width: 18px; height: 18px; flex-basis: 18px; }
.wechat-id { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 10px; }
.wechat-id-text { display: flex; flex-direction: column; gap: 3px; }
.wechat-id-text > span { color: var(--muted); font-size: 11px; }
.wechat-id code { font: inherit; font-size: 15px; user-select: all; }
.copy-id { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--green); font-size: 13px; cursor: pointer; }
.copy-status { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.copy-status:not(:empty) { margin-top: 8px; }
body:has(dialog[open]) { overflow: hidden; }

@media (hover: hover) {
  .primary-contact:hover, .save-qr:hover { background: #2e5043; }
  a.contact-row:hover, button.contact-row:hover { background: #eeeee4; border-color: #abb5a8; }
  .copy-id:hover { background: #eeeee4; }
  .close-dialog:hover { background: #e9eadd; }
}
@media (min-width: 600px) {
  body { padding: 32px 16px; background: radial-gradient(ellipse at 50% 18%, #ebece0 0, var(--paper) 65%); }
  .namecard { padding: 26px; border: 1px solid #dfdfd1; border-radius: 20px; background: var(--paper); box-shadow: 0 10px 65px #24332b08; }
}
@media (max-width: 340px) {
  .namecard { padding-left: 16px; padding-right: 16px; }
  .profile { gap: 12px; }
  .profile-photo { flex-basis: 88px; width: 88px; height: 88px; }
  .contact-row { gap: 8px; padding-left: 8px; padding-right: 8px; }
  .eyebrow { letter-spacing: 0.14em; }
}
@media (max-height: 570px) and (max-width: 599px) {
  .namecard { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .profile { --profile-padding: 9px; }
  .profile-copy .eyebrow { display: none; }
  .profile-photo { flex-basis: 88px; width: 88px; height: 88px; }
  h1 { font-size: 44px; margin-bottom: 4px; }
  .contact-row { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
  .footer { margin-top: 4px; }
  .dialog-panel { padding: 44px 18px 14px; }
  #wechat-title { font-size: 25px; margin-bottom: 6px; }
  #wechat-instructions { font-size: 12px; margin-bottom: 10px; }
  .wechat-qr-frame { margin-bottom: 10px; }
  .wechat-id { padding-top: 8px; margin-top: 10px; }

}
@media (max-width: 599px) {
  .namecard {
    --row-gap: clamp(6px, calc(3dvh - 8.4px), 16px);
    --section-gap: clamp(10px, calc(3.5dvh - 6.8px), 22px);
    --portrait-size: clamp(112px, min(44vw, calc(28dvh - 13px)), 206px);
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    min-height: 100dvh;
    padding-top: max(clamp(10px, calc(3dvh - 4.4px), 24px), env(safe-area-inset-top));
    padding-bottom: max(clamp(10px, calc(3dvh - 4.4px), 24px), env(safe-area-inset-bottom));
  }
  .profile { --profile-padding: clamp(9px, calc(3dvh - 5.4px), 19px); flex: 0 0 auto; gap: 0; }
  .profile-photo {
    margin-inline: auto;
    flex-basis: var(--portrait-size);
    width: var(--portrait-size);
    height: calc(var(--portrait-size) + var(--profile-padding));
  }
  .profile-copy .eyebrow { font-size: clamp(10px, calc(0.5dvh + 7.6px), 12px); }
  h1 { font-size: clamp(44px, min(13vw, calc(3dvh + 29.6px)), 56px); margin-bottom: clamp(4px, 1dvh, 8px); }
  .company { font-size: clamp(12px, min(3.5vw, calc(1dvh + 7.2px)), 15px); }
  .tagline { margin: 0 0 clamp(6px, 1.5dvh, 12px); font-size: clamp(14px, min(4.3vw, calc(1dvh + 9.2px)), 18px); }
  .primary-contact {
    flex: 1.2 0 auto;
    min-height: clamp(52px, calc(6dvh + 23.2px), 76px);
    margin: var(--section-gap) 0 var(--row-gap);
    padding-block: clamp(10px, 2dvh, 16px);
    font-size: clamp(15px, min(4.8vw, calc(1.5dvh + 7.8px)), 20px);
  }
  .primary-contact .icon { width: 1.4em; height: 1.4em; flex-basis: 1.4em; }
  .primary-contact .primary-arrow { width: 1em; height: 1em; flex-basis: 1em; }
  .messaging { flex: 1 0 auto; gap: var(--row-gap); }
  .messaging .contact-row { height: 100%; min-height: clamp(52px, calc(6dvh + 23.2px), 76px); }
  .other-contacts { display: flex; flex-direction: column; flex: 2 0 auto; margin-top: var(--section-gap); }
  .section-label { margin-bottom: var(--row-gap); font-size: clamp(10px, calc(0.6dvh + 7.12px), 12px); }
  .contacts { flex: 1 0 auto; grid-template-rows: repeat(2, minmax(min-content, 1fr)); gap: var(--row-gap); }
  .contact-row { min-height: 44px; padding-block: clamp(5px, calc(1.5dvh - 2.2px), 12px); font-size: clamp(14px, min(4.8vw, calc(1.5dvh + 6.8px)), 19px); }
  .contact-label, .other-contacts .contact-label { font-size: inherit; }
  .other-contacts .contact-row { font-size: clamp(13px, min(4.5vw, calc(1.2dvh + 7.24px)), 18px); }
  .contact-row > .icon:first-child, .other-contacts .contact-row > .icon:first-child { width: 1.25em; height: 1.25em; flex-basis: 1.25em; }
  .contact-text { gap: clamp(1px, calc(0.8dvh - 2.84px), 4px); }
  .contact-detail { font-size: clamp(11px, min(3.5vw, calc(1dvh + 6.2px)), 14px); }
  .email-contact .contact-detail { font-size: clamp(10px, min(3.3vw, calc(1.2dvh + 4.24px)), 14px); }
  .footer { flex: 0 0 auto; margin-top: var(--row-gap); font-size: clamp(9px, calc(0.8dvh + 5.16px), 12px); }
}
@media (max-width: 340px) {
  .profile { gap: 10px; }
  .profile-photo { flex-basis: 112px; width: 112px; height: calc(112px + var(--profile-padding)); margin-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
