/* Vafa Jahangir — Digital Business Card (Vizitema) — production stylesheet */

* { box-sizing: border-box; }

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  /* Use one document-level vertical scroller. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  font-family: "Vazirmatn", Tahoma, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Keep the same dark fallback behind the page's animated background. */
  background: #080808;
  /* The document root owns vertical scrolling; body must not become a nested scroller. */
  overflow: visible;
}

/* Hide the scrollbar chrome while keeping normal vertical scrolling enabled. */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

button { font-family: inherit; cursor: pointer; border: none; }

img { display: block; max-width: 100%; }

.page {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Keep only the normal page gutter below the card. */
  padding: 16px;
  position: relative;
  overflow: clip;
  transition: background 0.35s ease;
  background: linear-gradient(-45deg, #080808, #24070a, #7d101b, #d52b38, #3b070c, #080808);
  background-size: 400% 400%;
  animation: gradientShift 10s ease infinite;
  contain: style;
}
.page[data-theme="dark"] {
  background: linear-gradient(-45deg, #010101, #080203, #25050a, #4a0a12, #120204, #010101);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Theme tokens ---------- */
.page[data-theme="light"] {
  --cardBg: linear-gradient(180deg, rgba(12, 12, 12, 0.95) 0%, rgba(12, 12, 12, 0.95) 18%, rgba(38, 5, 10, 0.78) 23%, rgba(48, 6, 12, 0.61) 32%, rgba(88, 9, 17, 0.5) 44%, rgba(136, 16, 29, 0.43) 60%, rgba(174, 24, 39, 0.4) 78%, rgba(174, 24, 39, 0.4) 100%);
  --cardText: #fff4f5;
  --mutedText: #f0c4c8;
  --rowBg: linear-gradient(135deg, rgba(62, 9, 16, 0.62) 0%, rgba(20, 14, 15, 0.46) 100%);
  --rowBorder: 1.5px solid rgba(255, 48, 61, 0.56);
  --coverBg: transparent;
  --dialogBg: rgba(44, 6, 12, 0.82);
  --secondaryBtnBg: rgba(32, 10, 12, 0.54);
  --secondaryBtnBorder: 1.5px solid rgba(234, 27, 39, 0.52);
  --footerBorder: rgba(234, 27, 39, 0.14);
  --toggleBg: rgba(12, 12, 12, 0.92);
  --cardShadow: 0 28px 56px -14px rgba(0,0,0,0.54), 0 0 0 1px rgba(234,27,39,0.35), 0 0 40px rgba(180,12,28,0.3), inset 0 1px 0 rgba(255,255,255,0.12);
  --vignette: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.38) 100%);
  --gridLine: rgba(255, 52, 68, 0.18);
}
.page[data-theme="dark"] {
  --cardBg: linear-gradient(180deg, rgba(3, 3, 3, 0.99) 0%, rgba(3, 3, 3, 0.99) 20%, rgba(3, 3, 3, 0.84) 25%, rgba(18, 3, 6, 0.66) 35%, rgba(42, 4, 10, 0.54) 48%, rgba(76, 7, 16, 0.46) 64%, rgba(102, 10, 20, 0.4) 80%, rgba(102, 10, 20, 0.4) 100%);
  --cardText: #e8f0fa;
  --mutedText: #a0b4cc;
  --rowBg: linear-gradient(135deg, rgba(54, 5, 12, 0.5) 0%, rgba(8, 3, 5, 0.42) 100%);
  --rowBorder: 1.5px solid rgba(220, 38, 55, 0.42);
  --coverBg: transparent;
  --dialogBg: rgba(12, 2, 4, 0.86);
  --secondaryBtnBg: rgba(12, 4, 6, 0.5);
  --secondaryBtnBorder: 1.5px solid rgba(220, 38, 55, 0.38);
  --footerBorder: rgba(220, 38, 55, 0.12);
  --toggleBg: rgba(5, 3, 4, 0.94);
  --cardShadow: 0 28px 56px -14px rgba(0,0,0,0.72), 0 0 0 1px rgba(160,15,30,0.34), 0 0 40px rgba(120,6,20,0.24), inset 0 1px 0 rgba(255,255,255,0.06);
  --vignette: radial-gradient(ellipse at center, transparent 32%, rgba(0,0,0,0.68) 100%);
  --gridLine: rgba(180, 22, 40, 0.09);
}

/* ---------- Keyframes ---------- */
@keyframes cardRise {
  0% { opacity: 0; transform: translateY(36px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gridPulse {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 26px 26px; }
}
@keyframes squareFloat {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(var(--sq-dx, 14px), var(--sq-dy, -18px)) rotate(var(--sq-rot, 12deg)); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes orbDrift1 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(28px, 22px); } }
@keyframes orbDrift2 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-22px, -28px); } }
@keyframes orbPulse { 0%, 100% { transform: scale(1); opacity: 0.45; } 50% { transform: scale(1.12); opacity: 0.75; } }
@keyframes sparkle { 0%, 100% { opacity: 0.15; transform: scale(0.85); } 50% { opacity: 0.85; transform: scale(1.25); } }
/* V logo 3D + sparkles */
@keyframes vlogo3d {
  0%   { transform: perspective(400px) rotateY(-22deg) rotateX(8deg) scale(1); filter: drop-shadow(0 0 4px rgba(56,189,248,0.35)); }
  25%  { transform: perspective(400px) rotateY(0deg) rotateX(-6deg) scale(1.12); filter: drop-shadow(0 0 12px rgba(56,189,248,0.7)); }
  50%  { transform: perspective(400px) rotateY(22deg) rotateX(8deg) scale(1); filter: drop-shadow(0 0 6px rgba(148,163,184,0.5)); }
  75%  { transform: perspective(400px) rotateY(0deg) rotateX(-6deg) scale(1.12); filter: drop-shadow(0 0 14px rgba(56,189,248,0.75)); }
  100% { transform: perspective(400px) rotateY(-22deg) rotateX(8deg) scale(1); filter: drop-shadow(0 0 4px rgba(56,189,248,0.35)); }
}
@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  40% { opacity: 1; transform: scale(1.15) rotate(40deg); }
  60% { opacity: 0.85; transform: scale(0.9) rotate(80deg); }
  80% { opacity: 0.2; transform: scale(0.4) rotate(120deg); }
}
.vlogo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  vertical-align: middle;
  flex-shrink: 0;
}
.vlogo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  animation: vlogo3d 3.2s ease-in-out infinite;
  transform-style: preserve-3d;
  will-change: transform, filter;
}
.vlogo-sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #7dd3fc 40%, transparent 70%);
  box-shadow: 0 0 6px 1px rgba(125, 211, 252, 0.9), 0 0 12px 2px rgba(56, 189, 248, 0.5);
  pointer-events: none;
  animation: sparkleTwinkle 1.8s ease-in-out infinite;
}
.vlogo-sparkle::before,
.vlogo-sparkle::after {
  content: "";
  position: absolute;
  background: #e0f2fe;
  border-radius: 1px;
}
.vlogo-sparkle::before {
  width: 1.5px;
  height: 7px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.vlogo-sparkle::after {
  width: 7px;
  height: 1.5px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.vlogo-sparkle.s1 { top: -4px; left: 2px; animation-delay: 0s; }
.vlogo-sparkle.s2 { top: 2px; right: -5px; animation-delay: 0.3s; }
.vlogo-sparkle.s3 { bottom: -3px; left: 6px; animation-delay: 0.6s; }
.vlogo-sparkle.s4 { top: 8px; left: -6px; animation-delay: 0.9s; }
.vlogo-sparkle.s5 { top: -6px; right: 4px; animation-delay: 1.2s; width: 4px; height: 4px; }
.vlogo-sparkle.s6 { bottom: 2px; right: 0; animation-delay: 1.5s; width: 3.5px; height: 3.5px; }
@keyframes ringPulse { 0%, 100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.06); opacity: 0.9; } }
@keyframes iconSwap { 0% { transform: rotate(-90deg) scale(0.5); opacity: 0; } 100% { transform: rotate(0) scale(1); opacity: 1; } }


