/* ============================================
   معرض الأعمال متعدد القوالب
   بطاقات حسب النوع + صفحات الهوية/السوشيال/الحملات/الفيديو
   ============================================ */

/* ---------- الفلاتر ---------- */
.work-filters { margin-bottom: 40px; }
.work-filters .portfolio-filter { margin-bottom: 0; }
.work-filter-sub {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
  margin-top: 18px; font-size: 13px; color: var(--text-light);
}
.work-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.work-filter-group > span { font-weight: 600; margin-inline-end: 4px; }
.work-filter-group button {
  padding: 5px 14px; border-radius: 50px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.work-filter-group button:hover { border-color: var(--primary-light); }
.work-filter-group button.active { background: var(--secondary); border-color: var(--secondary); color: var(--primary-dark); font-weight: 600; }
[data-theme="dark"] .work-filter-group button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.work-empty { text-align: center; color: var(--text-light); padding: 40px 0; }
.work-card.is-hidden, .client-folder.is-hidden { display: none !important; }
.work-grid > [data-in-folder]:not(.is-on) { display: none; }

/* ---------- البطاقات ---------- */
.work-card .work-card__media { background: var(--secondary-light); }
[data-theme="dark"] .work-card .work-card__media { background: #24121f; }
.work-card .work-card__media img.is-cover,
.work-card:hover .work-card__media img.is-cover {
  height: 100%; object-fit: cover; transform: none; transition: transform .6s ease;
}
.work-card:hover .work-card__media img.is-cover { transform: scale(1.03); }

.work-card__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; height: 100%; background: var(--white);
}
.work-card__grid img,
.work-card:hover .work-card__grid img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto; transform: none !important;
}
.work-card--social .work-card__grid:has(img:nth-child(6):last-child) { grid-template-rows: repeat(2, 1fr); }

.work-card__palette {
  position: absolute; inset-inline: 0; bottom: 0; height: 14px; display: flex; z-index: 4;
}
.work-card__palette span { flex: 1; }

