/* Nexus Immigration — public digital business cards.
   One stylesheet, five templates. Structure is shared; each template scopes
   its own look under .card--<name>. Mobile-first throughout. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --radius: 18px;
  --shadow: 0 18px 48px rgba(15, 23, 42, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 28px;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { flex: none; }

.preview-banner {
  width: 100%;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  text-align: center;
}
.preview-banner a { color: #fff; text-decoration: underline; margin-left: 6px; }

.card {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.card__initials {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.card__name   { margin: 0; font-size: 1.6rem; line-height: 1.25; font-weight: 700; }
.card__role   { margin: 6px 0 0; font-size: 1rem; }
.card__company{ margin: 4px 0 0; font-size: .95rem; }
.card__bio p  { margin: 0; font-size: .95rem; }

/* minmax(0, …) and min-width: 0 stop a long address from forcing the whole
   card wider than the viewport — grid and flex children default to auto. */
.card__actions { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }

.action { display: flex; align-items: center; gap: 14px; min-width: 0; }
.action__icon  { flex: none; }
.action__text  { display: flex; flex-direction: column; min-width: 0; }
.action__label { font-weight: 600; font-size: .95rem; }
.action__sub   { font-size: .82rem; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card__socials { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Utility bar (identical behaviour in every template) --------------- */

/* Narrow screens: "Save contact" takes its own full-width row so the label
   never wraps; Share and QR sit beneath it. Wider cards use three columns. */
.card-utils {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}
.card-utils .util--primary { grid-column: 1 / -1; }

.util {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, .14);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  cursor: pointer;
  min-height: 48px;
  transition: transform .12s ease, opacity .12s ease;
}
.util:active { transform: scale(.98); }
.util--primary { border: none; }

@media (min-width: 500px) {
  .card-utils { grid-template-columns: repeat(3, 1fr); }
  .card-utils .util--primary { grid-column: auto; }
}

.qr-dialog {
  border: none;
  border-radius: 18px;
  padding: 24px;
  max-width: 340px;
  width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--shadow);
  color: #0f172a;
  background: #fff;
}
.qr-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.qr-dialog h2 { margin: 0 0 16px; font-size: 1.05rem; }
.qr-dialog img { margin: 0 auto; width: 260px; height: 260px; }
.qr-dialog__url { margin: 14px 0 18px; font-size: .82rem; color: #64748b; word-break: break-all; }
.qr-dialog .btn {
  display: inline-block; padding: 11px 22px; border-radius: 10px; border: none;
  background: #0f172a; color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

.card-footer { margin-top: 22px; font-size: .8rem; opacity: .6; }
.card-footer a { color: inherit; }

/* =======================================================================
   Template 1 — Classic Corporate
   ======================================================================= */

.card-body--t1 { background: #eef2f7; color: #0f172a; }
.card--classic {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 0;
  padding-bottom: 24px;
}
@media (min-width: 520px) { .card--classic { margin-top: 32px; } }

.card--classic .card__cover {
  height: 148px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6 60%, #60a5fa);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card--classic .card__logo {
  position: absolute; top: 14px; right: 16px;
  max-height: 40px; width: auto;
  background: rgba(255, 255, 255, .92);
  border-radius: 8px; padding: 6px 10px;
}
/* z-index so the avatar sits over the positioned cover, not behind it. */
.card--classic .card__head {
  text-align: center; padding: 0 24px 4px; margin-top: -66px;
  position: relative; z-index: 1;
}
.card--classic .card__avatar {
  width: 132px; height: 132px; margin: 0 auto 14px;
  border-radius: 50%; overflow: hidden;
  border: 5px solid #fff; background: #dbeafe; color: #1d4ed8;
  box-shadow: 0 8px 20px rgba(29, 78, 216, .22);
}
.card--classic .card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card--classic .card__role { color: #1d4ed8; font-weight: 600; }
.card--classic .card__company { color: #64748b; }

.card--classic .card__section-title {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: #94a3b8; margin: 0 0 8px; font-weight: 700;
}
.card--classic .card__bio { padding: 20px 24px 4px; color: #475569; }
.card--classic .card__bio::before {
  content: ""; display: block; width: 44px; height: 3px;
  background: #1d4ed8; border-radius: 2px; margin: 0 auto 20px;
}
.card--classic .card__actions { padding: 20px 24px 0; }
.card--classic .action {
  padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px;
  color: #0f172a; background: #fff;
}
.card--classic .action:hover { border-color: #bfdbfe; background: #f8fbff; }
.card--classic .action__icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: #eff6ff; color: #1d4ed8;
}
.card--classic .card__socials { padding: 18px 24px 0; justify-content: center; }
.card--classic .social {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: #f1f5f9; color: #334155;
}
.card--classic .social:hover { background: #1d4ed8; color: #fff; }
.card--classic .card-utils { padding: 22px 24px 0; }
.card--classic .util { color: #334155; }
.card--classic .util--primary { background: #1d4ed8; color: #fff; }

/* =======================================================================
   Template 2 — Dark Executive
   ======================================================================= */

.card-body--t2 { background: #060b14; color: #e5e7eb; }
.card--executive {
  background: #0b1220;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 175, 55, .22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  padding-bottom: 26px;
}
@media (min-width: 520px) { .card--executive { margin-top: 32px; } }

.card--executive .card__cover {
  height: 150px;
  background: radial-gradient(120% 140% at 20% 0%, #1e293b 0%, #0b1220 70%);
  background-size: cover; background-position: center;
  border-bottom: 1px solid rgba(212, 175, 55, .28);
  position: relative;
}
/* Light enough that an uploaded cover still reads, dark enough at the foot
   for the name to sit on it. */
.card--executive .card__cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, .1) 0%, rgba(11, 18, 32, .45) 55%, rgba(11, 18, 32, .9) 100%);
}
/* Only the portrait laps the cover. The name sits beside it, tight under the
   cover edge; designation and company run full width below the portrait. */
.card--executive .card__head {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 6px 26px 0; position: relative; z-index: 1;
}
.card--executive .card__avatar {
  width: 104px; height: 104px; flex: none; overflow: hidden;
  margin-top: -70px;
  border-radius: 6px; border: 2px solid #d4af37; background: #111c2e; color: #d4af37;
}
.card--executive .card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card--executive .card__meta { padding: 12px 26px 0; }
.card--executive .card__name {
  font-size: 1.62rem; color: #f8fafc; letter-spacing: .01em;
  padding-top: 2px; min-width: 0;
}
.card--executive .card__role {
  color: #d4af37; text-transform: uppercase; letter-spacing: .16em;
  font-size: .74rem; font-weight: 700; margin: 0;
}
.card--executive .card__company { color: #94a3b8; display: flex; align-items: center; gap: 8px; }
.card--executive .card__logo { max-height: 22px; width: auto; }

.card--executive .card__rule {
  height: 1px; margin: 22px 26px 0;
  background: linear-gradient(90deg, #d4af37, rgba(212, 175, 55, 0));
}
.card--executive .card__bio { padding: 18px 26px 0; color: #94a3b8; font-style: italic; }
.card--executive .card__actions { padding: 20px 26px 0; }
.card--executive .action {
  padding: 13px 14px; border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 10px; color: #e5e7eb; background: rgba(255, 255, 255, .02);
}
.card--executive .action:hover { border-color: rgba(212, 175, 55, .55); background: rgba(212, 175, 55, .06); }
.card--executive .action__icon { color: #d4af37; width: 34px; display: grid; place-items: center; }
.card--executive .card__socials { padding: 18px 26px 0; }
.card--executive .social {
  width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center;
  border: 1px solid rgba(148, 163, 184, .2); color: #cbd5e1;
}
.card--executive .social:hover { border-color: #d4af37; color: #d4af37; }
.card--executive .card-utils { padding: 22px 26px 0; }
.card--executive .util { border-color: rgba(148, 163, 184, .25); color: #e5e7eb; }
.card--executive .util--primary { background: #d4af37; color: #0b1220; }
.card--executive .qr-dialog { background: #0b1220; color: #e5e7eb; border: 1px solid rgba(212, 175, 55, .3); }
.card--executive .qr-dialog .btn { background: #d4af37; color: #0b1220; }

/* =======================================================================
   Template 3 — Minimal Modern
   ======================================================================= */

.card-body--t3 { background: #fafaf9; color: #1c1917; }
.card--minimal {
  background: #fafaf9;
  max-width: 440px;
  padding: 0 22px 20px;
}
@media (min-width: 520px) { .card--minimal { padding-top: 48px; } }

.card--minimal .card__cover {
  height: 120px; border-radius: 10px; margin: 22px 0 0;
  background-size: cover; background-position: center; filter: saturate(.85);
}
.card--minimal .card__head { padding: 30px 0 0; }
.card--minimal .card__avatar {
  width: 88px; height: 88px; border-radius: 50%; overflow: hidden;
  background: #e7e5e4; margin-bottom: 20px;
}
.card--minimal .card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card--minimal .card__logo-only { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card--minimal .card__name { font-size: 2rem; font-weight: 600; letter-spacing: -.02em; }
.card--minimal .card__role { color: #78716c; font-size: 1rem; margin-top: 8px; }
.card--minimal .card__logo { max-height: 26px; width: auto; margin-top: 16px; opacity: .8; }
.card--minimal .card__bio { padding: 26px 0 0; color: #57534e; }

.card--minimal .card__actions { padding: 30px 0 0; gap: 0; }
.card--minimal .action {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 2px;
  border-top: 1px solid #e7e5e4;
  color: #1c1917;
}
.card--minimal .action:last-child { border-bottom: 1px solid #e7e5e4; }
.card--minimal .action__label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: #a8a29e; font-weight: 600;
}
.card--minimal .action__sub {
  font-size: .95rem; opacity: 1; color: #1c1917;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card--minimal .action__icon { color: #a8a29e; }
.card--minimal .action:hover .action__icon { color: #1c1917; }

.card--minimal .card__socials { padding: 26px 0 0; gap: 8px 18px; }
.card--minimal .social {
  display: inline-flex; align-items: center; gap: 7px;
  color: #57534e; font-size: .86rem; border-bottom: 1px solid transparent;
}
.card--minimal .social:hover { color: #1c1917; border-bottom-color: #1c1917; }
.card--minimal .card-utils { padding: 30px 0 0; }
.card--minimal .util { border-color: #d6d3d1; border-radius: 10px; color: #1c1917; }
.card--minimal .util--primary { background: #1c1917; color: #fafaf9; }

/* =======================================================================
   Template 4 — Bold Gradient
   ======================================================================= */

.card-body--t4 { background: #f5f3ff; color: #1e1b4b; }
.card--gradient {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(124, 58, 237, .22);
  padding-bottom: 26px;
}
@media (min-width: 520px) { .card--gradient { margin-top: 32px; } }

/* Cover photo gets its own band. The gradient identity block sits underneath
   it, so the name is never laid over the artwork — only the avatar laps up. */
.card--gradient .card__cover {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.card--gradient .card__cover-image {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.card--gradient .card__cover-wash {
  position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 50% 0%, rgba(255, 255, 255, .28), transparent 70%);
}
.card--gradient .card__head {
  position: relative; z-index: 1;
  padding: 34px 24px 30px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 55%, #f97316 100%);
  text-align: center;
  color: #fff;
  /* No overflow clipping — the avatar deliberately laps up over the cover. */
}
.card--gradient.has-cover .card__head { padding-top: 10px; }
.card--gradient .card__avatar {
  position: relative; z-index: 1;
  width: 128px; height: 128px; margin: 0 auto 16px;
  border-radius: 50%; overflow: hidden;
  border: 4px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .2); color: #fff;
  box-shadow: 0 10px 30px rgba(76, 29, 149, .35);
}
/* Only the portrait breaks the boundary between the photo and the gradient. */
.card--gradient.has-cover .card__avatar { margin-top: -80px; }
.card--gradient .card__name,
.card--gradient .card__role,
.card--gradient .card__company { position: relative; z-index: 1; }
.card--gradient .card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card--gradient .card__name { font-size: 1.7rem; }
.card--gradient .card__role { opacity: .95; font-weight: 600; }
.card--gradient .card__company {
  opacity: .9; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.card--gradient .card__logo {
  max-height: 24px; width: auto; background: rgba(255, 255, 255, .9);
  border-radius: 6px; padding: 3px 6px;
}

.card--gradient .card__body { padding: 0 22px; }
.card--gradient .card__bio { padding: 24px 2px 0; color: #4c1d95; text-align: center; }
.card--gradient .card__actions { padding: 24px 0 0; gap: 12px; }
.card--gradient .action {
  padding: 15px 18px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 8px 20px rgba(124, 58, 237, .28);
}
.card--gradient .action--whatsapp { background: linear-gradient(135deg, #059669, #34d399); box-shadow: 0 8px 20px rgba(5, 150, 105, .28); }
.card--gradient .action--email    { background: linear-gradient(135deg, #db2777, #f472b6); box-shadow: 0 8px 20px rgba(219, 39, 119, .28); }
.card--gradient .action--website  { background: linear-gradient(135deg, #ea580c, #fb923c); box-shadow: 0 8px 20px rgba(234, 88, 12, .28); }
.card--gradient .action--address  { background: linear-gradient(135deg, #0284c7, #38bdf8); box-shadow: 0 8px 20px rgba(2, 132, 199, .28); }
.card--gradient .action:hover { filter: brightness(1.06); }
.card--gradient .action__label { font-size: 1rem; }
.card--gradient .action__sub { opacity: .85; }

.card--gradient .card__socials { padding: 22px 0 0; justify-content: center; }
.card--gradient .social {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #f5f3ff; color: #7c3aed;
}
.card--gradient .social:hover { background: #7c3aed; color: #fff; }
.card--gradient .card-utils { padding: 24px 0 0; }
.card--gradient .util { border-color: #ddd6fe; color: #5b21b6; border-radius: 14px; }
.card--gradient .util--primary { background: #1e1b4b; color: #fff; }

/* =======================================================================
   Template 5 — Image-led Portfolio
   ======================================================================= */

.card-body--t5 { background: #111827; color: #f9fafb; padding-bottom: 0; }
.card--portfolio { max-width: 520px; }

.card--portfolio .card__cover {
  height: 46vh; min-height: 260px; max-height: 420px;
  background: linear-gradient(160deg, #1f2937, #0f172a);
  background-size: cover; background-position: center;
  position: relative;
}
.card--portfolio .card__cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(17, 24, 39, .15) 40%, rgba(17, 24, 39, .85));
}
.card--portfolio .card__logo {
  position: absolute; top: 18px; left: 18px; z-index: 1;
  max-height: 44px; width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5));
}
.card--portfolio .card__panel {
  position: relative;
  margin: -48px 14px 0;
  background: #1f2937;
  border-radius: 22px 22px 0 0;
  padding: 24px 22px 30px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .35);
}
@media (min-width: 560px) { .card--portfolio .card__panel { border-radius: 22px; margin-bottom: 28px; } }

.card--portfolio .card__head { display: flex; align-items: center; gap: 16px; }
.card--portfolio .card__avatar {
  width: 88px; height: 88px; flex: none; border-radius: 20px; overflow: hidden;
  border: 3px solid #38bdf8; background: #0f172a; color: #38bdf8;
}
.card--portfolio .card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.card--portfolio .card__identity { min-width: 0; }
.card--portfolio .card__name { font-size: 1.45rem; }
.card--portfolio .card__role { color: #38bdf8; font-weight: 600; font-size: .95rem; }
.card--portfolio .card__company { color: #9ca3af; }
.card--portfolio .card__bio { padding: 20px 0 0; color: #d1d5db; }

.card--portfolio .card__actions {
  padding: 22px 0 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.card--portfolio .action {
  flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 15px 14px; border-radius: 14px;
  background: #111827; border: 1px solid #374151; color: #f9fafb;
  min-width: 0;
}
.card--portfolio .action:hover { border-color: #38bdf8; }
/* Addresses are long — give them the full width rather than truncating. */
.card--portfolio .action--address { grid-column: 1 / -1; }
.card--portfolio .action__icon { color: #38bdf8; }
.card--portfolio .action__label { font-size: .9rem; }
.card--portfolio .action__sub {
  font-size: .78rem; opacity: .65; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card--portfolio .card__socials { padding: 20px 0 0; }
.card--portfolio .social {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: #111827; border: 1px solid #374151; color: #d1d5db;
}
.card--portfolio .social:hover { border-color: #38bdf8; color: #38bdf8; }
.card--portfolio .card-utils { padding: 22px 0 0; }
.card--portfolio .util { border-color: #374151; color: #f9fafb; border-radius: 14px; }
.card--portfolio .util--primary { background: #38bdf8; color: #0f172a; }
.card-body--t5 .card-footer { margin: 18px 0 24px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