/* ---------- Backgrounds ---------- */
.bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* Promote to own layer */
  transform: translateZ(0);
  will-change: transform;
}
.orb {
  position: absolute;
  border-radius: 50%;
  /* Prefer large soft radial over heavy CSS filter when possible */
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}
.orb-1 {
  width: 320px; height: 320px; top: -10%; left: -14%;
  background: radial-gradient(circle, rgba(61,143,224,0.55) 0%, rgba(10,74,158,0.2) 40%, transparent 70%);
  filter: blur(24px);
  animation: orbDrift1 14s ease-in-out infinite;
}
.orb-2 {
  width: 280px; height: 280px; bottom: -8%; right: -10%;
  background: radial-gradient(circle, rgba(30,107,200,0.5) 0%, rgba(13,63,133,0.18) 40%, transparent 70%);
  filter: blur(26px);
  animation: orbDrift2 16s ease-in-out infinite;
}
.orb-3 {
  width: 180px; height: 180px; top: 40%; right: 6%;
  background: radial-gradient(circle, rgba(91,163,240,0.45) 0%, transparent 70%);
  filter: blur(20px);
  animation: orbPulse 10s ease-in-out infinite;
}
.sparkle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 0 8px rgba(91,163,240,0.7), 0 0 14px rgba(61,143,224,0.4);
  animation-name: sparkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  transform: translateZ(0);
  will-change: opacity, transform;
  backface-visibility: hidden;
}