.work-card__type {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.92); color: var(--primary-dark);
  font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 50px;
}
[data-theme="dark"] .work-card__type { background: rgba(20,11,19,.85); color: #f0e8ef; }
.work-card__type i { font-size: 10.5px; opacity: .8; }

.work-card__play {
  position: absolute; bottom: 14px; inset-inline-end: 14px; z-index: 5;
  background: rgba(20,11,19,.78); color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 50px; display: inline-flex; gap: 6px; align-items: center;
}

.work-card .work-card__body {
  flex-direction: row; justify-content: space-between; align-items: center; gap: 15px; padding: 20px;
}
.work-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.work-card .portfolio-title { font-size: 16px; line-height: 1.35; }
.work-card .portfolio-desc { font-size: 12.5px; color: var(--text-light); line-height: 1.6; }
.work-card__kpi { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; line-height: 1.2; text-align: center; }
.work-card__kpi strong { font-size: 20px; font-weight: 800; color: var(--primary); }
[data-theme="dark"] .work-card__kpi strong { color: #d9b8d6; }
.work-card__kpi span { font-size: 11px; color: var(--text-light); }

/* ---------- صفحة التفاصيل (القوالب الخاصة) ---------- */
.work-hero { padding-bottom: 70px; }
.work-hero .project-title-showcase { -webkit-text-fill-color: #fff; background: none; color: #fff; }
.work-body { padding-top: 50px; }
.work-body .container > * + * { margin-top: 56px; }
.work-h { font-size: 22px; font-weight: 800; color: var(--dark); margin: 0 0 18px; }

/* أرقام الحملة */
.work-results { position: relative; z-index: 3; margin-top: -40px; }
.work-results__grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.work-results__grid.count-1 { grid-template-columns: minmax(0, 360px); justify-content: center; }
.work-results__grid.count-2 { grid-template-columns: repeat(2, 1fr); }
.work-results__grid.count-3 { grid-template-columns: repeat(3, 1fr); }
.work-result {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-card);
}
.work-result strong { font-size: 34px; font-weight: 800; color: var(--primary); line-height: 1.1; align-self: flex-start; }
[data-theme="dark"] .work-result strong { color: #d9b8d6; }
.work-result span { font-size: 14.5px; color: var(--text); font-weight: 600; }
.work-result small { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

/* معلومات العمل */
.work-facts {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; background: var(--white);
}
.work-facts__list { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 0; }
.work-facts__list div { display: flex; flex-direction: column; gap: 2px; }
.work-facts__list dt { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.work-facts__list dd { margin: 0; font-size: 15px; font-weight: 700; color: var(--text); }
.work-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.work-tags li { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--secondary-light); padding: 4px 12px; border-radius: 50px; }
[data-theme="dark"] .work-tags li { background: #2c1529; color: #e5d4e2; }
.work-facts__link { margin-inline-start: auto; border-radius: 50px; }

/* لوحة الهوية */
.brand-board {
  display: grid; grid-template-columns: 1.25fr 1fr; grid-template-areas: "logo colors" "logo type";
  gap: 16px;
}
.brand-board > * { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: var(--white); }
.brand-board__logo {
  grid-area: logo; margin: 0; min-height: 320px; display: flex; align-items: center; justify-content: center; position: relative;
}
.brand-board__logo img { max-width: 62%; max-height: 220px; object-fit: contain; }
.brand-board__logo figcaption {
  position: absolute; top: 14px; inset-inline-start: 16px; font-size: 12px; font-weight: 600;
  color: rgba(0,0,0,.45); mix-blend-mode: difference; filter: invert(1);
}
.brand-board__logo:only-child { grid-column: 1 / -1; }
.brand-board__colors { grid-area: colors; }
.brand-board__type { grid-area: type; }
.brand-board:not(:has(.brand-board__logo)) { grid-template-areas: "colors type"; grid-template-columns: 1fr 1fr; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.swatch {
  border: 0; background: none; padding: 0; cursor: pointer; text-align: start; font: inherit;
  display: flex; flex-direction: column; gap: 6px;
}
.swatch__chip { display: block; height: 56px; border-radius: 10px; border: 1px solid rgba(0,0,0,.08); }
.swatch__hex { font-size: 12px; font-weight: 600; color: var(--text-light); font-family: ui-monospace, Consolas, monospace; }
.swatch.is-copied .swatch__hex { color: var(--primary); }
.brand-board__font { font-size: 20px; font-weight: 800; color: var(--text); margin: 0 0 10px; }
.brand-board__sample { font-size: 28px; line-height: 1.5; color: var(--text); margin: 0; }
.brand-board__type img { max-width: 100%; border-radius: 8px; display: block; }

.work-text { max-width: 780px; }
.work-text p, .work-story p { font-size: 16px; line-height: 1.95; color: var(--text); margin: 0; }

/* قصة الحملة */
.work-story { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.work-story__step { border-top: 2px solid var(--primary); padding-top: 18px; }
.work-story__n { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; font-family: 'Segoe UI', Tahoma, sans-serif; }
.work-story .work-h { font-size: 19px; margin-bottom: 10px; }

/* شبكة السوشيال */
.social-feed { max-width: 820px; margin-inline: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); overflow: hidden; }
.social-feed__head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.social-feed__avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); background: #fff; }
.social-feed__head strong { display: block; font-size: 15.5px; color: var(--text); }
.social-feed__head span { font-size: 12.5px; color: var(--text-light); }
.social-feed__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.social-feed__grid > * { margin: 0; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--secondary-light); }
.social-feed__grid img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.social-feed__grid > *:hover img { opacity: .88; }

/* الريلز */
.reels-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.reel { aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #140b13; position: relative; }
.reel video, .reel iframe { width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.reel__link { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; font-weight: 600; }
.reel__link i { width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* معرض بمقاسات مختلطة */
.masonry { columns: 3 260px; column-gap: 14px; }
.masonry > * { margin: 0 0 14px; display: block; margin-bottom: 14px; break-inside: avoid; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--secondary-light); }
.masonry img { width: 100%; height: auto; display: block; transition: transform .5s ease; }
.masonry > *:hover img { transform: scale(1.02); }

/* اقتباس العميل */
.work-quote { margin-inline: 0; max-width: 780px; border-inline-start: 3px solid var(--primary); padding: 6px 24px; }
.work-quote p { font-size: 20px; line-height: 1.8; color: var(--text); margin: 0 0 10px; font-weight: 600; }
.work-quote cite { font-style: normal; font-size: 14px; color: var(--text-light); }

.work-related .portfolio-grid { margin-top: 0; }
.work-body .case-study-cta { margin-bottom: 80px; }

/* معرض صور قالب المواقع (كانت تفتح في نافذة جديدة) */
a.gallery-item { display: block; }

/* ---------- العارض المكبّر ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 99999; background: rgba(12, 6, 11, .92);
  display: flex; align-items: center; justify-content: center; padding: 50px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button {
  position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; width: 46px; height: 46px;
  border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center;
}
.lightbox button:hover { background: rgba(255,255,255,.2); }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox__next { left: 16px; top: 50%; transform: translateY(-50%); }
html[dir="ltr"] .lightbox__prev { right: auto; left: 16px; }
html[dir="ltr"] .lightbox__next { left: auto; right: 16px; }
.lightbox__count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 13px; }

/* ---------- الجوال ---------- */
@media (max-width: 991px) {
  .work-results__grid { grid-template-columns: repeat(2, 1fr); }
  .brand-board, .brand-board:not(:has(.brand-board__logo)) { grid-template-columns: 1fr; grid-template-areas: "logo" "colors" "type"; }
  .work-story { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 700px) {
  .work-results__grid.count-3 { grid-template-columns: repeat(2, 1fr); }
  .work-results__grid.count-3 .work-result:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .work-filter-sub { justify-content: flex-start; flex-direction: column; gap: 12px; }
  .work-filter-group { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .work-filter-group button { flex-shrink: 0; }
  .work-results { margin-top: -30px; }
  .work-result { padding: 16px; }
  .work-result strong { font-size: 26px; }
  .work-facts { padding: 18px; }
  .work-facts__link { margin-inline-start: 0; width: 100%; justify-content: center; }
  .brand-board__logo { min-height: 220px; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
  .reels-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .masonry { columns: 2; column-gap: 8px; }
  .masonry > * { margin-bottom: 8px; }
  .lightbox { padding: 60px 10px; }
  .work-body .container > * + * { margin-top: 40px; }
}

/* شريط معاينة المسودة (للمدير فقط) */
.work-draft-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; background: #2a1228; color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 50px; box-shadow: 0 8px 24px rgba(0,0,0,.25); display: flex; gap: 12px; align-items: center; }
.work-draft-bar a { color: #e5d4e2; font-weight: 700; text-decoration: underline; }

/* ---------- حماية التصاميم: الضغط يحرّكها ولا يفتحها، ولا حفظ أو سحب ---------- */
.pz { position: relative; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; outline: none;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; }
.pz img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.pz::before { content: ''; position: absolute; inset: 0; z-index: 3; background: transparent; }   /* درع: «حفظ الصورة» يقع عليه لا على الصورة */
.pz:hover, .pz:focus-visible { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(42, 18, 40, .18); z-index: 2; }
.pz.is-pop { animation: pzPop .9s cubic-bezier(.2, .8, .2, 1); z-index: 4; }
@keyframes pzPop {
  0% { transform: none; }
  35% { transform: perspective(900px) translateY(-14px) scale(1.07) rotateX(6deg) rotateY(-8deg); box-shadow: 0 30px 60px rgba(42, 18, 40, .3); }
  70% { transform: perspective(900px) translateY(-6px) scale(1.03) rotateY(4deg); }
  100% { transform: none; }
}
.pz .pz-shine { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.55) 48%, transparent 66%); transform: translateX(-120%); }
.pz.is-pop .pz-shine { animation: pzShine .9s ease; }
@keyframes pzShine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .pz, .pz.is-pop { animation: none; transition: none; } }

/* ---------- النتائج التسويقية بالأيقونات ---------- */
.work-results__grid.count-5, .work-results__grid.count-6 { grid-template-columns: repeat(3, 1fr); }
.work-result { position: relative; overflow: hidden; }
.work-result__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 16px; margin-bottom: 8px;
  color: var(--primary); background: rgba(90, 47, 88, .08); }
[data-theme="dark"] .work-result__ic { color: #e2c4df; background: rgba(255, 255, 255, .08); }
.work-result strong { font-variant-numeric: tabular-nums; }
.work-result__period { font-style: normal; font-size: 12px; color: var(--text-light); }
.work-result::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 47, 88, .08), transparent 70%); pointer-events: none; }

/* ---------- الأهداف المحققة ---------- */
.work-goals ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.work-goals li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--white); border: 1px solid var(--border);
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.7; }
.work-goals li i { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; color: #fff; background: #16a34a; margin-top: 1px; }
html.mx-ready .work-goals:not(.visible) li { opacity: 0; transform: translateY(10px); }
.work-goals.visible li { opacity: 1; transform: none; transition: opacity .5s, transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i) * 90ms); }
.work-goals.visible li i { animation: goalTick .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 90ms + .25s); }
@keyframes goalTick { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }

