/* ==========================================================
   Projects Showcase - معرض المشاريع
   فكرة التصميم: كل مشروع بيتعرض كأنه "نافذة متصفح" حقيقية،
   بتظهر بالتدريج على الشاشة (Scroll Reveal) وبتتفاعل مع
   حركة الماوس بميل خفيف ثلاثي الأبعاد + كشف تفاصيل عند الهوفر.
   ========================================================== */

.pms-grid {
    --pms-accent: #6c5ce7;
    max-width: 1180px;
    margin: 32px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(var(--pms-columns, 3), 1fr);
    gap: 28px;
    perspective: 1200px;
}

@media (max-width: 900px) {
    .pms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .pms-grid { grid-template-columns: 1fr; }
}

.pms-empty {
    padding: 24px;
    text-align: center;
    background: #f5f5f7;
    border-radius: 12px;
    color: #555;
}

/* الكارت الأساسي */
.pms-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #14141a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1), box-shadow .3s ease;
    transition-delay: var(--pms-delay, 0ms);
    will-change: transform, opacity;
    transform-style: preserve-3d;
}

.pms-card.pms-in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pms-card:hover {
    box-shadow: 0 20px 45px rgba(0,0,0,0.28);
}

/* شريط المتصفح العلوي */
.pms-browser-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #1e1e26;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pms-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.pms-dot-red { background: #ff5f57; }
.pms-dot-yellow { background: #febc2e; }
.pms-dot-green { background: #28c840; }

.pms-domain {
    margin-inline-start: 10px;
    font-size: 12px;
    color: #9a9aa5;
    font-family: monospace;
    background: rgba(255,255,255,0.05);
    padding: 3px 10px;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

/* منطقة السكرين شوت */
.pms-shot-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0c0c10;
}

.pms-shot {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform .6s cubic-bezier(.2,.7,.3,1), filter .4s ease;
    transform: translateZ(0) scale(1.02);
}

.pms-card:hover .pms-shot {
    transform: scale(1.12);
    filter: brightness(0.55) saturate(1.1);
}

/* الطبقة اللي بتظهر عند الهوفر فوق السكرين شوت */
.pms-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    background: linear-gradient(to top, rgba(10,10,14,0.95) 10%, rgba(10,10,14,0.55) 55%, rgba(10,10,14,0) 100%);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .4s ease, transform .4s ease;
    color: #fff;
}

.pms-card:hover .pms-overlay,
.pms-card:focus-within .pms-overlay {
    opacity: 1;
    transform: translateY(0);
}

.pms-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.pms-desc {
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #d8d8de;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.pms-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #eee;
    backdrop-filter: blur(2px);
}

.pms-visit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--pms-accent);
    color: #fff;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: transform .25s ease, filter .25s ease;
}

.pms-visit:hover {
    filter: brightness(1.12);
    transform: translateX(-4px);
    color: #fff;
}

.pms-arrow {
    transition: transform .25s ease;
}
.pms-visit:hover .pms-arrow {
    transform: translateX(-4px);
}

/* ==========================================================
   تصميم "العرض المتتابع" - Stack Layout
   كل مشروع ياخد سطر كامل: صورة من جهة ومحتوى من الجهة التانية،
   وبيتبادل الاتجاه كل مرة. بيظهر بأنيميشن انزلاق + تكبير لما
   يوصله السكرول، والموقع اللي بعده بيظهر بنفس الطريقة بعده.
   ========================================================== */

.pms-stack {
    --pms-accent: #6c5ce7;
    max-width: 1180px;
    margin: 50px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 90px;
}

.pms-row {
    display: flex;
    align-items: center;
    gap: 55px;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity .9s cubic-bezier(.16,.8,.24,1), transform .9s cubic-bezier(.16,.8,.24,1);
}

.pms-row.pms-row-reverse {
    flex-direction: row-reverse;
}

.pms-row.pms-in-view {
    opacity: 1;
    transform: translateY(0);
}

/* جزء الصورة */
.pms-row-media {
    flex: 1.15;
    min-width: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #14141a;
    box-shadow: 0 25px 60px rgba(0,0,0,0.22);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 1s cubic-bezier(.16,.8,.24,1) .12s, opacity 1s ease .12s;
}

.pms-row.pms-in-view .pms-row-media {
    transform: scale(1);
    opacity: 1;
}

.pms-row-media .pms-shot-wrap {
    aspect-ratio: 16/10;
    max-height: 380px;
}

.pms-row-media .pms-shot {
    transition: transform .8s cubic-bezier(.16,.8,.24,1);
}