.bg-square-grid {
  position: absolute;
  inset: -5%;
  background-image:
    linear-gradient(var(--gridLine) 1px, transparent 1px),
    linear-gradient(90deg, var(--gridLine) 1px, transparent 1px);
  background-size: 42px 42px;
  /* Static grid is much cheaper; keep a very subtle pulse only */
  animation: none;
  pointer-events: none;
  transform: translateZ(0);
  transition: opacity 0.35s ease;
}
.bg-square {
  position: absolute;
  border-radius: 6px;
  pointer-events: none;
  animation-name: squareFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}
.bg-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--vignette);
  transition: background 0.35s ease;
  transform: translateZ(0);
}

/* ---------- Round buttons (theme / language) ---------- */
.round-btn {
  position: fixed;
  top: 16px;
  z-index: 60;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--toggleBg);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow:
    0 6px 24px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.5);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: transform 0.15s ease, background 0.4s ease, box-shadow 0.25s ease;
}
.round-btn:active { transform: scale(0.9); }
.theme-toggle { left: 16px; }
.lang-toggle {
  right: 16px;
  width: 44px;
  min-width: 44px;
  padding: 0;
  color: #EA1B27;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.page[data-theme="dark"] .lang-toggle {
  color: #ffb3b8;
  border-color: rgba(234, 27, 39, 0.5);
}
.icon-anim { animation: iconSwap 0.35s cubic-bezier(0.22, 1, 0.36, 1); display: flex; align-items: center; justify-content: center; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  padding: 16px;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: min(90vw, 320px);
  border-radius: 1.15rem;
  overflow: hidden;
  background: var(--dialogBg);
  box-shadow:
    0 25px 50px -12px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.4);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255,255,255,0.35);
}
.modal-inner { padding: 20px; }
.modal-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  color: var(--cardText);
}
.modal-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.btn-primary {
  width: 100%;
  padding: 14px 16px;
  border-radius: 0.75rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #0A4A9E, #0D3F85);
  box-shadow: 0 4px 14px rgba(10,74,158,0.4);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  width: 100%;
  padding: 14px 16px;
  border-radius: 0.75rem;
  font-weight: 500;
  color: var(--cardText);
  background: var(--secondaryBtnBg);
  border: 2px solid #0A4A9E;
}
.btn-secondary:active { transform: scale(0.97); }