/* ---------- الفعاليات ---------- */
.work-card__date { position: absolute; bottom: 14px; inset-inline-start: 14px; z-index: 5; display: inline-flex; gap: 6px; align-items: center;
  background: rgba(20, 11, 19, .78); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 50px; backdrop-filter: blur(6px); }
.events-home { background: linear-gradient(180deg, transparent, rgba(90, 47, 88, .04) 40%, transparent); }

@media (max-width: 991px) { .work-results__grid.count-5, .work-results__grid.count-6 { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { html.mx-ready .work-goals:not(.visible) li { opacity: 1; transform: none; } .work-goals.visible li i { animation: none; } }

/* ---------- فيديو يوتيوب أفقي (خفيف: يُحمَّل عند الضغط) ---------- */
.reels-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; margin-bottom: 18px; }
.reel.reel--wide { aspect-ratio: auto; background: none; overflow: visible; margin: 0; }
.yt-lite { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; cursor: pointer; border-radius: 16px; overflow: hidden; background: #140b13;
  box-shadow: 0 14px 34px rgba(42, 18, 40, .16); transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; }
.yt-lite img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1s cubic-bezier(.2, .8, .2, 1), filter .4s; }
.yt-lite::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(20, 11, 19, .55)); }
.yt-lite:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(42, 18, 40, .24); }
.yt-lite:hover img { transform: scale(1.05); filter: saturate(1.1); }
.yt-lite__play { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; z-index: 2; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .95); color: var(--primary); font-size: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.yt-lite__play::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); animation: ytPulse 2.2s ease-out infinite; }
.yt-lite:hover .yt-lite__play { transform: scale(1.1); }
@keyframes ytPulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.yt-lite.is-playing { cursor: default; transform: none; }
.reel--wide figcaption { margin-top: 10px; font-size: 14.5px; font-weight: 700; color: var(--dark); line-height: 1.6; }
@media (max-width: 600px) { .reels-wide { grid-template-columns: 1fr; } .yt-lite__play { width: 56px; height: 56px; font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .yt-lite__play::before { animation: none; } }

/* ---------- حركة التصاميم ---------- */
.pz { --rx: 0deg; --ry: 0deg; --px: 0px; --py: 0px; --gx: 50%; --gy: 50%; }
.pz-curtain, .pz-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }

/* الدخول: ستارة بلون الوكالة ترتفع، والتصميم يستقر من تكبير خفيف وضباب */
.pz-curtain { z-index: 2; transform: scaleY(0); transform-origin: 50% 0;
  background: linear-gradient(165deg, #6b3a68 0%, #4a2447 55%, #2a1228 100%); }
.pz-curtain::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #f0b8cf 30%, #fff 50%, #f0b8cf 70%, transparent); box-shadow: 0 0 14px rgba(240, 184, 207, .9); }
html.pz-motion .pz:not(.pz-in) .pz-curtain { transform: scaleY(1); }
html.pz-motion .pz:not(.pz-in) img { transform: scale(1.22); filter: blur(8px) saturate(.3); }
html.pz-motion .pz .pz-curtain { transition: transform 1s cubic-bezier(.77, 0, .18, 1) var(--pz-d, 0ms); }
html.pz-motion .pz img { transition: transform 1.6s cubic-bezier(.16, .84, .3, 1) var(--pz-d, 0ms), filter 1.1s ease var(--pz-d, 0ms); }
html.pz-motion .pz:not([data-reveal]):not(.pz-in) { opacity: 0; transform: perspective(1000px) translateY(36px) rotateX(10deg); }
html.pz-motion .pz:not([data-reveal]) { transition: opacity .9s ease var(--pz-d, 0ms), transform 1.1s cubic-bezier(.16, .84, .3, 1) var(--pz-d, 0ms), box-shadow .5s; }

/* بعد الدخول: حركة سريعة الاستجابة */
html.pz-motion .pz.pz-done,
html.pz-motion .cf .cf-tile.pz.pz-done { transition: transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .5s, opacity .45s, filter .45s; transition-delay: 0s; }
html.pz-motion .pz.pz-done img { transition: transform .9s cubic-bezier(.2, .8, .2, 1), filter .35s; }

/* الميلان ثلاثي الأبعاد مع الماوس */
html .pz.is-tilt,
html .cf .cf-tile.pz.is-in.is-tilt {
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.025);
  transition: transform .14s ease-out, box-shadow .4s, opacity .45s, filter .45s;
  box-shadow: 0 28px 54px rgba(42, 18, 40, .26); z-index: 3;
}
html .pz.is-tilt img { transform: scale(1.08) translate3d(var(--px), var(--py), 0); transition: transform .2s ease-out; }
.pz-glare { z-index: 2; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .34), rgba(255, 255, 255, .06) 38%, transparent 62%); }
.pz.is-tilt .pz-glare { opacity: 1; }

