/* =========================================================
   תיק עבודות — Layered Project Deck (מחליף את הקרוסלה הקודמת)
   כל ה-class-ים עם הקידומת pfx- כדי לא להתנגש בשאר האתר.
   משתמש רק במשתני העיצוב הקיימים (--orange, --ink, --muted, --ease…).
   ========================================================= */

#work { --pfx-h: clamp(430px, calc(100svh - 262px), 780px); }
.pfx { position: relative; width: 100%; margin-top: clamp(0px, 1vh, 12px); }
.pfx-desk, .pfx-mob { display: none; }
.pfx.is-desk .pfx-desk { display: block; }
.pfx.is-mob .pfx-mob { display: block; }

/* ---------- DESKTOP ---------- */
.pfx-desk { position: relative; height: var(--pfx-h); cursor: grab; user-select: none; -webkit-user-select: none; }
.pfx-desk.is-grab { cursor: grabbing; }
.pfx-deck { position: absolute; inset: 0; perspective: 1500px; perspective-origin: 50% 46%; }   /* flat context: cards stack by z-index, tilted cards never cut each other */

.pfx-card { position: absolute; left: 50%; top: var(--cy, 40%); width: var(--W); aspect-ratio: 16 / 9; margin: calc(var(--W) * -0.28125) 0 0 calc(var(--W) * -0.5); will-change: transform, opacity; cursor: pointer; }
.pfx-glow { position: absolute; inset: -26%; border-radius: 50%; pointer-events: none; opacity: 0; will-change: opacity, transform;
  background: radial-gradient(closest-side, rgba(255, 112, 48, 0.78), rgba(200, 76, 24, 0.44) 46%, rgba(122, 61, 28, 0.2) 72%, transparent 100%); filter: blur(38px); }
.pfx-face { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: #150c07; border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.35); transition: border-color 0.5s, box-shadow 0.5s; }
.pfx-card.is-act .pfx-face { border-color: rgba(255, 150, 90, 0.5); box-shadow: 0 50px 110px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 128, 64, 0.18); }
.pfx-card:hover .pfx-face { border-color: rgba(255, 178, 122, 0.7); }
.pfx-face video, .pfx-face .pfx-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pfx-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(19, 11, 7, 0) 60%, rgba(19, 11, 7, 0.45)); opacity: 0.7; }
.pfx-dim { position: absolute; inset: 0; background: var(--bg); pointer-events: none; will-change: opacity; }
.pfx-badge { position: absolute; right: 14px; top: 12px; font-size: 11px; letter-spacing: 0.22em; direction: ltr; color: var(--amber); background: rgba(19, 11, 7, 0.55); border: 1px solid var(--line-soft); padding: 5px 10px; border-radius: 999px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* מידע מתחת לחפיסה: שם · משפט · כפתור */
.pfx-panel { position: absolute; left: 50%; bottom: var(--pb, 60px); width: min(540px, 86%); height: var(--ph, 160px); transform: translateX(-50%); pointer-events: none; }
.pfx-pn { position: absolute; inset: 0; text-align: center; opacity: 0; will-change: transform, opacity; }
.pfx-pn h3 { direction: ltr; font-size: clamp(1.6rem, min(3.4vw, 6.4vh), 3rem); font-weight: 800; line-height: 1.1; letter-spacing: 0.05em; }
.pfx-pn p { margin: clamp(6px, 1.2vh, 12px) auto 0; max-width: 34em; color: var(--muted); font-size: clamp(0.82rem, min(1.1vw, 2.1vh), 1.05rem); line-height: 1.55; }
.pfx-pn .btn { pointer-events: auto; margin-top: clamp(10px, 2vh, 18px); }

/* התקדמות */
.pfx-prog { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: min(420px, 70%); display: flex; align-items: center; gap: 14px; direction: ltr; }
.pfx-cnt { font-size: 0.8rem; letter-spacing: 0.25em; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 5.2em; white-space: nowrap; }
.pfx-cnt b { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: bottom; color: var(--ink); font-weight: 600; line-height: 1.2em; }
.pfx-cnt b span { display: block; height: 1.2em; transition: transform 0.6s var(--ease); }
.pfx-line { position: relative; flex: 1; height: 22px; display: flex; align-items: center; }
.pfx-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-soft); }
.pfx-bar { position: absolute; left: 0; top: calc(50% - 1px); height: 3px; border-radius: 3px; width: 100%; transform-origin: left; transform: scaleX(0); transition: transform 0.7s var(--ease);
  background: linear-gradient(90deg, var(--orange), var(--orange-2) 70%, rgba(255, 178, 122, 0.5)); box-shadow: 0 0 14px rgba(255, 90, 31, 0.45); }