/* ---------- Share Modal (site blue theme) ---------- */
.share-modal-box {
  width: min(94vw, 360px);
  border-radius: 1.5rem 1.5rem 1.25rem 1.25rem;
  background: var(--dialogBg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  border: 1px solid rgba(10, 74, 158, 0.28);
}
.share-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(10, 74, 158, 0.45);
  margin: 10px auto 0;
}
.share-modal-inner {
  padding: 4px 20px 20px;
}
.share-modal-title {
  margin: 8px 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: var(--cardText);
}
.share-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 0 18px;
}
.share-avatar-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(145deg, #0A4A9E, #3D8FE0, #0D3F85);
  box-shadow: 0 6px 20px rgba(10, 74, 158, 0.35);
  margin-bottom: 18px;
}
.share-profile-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #fff;
}
[data-theme="dark"] .share-profile-img {
  border-color: #2a2620;
}
.share-qr-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 18px rgba(10, 74, 158, 0.15);
  margin-bottom: 16px;
  border: 1px solid rgba(10, 74, 158, 0.2);
}
.share-qr-img {
  width: 130px;
  height: 130px;
  display: block;
  border-radius: 8px;
  background: #ffffff;
}
.share-link-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mutedText);
}
.share-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(10, 74, 158, 0.45);
  background: rgba(10, 74, 158, 0.08);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  direction: ltr;
  unicode-bidi: isolate;
  margin-bottom: 4px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.share-link-box:hover {
  background: rgba(10, 74, 158, 0.14);
  border-color: rgba(10, 74, 158, 0.7);
}
.share-link-box:active {
  transform: scale(0.98);
  background: rgba(10, 74, 158, 0.18);
}
.share-link-box.copied {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
}
[data-theme="dark"] .share-link-box {
  background: rgba(10, 74, 158, 0.12);
  border-color: rgba(10, 74, 158, 0.4);
}
[data-theme="dark"] .share-link-box:hover {
  background: rgba(10, 74, 158, 0.2);
  border-color: rgba(245, 215, 110, 0.6);
}
[data-theme="dark"] .share-link-box.copied {
  border-color: #66bb6a;
  background: rgba(76, 175, 80, 0.18);
}
.share-link-url {
  flex: 1;
  min-width: 0;
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0A4A9E;
  text-decoration: none;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
[data-theme="dark"] .share-link-url {
  color: #3D8FE0;
}
.share-link-copy-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A4A9E;
  opacity: 0.85;
}
[data-theme="dark"] .share-link-copy-icon {
  color: #3D8FE0;
}
.share-link-box.copied .share-link-copy-icon {
  color: #4caf50;
}
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.share-btn-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, #0A4A9E, #0D3F85);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(10, 74, 158, 0.4);
  transition: transform 0.1s, box-shadow 0.15s;
}
.share-btn-main:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(10, 74, 158, 0.3);
}
.share-btn-icon {
  flex-shrink: 0;
  stroke: #fff;
}
.share-btn-cancel {
  width: 100%;
  padding: 14px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--cardText);
  background: var(--secondaryBtnBg);
  border: 2px solid #0A4A9E;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.share-btn-cancel:active {
  transform: scale(0.98);
}

