/* ── vCard layout (mobile-first, mirrors for RTL) ───────────────────────── */

body {
  background: #efece8;
}

.card {
  position: relative;
  width: 100%;
  max-width: var(--card-w);
  min-height: 100svh;
  margin-inline: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Photo ── */
.photo {
  width: 100%;
  aspect-ratio: 440 / 586;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* ── Language toggle pill (top corner, flips with direction) ── */
.lang-toggle {
  position: absolute;
  top: 24px;
  inset-inline-end: 24px;
  background: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 14px;
  min-width: 54px;
  font: inherit;
  font-size: 16px;
  color: var(--brand);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* ── White sheet overlapping the photo ── */
.sheet {
  position: relative;
  margin-top: -28px;
  flex: 1;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Header: name/title + logo ── */
.header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
.name-block {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.name {
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
}
.title {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
}
.logo {
  flex: none;
  width: 115px;
  aspect-ratio: 116 / 47;
  background: var(--brand);
  -webkit-mask: url('../icons/logo.svg') no-repeat center / contain;
  mask: url('../icons/logo.svg') no-repeat center / contain;
}

/* ── Divider ── */
.divider {
  border: 0;
  height: 1px;
  background: var(--line);
  border-radius: 99px;
}

/* Trim the font's leading to cap height / alphabetic baseline so vertical
   spacing matches the Figma metrics (text-box-trim: trim-both, edge cap). */
.name,
.title,
.bio,
.bio p,
.save-label,
.lang-toggle {
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  /* shorthand fallback for engines that only expose the combined property */
  text-box: trim-both cap alphabetic;
}

/* ── Bio ── */
.bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--brand);
  text-align: justify;
}
.bio p + p {
  margin-top: 16px;
}

/* ── Contact buttons ── */
.contacts {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.contact-btn {
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.contact-btn:hover {
  background: #faf8f6;
}
.contact-btn:active {
  transform: scale(0.94);
}
.contact-ico {
  width: 20px;
  height: 20px;
  background: var(--brand);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.ico-whatsapp { -webkit-mask-image: url('../icons/whatsapp.svg'); mask-image: url('../icons/whatsapp.svg'); }
.ico-phone    { -webkit-mask-image: url('../icons/phone.svg');    mask-image: url('../icons/phone.svg'); }
.ico-email    { -webkit-mask-image: url('../icons/email.svg');    mask-image: url('../icons/email.svg'); }

/* keeps the last content clear of the fixed save bar */
.save-spacer { height: 86px; }

/* ── Save Contact (fixed to viewport bottom, centered to the card column) ── */
.save-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--card-w);
  z-index: 10;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 43%);
  pointer-events: none;
}
.save-btn {
  pointer-events: auto;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.save-btn:hover { opacity: 0.92; }
.save-btn:active { transform: scale(0.99); }
.save-ico {
  width: 14px;
  height: 14px;
  background: #fff;
  -webkit-mask: url('../icons/download-contact.svg') no-repeat center / contain;
  mask: url('../icons/download-contact.svg') no-repeat center / contain;
}

/* desktop framing */
@media (min-width: 480px) {
  body {
    display: grid;
    place-items: start center;
  }
  .card {
    min-height: 100svh;
    box-shadow: 0 30px 80px rgba(54, 37, 29, 0.16);
  }
}