.pfx-ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; }
.pfx-tk { position: relative; width: 22px; height: 22px; display: grid; place-items: center; }
.pfx-tk i { width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--dim); transition: all 0.4s var(--ease); }
.pfx-tk.on i { background: var(--orange); border-color: var(--orange-2); box-shadow: 0 0 12px rgba(255, 90, 31, 0.7); transform: scale(1.25); }
.pfx-tk em { position: absolute; bottom: 26px; font-style: normal; font-size: 10px; letter-spacing: 0.2em; white-space: nowrap; color: var(--amber); opacity: 0; transform: translateY(4px); transition: all 0.3s var(--ease); pointer-events: none; }
.pfx-tk:hover em { opacity: 1; transform: none; }

/* ---------- MOBILE / touch / natural-scroll ---------- */
.pfx-mob { margin-inline: calc(var(--pad-x) * -1); }
.pfx-track { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y; padding: 22px 0 6px; direction: rtl; }
.pfx-track::-webkit-scrollbar { display: none; }
.pfx-track::before, .pfx-track::after { content: ''; flex: 0 0 calc((100% - var(--mw)) / 2); }
.pfx-mob { --mw: min(78vw, 560px); }
.pfx-mc { flex: 0 0 var(--mw); scroll-snap-align: center; position: relative; aspect-ratio: 16 / 10.5; margin: 0 6px; will-change: transform, opacity; }
.pfx-mc .pfx-glow { inset: -18%; filter: blur(26px); }
.pfx-mc .pfx-face { border-radius: 16px; box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5); }
.pfx-mhead { position: relative; height: 3rem; margin-top: 10px; direction: ltr; }
.pfx-mhead .pfx-mh { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; will-change: transform, opacity; }
.pfx-mh h3 { font-size: 1.9rem; font-weight: 800; letter-spacing: 0.06em; }
.pfx-mprog { display: flex; align-items: center; gap: 12px; direction: ltr; padding: 12px var(--pad-x) 0; }
.pfx-mprog .pfx-mcnt { font-size: 0.78rem; letter-spacing: 0.22em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pfx-mprog .pfx-mcnt b { color: var(--ink); font-weight: 600; }
.pfx-mline { position: relative; flex: 1; height: 3px; border-radius: 3px; background: var(--line-soft); }
.pfx-mbar { position: absolute; inset: 0; border-radius: 3px; transform-origin: left; transform: scaleX(0); transition: transform 0.5s var(--ease); background: linear-gradient(90deg, var(--orange), var(--orange-2)); box-shadow: 0 0 12px rgba(255, 90, 31, 0.45); }
.pfx-mdots { display: flex; justify-content: center; gap: 2px; margin-top: 4px; direction: ltr; }
.pfx-mdots button { width: 30px; height: 30px; display: grid; place-items: center; }
.pfx-mdots i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--dim); transition: all 0.35s var(--ease); }
.pfx-mdots .on i { background: var(--orange); border-color: var(--orange-2); transform: scale(1.35); box-shadow: 0 0 10px rgba(255, 90, 31, 0.7); }
.pfx-mbody { position: relative; padding: 10px var(--pad-x) 0; text-align: center; min-height: 168px; }
.pfx-mbody .pfx-pn { position: relative; inset: auto; opacity: 1; display: none; }
.pfx-mbody .pfx-pn.on { display: block; animation: pfx-rise 0.6s var(--ease) both; }
.pfx-mbody .pfx-pn h3 { font-size: 2.1rem; }
.pfx-mbody .pfx-pn p { font-size: 0.95rem; }
.pfx-mbody .pfx-pn .btn { min-height: 50px; }
@keyframes pfx-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Project showcase layer (glass) ---------- */
.pfx-pm { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: clamp(10px, 3vh, 32px); visibility: hidden; pointer-events: none; }
.pfx-pm.vis { visibility: visible; }
.pfx-pm.open { pointer-events: auto; }
.pfx-pm-back { position: absolute; inset: 0; background: rgba(10, 6, 4, 0.5); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); opacity: 0; transition: opacity 0.5s var(--ease), backdrop-filter 0.5s var(--ease), -webkit-backdrop-filter 0.5s var(--ease); }
.pfx-pm.open .pfx-pm-back { opacity: 1; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); }
.pfx-pm-box { position: relative; width: min(1060px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; direction: rtl;
  background: linear-gradient(145deg, rgba(46, 27, 17, 0.84), rgba(19, 11, 7, 0.8));
  -webkit-backdrop-filter: blur(26px) saturate(1.45); backdrop-filter: blur(26px) saturate(1.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 128, 64, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  opacity: 0; transform: translateY(14px) scale(0.96); filter: blur(10px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), filter 0.5s var(--ease); }
.pfx-pm.open .pfx-pm-box { opacity: 1; transform: none; filter: blur(0); }
.pfx-pm-box::before { content: ''; position: absolute; left: 12%; right: 12%; top: -120px; height: 200px; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 112, 48, 0.3), transparent); filter: blur(30px); }
.pfx-pm-x { position: absolute; top: 14px; left: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(19, 11, 7, 0.55); border: 1px solid var(--line-soft); transition: background 0.3s, transform 0.4s var(--ease), border-color 0.3s; }
.pfx-pm-x:hover { background: rgba(255, 90, 31, 0.2); border-color: var(--line); transform: rotate(90deg); }
.pfx-pm-x svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.pfx-pm-scroll { position: relative; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; padding: clamp(22px, 3.4vw, 40px); scrollbar-width: thin; scrollbar-color: rgba(255, 128, 64, 0.4) transparent; }
.pfx-pm-head { padding-inline-end: 56px; }
.pfx-pm-head .n { font-size: 0.78rem; letter-spacing: 0.2em; color: var(--orange); }
.pfx-pm-head h2 { margin-top: 8px; font-size: clamp(2rem, 4.4vw, 3.6rem); font-weight: 800; line-height: 1.05; direction: ltr; text-align: right; letter-spacing: 0.04em; }
.pfx-pm-head p { margin-top: 12px; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.6; max-width: 44em; }
.pfx-pm-media { position: relative; margin-top: clamp(18px, 2.6vw, 28px); width: 100%; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #150c07; border: 1px solid rgba(255, 150, 90, 0.28); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 70px rgba(255, 90, 31, 0.14); }
.pfx-pm-media video, .pfx-pm-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pfx-pm-text { margin-top: clamp(20px, 3vw, 32px); max-width: 46em; }
.pfx-pm-text p { color: #e6d9cc; font-size: clamp(1rem, 1.2vw, 1.1rem); line-height: 1.85; }
.pfx-pm-text p + p { margin-top: 1.05em; }
.pfx-pm-text .flow { display: block; margin-top: 0.5em; color: var(--amber); font-weight: 600; direction: rtl; }
.pfx-pm-foot { margin-top: clamp(22px, 3vw, 34px); padding-top: 20px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pfx-pm-foot span { color: var(--muted); }

@media (max-width: 759px) {
  .pfx-pm { padding: 10px; }
  .pfx-pm-box { border-radius: 22px; max-height: calc(100dvh - 20px); }
  .pfx-pm-scroll { padding: 20px 16px 26px; }
  .pfx-pm-x { top: 10px; width: 46px; height: 46px; }
  .pfx-pm-head { padding-inline-end: 50px; }
  .pfx-pm-media { border-radius: 14px; }
  .pfx-pm-foot { flex-direction: column; align-items: stretch; }
  .pfx-pm-foot .btn { justify-content: center; min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .pfx-pm-back, .pfx-pm-box { transition: opacity 0.2s; transform: none !important; filter: none !important; }
  .pfx-mbody .pfx-pn.on { animation: none; }
}
html.a11y-nomotion .pfx-pm-back, html.a11y-nomotion .pfx-pm-box { transition: opacity 0.2s; transform: none !important; filter: none !important; }
.pfx-mhead { display: none; }