/* ---------- Card ---------- */
.card-wrap {
  width: 100%;
  max-width: 24rem;
  position: relative;
  z-index: 10;
  opacity: 0;
}
.card-wrap.ready {
  animation: cardRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.card {
  position: relative;
  border-radius: 1.75rem;
  /* Clip visual effects without turning the card into a scroll container. */
  overflow: clip;
  background: var(--cardBg);
  box-shadow: var(--cardShadow);
  /* Advanced glassmorphism */
  backdrop-filter: blur(22px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(22px) saturate(180%) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  transform: translateZ(0);
  will-change: background, box-shadow;
  backface-visibility: hidden;
  isolation: isolate;
}
/* Specular top highlight */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.08) 18%, transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  mix-blend-mode: soft-light;
}
/* Soft animated shine sweep */
.card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 45%;
  height: 200%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.02) 35%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.02) 65%,
    transparent 100%
  );
  transform: skewX(-18deg);
  animation: glassShine 7s ease-in-out infinite;
  opacity: 0.7;
}
@keyframes glassShine {
  0%, 100% { left: -60%; opacity: 0; }
  15% { opacity: 0.7; }
  45% { left: 120%; opacity: 0.5; }
  50%, 100% { left: 120%; opacity: 0; }
}
.page[data-theme="dark"] .card {
  border-color: rgba(180, 22, 40, 0.3);
}
.page[data-theme="dark"] .card::before {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 16%, transparent 40%),
    linear-gradient(135deg, rgba(180, 22, 40, 0.08) 0%, transparent 50%);
}
.page[data-theme="dark"] .card::after {
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(180, 22, 40, 0.02) 35%,
    rgba(240, 76, 88, 0.1) 50%,
    rgba(180, 22, 40, 0.02) 65%,
    transparent 100%
  );
}
/* Ensure content sits above glass layers */
.card > * {
  position: relative;
  z-index: 5;
}

.cover {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border-radius: 1.75rem 1.75rem 0 0;
  padding: 16px 16px 8px;
  background: transparent;
  border-bottom: 0;
  transition: background 0.35s ease;
  z-index: 25;
}
.page[data-theme="dark"] .cover {
  background: transparent;
}
.cover-glow {
  position: absolute;
  top: 10px;
  width: 112px;
  height: 88px;
  border-radius: 50%;
  opacity: 0.55;
  background: radial-gradient(ellipse, rgba(234, 27, 39, 0.36) 0%, rgba(192, 24, 37, 0.18) 38%, transparent 72%);
}
.page[data-theme="dark"] .cover-glow {
  opacity: 0.48;
  background: radial-gradient(ellipse, rgba(170, 16, 32, 0.32) 0%, rgba(240, 76, 88, 0.1) 42%, transparent 74%);
}
.cover-logo {
  position: relative;
  z-index: 30;
  width: 150px;
  height: auto;
  max-height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 2px 7px rgba(38, 70, 83, 0.32));
  border: 1.5px solid rgba(234, 27, 39, 0.92);
  border-radius: 12px;
  padding: 1px;
  box-shadow: 0 0 0 2px rgba(192, 24, 37, 0.2), 0 8px 18px rgba(0, 0, 0, 0.34);
}
.page[data-theme="dark"] .cover-logo {
  filter: drop-shadow(0 2px 7px rgba(38, 70, 83, 0.32));
  border-color: rgba(160, 15, 30, 0.94);
  box-shadow: 0 0 0 2px rgba(220, 38, 55, 0.16), 0 8px 18px rgba(0, 0, 0, 0.42);
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 20px 20px;
  position: relative;
  background: transparent;
  backdrop-filter: blur(8px) saturate(135%);
  -webkit-backdrop-filter: blur(8px) saturate(135%);
  z-index: 20;
}

.profile-wrap {
  position: relative;
  margin-top: 4px;
  margin-bottom: 18px;
  z-index: 40;
}
.profile-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 3px solid #EA1B27;
  box-shadow:
    0 10px 28px rgba(0,0,0,0.38),
    0 0 0 3px rgba(192,24,37,0.72),
    0 0 0 6px rgba(234,27,39,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.3);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-ring-anim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  border: 1.5px solid rgba(192,24,37,0.72);
  box-shadow: 0 0 12px rgba(234,27,39,0.28);
  animation: ringPulse 3.5s ease-in-out infinite;
}
.page[data-theme="light"] .profile-ring-anim {
  border-color: rgba(234,27,39,0.78);
  box-shadow: 0 0 12px rgba(192,24,37,0.4);
}

.identity { width: 100%; text-align: center; }
.name {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cardText);
  font-size: 1.65rem;
  line-height: 1.25;
  transition: color 0.35s ease;
}
.title {
  margin: 8px 0 0;
  font-weight: 700;
  line-height: 1.55;
  color: #e9828b;
  font-size: 1rem;
}
.gold-dash {
  margin: 12px auto 0;
  width: 40px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ea1b27, transparent);
}

