/* ============================================================
   Public digital business card  —  /card
   Premium dark + gold · glassmorphism · fully responsive · RTL-aware
   ============================================================ */

.card-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  color: var(--paper);
  color-scheme: dark;
  padding:
    calc(40px + env(safe-area-inset-top))
    calc(18px + env(safe-area-inset-right))
    calc(60px + env(safe-area-inset-bottom))
    calc(18px + env(safe-area-inset-left));
  background:
    radial-gradient(125% 62% at 50% -12%, rgba(247, 205, 107, 0.18), transparent 60%),
    radial-gradient(90% 55% at 100% 0%, rgba(217, 154, 37, 0.12), transparent 55%),
    radial-gradient(80% 50% at 0% 100%, rgba(247, 205, 107, 0.06), transparent 60%),
    linear-gradient(180deg, #0c0c11 0%, #08080b 45%, #0a0a0f 100%);
}

/* Film grain */
.card-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient floating orbs */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.55;
  animation: orb-float 20s ease-in-out infinite;
}
.orb-1 {
  width: 340px; height: 340px;
  top: -90px; left: -70px;
  background: radial-gradient(circle, rgba(247, 205, 107, 0.5), transparent 70%);
}
.orb-2 {
  width: 280px; height: 280px;
  bottom: 3%; right: -80px;
  animation-delay: -7s;
  background: radial-gradient(circle, rgba(217, 154, 37, 0.42), transparent 70%);
}
.orb-3 {
  width: 220px; height: 220px;
  top: 42%; left: 58%;
  animation-delay: -13s;
  background: radial-gradient(circle, rgba(255, 240, 205, 0.22), transparent 70%);
}
@keyframes orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(0, -28px, 0) scale(1.09); }
}

/* ---------- Card wrap ---------- */
.card-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  animation: card-rise 0.6s var(--ease) both;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Card shell ---------- */
.card-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 28px;
  padding: 26px 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(28, 28, 36, 0.92), rgba(15, 15, 20, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 34px 80px -24px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* Gold gradient hairline */
.card-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    155deg,
    rgba(247, 205, 107, 0.75),
    rgba(247, 205, 107, 0) 34%,
    rgba(217, 154, 37, 0) 64%,
    rgba(217, 154, 37, 0.55)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Sweeping sheen (plays a few times, then parks off-screen) */
.card-sheen {
  position: absolute;
  top: -60%;
  left: -30%;
  width: 55%;
  height: 220%;
  z-index: 0;
  pointer-events: none;
  transform: translateX(-140%) rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: sheen 7s var(--ease) 1.6s 3 forwards;
}
@keyframes sheen {
  0%        { transform: translateX(-140%) rotate(18deg); opacity: 0; }
  12%       { opacity: 1; }
  60%, 100% { transform: translateX(360%) rotate(18deg); opacity: 0; }
}

.card-shell > *:not(.card-sheen) {
  position: relative;
  z-index: 1;
}

/* ---------- Hero ---------- */
.card-hero {
  text-align: center;
  padding: 6px 4px 2px;
}

.avatar-ring {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}
.avatar-ring::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(
    from 140deg,
    var(--gold-700),
    var(--gold-400),
    #fff4d4,
    var(--gold-400),
    var(--gold-700)
  );
  animation: ring-spin 7s linear infinite;
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #101015;
}
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.card-avatar {
  position: relative;
  z-index: 1;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0 10px;
  text-align: center;
  background: linear-gradient(160deg, #24242c, #15151a);
  color: var(--gold-400);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-badge {
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 4px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--gold-400), var(--gold-600));
  color: #1a1205;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45), 0 0 0 3px #101015;
}
.avatar-badge svg { width: 15px; height: 15px; }

.card-name {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 5.4vw, 1.6rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fdfbf5;
}

.card-desc {
  margin: 0 auto;
  max-width: 34ch;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--paper-muted);
}

/* ---------- Hero actions ---------- */
.hero-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #f3efe6;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.14s var(--ease), background 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}
.pill svg { width: 16px; height: 16px; }
.pill[hidden] { display: none; }
.pill:active { transform: scale(0.95); }
.pill-primary {
  border-color: transparent;
  color: #1a1205;
  background: linear-gradient(160deg, var(--gold-300), var(--gold-600));
  box-shadow: 0 10px 24px -8px rgba(239, 182, 59, 0.55);
}
@media (hover: hover) {
  .pill:hover { border-color: rgba(247, 205, 107, 0.5); background: rgba(255, 255, 255, 0.1); }
  .pill-primary:hover { filter: brightness(1.05); border-color: transparent; }
}

/* ---------- Links ---------- */
.card-buttons {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.15s var(--ease), background 0.2s ease, border-color 0.2s ease;
  animation: btn-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms + 0.18s);
}
@keyframes btn-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-btn:active { transform: scale(0.985); }
@media (hover: hover) {
  .card-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(247, 205, 107, 0.35);
    transform: translateY(-2px);
  }
}

.icon-badge {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.6);
}
.icon-badge svg { width: 22px; height: 22px; }

.btn-text {
  flex: 1;
  min-width: 0;
  text-align: start;
}
.btn-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f6f3ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--paper-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-btn--wide .btn-sub {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.go-arrow {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.2s var(--ease), color 0.2s ease;
}
.go-arrow svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .card-btn:hover .go-arrow { color: var(--gold-400); transform: translateX(3px); }
}