.pms-row-media:hover .pms-shot {
    transform: scale(1.06);
}

/* جزء المحتوى (العنوان، الوصف، الأزرار) */
.pms-row-content {
    flex: 1;
    min-width: 0;
    position: relative;
    padding: 10px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s ease .28s, transform .8s cubic-bezier(.16,.8,.24,1) .28s;
}

.pms-row.pms-in-view .pms-row-content {
    opacity: 1;
    transform: translateY(0);
}

.pms-row-number {
    display: block;
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--pms-accent);
    margin-bottom: 10px;
}

.pms-row-title {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.25;
    font-weight: 800;
    color: #16161c;
}

.pms-row-desc {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.8;
    color: #55555f;
    max-width: 46ch;
}

.pms-row .pms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.pms-tag-light {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(108,92,231,0.09);
    border: 1px solid rgba(108,92,231,0.25);
    color: #4b4b55;
}

.pms-row .pms-visit {
    position: static;
}

@media (max-width: 820px) {
    .pms-stack { gap: 70px; }
    .pms-row, .pms-row.pms-row-reverse {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }
    .pms-row-title { font-size: 24px; }
}

/* ==========================================================
   تصميم "الكروت المقلوبة" - Flip Reveal Layout
   كروت بورتريه بتبان مقلوبة (واقعة) وبترجع تقف واحدة ورا التانية
   وهي بتظهر بالسكرول، زي معرض أعمال استوديو تصميم.
   ========================================================== */

.pms-flip-wrap {
    --pms-accent: #6c5ce7;
    max-width: 1180px;
    margin: 60px auto;
    padding: 0 20px;
}

.pms-flip-heading {
    position: sticky;
    top: 24px;
    z-index: 3;
    font-size: 30px;
    font-weight: 800;
    margin: 0 0 34px;
    padding: 10px 0 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    color: #16161c;
    background: rgba(255,255,255,0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.pms-flip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    justify-content: center;
}

.pms-flip-card {
    flex: 1 1 240px;
    max-width: 280px;
    opacity: 0;
    transform-origin: bottom center;
    transform: perspective(2000px) rotateX(90deg) scale(0.5);
    transition: transform 1.1s cubic-bezier(.16,.9,.2,1), opacity .6s ease;
    transition-delay: var(--pms-flip-delay, 0ms);
}

.pms-flip-card.pms-in-view {
    opacity: 1;
    transform: perspective(1400px) rotateX(0deg) scale(1);
}

.pms-flip-thumb {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    background: #111117;
    cursor: pointer;
}

.pms-flip-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    display: block;
    transition: transform .7s cubic-bezier(.2,.9,.25,1);
}

.pms-flip-card:hover .pms-flip-thumb img {
    transform: scale(1.08);
}

/* الليبل اللي بيتحرك مع الماوس فوق الصورة */
.pms-flip-cursor-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    pointer-events: none;
    background: var(--pms-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition: opacity .25s ease, transform .25s ease;
}

.pms-flip-thumb.pms-cursor-active .pms-flip-cursor-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.pms-flip-meta {
    text-align: center;
    padding-top: 14px;
}

.pms-flip-name {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #16161c;
}

.pms-flip-sub {
    font-size: 11.5px;
    font-family: monospace;
    color: #93939c;
}

/* الزرار الدائري تحت الكروت */
.pms-flip-cta-wrap {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}

.pms-flip-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    text-decoration: none;
    color: #16161c;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    overflow: hidden;
    transition: color .4s ease, transform .25s ease;
}

.pms-flip-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--pms-accent);
    transform: scale(0);
    transition: transform .5s cubic-bezier(.2,.9,.25,1);
    z-index: 0;
}

.pms-flip-cta span {
    position: relative;
    z-index: 1;
}

.pms-flip-cta:hover {
    color: #fff;
}

.pms-flip-cta:hover::before {
    transform: scale(1);
}

@media (max-width: 640px) {
    .pms-flip-heading { font-size: 24px; }
    .pms-flip-card { flex: 1 1 140px; max-width: 45%; }
    .pms-flip-cta { width: 120px; height: 120px; font-size: 12.5px; }
}

/* دعم تفضيل تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
    .pms-card, .pms-shot, .pms-overlay, .pms-visit, .pms-arrow,
    .pms-row, .pms-row-media, .pms-row-content,
    .pms-flip-card, .pms-flip-thumb img, .pms-flip-cta {
        transition: none !important;
        transform: none !important;
    }
    .pms-card, .pms-row, .pms-row-media, .pms-row-content, .pms-flip-card { opacity: 1; }
}