.contact-list { width: 100%; margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.row-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mutedText);
  text-align: right;
  letter-spacing: 0.02em;
}
.contact-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 1rem;
  background: var(--rowBg);
  border: var(--rowBorder);
  box-shadow:
    0 2px 10px rgba(10,74,158,0.08),
    inset 0 1px 0 rgba(255,255,255,0.45);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  min-height: 56px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease, border-color 0.25s ease;
}
.contact-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(10,74,158,0.28);
  background: linear-gradient(135deg, #0A4A9E, #0D3F85);
  border-color: transparent;
}
.contact-row:hover .row-text,
.contact-row:hover .row-icon {
  color: #fff !important;
  stroke: #fff !important;
}
.contact-row:hover .row-icon,
.contact-row:hover svg {
  stroke: #fff !important;
}
.row-icon { flex-shrink: 0; transition: stroke 0.25s ease; }
.primary-chip .chip-icon {
  stroke: #ea1b27 !important;
  color: #ea1b27 !important;
  filter: none;
}
.row-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cardText);
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  transition: color 0.35s ease;
  font-feature-settings: "tnum", "kern";
}
.row-text[dir="ltr"] {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.action-row { width: 100%; margin-top: 20px; display: flex; gap: 10px; direction: ltr !important; }
.action-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 1rem;
  min-height: 76px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.action-chip:hover {
  transform: translateY(-3px) scale(1.02);
}
.primary-chip {
  background: linear-gradient(145deg, rgba(176, 15, 29, 0.96) 0%, rgba(92, 7, 16, 0.92) 52%, rgba(18, 3, 6, 0.98) 100%);
  color: #fff;
  box-shadow:
    0 6px 20px rgba(120, 6, 20, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.secondary-chip {
  background: var(--secondaryBtnBg);
  border: var(--secondaryBtnBorder);
  color: var(--cardText);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 4px 14px rgba(10,74,158,0.1);
}
.action-chip:active { transform: scale(0.95); }
.chip-icon { width: 20px; height: 20px; }
.chip-label { font-size: 0.82rem; font-weight: 700; text-align: center; line-height: 1.25; }

.footer {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: center;
  margin-top: 24px;
  width: 100%;
  padding: 16px 18px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(72, 7, 14, 0.38), rgba(8, 8, 8, 0.42));
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(234, 27, 39, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.footer-line {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  letter-spacing: 0.01em;
}
.footer-link {
  margin-top: 10px;
  display: block;
  font-weight: 800;
  font-size: 1.12rem;
  color: #ffb3b8;
  letter-spacing: 0.04em;
  text-decoration: none;
  position: relative;
  padding: 4px 4px 6px;
  pointer-events: none;
  text-shadow: 0 0 24px rgba(234, 27, 39, 0.36);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.footer-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #ea1b27, transparent);
  border-radius: 2px;
  opacity: 0.9;
  transform: scaleX(0.7);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.footer-link:hover {
  opacity: 1;
  transform: translateY(-2px);
  color: #ffd9dc;
}
.footer-link:hover::after { transform: scaleX(1); }

@media (max-width: 380px) {
  .card-wrap { max-width: 100%; }
}


/* ---------- Map app options ---------- */
.map-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.map-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(10,74,158,0.35);
  background: var(--secondaryBtnBg);
  color: var(--cardText);
  text-align: right;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.map-option:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0A4A9E, #0D3F85);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(10,74,158,0.35);
}
.map-option:hover .map-option-text small {
  color: rgba(255,255,255,0.85);
}
.map-option-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.map-option-icon .map-logo {
  width: 44px;
  height: 44px;
  display: block;
}
.map-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.map-option-text strong {
  font-size: 1.02rem;
  font-weight: 700;
}
.map-option-text small {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mutedText);
}
.map-cancel {
  margin-top: 12px;
}
.map-modal-box {
  width: min(92vw, 340px);
}

@media (max-width: 400px) {
  .name { font-size: 1.45rem; }
  .title { font-size: 0.95rem; }
  .row-text { font-size: 1rem; }
  .chip-label { font-size: 0.78rem; }
}
@media (min-width: 420px) {
  .name { font-size: 1.75rem; }
  .title { font-size: 1.05rem; }
}

/* prefers-reduced-motion disabled — animations always play */

/* On smaller / weaker devices, further lighten glass cost */
@media (max-width: 480px) {
  .card {
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
  }
  .orb-1,
  .orb-2,
  .orb-3 {
    filter: blur(18px);
  }
}

/* dir فقط روی محتوای داخل کارت اعمال می‌شود تا backdrop-filter خراب نشود */
.content[dir="ltr"] .row-label {
  text-align: left;
}
.content[dir="rtl"] .row-label {
  text-align: right;
}

/* Address rows below the website */
.address-row {
  align-items: flex-start;
  cursor: default;
  padding: 12px 18px;
}
.address-row .row-text {
  font-size: 0.92rem;
  line-height: 1.6;
  font-weight: 600;
  white-space: normal;
  word-break: break-word;
  text-align: right;
}
.page[data-lang="en"] .address-row .row-text {
  text-align: left;
}

/* ---------- Simple, soft ZarinMouj intro ---------- */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: radial-gradient(ellipse at center, #4f0810 0%, #1a0306 58%, #030303 100%);
  opacity: 1;
  visibility: visible;
  will-change: opacity;
  transition: opacity 0.75s ease, visibility 0s linear 0s;
}
.intro-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.75s ease, visibility 0s linear 0.75s;
}
.intro-logo-shell {
  width: min(86vw, 360px);
  aspect-ratio: 442 / 118;
  display: grid;
  place-items: center;
  overflow: visible;
}
.intro-logo-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: visible;
}
.intro-logo-real {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  opacity: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.56));
  animation: none;
}
.intro-logo-real.is-visible {
  animation: loaderLogoFadeIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.intro-logo-shine {
  display: none;
}
@keyframes loaderLogoFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  /* Keep the requested Fade In even when the OS requests less motion. */
  .intro-logo-real.is-visible {
    animation-duration: 1.8s;
  }
  .intro-screen,
  .intro-screen.hidden {
    transition-duration: 0.01ms;
  }
}

