/* Projects page: the featured projects as a deck of layered cards (views/projects/_pj-featured.php, assets/js/projects-deck.js) */
.pk-wrap { padding: 70px 0 30px; }
.pk-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.pk-label { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 30px; color: #EE5D38; font-size: 14px; background: rgba(238, 93, 56, .1); }
.pk-nav { display: flex; align-items: center; gap: 12px; }
.pk-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 20px; background: #F1F1F6; }
.pk-tab { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 15px; color: #55536B; font-size: 13px; font-weight: 700; white-space: nowrap; transition: color .25s, background .25s, box-shadow .25s; }
html[dir="rtl"] .pk-tab { padding: 7px 8px 7px 14px; }
.pk-tab img { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; background: #fff; }
.pk-tab span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.pk-tab.is-on { color: #110E2D; background: #fff; box-shadow: 0 8px 18px -10px rgba(17, 14, 45, .35); }
.pk-tab-time { position: absolute; inset-inline: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: #EE5D38; transform: scaleX(0); transform-origin: var(--from, left); opacity: 0; }
html[dir="rtl"] .pk-tab-time { --from: right; }
.pk-tab.is-on .pk-tab-time { opacity: 1; }
.pk.is-running .pk-tab.is-on .pk-tab-time { animation: pkTime var(--pk-time, 7s) linear forwards; }
.pk.is-paused .pk-tab.is-on .pk-tab-time { animation-play-state: paused; }
@keyframes pkTime { to { transform: scaleX(1); } }
.pk-arrows { display: flex; gap: 6px; }
.pk-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: #110E2D; transition: transform .2s, background .2s; }
.pk-arrow:hover { background: #EE5D38; transform: translateY(-2px); }

/* the deck: every card in the same grid cell; --pos 0 is the front one, the rest peek out above it */
.pk-deck { position: relative; display: grid; padding-top: calc((min(var(--n), 3) - 1) * 22px); perspective: 1600px; touch-action: pan-y; }
.pk-card {
    --lift: min(var(--pos), 3);
    grid-area: 1 / 1;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: 40px;
    align-items: center;
    min-height: 540px;
    padding: 50px;
    border-radius: 36px;
    color: #fff;
    z-index: calc(20 - var(--pos));
    transform: translateY(calc(var(--lift) * -22px)) scale(calc(1 - var(--lift) * .05));
    transform-origin: 50% 0;
    box-shadow: 0 -16px 40px -30px rgba(17, 14, 45, .7), 0 34px 70px -34px rgba(17, 14, 45, .75);
    contain: layout paint;
    transition: transform .75s cubic-bezier(.2, .8, .2, 1);
}
.pk-card:not(.is-front)::after { content: ""; position: absolute; inset: 0; z-index: 1; background: rgba(17, 14, 45, .22); pointer-events: none; }
.pk-card:not(.is-front) > * { visibility: hidden; }
.pk-card:not(.is-front) > .pk-mark { visibility: visible; }
.pk-card.is-front > * { animation: pkIn .7s .12s cubic-bezier(.2, .8, .2, 1) both; }
.pk-card.is-front > .pk-visual { animation-delay: .22s; }
.pk-card.is-front > .pk-mark { animation: pkMark 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pkIn { from { opacity: 0; transform: translateY(18px); } }
@keyframes pkMark { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 60px)); } }
html[dir="rtl"] .pk-card { --dir: -1; }
.pk-card.is-leave { z-index: 30; animation: pkLeave .55s cubic-bezier(.5, 0, .75, 0) forwards; }
.pk-card.is-leave > * { visibility: visible; }
@keyframes pkLeave { to { transform: translate(calc(var(--dir, 1) * -16%), 70px) rotate(calc(var(--dir, 1) * -5deg)) scale(.92); opacity: 0; } }
.pk-card.is-enter { animation: pkEnter .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pkEnter { from { transform: translate(calc(var(--dir, 1) * -16%), 70px) rotate(calc(var(--dir, 1) * -5deg)) scale(.92); opacity: 0; } }

.pk-card.is-eec { background: radial-gradient(70% 90% at 15% 15%, #3B2C9B, transparent 70%), linear-gradient(150deg, #0B0920, #1B1550); }
.pk-card.is-fmut { background: radial-gradient(70% 90% at 85% 10%, #FF9A6B, transparent 70%), linear-gradient(150deg, #EE5D38, #B93A18); }
.pk-card.is-utept { background: radial-gradient(70% 90% at 15% 90%, #22B8E0, transparent 70%), linear-gradient(150deg, #06262E, #075A78); }
.pk-card.is-other { background: radial-gradient(70% 90% at 85% 10%, rgba(var(--tint), .85), transparent 70%), linear-gradient(150deg, #110E2D, #26214F); }
.pk-mark { position: absolute; z-index: -1; top: -26px; inset-inline-end: 24px; color: transparent; font-size: clamp(90px, 15vw, 210px); font-weight: 800; line-height: 1; white-space: nowrap; opacity: .3; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .55); pointer-events: none; }

.pk-copy { min-width: 0; }
.pk-chip { display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 6px 14px 6px 8px; border-radius: 30px; font-size: 12px; line-height: 1.6; background: rgba(255, 255, 255, .14); }
html[dir="rtl"] .pk-chip { padding: 6px 8px 6px 14px; }
.pk-chip img { flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 50%; object-fit: contain; background: #fff; }
.pk-claim { margin-top: 18px; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.35; }
.pk-name { margin-top: 12px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.7; }
.pk-client { margin-top: 6px; color: rgba(255, 255, 255, .72); font-size: 13px; line-height: 1.9; }
.pk-client b { display: inline-block; margin-inline-start: 6px; padding: 0 9px; border-radius: 8px; color: #fff; font-weight: 700; background: rgba(255, 255, 255, .14); }
.pk-text { max-width: 560px; margin-top: 10px; color: rgba(255, 255, 255, .8); font-size: 14px; line-height: 2.05; }
.pk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pk-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 15px; font-size: 14px; font-weight: 700; transition: transform .2s, background .2s; }
.pk-btn:hover { transform: translateY(-2px); }
.pk-btn-main { color: #110E2D; background: #fff; }
.pk-btn-line { color: #fff; border: 1.5px solid rgba(255, 255, 255, .4); }
.pk-btn-line:hover { background: rgba(255, 255, 255, .12); }

.pk-visual { position: relative; min-width: 0; padding-bottom: 26px; }
.pk-win { border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .65); transform: rotate(var(--tilt, -1.6deg)); }
html[dir="ltr"] .pk-win { --tilt: 1.6deg; }
.pk-win-bar { display: flex; align-items: center; gap: 5px; padding: 9px 12px; background: #EDEDF2; direction: ltr; }
.pk-win-bar i { width: 8px; height: 8px; border-radius: 50%; background: #C9C8D4; }
.pk-win-bar span { margin-left: 8px; padding: 2px 12px; border-radius: 8px; color: #55536B; font-size: 12px; background: #fff; }
.pk-win-page { height: 340px; overflow: hidden; }
.pk-win-page img, .pk-phone-page img { display: block; width: 100%; height: auto; backface-visibility: hidden; }
.pk-card.is-front .pk-win-page img, .pk-card.is-front .pk-phone-page img { will-change: transform; }
.pk.is-off .pk-card img, .pk.is-paused .pk-card img { animation-play-state: paused !important; }
.pk-card.is-front .pk-win-page img { animation: pkPage 34s ease-in-out 1s infinite alternate; }
.pk-card.is-front .pk-phone-page img { animation: pkPhone 26s ease-in-out 1.6s infinite alternate; }
@keyframes pkPage { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-100% + 340px), 0); } }
@keyframes pkPhone { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-100% + 300px), 0); } }
.pk-phone { position: absolute; bottom: 0; inset-inline-start: -22px; width: 150px; padding: 7px; border-radius: 28px; background: #110E2D; box-shadow: 0 24px 40px -16px rgba(0, 0, 0, .7), inset 0 0 0 1.5px rgba(255, 255, 255, .18); transform: rotate(calc(var(--tilt, -1.6deg) * -3)); }
html[dir="ltr"] .pk-phone { --tilt: 1.6deg; }
.pk-phone-page { height: 300px; overflow: hidden; border-radius: 21px; background: #fff; }

@media (max-width: 1023px) {
    .pk-card { grid-template-columns: minmax(0, 1fr); gap: 30px; min-height: 0; padding: 36px 28px; }
    .pk-visual { max-width: 560px; }
}
@media (max-width: 640px) {
    .pk-wrap { padding: 46px 0 20px; }
    .pk-head { align-items: stretch; flex-direction: column; }
    .pk-nav { justify-content: space-between; }
    .pk-tabs { overflow-x: auto; scrollbar-width: none; }
    .pk-tab span { display: none; }
    .pk-tab, html[dir="rtl"] .pk-tab { padding: 6px; }
    .pk-tab.is-on span { display: inline; }
    .pk-tab.is-on, html[dir="rtl"] .pk-tab.is-on { padding: 6px 12px 6px 6px; }
    html[dir="rtl"] .pk-tab.is-on { padding: 6px 6px 6px 12px; }
    .pk-card { padding: 26px 20px; border-radius: 26px; }
    .pk-claim { font-size: 25px; }
    .pk-text { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
    .pk-win-page { height: 220px; }
    @keyframes pkPage { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-100% + 220px), 0); } }
    .pk-phone { width: 104px; padding: 5px; border-radius: 20px; inset-inline-start: -6px; }
    .pk-phone-page { height: 200px; border-radius: 15px; }
    @keyframes pkPhone { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-100% + 200px), 0); } }
    .pk-btn { padding: 11px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .pk-card, .pk-card > *, .pk-card .pk-win-page img, .pk-card .pk-phone-page img, .pk-tab-time { animation: none !important; transition: none; }
}
