/* 電子名片 /card/*。版型與色票跟 styles.css 同一家；名片內的尺寸用 cqw，同一份 markup 也拿來輸出分享圖。 */
:root {
  --bg: #f6f1e8;
  --bg-deep: #ece4d6;
  --ink: #1f1b18;
  --muted: #655c54;
  --line: rgba(31, 27, 24, 0.12);
  --copper: #8d4c31;
  --copper-strong: #6f341d;
  --gold: #b48a4a;
  --night: #1c1815;
  --night-ink: #f4ebdf;
  --night-gold: #d9b57e;
  --accent: var(--copper);
  --serif: "Noto Serif TC", Georgia, "Songti TC", "Source Han Serif TC", serif;
  --sans: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
}
.is-alisha { --accent: #9d5f6b; }
.is-darren { --accent: #0f766e; }
.is-fozone { --accent: #c7802f; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, rgba(141, 76, 49, 0.16), transparent 34%),
    radial-gradient(circle at 100% 18%, rgba(49, 72, 63, 0.14), transparent 30%),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 55%, var(--bg-deep) 100%);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.wrap {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 48px;
}

/* ¾ 記號：四分之三是公司，補上那一角的，是名片上的這個人（各自的代表色）。 */
.mark { display: block; flex: none; }
.mark-arc,
.mark-quarter { fill: none; stroke-width: 3.6; stroke-linecap: butt; }
.mark-arc { stroke: currentColor; }
.mark-quarter { stroke: var(--accent); }

/* ---------- 名片 ---------- */
.card {
  container-type: inline-size;
  width: 100%;
  perspective: 1600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-inner {
  position: relative;
  aspect-ratio: 5 / 3;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.card.is-flipped .card-inner { transform: rotateY(180deg); }
.card.is-nudging .card-inner { animation: nudge 1.1s ease-in-out; }
@keyframes nudge {
  0%, 100% { transform: rotateY(0); }
  40% { transform: rotateY(-16deg); }
  70% { transform: rotateY(4deg); }
}
.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
  padding: 5.2cqw 5.6cqw 4.8cqw;
  border-radius: 14px;
  border-radius: 3.6cqw;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  box-shadow: 0 24px 60px rgba(31, 27, 24, 0.16), 0 2px 6px rgba(31, 27, 24, 0.06);
}

.front {
  background:
    radial-gradient(circle at 100% 100%, rgba(141, 76, 49, 0.07), transparent 46%),
    linear-gradient(150deg, #fffdf8 0%, #f9f2e7 100%);
  border: 1px solid rgba(141, 76, 49, 0.14);
}
.front::after {
  /* 右下角的大 ¾ 浮水印 */
  content: "";
  position: absolute;
  right: -9cqw;
  bottom: -11cqw;
  width: 42cqw;
  height: 42cqw;
  border: 5.2cqw solid rgba(141, 76, 49, 0.055);
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
  pointer-events: none;
}
.front-top { display: flex; justify-content: space-between; align-items: flex-start; }
.lockup { display: flex; align-items: center; gap: 2.6cqw; color: var(--copper); }
.lockup .mark { width: 7.4cqw; height: 7.4cqw; }
.lockup-text { display: grid; line-height: 1.15; }
.lockup-zh {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  font-size: 4.3cqw;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.lockup-en {
  font-size: 8px;
  font-size: 2.2cqw;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-top: 0.6cqw;
}
.portrait {
  width: 18.5cqw;
  height: 18.5cqw;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 0.7cqw #fffdf8, 0 0 0 1.05cqw var(--accent), 0 2cqw 4cqw rgba(31, 27, 24, 0.18);
}
.front-mid { align-self: center; }
.name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 29px;
  font-size: 8.2cqw;
  line-height: 1.15;
  letter-spacing: 0.08em;
}
.name-en {
  margin-left: 0.5em;
  font-weight: 500;
  font-size: 0.56em;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.role {
  margin: 1.6cqw 0 0;
  font-size: 12.5px;
  font-size: 3.5cqw;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.5;
}
.role-en {
  margin: 0.3cqw 0 0;
  font-size: 9px;
  font-size: 2.55cqw;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1.4;
}
.motto {
  margin: 0;
  padding-top: 2.6cqw;
  border-top: 1px solid rgba(141, 76, 49, 0.18);
  font-family: var(--serif);
  font-size: 11px;
  font-size: 3.15cqw;
  letter-spacing: 0.16em;
  color: var(--copper-strong);
  line-height: 1.4;
}
.motto i { font-style: normal; color: var(--accent); margin: 0 0.35em; }

.back {
  transform: rotateY(180deg);
  color: var(--night-ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(217, 181, 126, 0.18), transparent 46%),
    radial-gradient(circle at 0% 100%, rgba(141, 76, 49, 0.22), transparent 50%),
    var(--night);
  border: 1px solid rgba(217, 181, 126, 0.22);
}
.back-top { display: flex; align-items: center; gap: 2.4cqw; color: var(--night-gold); }
.back-top .mark { width: 5.6cqw; height: 5.6cqw; }
.legs {
  margin: 0;
  font-size: 9.5px;
  font-size: 2.7cqw;
  letter-spacing: 0.2em;
  line-height: 1.4;
}
.legs i { font-style: normal; opacity: 0.5; margin: 0 0.45em; }
.brands {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4cqw;
  margin: 0;
}
.brands div { border-left: 1px solid rgba(217, 181, 126, 0.35); padding-left: 3cqw; }
.brands dt {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15.5px;
  font-size: 4.4cqw;
  letter-spacing: 0.14em;
  line-height: 1.3;
}
.brands dd {
  margin: 1cqw 0 0;
  font-size: 9px;
  font-size: 2.5cqw;
  letter-spacing: 0.06em;
  color: rgba(244, 235, 223, 0.66);
  line-height: 1.45;
}
.reach {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6cqw 3cqw;
  margin: 0;
  padding-top: 2.6cqw;
  border-top: 1px solid rgba(217, 181, 126, 0.25);
  font-size: 10.5px;
  font-size: 2.95cqw;
  letter-spacing: 0.05em;
  line-height: 1.4;
}
.reach b { font-weight: 500; color: var(--night-gold); margin-right: 0.4em; letter-spacing: 0.1em; }
.reach .site { color: rgba(244, 235, 223, 0.6); }

/* ---------- 名片下面 ---------- */
.flip-hint { margin: 18px 0 0; text-align: center; }
.flip-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
}
.flip-btn svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.actions .wide { grid-column: 1 / -1; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #bf7045 0%, var(--copper) 60%, var(--copper-strong) 100%);
  box-shadow: 0 12px 26px rgba(141, 76, 49, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-line {
  color: #fff;
  background: linear-gradient(135deg, #078a41 0%, #067a39 60%, #05642f 100%);
  box-shadow: 0 12px 26px rgba(6, 122, 57, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(141, 76, 49, 0.22);
}
.note {
  margin: 14px 4px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  margin-top: 28px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(31, 27, 24, 0.06);
}
.panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.08em;
}
.panel p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

.share { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; }
.share img { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--line); }
.share .btn { margin-top: 12px; min-height: 44px; font-size: 14px; padding: 0 18px; }
.share-status { display: block; min-height: 1.4em; margin-top: 6px; font-size: 12px; color: var(--copper); }

.family { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.family a {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 14px;
  text-decoration: none;
}
.family a:hover { background: rgba(141, 76, 49, 0.06); }
.family img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.family strong { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0.06em; }
.family span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.family em { font-style: normal; font-size: 12px; color: var(--copper); }
.family a[aria-current] { background: rgba(141, 76, 49, 0.07); }

.foot {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.foot .mark { width: 20px; height: 20px; color: var(--copper); }
.foot a { text-decoration: none; }
.foot strong { font-family: var(--serif); color: var(--ink); letter-spacing: 0.12em; }

@media (prefers-reduced-motion: reduce) {
  .card-inner { transition: none; }
  .card.is-nudging .card-inner { animation: none; }
}
@media (min-width: 720px) {
  .wrap { padding-top: 72px; }
}