/* Brand icon colours */
.icon-badge.whatsapp  { background: linear-gradient(160deg, #38e07b, #17a94f); }
.icon-badge.facebook  { background: linear-gradient(160deg, #3b82f6, #1877f2); }
.icon-badge.instagram { background: linear-gradient(135deg, #f9a03c, #e6335e 45%, #b33cc4); }
.icon-badge.tiktok    { background: linear-gradient(135deg, #25f4ee 0%, #111 45%, #fe2c55 100%); }
.icon-badge.snapchat  { background: linear-gradient(160deg, #fffc00, #ffe300); color: #111; }
.icon-badge.youtube   { background: linear-gradient(160deg, #ff5b52, #d6060d); }
.icon-badge.twitter   { background: linear-gradient(160deg, #2b2b31, #0a0a0c); }
.icon-badge.linkedin  { background: linear-gradient(160deg, #2f9ad0, #0a66c2); }
.icon-badge.viber     { background: linear-gradient(160deg, #8f7bff, #6a52e6); }
.icon-badge.telegram  { background: linear-gradient(160deg, #3fc0f0, #229ed9); }
.icon-badge.website   { background: linear-gradient(160deg, #3a3a44, #1e1e25); }
.icon-badge.phone     { background: linear-gradient(160deg, var(--gold-300), var(--gold-600)); color: #1a1205; }
.icon-badge.email     { background: linear-gradient(160deg, #7d7d8a, #565661); }
.icon-badge.address   { background: linear-gradient(160deg, #e2564a, #c0392b); }

/* ---------- Services ---------- */
.card-services {
  margin-top: 14px;
  padding: 16px 16px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  animation: btn-in 0.5s var(--ease) both;
  animation-delay: 0.5s;
}
.card-services-title {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.card-services-title::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-400);
  box-shadow: 0 0 8px rgba(247, 205, 107, 0.5);
}
.card-services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.card-services-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e9e5db;
}
.svc-tick {
  flex: none;
  margin-top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(247, 205, 107, 0.14);
  color: var(--gold-400);
}
.svc-tick svg { width: 11px; height: 11px; }

/* ---------- QR strip ---------- */
.card-qr {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(247, 205, 107, 0.16);
  background: linear-gradient(160deg, rgba(247, 205, 107, 0.1), rgba(255, 255, 255, 0.02));
}
.qr-thumb {
  width: 74px;
  height: 74px;
  min-width: 74px;
  padding: 6px;
  border: none;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.15s var(--ease);
}
.qr-thumb img { width: 100%; height: 100%; }
.qr-thumb:active { transform: scale(0.94); }
@media (hover: hover) {
  .qr-thumb:hover { transform: scale(1.05); }
}
.qr-meta {
  min-width: 0;
  text-align: start;
}
.qr-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f6f3ec;
}
.qr-hint {
  margin: 3px 0 0;
  font-size: 0.76rem;
  color: var(--paper-muted);
}

/* ---------- Footer ---------- */
.card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.card-footer-brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
}
.card-footer-brand::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 10px var(--gold-400);
}
.card-footer-phone {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold-400);
  transition: color 0.2s ease;
}
@media (hover: hover) {
  .card-footer-phone:hover { color: var(--gold-300); }
}

/* ---------- Loading / error ---------- */
.card-loading,
.card-empty {
  min-height: 44vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--paper-muted);
  font-size: 0.9rem;
}
.card-loading .spinner {
  width: 26px;
  height: 26px;
  border-width: 2.5px;
  border-color: rgba(247, 205, 107, 0.25);
  border-top-color: var(--gold-400);
}
.card-empty {
  padding: 32px 20px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

/* ---------- QR lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 1;
  background: rgba(6, 6, 9, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-fade 0.2s ease both;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox-inner {
  width: 100%;
  max-width: 320px;
  padding: 20px;
  border-radius: 22px;
  background: #fff;
  text-align: center;
  animation: lb-pop 0.3s var(--ease) both;
}
@keyframes lb-pop {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-inner img {
  width: 100%;
  border-radius: 12px;
}
.lightbox-inner p {
  margin: 12px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}
.lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* ---------- Responsive scale-up ---------- */
@media (min-width: 600px) {
  .card-wrap { max-width: 470px; }
  .card-shell { padding: 30px 26px 22px; border-radius: 30px; }
  .card-desc { font-size: 0.95rem; }
}

@media (min-width: 860px) {
  .card-page { align-items: center; }
  .card-wrap { max-width: 640px; }
  .card-shell { padding: 38px 36px 28px; }
  .card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .card-btn--wide { grid-column: 1 / -1; }
  .card-qr { margin-top: 24px; }
  .pill { padding: 11px 18px; font-size: 0.9rem; }
  .card-services-list { grid-template-columns: 1fr 1fr; gap: 10px 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card-wrap,
  .card-btn,
  .card-services,
  .card-sheen,
  .lightbox,
  .lightbox-inner { animation: none !important; }
  .orb,
  .avatar-ring::before { animation: none !important; }
  .card-btn,
  .card-services { opacity: 1 !important; transform: none !important; }
}