/* ---------- Unified red modal theme and close controls ---------- */
.modal-box,
.share-modal-box {
  position: relative;
  background: linear-gradient(145deg, rgba(38, 5, 10, 0.94), rgba(12, 3, 5, 0.92));
  border: 1px solid rgba(234, 27, 39, 0.48);
  box-shadow: 0 25px 50px rgba(0,0,0,0.55), 0 0 30px rgba(180,12,28,0.22), inset 0 1px 0 rgba(255,255,255,0.1);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #fff4f5;
  background: rgba(234, 27, 39, 0.18);
  border: 1px solid rgba(234, 27, 39, 0.55);
  font-size: 1.55rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.modal-close:hover { background: rgba(234, 27, 39, 0.75); border-color: #ff6973; }
.modal-close:active { transform: scale(0.9); }
.modal-box .modal-inner { padding-top: 52px; }
.btn-primary,
.share-btn-main {
  background: linear-gradient(135deg, #ea1b27, #9f0d18);
  box-shadow: 0 4px 14px rgba(234,27,39,0.34);
}
.btn-secondary,
.share-btn-cancel {
  background: rgba(92, 10, 18, 0.38);
  border-color: rgba(234, 27, 39, 0.58);
}
.share-handle { background: rgba(234, 27, 39, 0.55); }
.share-avatar-ring { background: linear-gradient(145deg, #ea1b27, #9f0d18, #4a070d); box-shadow: 0 6px 20px rgba(234,27,39,0.3); }
.share-link-box { border-color: rgba(234,27,39,0.48); background: rgba(92,10,18,0.2); }
.share-link-box:hover { background: rgba(234,27,39,0.14); border-color: rgba(255,105,115,0.72); }
.share-link-url, .share-link-copy-icon { color: #ffb3b8; }
.share-modal-inner { padding-top: 52px; }

/* ---------- Unified red hover behavior ---------- */
.contact-row:hover {
  background: linear-gradient(135deg, #ea1b27, #9f0d18) !important;
  border-color: rgba(255, 105, 115, 0.9) !important;
  box-shadow: 0 8px 22px rgba(234, 27, 39, 0.34) !important;
}
.action-chip {
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(234, 27, 39, 0.42);
  border-radius: 14px;
  background: rgba(92, 10, 18, 0.34);
  transition: transform 0.2s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}
.action-chip:hover,
.action-chip:focus-visible {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #ea1b27, #9f0d18) !important;
  border-color: rgba(255, 105, 115, 0.92) !important;
  box-shadow: 0 8px 20px rgba(234, 27, 39, 0.38);
  color: #fff !important;
  outline: none;
}
.action-chip:hover .chip-icon,
.action-chip:focus-visible .chip-icon,
.action-chip:hover .chip-label,
.action-chip:focus-visible .chip-label {
  color: #fff !important;
  stroke: #fff !important;
}
.btn-primary:hover,
.btn-secondary:hover,
.share-btn-main:hover,
.share-btn-cancel:hover,
.map-option:hover {
  background: linear-gradient(135deg, #ea1b27, #9f0d18) !important;
  border-color: rgba(255, 105, 115, 0.92) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(234, 27, 39, 0.38) !important;
}
.btn-primary:hover,
.share-btn-main:hover { transform: translateY(-2px); }
.btn-secondary:hover,
.share-btn-cancel:hover { transform: translateY(-2px); }

/* Address copy follows the selected language explicitly. */
.content[dir="ltr"] #officeAddrText,
.content[dir="ltr"] #factoryAddrText {
  text-align: left !important;
  direction: ltr;
}
.content[dir="rtl"] #officeAddrText,
.content[dir="rtl"] #factoryAddrText {
  text-align: right !important;
  direction: rtl;
}

/* ---------- Performance tuning: preserve visuals, reduce paint contention ---------- */
.page {
  will-change: background-position;
}
.bg-orbs,
.bg-square-grid,
.bg-square,
.orb,
.sparkle,
.card-wrap,
.card,
.profile-ring-anim,
.vlogo-img,
.vlogo-sparkle,
.intro-logo-real,
.intro-logo-shine {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.bg-orbs,
.bg-square-grid,
.bg-square,
.orb,
.sparkle {
  contain: layout paint;
}
.orb,
.bg-square,
.sparkle,
.profile-ring-anim,
.vlogo-img,
.vlogo-sparkle,
.intro-logo-real,
.intro-logo-shine {
  will-change: transform, opacity;
}
.card-wrap,
.card {
  transform: translate3d(0, 0, 0);
}
.card {
  will-change: auto;
}
.card::after {
  will-change: background-position, opacity;
}
.modal-overlay,
.modal-box,
.share-modal-box {
  transform: translate3d(0, 0, 0);
}

/* ---------- Shared compositor tuning: same UI, less main-thread work ---------- */
.card-wrap:not(.ready) { will-change: transform, opacity; }
.card-wrap.ready { will-change: auto; }
.bg-square-grid { will-change: auto; }

/* ---------- Mobile compositor tuning: same UI, less main-thread work ---------- */
@media (max-width: 480px) {
  .page {
    isolation: isolate;
    overscroll-behavior-y: auto;
  }
  .bg-orbs,
  .bg-square-grid,
  .card-wrap,
  .card {
    transform: translate3d(0, 0, 0);
  }
  .bg-orbs,
  .bg-square-grid {
    will-change: auto;
  }
  .card-wrap {
    will-change: auto;
  }
  .card-wrap:not(.ready) {
    will-change: transform, opacity;
  }
  .orb,
  .bg-square,
  .sparkle,
  .card::before,
  .card::after,
  .intro-logo-shine {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  button,
  a,
  .contact-row {
    touch-action: manipulation;
  }
  img {
    content-visibility: auto;
  }
}