/* إبراز التصميم المختار وتهدئة البقية */
@media (hover: hover) and (pointer: fine) {
  .cf-masonry:has(.pz.is-tilt) .pz:not(.is-tilt),
  .masonry:has(.pz.is-tilt) .pz:not(.is-tilt),
  .social-feed__grid:has(.pz.is-tilt) .pz:not(.is-tilt) { opacity: .62; filter: saturate(.5) brightness(.95); }
}

/* لمعة حيّة عابرة */
.pz.is-glint .pz-shine { animation: pzGlint 1.35s cubic-bezier(.45, 0, .25, 1); }
@keyframes pzGlint { 0% { transform: translateX(-120%); opacity: 0; } 15% { opacity: .75; } 85% { opacity: .75; } 100% { transform: translateX(120%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .pz-curtain, .pz-glare { display: none; }
  html .pz.is-tilt, html .pz.is-tilt img { transform: none; }
}

/* ============================================
   تقرير النتائج التسويقية (ملف العميل + صفحة العمل)
   ============================================ */
.rr { --rr-c: var(--brand, var(--primary, #5a2f58)); --rr-ease: cubic-bezier(.16, .84, .3, 1); margin-top: 34px; }
.rr-wrap { position: relative; z-index: 3; margin-top: -40px; }
.rr__panel {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  border-radius: 28px; padding: 34px 34px 30px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--rr-c) 70%, #fff 12%), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--rr-c) 82%, #000), color-mix(in srgb, var(--rr-c) 52%, #000));
  box-shadow: 0 30px 70px -20px color-mix(in srgb, var(--rr-c) 55%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
/* ضوء ينجرف ببطء + شبكة نقاط */
.rr__glow { position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, .2), transparent 65%); filter: blur(10px); animation: rrDrift 16s ease-in-out infinite alternate; }
@keyframes rrDrift { to { transform: translate(260px, 120px) scale(1.15); } }
.rr__dots { position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }

/* الرأس */
.rr__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 24px; }
.rr__eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.rr__live { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); animation: rrLive 2s ease-out infinite; }
@keyframes rrLive { 70%, 100% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); } }
.rr__title { flex-basis: 100%; margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; color: #fff; line-height: 1.35; }
.rr__src { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .72); display: inline-flex; align-items: center; gap: 7px; }
.rr__src i { color: #86efac; }

/* بطاقات الأرقام */
.rr__metrics { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); perspective: 1100px; }
.rr__metrics.count-1 { grid-template-columns: minmax(0, 340px); }
.rr__metrics.count-2 { grid-template-columns: repeat(2, 1fr); }
.rr__metrics.count-3, .rr__metrics.count-5, .rr__metrics.count-6 { grid-template-columns: repeat(3, 1fr); }
.rr__m {
  --mx: 50%; --my: 0%;
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 18px; border-radius: 20px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform .5s var(--rr-ease), background-color .4s, box-shadow .4s;
}
.rr__m::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 255, 255, .16), transparent 60%); }
.rr__m:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .11); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 20px 40px -18px rgba(0, 0, 0, .5); }
.rr__m:hover::before { opacity: 1; }

