/* ══════════════════════════════════════════════════════════════
   projects.css — Top 5 Software & WebGL Engineering Projects
   Bento Showcase Grid + Interactive Full-Detail Modal Drawer
   ══════════════════════════════════════════════════════════════ */

#projects-section {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 24px 52px;
  background: transparent;
  z-index: 20;
  box-sizing: border-box;
  scroll-margin-top: 70px;
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

/* Elegant separator matching other sections */
#projects-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(7, 25, 27, 0.08) 20%,
    rgba(7, 25, 27, 0.16) 50%,
    rgba(7, 25, 27, 0.08) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 10;
}

body.dark #projects-section::before {
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 255, 165, 0.15) 20%,
    rgba(0, 255, 165, 0.38) 50%,
    rgba(0, 255, 165, 0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 0 12px rgba(0, 255, 165, 0.2);
}

/* ── Section Header ── */
.projects-header {
  text-align: center;
  margin-bottom: 40px;
}

.projects-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all .2s ease;
  margin-bottom: 16px;
  cursor: default;
}

.projects-badge-pill:hover {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

body.dark .projects-badge-pill {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e2ede8;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.dark .projects-badge-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(0, 255, 165, 0.4);
  box-shadow: 0 4px 16px rgba(0, 255, 165, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

body.lang-ar .projects-badge-pill,
html[lang="ar"] .projects-badge-pill {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', 'Thmanyah Sans', sans-serif !important;
  font-weight: 600;
  letter-spacing: 0;
}

.projects-title {
  font-family: var(--font-foreign);
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #07191b;
  margin: 0 0 14px;
}

body.dark .projects-title {
  color: #ffffff;
}

.projects-title .projects-accent {
  color: #059669;
}

body.dark .projects-title .projects-accent {
  color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow);
}

body.lang-ar .projects-title {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', 'Thmanyah Sans', serif;
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
  line-height: 1.4;
  font-feature-settings: "swsh" 1, "salt" 1, "calt" 1, "ss01" 1;
}

body.lang-ar .projects-title .projects-accent {
  font-family: inherit;
  direction: rtl;
  unicode-bidi: isolate;
  font-weight: 700;
  font-feature-settings: "swsh" 1, "salt" 1, "calt" 1, "ss01" 1;
}

.projects-subtitle {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  font-weight: 400;
  line-height: 1.6;
  color: #555555;
  max-width: 660px;
  margin: 0 auto;
}

body.dark .projects-subtitle {
  color: #94a3b8;
}

body.lang-ar .projects-subtitle {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════
   BENTO SHOWCASE GRID (1 Flagship + 4 Grid Cards)
   ══════════════════════════════════════════════════════════════ */
.projects-bento {
  display: flex;
  flex-direction: column;
  gap: 34px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* ── Project Card — Architectural Frosted Glass with Corner Crosshair Lines ── */
.pcard {
  direction: ltr; /* Keeps grid column positions fixed so cards never flip when language changes */
  position: relative;
  width: 100%;
  display: grid;
  align-items: stretch;
  min-height: 230px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  overflow: visible;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease,
              background 0.35s ease;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.06),
              inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Fixed Alternating Pattern (Identical across ALL languages) */
/* Odd Cards (1, 3, 5): Image on Left, Body on Right */
.pcard:nth-child(odd) {
  grid-template-columns: 350px 1fr;
}
.pcard:nth-child(odd) .pcard-media {
  order: 1;
  border-radius: 4px 0 0 4px;
}
.pcard:nth-child(odd) .pcard-body {
  order: 2;
}

/* Even Cards (2, 4): Body on Left, Image on Right */
.pcard:nth-child(even) {
  grid-template-columns: 1fr 350px;
}
.pcard:nth-child(even) .pcard-media {
  order: 2;
  border-radius: 0 4px 4px 0;
}
.pcard:nth-child(even) .pcard-body {
  order: 1;
}

/* Arabic RTL Content Styling (Card side and layout remain completely fixed in place) */
body.lang-ar .pcard-body {
  direction: rtl;
  text-align: right;
}

/* Crosshair Hairline Guides (extending past all 4 corners) */
.pcard::before,
.pcard::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 3;
  transition: border-color 0.3s ease;
}

/* Horizontal guidelines extending past left/right */
.pcard::before {
  top: 0;
  bottom: 0;
  left: -22px;
  right: -22px;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
}

body.dark .pcard::before {
  border-color: rgba(255, 255, 255, 0.11);
}

/* Vertical guidelines extending past top/bottom */
.pcard::after {
  left: 0;
  right: 0;
  top: -22px;
  bottom: -22px;
  border-left: 1px solid rgba(0, 0, 0, 0.10);
  border-right: 1px solid rgba(0, 0, 0, 0.10);
}

body.dark .pcard::after {
  border-color: rgba(255, 255, 255, 0.11);
}

body.dark .pcard {
  background: rgba(6, 10, 8, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.pcard:hover {
  transform: translateY(-4px);
  border-color: rgba(20, 71, 58, 0.45);
  border-top-color: rgba(20, 71, 58, 0.85);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.10),
              inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.pcard:hover::before {
  border-top-color: rgba(20, 71, 58, 0.35);
  border-bottom-color: rgba(20, 71, 58, 0.35);
}

.pcard:hover::after {
  border-left-color: rgba(20, 71, 58, 0.35);
  border-right-color: rgba(20, 71, 58, 0.35);
}

body.dark .pcard:hover {
  border-color: rgba(0, 255, 165, 0.35);
  border-top-color: rgba(0, 255, 165, 0.65);
  box-shadow: 0 32px 80px -10px rgba(0, 0, 0, 0.75),
              0 0 28px rgba(0, 255, 165, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body.dark .pcard:hover::before {
  border-top-color: rgba(0, 255, 165, 0.35);
  border-bottom-color: rgba(0, 255, 165, 0.35);
}

body.dark .pcard:hover::after {
  border-left-color: rgba(0, 255, 165, 0.35);
  border-right-color: rgba(0, 255, 165, 0.35);
}

/* ── Card Visual Media Wrapper ── */
.pcard-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  overflow: hidden;
  background: #07191b;
}

.pcard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.pcard:hover .pcard-img {
  transform: scale(1.05);
}

/* Visual Overlay Gradient - Removed transparent black */
.pcard-media::after,
body.dark .pcard-media::after,
.pcard-flagship .pcard-media::after,
body.dark .pcard-flagship .pcard-media::after {
  display: none !important;
}

/* ── Card Content Body ── */
.pcard-body {
  position: relative;
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  z-index: 2;
}

.pcard-flagship .pcard-body {
  padding: 20px 22px;
}

.pcard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pcard-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #059669;
  background: rgba(5, 150, 105, 0.10);
  border: 1px solid rgba(5, 150, 105, 0.22);
  padding: 4px 12px;
  border-radius: 999px;
}

body.dark .pcard-badge {
  color: #00ffa5;
  background: rgba(0, 255, 165, 0.10);
  border-color: rgba(0, 255, 165, 0.25);
  box-shadow: 0 0 12px rgba(0, 255, 165, 0.15);
}

body.lang-ar .pcard-badge {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  letter-spacing: 0;
}

.pcard-year {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: #718096;
}

body.dark .pcard-year {
  color: #64748b;
}

.pcard-name {
  font-family: var(--font-foreign);
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: #07191b;
  margin: 0 0 8px;
}

.pcard-flagship .pcard-name {
  font-size: clamp(1.4rem, 2.1vw, 1.85rem);
}

body.dark .pcard-name {
  color: #ffffff;
}

body.lang-ar .pcard-name {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', serif;
  letter-spacing: 0;
}

.pcard-summary {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #4a5568;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard-flagship .pcard-summary {
  font-size: 0.92rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  margin-bottom: 16px;
}

body.dark .pcard-summary {
  color: #94a3b8;
}

body.lang-ar .pcard-summary {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ── Tech Stack Chips ── */
.pcard-tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.pcard-chip {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: rgba(7, 25, 27, 0.04);
  border: 1px solid rgba(7, 25, 27, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}

body.dark .pcard-chip {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.pcard:hover .pcard-chip {
  border-color: rgba(5, 150, 105, 0.3);
}

body.dark .pcard:hover .pcard-chip {
  border-color: rgba(0, 255, 165, 0.3);
}

/* ── Card Footer Action (Explore Details) ── */
.pcard-action {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  color: #718096;
  margin-top: auto !important;
  padding-top: 14px;
  letter-spacing: 0.02em;
  transition: color 0.22s ease, opacity 0.22s ease;
  cursor: pointer;
  width: fit-content;
  text-decoration: none;
  opacity: 0.85;
}

body.dark .pcard-action {
  color: #70827b;
  opacity: 0.80;
}

.pcard:hover .pcard-action {
  color: #07191b;
  opacity: 1;
}

body.dark .pcard:hover .pcard-action {
  color: #d1ded9;
  opacity: 1;
  text-shadow: none;
}

body.lang-ar .pcard-action {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 400;
}

.pcard-action-icon {
  display: none !important;
}

/* ──────────────────────────────────────────────────────────────
   INTERACTIVE FULL-DETAIL MODAL DRAWER
   ══════════════════════════════════════════════════════════════ */
.pmodal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 25, 27, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.2, 0.8, 0.4, 1),
              visibility 0.32s ease;
}

body.dark .pmodal-overlay {
  background: rgba(3, 5, 4, 0.50);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pmodal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Modal Box — Luminous Architectural Frosted Glass */
.pmodal-box {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 88vh;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.90);
  border-top: 2px solid #ffffff;
  border-radius: 4px;
  box-shadow: 0 24px 80px -15px rgba(0, 0, 0, 0.20),
              0 8px 32px rgba(7, 25, 27, 0.08),
              inset 0 1px 0 #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(28px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(7, 25, 27, 0.15) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: content;
}

body.dark .pmodal-box {
  background: #091310;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(0, 255, 165, 0.45);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.85),
              0 0 40px rgba(0, 255, 165, 0.10),
              inset 0 1px 0 rgba(255, 255, 255, 0.20);
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.pmodal-overlay.is-open .pmodal-box {
  transform: translateY(0) scale(1);
}

/* Sticky Close Bar — always pinned to the top right */
.pmodal-sticky-bar,
body.lang-ar .pmodal-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  direction: ltr !important;
  justify-content: flex-end !important;
  padding: 14px 18px 0;
  pointer-events: none;
  background: transparent;
  /* pull it up so it sits above the hero banner */
  margin-bottom: -58px;
}

/* Modal Close Button (Frosted Glass — Always on the Right) */
.pmodal-close-btn {
  position: relative;
  pointer-events: all;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-top: 1.5px solid #ffffff;
  color: #07191b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: all 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 #ffffff;
  outline: none;
}

body.dark .pmodal-close-btn {
  background: rgba(6, 12, 10, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-top: 1px solid rgba(0, 255, 165, 0.45);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
}

.pmodal-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  border-top-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.60), 0 4px 12px rgba(239, 68, 68, 0.35);
}

body.dark .pmodal-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  border-top-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.70);
}

/* Modal Hero Image Visual */
.pmodal-hero-visual {
  position: relative;
  width: 100%;
  height: 340px;
  background: #030504;
  overflow: hidden;
  flex-shrink: 0;
}

.pmodal-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pmodal-hero-visual::after {
  display: none !important;
}

.pmodal-hero-meta {
  position: absolute;
  bottom: 24px;
  left: 28px;
  right: 28px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

body.lang-ar .pmodal-hero-meta {
  direction: rtl;
}

.pmodal-hero-title {
  font-family: var(--font-foreign);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 6px 0 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}

body.lang-ar .pmodal-hero-title {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', serif;
  letter-spacing: 0;
  font-feature-settings: "swsh" 1, "salt" 1, "calt" 1, "ss01" 1;
}

.pmodal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #00ffa5;
  background: rgba(0, 255, 165, 0.16);
  border: 1px solid rgba(0, 255, 165, 0.35);
  padding: 4px 14px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

body.lang-ar .pmodal-hero-badge {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  letter-spacing: 0;
}

/* Modal Content Container */
.pmodal-content {
  padding: 28px 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Meta Bar (Action buttons + Chips) */
.pmodal-meta-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(7, 25, 27, 0.08);
}

body.dark .pmodal-meta-bar {
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

body.lang-ar .pmodal-meta-bar {
  direction: rtl;
  justify-content: flex-start;
}

/* ── Interactive In-Modal Phone & Desktop Mockups Showcase ── */
.pmodal-section-mockups {
  margin-top: 8px;
  position: relative;
}

/* Stacked Device Rows: Mobile screens and Computer screens row below row (سطر تحت سطر) */
.pmodal-device-stack {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  margin-top: 0;
}

.pmodal-device-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.pmodal-device-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

body.lang-ar .pmodal-device-header {
  direction: rtl;
}

.pmodal-device-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pmodal-device-icon {
  color: var(--accent, #059669);
  display: block;
  flex-shrink: 0;
}

body.dark .pmodal-device-icon {
  color: var(--accent, #00ffa5);
}

.pmodal-device-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: #07191b;
  margin: 0;
  letter-spacing: -0.01em;
}

body.dark .pmodal-device-title {
  color: #e2ede8;
}

body.lang-ar .pmodal-device-title {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  letter-spacing: 0;
}

.pmodal-device-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(7, 25, 27, 0.07);
  color: #07191b;
  border: 1px solid rgba(7, 25, 27, 0.12);
}

body.dark .pmodal-device-badge {
  background: rgba(0, 255, 165, 0.10);
  color: #00ffa5;
  border-color: rgba(0, 255, 165, 0.25);
}

/* Carousel Outer Wrapper with Relative Positioning for Side Buttons */
.pmodal-carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

/* Scrollbar-Free Carousel Track (Pure Button & Auto-Scroll Navigation) */
.pmodal-mockup-carousel {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  overflow-x: auto;
  padding: 14px 4px 20px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  width: 100%;
  direction: ltr !important;
  will-change: scroll-position;
  contain: layout paint;
  overscroll-behavior-x: contain;
}

.pmodal-mockup-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera - Zero Scrollbar */
}

/* Side Navigation Arrow Buttons */
.pmodal-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  color: #07191b;
  border: 1px solid rgba(7, 25, 27, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  z-index: 25;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.dark .pmodal-carousel-btn {
  background: rgba(10, 24, 22, 0.88);
  color: #e2ede8;
  border-color: rgba(0, 255, 165, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pmodal-carousel-btn:hover {
  transform: translateY(-50%) scale(1.12);
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.45);
}

body.dark .pmodal-carousel-btn:hover {
  background: var(--accent, #00ffa5);
  color: #031310;
  border-color: var(--accent, #00ffa5);
  box-shadow: 0 12px 32px rgba(0, 255, 165, 0.45);
}

.pmodal-carousel-btn.pmodal-btn-prev {
  left: -14px;
}

.pmodal-carousel-btn.pmodal-btn-next {
  right: -14px;
}

@media (max-width: 640px) {
  .pmodal-carousel-btn {
    width: 36px;
    height: 36px;
  }
  .pmodal-carousel-btn.pmodal-btn-prev {
    left: -8px;
  }
  .pmodal-carousel-btn.pmodal-btn-next {
    right: -8px;
  }
}

.pmodal-mockup-item {
  flex: 0 0 190px;
  scroll-snap-align: start;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateZ(0);
  will-change: transform;
}

.pmodal-mockup-item.is-desktop {
  flex: 0 0 540px;
}

@media (max-width: 768px) {
  .pmodal-mockup-item.is-desktop {
    flex: 0 0 85vw;
  }
}

@media (max-width: 480px) {
  .pmodal-mockup-item.is-desktop {
    flex: 0 0 88vw;
  }
}

.pmodal-mockup-item:hover {
  transform: translateY(-5px) scale(1.02) translateZ(0);
}

/* Samsung Galaxy Ultra Style Smartphone Frame (Sharp Corners & Pinhole Camera) */
.pmodal-phone-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 9px;
  background: #060e0c;
  border: 1.5px solid rgba(7, 25, 27, 0.18);
  box-shadow: none !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: paint;
}

body.dark .pmodal-phone-frame {
  border-color: rgba(0, 255, 165, 0.35);
  box-shadow: none !important;
}

.pmodal-phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
  z-index: 10;
  pointer-events: none;
}

/* PC / Laptop Desktop Mockup Frame */
.pmodal-laptop-frame {
  position: relative;
  width: 100%;
  border-radius: 8px;
  background: #080f11;
  border: 1.5px solid rgba(7, 25, 27, 0.16);
  box-shadow: none !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  contain: paint;
}

body.dark .pmodal-laptop-frame {
  border-color: rgba(0, 255, 165, 0.30);
  box-shadow: none !important;
}

.pmodal-laptop-bar {
  height: 22px;
  background: #0d1517;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  z-index: 5;
}

.pmodal-laptop-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pmodal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.pmodal-dot.dot-red { background: #ff5f56; }
.pmodal-dot.dot-yellow { background: #ffbd2e; }
.pmodal-dot.dot-green { background: #27c93f; }

.pmodal-laptop-pill {
  flex: 1;
  max-width: 120px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.10);
  margin: 0 auto;
}

.pmodal-laptop-screen {
  position: relative;
  width: 100%;
  background: #030504;
  overflow: hidden;
  display: block;
}

.pmodal-phone-frame .pmodal-mockup-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pmodal-laptop-screen .pmodal-mockup-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Bottom Platform Actions Bar */
.pmodal-bottom-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 24px;
  border-top: 1px solid rgba(7, 25, 27, 0.08);
}

body.dark .pmodal-bottom-actions-bar {
  border-top-color: rgba(255, 255, 255, 0.10);
}

body.lang-ar .pmodal-bottom-actions-bar {
  direction: rtl;
  justify-content: center;
}

.pmodal-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: 0.90rem;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

body.lang-ar .pmodal-btn-action {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
}

/* 1. Live Website Button */
.pmodal-btn-live {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

body.dark .pmodal-btn-live {
  background: #00ffa5;
  color: #030504;
  border-color: #00ffa5;
  box-shadow: 0 0 20px var(--accent-glow);
}

.pmodal-btn-live:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* 2. Google Play Button */
.pmodal-btn-playstore {
  background: rgba(255, 255, 255, 0.70);
  color: #07191b;
  border: 1px solid rgba(7, 25, 27, 0.15);
  backdrop-filter: blur(12px);
}

body.dark .pmodal-btn-playstore {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
}

.pmodal-btn-playstore:hover {
  background: rgba(7, 25, 27, 0.08);
  border-color: #059669;
  color: #059669;
  transform: translateY(-2px);
}

body.dark .pmodal-btn-playstore:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #00ffa5;
  color: #00ffa5;
}

/* 3. Apple App Store Button */
.pmodal-btn-appstore {
  background: rgba(255, 255, 255, 0.70);
  color: #07191b;
  border: 1px solid rgba(7, 25, 27, 0.15);
  backdrop-filter: blur(12px);
}

body.dark .pmodal-btn-appstore {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
}

.pmodal-btn-appstore:hover {
  background: rgba(7, 25, 27, 0.08);
  border-color: #059669;
  color: #059669;
  transform: translateY(-2px);
}

body.dark .pmodal-btn-appstore:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #00ffa5;
  color: #00ffa5;
}

/* Detail Sections */
.pmodal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pmodal-section-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #07191b;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.dark .pmodal-section-title {
  color: #ffffff;
}

.pmodal-section-title svg {
  color: var(--accent);
}

body.lang-ar .pmodal-box {
  direction: rtl;
  text-align: right;
}

body.lang-ar .pmodal-content {
  direction: rtl;
  text-align: right;
}

body.lang-ar .pmodal-section {
  text-align: right;
}

body.lang-ar .pmodal-section-title {
  direction: rtl;
  text-align: right;
  justify-content: flex-start;
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', serif;
  letter-spacing: 0;
  gap: 10px;
}

body.lang-ar .pmodal-section-title svg {
  margin-left: 4px;
  margin-right: 0;
}

.pmodal-section-text {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: #4a5568;
}

body.dark .pmodal-section-text {
  color: #94a3b8;
}

body.lang-ar .pmodal-section-text {
  direction: rtl;
  text-align: right;
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  line-height: 1.85;
  font-size: 0.98rem;
}

/* Key Features Grid */
.pmodal-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}

.pmodal-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.90rem;
  line-height: 1.5;
  color: #334155;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.70);
  padding: 12px 14px;
  border-radius: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.dark .pmodal-feature-item {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.lang-ar .pmodal-feature-item {
  direction: rtl;
  text-align: right;
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
}

body.lang-ar .pmodal-feature-icon {
  margin-left: 8px;
  margin-right: 0;
}

.pmodal-feature-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Metrics Badges Bar */
.pmodal-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.pmodal-metric-box {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.70);
  border-top: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  padding: 16px 18px;
  text-align: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: all 0.22s ease;
}

body.dark .pmodal-metric-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pmodal-metric-val {
  font-family: var(--font-foreign);
  font-size: 1.5rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.02em;
}

body.dark .pmodal-metric-val {
  color: #00ffa5;
  text-shadow: 0 0 14px var(--accent-glow);
}

body.lang-ar .pmodal-metric-val {
  direction: ltr;
  display: inline-block;
  font-family: var(--font-foreign);
}

.pmodal-metric-lbl {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

body.lang-ar .pmodal-metric-lbl {
  font-family: var(--pf-text-face), 'Thmanyah Sans', sans-serif;
  letter-spacing: 0;
}

/* Modal Footer Action (Close Window Button) */
.pmodal-footer-nav.pmodal-footer-close-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 24px;
  border-top: 1px solid rgba(7, 25, 27, 0.08);
  margin-top: 18px;
}

body.dark .pmodal-footer-nav.pmodal-footer-close-wrap {
  border-top-color: rgba(255, 255, 255, 0.10);
}

.pmodal-bottom-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(7, 25, 27, 0.05);
  border: 1px solid rgba(7, 25, 27, 0.16);
  border-radius: 999px;
  padding: 12px 36px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #07191b;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body.dark .pmodal-bottom-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.pmodal-bottom-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

body.dark .pmodal-bottom-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .pcard,
  .pcard:nth-child(odd),
  .pcard:nth-child(even),
  body.lang-ar .pcard,
  body.lang-ar .pcard:nth-child(odd),
  body.lang-ar .pcard:nth-child(even) {
    grid-template-columns: 1fr !important;
  }
  .pcard-media,
  .pcard:nth-child(odd) .pcard-media,
  .pcard:nth-child(even) .pcard-media,
  body.lang-ar .pcard-media,
  body.lang-ar .pcard:nth-child(odd) .pcard-media,
  body.lang-ar .pcard:nth-child(even) .pcard-media {
    order: 1 !important;
    border-radius: 4px 4px 0 0 !important;
    min-height: 220px;
    height: 220px;
  }
  .pcard-body,
  .pcard:nth-child(odd) .pcard-body,
  .pcard:nth-child(even) .pcard-body,
  body.lang-ar .pcard-body,
  body.lang-ar .pcard:nth-child(odd) .pcard-body,
  body.lang-ar .pcard:nth-child(even) .pcard-body {
    order: 2 !important;
  }
  .pcard::before {
    left: -12px;
    right: -12px;
  }
  .pcard::after {
    top: -12px;
    bottom: -12px;
  }
}

@media (max-width: 768px) {
  #projects-section {
    padding: 44px 16px 48px;
  }
  .projects-bento {
    gap: 26px;
  }
  .pmodal-hero-visual {
    height: 240px;
  }
  .pmodal-content {
    padding: 24px 20px 28px;
  }
  .pmodal-features-grid {
    grid-template-columns: 1fr;
  }
  .pmodal-metrics-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .pcard::before {
    left: -6px;
    right: -6px;
  }
  .pcard::after {
    top: -6px;
    bottom: -6px;
  }
}