/* أيقونة داخل حلقة تُرسم */
.rr__ic { position: relative; width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 10px; font-size: 17px; color: #fff; }
.rr__ic svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.rr__ic circle { fill: none; stroke-width: 2.4; }
.rr__ring-bg { stroke: rgba(255, 255, 255, .14); }
.rr__ring { stroke: #f5c2d8; stroke-linecap: round; stroke-dasharray: 138.3; stroke-dashoffset: 0; }
.rr__ic i { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.rr__m:hover .rr__ic i { transform: scale(1.18) rotate(-8deg); }

.rr__num { font-size: clamp(30px, 3.3vw, 42px); font-weight: 800; line-height: 1.05; letter-spacing: -.01em; color: #fff; align-self: flex-start;
  font-variant-numeric: tabular-nums; text-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.rr__label { font-size: 14.5px; font-weight: 700; color: rgba(255, 255, 255, .92); }
.rr__line { display: block; height: 2px; margin: 10px 0 8px; border-radius: 2px; transform-origin: right center;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #f5c2d8); }
html[dir="ltr"] .rr__line { transform-origin: left center; background: linear-gradient(90deg, #f5c2d8, rgba(255, 255, 255, 0)); }
.rr__period { font-style: normal; font-size: 12.5px; color: rgba(255, 255, 255, .7); display: inline-flex; align-items: center; gap: 6px; }
.rr__msrc { font-size: 11px; color: rgba(255, 255, 255, .55); }

/* الأهداف المحققة */
.rr__goals { margin-top: 18px; padding: 20px 22px; border-radius: 20px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.rr__goals h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 16px; font-weight: 800; color: #fff; }
.rr__goals h3 i { color: #f5c2d8; }
.rr__goals ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 22px; }
.rr__goals li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.7; color: rgba(255, 255, 255, .92); }
.rr__chk { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rr__chk circle { stroke: #4ade80; stroke-width: 1.8; stroke-dasharray: 66; stroke-dashoffset: 0; fill: rgba(74, 222, 128, .14); }
.rr__chk path { stroke: #bbf7d0; stroke-width: 2.4; stroke-dasharray: 16; stroke-dashoffset: 0; }

/* ---------- الحركة: تبدأ عند ظهور التقرير ---------- */
html.rr-motion .rr:not(.is-in) .rr__panel { clip-path: inset(18% 4% 18% 4% round 28px); opacity: 0; transform: translateY(40px) scale(.97); }
html.rr-motion .rr.is-in .rr__panel { transition: clip-path 1.1s var(--rr-ease), opacity .6s ease, transform 1.1s var(--rr-ease); clip-path: inset(0 0 0 0 round 28px); }
html.rr-motion .rr:not(.is-in) .rr__eyebrow, html.rr-motion .rr:not(.is-in) .rr__src { opacity: 0; transform: translateY(12px); }
html.rr-motion .rr:not(.is-in) .rr__title { opacity: 0; transform: translateY(22px); filter: blur(6px); }
html.rr-motion .rr.is-in .rr__eyebrow { transition: opacity .6s .35s, transform .7s var(--rr-ease) .35s; }
html.rr-motion .rr.is-in .rr__title { transition: opacity .7s .45s, transform .9s var(--rr-ease) .45s, filter .8s .45s; }
html.rr-motion .rr.is-in .rr__src { transition: opacity .6s .6s, transform .7s var(--rr-ease) .6s; }

/* البطاقات تنقلب للأمام بالتتابع */
html.rr-motion .rr:not(.is-in) .rr__m { opacity: 0; transform: translateY(34px) rotateX(-26deg); }
html.rr-motion .rr.is-in .rr__m { animation: rrCard 1s var(--rr-ease) backwards; animation-delay: calc(.55s + var(--i) * .12s); }
@keyframes rrCard { from { opacity: 0; transform: translateY(34px) rotateX(-26deg); } to { opacity: 1; transform: none; } }
html.rr-motion .rr.is-in .rr__m:hover { transform: translateY(-6px); }
/* الحلقة تُرسم ثم تنبض الأيقونة */
html.rr-motion .rr:not(.is-in) .rr__ring { stroke-dashoffset: 138.3; }
html.rr-motion .rr.is-in .rr__ring { transition: stroke-dashoffset 1.4s cubic-bezier(.65, 0, .35, 1); transition-delay: calc(.8s + var(--i, 0) * .12s); }
html.rr-motion .rr.is-in .rr__m .rr__ring { transition-delay: calc(.8s + var(--i) * .12s); }
html.rr-motion .rr.is-in .rr__ic i { animation: rrPop .7s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(1.5s + var(--i) * .12s); }
@keyframes rrPop { from { transform: scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
/* الرقم يتضح أثناء العدّ */
html.rr-motion .rr:not(.is-in) .rr__num { filter: blur(8px); opacity: .4; }
html.rr-motion .rr.is-in .rr__num { transition: filter 1.2s ease, opacity .8s ease; transition-delay: calc(.7s + var(--i, 0) * .12s); }
html.rr-motion .rr.is-in .rr__m .rr__num { transition-delay: calc(.7s + var(--i) * .12s); }
.rr__num.is-done { animation: rrFlash .9s ease; }
@keyframes rrFlash { 30% { text-shadow: 0 0 22px rgba(245, 194, 216, .95), 0 6px 24px rgba(0, 0, 0, .25); } }
/* الخط تحت الرقم يُرسم */
html.rr-motion .rr:not(.is-in) .rr__line { transform: scaleX(0); }
html.rr-motion .rr.is-in .rr__m .rr__line { transition: transform 1.2s cubic-bezier(.77, 0, .18, 1); transition-delay: calc(1.1s + var(--i) * .12s); }
/* الأهداف: كل سطر يدخل ثم تُرسم علامة الصح */
html.rr-motion .rr:not(.is-in) .rr__goals { opacity: 0; transform: translateY(20px); }
html.rr-motion .rr.is-in .rr__goals { transition: opacity .7s 1s, transform .9s var(--rr-ease) 1s; }
html.rr-motion .rr:not(.is-in) .rr__goals li { opacity: 0; transform: translateX(-18px); }
html.rr-motion[dir="ltr"] .rr:not(.is-in) .rr__goals li { transform: translateX(18px); }
html.rr-motion .rr.is-in .rr__goals li { transition: opacity .6s ease, transform .8s var(--rr-ease); transition-delay: calc(1.2s + var(--i) * .14s); }
html.rr-motion .rr:not(.is-in) .rr__chk circle { stroke-dashoffset: 66; }
html.rr-motion .rr:not(.is-in) .rr__chk path { stroke-dashoffset: 16; }
html.rr-motion .rr.is-in .rr__chk circle { transition: stroke-dashoffset .8s ease; transition-delay: calc(1.3s + var(--i) * .14s); }
html.rr-motion .rr.is-in .rr__goals li .rr__chk path { transition: stroke-dashoffset .45s ease; transition-delay: calc(1.75s + var(--i) * .14s); }

/* الجوال */
@media (max-width: 900px) {
  .rr__metrics, .rr__metrics.count-3, .rr__metrics.count-5, .rr__metrics.count-6 { grid-template-columns: repeat(2, 1fr); }
  .rr__metrics.count-3 .rr__m:first-child, .rr__metrics.count-5 .rr__m:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .rr { margin-top: 24px; }
  .rr-wrap { margin-top: -24px; }
  .rr__panel { padding: 24px 16px 18px; border-radius: 22px; }
  .rr__metrics { gap: 10px; }
  .rr__m { padding: 16px 14px 14px; border-radius: 16px; }
  .rr__ic { width: 40px; height: 40px; font-size: 15px; margin-bottom: 6px; }
  .rr__num { font-size: 28px; }
  .rr__label { font-size: 13.5px; }
  .rr__goals { padding: 16px; }
  .rr__glow { width: 300px; height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .rr__glow, .rr__live { animation: none; }
  .rr .rr__panel, .rr .rr__m, .rr .rr__goals, .rr .rr__goals li { transition: none; animation: none; opacity: 1; transform: none; clip-path: none; filter: none; }
}

/* فيديو برابط خارجي (فيسبوك…): غلاف من صور العمل مع زر تشغيل */
.reel__link.has-poster { overflow: hidden; }
.reel__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.reel__link.has-poster::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(20, 8, 18, .15), rgba(20, 8, 18, .7)); }
.reel__link.has-poster i, .reel__link.has-poster span { position: relative; z-index: 2; }
.reel__link.has-poster i { width: 64px; height: 64px; font-size: 20px; background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); animation: reelPulse 2.4s ease-out infinite; }
.reel__link.has-poster:hover .reel__poster { transform: scale(1.06); }
@keyframes reelPulse { 70%, 100% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .reel__link.has-poster i { animation: none; } }

/* ---------- ريلز فيسبوك (صورة مصغّرة + المشاهدات ثم مشغّل فيسبوك عند الضغط) ---------- */
.reel.reel--fb { background: #140b13; }
.fb-lite.is-tall { aspect-ratio: 9 / 16; height: 100%; border-radius: inherit; box-shadow: none; }
.fb-lite.is-tall:hover { transform: none; }
.fb-lite.is-tall::after { background: linear-gradient(180deg, rgba(20, 11, 19, .1) 45%, rgba(20, 11, 19, .82)); }
.fb-lite__views { position: absolute; z-index: 2; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: #fff; direction: rtl;
  background: rgba(20, 11, 19, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
html[dir="ltr"] .fb-lite__views { direction: ltr; }
.fb-lite__src { position: absolute; z-index: 2; top: 12px; inset-inline-end: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; color: #fff; background: #1877f2; box-shadow: 0 6px 16px rgba(24, 119, 242, .4); }
.fb-lite__title { position: absolute; z-index: 2; inset-inline: 14px; bottom: 14px; color: #fff; font-size: 13.5px; font-weight: 700; line-height: 1.6; text-align: start;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.fb-lite.is-tall .yt-lite__play { width: 58px; height: 58px; font-size: 19px; }
.fb-lite.is-playing .fb-lite__views, .fb-lite.is-playing .fb-lite__src, .fb-lite.is-playing .fb-lite__title { display: none; }
.fb-lite iframe { background: #000; }

/* تقرير لكل منصة (فيسبوك، انستقرام...) */
.rr-stack { display: grid; gap: 28px; margin-top: 34px; }
.rr-stack > .rr { margin-top: 0; }

/* ---------- بطاقة الحملة: لوحة أداء مصغّرة بدل الصورة ---------- */
.wcs { --rr-c: var(--primary, #5a2f58); position: relative; isolation: isolate; height: 100%; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 54px 16px 16px;
  background:
    radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--rr-c) 70%, #fff 12%), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--rr-c) 82%, #000), color-mix(in srgb, var(--rr-c) 50%, #000)); }
.wcs .rr__dots { position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.4px); background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); }
.wcs__head { position: absolute; top: 16px; inset-inline-end: 16px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .8); }
.wcs__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wcs__m { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  transition: background .3s ease, transform .3s ease; }
.work-card:hover .wcs__m { background: rgba(255, 255, 255, .11); }
.wcs__m strong { font-size: 25px; font-weight: 800; line-height: 1.1; color: #fff; letter-spacing: -.3px; text-align: start; font-variant-numeric: tabular-nums; }
.wcs__lbl { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcs__lbl i { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9.5px;
  background: rgba(255, 255, 255, .14); color: #fff; }
.wcs__lbl .fa-facebook-f { background: #1877f2; }
.wcs__lbl .fa-instagram { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); }
/* دخول متتابع للأرقام عند ظهور البطاقة */
.rr-motion .wcs:not(.is-in) .wcs__m { opacity: 0; transform: translateY(12px); }
.rr-motion .wcs.is-in .wcs__m { opacity: 1; transform: none; transition: opacity .6s ease calc(var(--i) * 90ms + 150ms), transform .7s cubic-bezier(.16, .84, .3, 1) calc(var(--i) * 90ms + 150ms), background .3s ease; }
@media (prefers-reduced-motion: reduce) { .rr-motion .wcs .wcs__m { opacity: 1; transform: none; } }

/* ---------- ريلز انستقرام (نفس بطاقة فيسبوك بشارة انستقرام) ---------- */
.ig-lite .fb-lite__src { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); box-shadow: 0 6px 16px rgba(214, 36, 159, .4); }
.ig-lite iframe { background: #fff; }

