.ghost-slider,
.ghost-slider * {
    box-sizing: border-box;
    font-family: "Vazirmatn", "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-style: normal;
}

.ghost-slider {
    position: relative;
    padding: 1.5rem 0 4rem;
    margin-bottom: 3.5rem;
    overflow: hidden;
    contain: layout style;
}

.ghost-slider .slide:first-child .card {
    visibility: visible;
}

.ghost-slider .swiper {
    position: relative;
    top: 0;
}

.ghost-slider .slide-container,
.ghost-slider .slide-wrapper {
    width: 100%;
}

/* --- Timer inside card, top-right --- */

.ghost-slider .card {
    position: relative;
}

.ghost-slider .autoplay-progress-bar {
    --progress: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--progress);
    height: 3px;
    background-color: var(--progress-color);
    z-index: 8;
}

.ghost-slider .autoplay-progress {
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    z-index: 9;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--progress-color);
    background: rgba(0, 0, 0, 0.22);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.ghost-slider .autoplay-progress svg {
    --progress: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    stroke-width: 2.5px;
    stroke: var(--progress-color);
    fill: none;
    stroke-dashoffset: calc(125.6px * (1 - var(--progress)));
    stroke-dasharray: 125.6;
    transform: rotate(-90deg);
}

/* --- Navigation & pagination --- */

.ghost-slider .slider-button {
    transition: 0.5s;
    outline: none;
    position: absolute;
    width: 100px;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.ghost-slider .slider-button svg {
    display: block;
    transition: 0.5s;
}

.ghost-slider .slider-button .slider-svg-circle-wrap {
    transition: 0.5s;
    transform-origin: -20px 40px;
    opacity: 1;
}

.ghost-slider .slider-button circle {
    transition: 0.5s;
    stroke-width: 2px;
    stroke: var(--progress-color);
    fill: none;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    opacity: 1;
    transform-origin: 0 0;
}

.ghost-slider .slider-button .slider-svg-arrow {
    transition: 0.5s;
    fill: var(--progress-color);
    transform: rotateY(180deg) translate(-55px, 36.1px) scale(1.75);
}

.ghost-slider .slider-button-prev {
    left: 24px;
}

.ghost-slider .slider-button-next {
    right: 24px;
}

.ghost-slider .swiper-button-disabled {
    display: none;
}

.ghost-slider .slider-button .slider-svg-wrap {
    transform: translateY(353px);
}

.ghost-slider .slider-button-next .slider-svg-wrap {
    transform: translateY(353px) rotateY(180deg);
    transform-origin: 80px 0 0;
}

.ghost-slider .slider-button .slider-svg-line {
    transition: 0.5s;
    stroke: var(--progress-color);
    stroke-width: 2;
    transform: translate(50px, 42px);
}

.ghost-slider .slider-button-prev:not(.slider-button-disabled):hover svg {
    transform: translate(-16px);
}

.ghost-slider .slider-button-next:not(.slider-button-disabled):hover svg {
    transform: translate(16px);
}

.ghost-slider .slider-button:not(.slider-button-disabled):hover .slider-svg-circle-wrap {
    transform: scale(1.1);
}

.ghost-slider .slider-button:not(.slider-button-disabled):hover circle {
    stroke-dasharray: 4px;
    stroke-dashoffset: 4px;
    opacity: 1;
}

.ghost-slider .slider-button:not(.slider-button-disabled):hover .slider-svg-arrow {
    transform: rotateY(180deg) translate(-40px, 36.1px) scale(1.75);
}

.ghost-slider .slider-button:not(.slider-button-disabled):hover .slider-svg-line {
    transform: translate(35px, 42px) scaleX(0.5);
}

.ghost-slider .swiper-pagination {
    text-align: center;
    padding-left: 0;
    bottom: 20px !important;
}

.ghost-slider .swiper-pagination .swiper-pagination-bullet {
    display: inline-block;
    margin: 2px;
    height: 6px;
    width: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.5s ease;
    border: 0;
}

.ghost-slider .swiper-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active {
    background: #fff;
    width: 25px;
}

/* --- Slide & card layout --- */

.ghost-slider .floating {
    animation: floatAnim 6s ease-in-out infinite;
}

.ghost-slider .slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ghost-slider .slide svg {
    max-height: 100%;
    width: auto;
    position: relative;
}

.ghost-slider .card {
    margin: auto;
    height: 70vh;
    width: 90vw;
    max-width: 1000px;
    border-radius: 50px;
    overflow: hidden;
}

.ghost-slider .card.slide-1 {
    background: linear-gradient(331deg, #2e0916 0%, #200a2b 100%);
}

.ghost-slider .card.slide-2 {
    background: linear-gradient(331deg, #8a87c1 0%, #e8cafb 100%);
}

.ghost-slider .card.slide-3 {
    background: linear-gradient(331deg, #5b874b 0%, #0c3720 100%);
}

.ghost-slider .svg-wrapper {
    width: 100%;
    height: 100%;
    text-align: center;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    top: -15%;
}

.ghost-slider .slide:nth-child(odd) .svg-wrapper {
    left: -22%;
}

.ghost-slider .slide:nth-child(even) .svg-wrapper {
    right: -22%;
    top: 0;
}

.ghost-slider .slide:nth-child(even) svg {
    height: 80%;
}

.ghost-slider .card-content {
    max-width: 445px;
    width: 100%;
    position: relative;
    top: 5%;
    padding: 0 24px;
}

.ghost-slider .slide:nth-child(odd) .card-content {
    margin-left: auto;
}

.ghost-slider .slide:nth-child(even) .card-content {
    margin-right: auto;
    margin-left: 5%;
}

/* Slide 2 text alignment (desktop & mobile) */
.ghost-slider .card.slide-2 .card-content {
    text-align: center;
}

.ghost-slider .card.slide-2 .card-description {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.ghost-slider .card-ghost-info {
    position: absolute;
    bottom: 8%;
    line-height: 1;
    color: #ffffff;
    font-size: 1vw;
    font-weight: 400;
}

.ghost-slider .ghost-name {
    font-size: 1.5vw;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: bold;
}

.ghost-slider .card-ghost-info span {
    height: 70px;
    display: inline-block;
    width: 0.5px;
    background-color: var(--color);
    position: absolute;
    bottom: 0;
}

.ghost-slider .card-ghost-info span::before {
    content: "";
    height: 5px;
    width: 5px;
    background-color: var(--color);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
}

/* hide vertical accent line + dot in all slides */
.ghost-slider .card-ghost-info span {
    display: none;
}

.ghost-slider .slide:nth-child(odd) .card-ghost-info {
    left: 8%;
    text-align: right;
}

.ghost-slider .slide:nth-child(even) .card-ghost-info {
    right: 8%;
    text-align: left;
}

.ghost-slider .slide:nth-child(odd) .card-ghost-info span {
    right: -15px;
}

.ghost-slider .slide:nth-child(even) .card-ghost-info span {
    left: -15px;
}

.ghost-slider .card-title {
    max-width: 320px;
    color: var(--color);
    font-weight: bold;
    font-size: 3vw;
    line-height: 1;
    margin: 14px 0 25px;
    text-transform: uppercase;
    position: relative;
}

.ghost-slider .card-title::before,
.ghost-slider .card-title::after {
    content: none;
    animation: none;
}

.ghost-slider .card-sub-title {
    color: var(--color);
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1.1vw;
}

.ghost-slider .card-description {
    color: var(--color);
    font-weight: 500;
    font-size: 0.9vw;
    max-width: 300px;
}

.ghost-slider .card-description--contact {
    max-width: 360px;
    font-size: 0.7rem;
    line-height: 1.5;
}

.ghost-slider .card-cta {
    margin-top: 30px;
}

.ghost-slider .cta-button {
    display: inline-flex;
    padding: 20px 40px;
    background-color: var(--color);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    text-decoration: none;
    text-align: center;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-weight: bold;
    width: 161px;
    height: 81px;
    clip-path: polygon(
        7.68786px 20.1081px,
        7.68786px 20.1081px,
        8.16364px 18.1351px,
        8.88914px 16.2804px,
        9.8446px 14.5617px,
        11.0103px 12.9969px,
        12.3663px 11.6038px,
        13.8931px 10.4002px,
        15.5708px 9.4038px,
        17.3796px 8.63251px,
        19.2998px 8.10411px,
        21.3116px 7.83638px,
        132.489px 0.710935px,
        132.489px 0.710935px,
        134.441px 0.714334px,
        136.343px 0.968456px,
        138.174px 1.46024px,
        139.914px 2.17663px,
        141.544px 3.10456px,
        143.044px 4.23098px,
        144.393px 5.54282px,
        145.572px 7.02703px,
        146.562px 8.67054px,
        147.341px 10.4603px,
        159.738px 44.9529px,
        159.738px 44.9529px,
        160.432px 47.6413px,
        160.613px 50.3152px,
        160.314px 52.9198px,
        159.569px 55.4005px,
        158.412px 57.7025px,
        156.877px 59.7713px,
        154.996px 61.5521px,
        152.804px 62.9903px,
        150.334px 64.0311px,
        147.621px 64.62px,
        16.6807px 80.5984px,
        16.6807px 80.5984px,
        13.7927px 80.6726px,
        11.051px 80.2112px,
        8.50526px 79.2659px,
        6.20477px 77.8885px,
        4.19901px 76.131px,
        2.53742px 74.045px,
        1.26946px 71.6825px,
        0.444554px 69.0952px,
        0.11216px 66.335px,
        0.321718px 63.4536px,
        7.68786px 20.1081px
    );
    transition: all 0.3s ease;
}

.ghost-slider .cta-button:hover {
    background-color: #fff;
    color: var(--color);
}

.ghost-slider .slide-1-eye {
    animation: move 5s ease-out infinite;
}

.ghost-slider .blink {
    animation: blink 2.4s infinite;
}

.ghost-slider .swing {
    animation: swing 6s ease-in-out infinite;
    transform-origin: left;
}

.ghost-slider .swiper-slide-active .card-cta {
    animation: bounce;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.ghost-slider .swiper-slide-active .card-ghost-info div {
    animation: fadeInLeft;
    animation-duration: 1.5s;
    animation-delay: 0.3s;
}

.ghost-slider .swiper-slide-active .card-title {
    animation: jackInTheBox;
    animation-duration: 1s;
    animation-delay: 0.8s;
}

.ghost-slider .swiper-slide-active .card-sub-title {
    animation: bounceIn;
    animation-duration: 1s;
    animation-delay: 0.5s;
}

.ghost-slider .swiper-slide-active .card-description {
    animation: bounceIn;
    animation-duration: 1s;
    animation-delay: 0.1s;
}

@media (max-width: 900px) {
    .ghost-slider .swiper {
        top: 0;
    }

    .ghost-slider .slide svg {
        max-width: 80%;
    }

    .ghost-slider .slide:nth-child(odd) svg {
        height: 350px;
        width: 350px;
    }

    .ghost-slider .slide:nth-child(even) svg {
        height: 300px;
        width: 300px;
    }

    .ghost-slider .slide:nth-child(odd) .svg-wrapper,
    .ghost-slider .slide:nth-child(even) .svg-wrapper {
        left: 0;
        right: 0;
        height: auto;
        width: 90%;
        margin: 0 auto;
        top: -10%;
    }

    .ghost-slider .slide:nth-child(even) .svg-wrapper {
        top: -2%;
    }

    .ghost-slider .slide:nth-child(even) .card-content,
    .ghost-slider .slide:nth-child(odd) .card-content {
        max-width: 100%;
        margin: 0;
        text-align: center;
    }

    .ghost-slider .card {
        height: 82vh;
    }

    .ghost-slider .card-title {
        font-size: 26px;
        margin-left: auto;
        margin-right: auto;
    }

    .ghost-slider .card-sub-title {
        font-size: 12px;
    }

    .ghost-slider .card-description {
        font-size: 1rem;
        line-height: 2;
        margin-left: auto;
        margin-right: auto;
    }

    .ghost-slider .card-description--contact {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    /* روی موبایل، برای کاهش LCP، تصویرهای SVG تزئینی را مخفی می‌کنیم
       (پس‌زمینه گرادیانی و متن و CTA کاملاً حفظ می‌شوند). */
    .ghost-slider .svg-wrapper {
        display: none;
    }

    /* Slide 2 & 3: قرار دادن متن نزدیک پایین کارت روی موبایل/تبلت */
    .ghost-slider .card.slide-2 .card-content,
    .ghost-slider .card.slide-3 .card-content {
        top: 0;
        padding: 0 1.2rem 2.4rem;
        display: flex;
        flex-direction: column;
    }

    .ghost-slider .card.slide-2 .card-content > div:first-child,
    .ghost-slider .card.slide-3 .card-content > div:first-child {
        margin-bottom: 0.8rem;
    }

    .ghost-slider .card.slide-2 .card-sub-title,
    .ghost-slider .card.slide-3 .card-sub-title {
        margin-top: auto;
    }

    .ghost-slider .card-cta {
        margin-top: 10px;
    }

    .ghost-slider .cta-button {
        transform: scale(0.7);
    }

    .ghost-slider .card-cta .cta-button {
        margin-left: auto;
        margin-right: auto;
    }

    .ghost-slider .card-ghost-info {
        bottom: unset;
        top: 25%;
    }

    .ghost-slider .ghost-name {
        font-size: 10px;
    }

    .ghost-slider .card-ghost-info {
        font-size: 8px;
    }

    .ghost-slider .slide:nth-child(odd) .card-ghost-info {
        left: 3%;
    }

    .ghost-slider .slide:nth-child(even) .card-ghost-info {
        right: 3%;
    }
}

@media (max-width: 768px) {
    .ghost-slider {
        padding-top: 0.3rem;
        margin-top: -1.8rem;
    }

    .ghost-slider .autoplay-progress {
        top: 0.6rem;
        /* روی موبایل بلور را حذف می‌کنیم تا رندر سبک‌تر شود */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.35);
    }

    .ghost-slider .card-content {
        top: 6%;
        padding: 0 1.2rem 2rem;
    }

    /* Slide 2 & 3: متن + تصویر وسط کارت روی موبایل
       (بدون تغییر روی اسلاید اول) */
    .ghost-slider .card.slide-2,
    .ghost-slider .card.slide-3 {
        display: flex;
        flex-direction: column;
        justify-content: center; /* وسط عمودی کارت */
    }

    .ghost-slider .card.slide-2 .card-content,
    .ghost-slider .card.slide-3 .card-content {
        position: relative;
        top: auto;
        bottom: auto;
        padding: 0 1.2rem 1.8rem;
        width: 100%;
        z-index: 2;
    }

    .ghost-slider .card.slide-2 .card-content > div:first-child,
    .ghost-slider .card.slide-3 .card-content > div:first-child {
        margin-bottom: 1rem; /* فقط کمی فاصله بین تصویر و متن */
    }

    /* روی موبایل، انیمیشن‌های بی‌وقفه اسلایدر را غیرفعال می‌کنیم
       تا مصرف CPU/GPU و رندر کمتر شود. ظاهر کلی ثابت می‌ماند. */
    .ghost-slider .floating,
    .ghost-slider .slide-1-eye,
    .ghost-slider .blink,
    .ghost-slider .swing {
        animation: none !important;
    }
}

/* ---------- Desktop layout tweaks (PC only) ---------- */
@media (min-width: 901px) {
    .ghost-slider .card {
        width: 80vw;
        height: 72vh;
    }

    .ghost-slider .svg-wrapper {
        display: none;
    }

    .ghost-slider .card-content {
        max-width: 520px;
        margin: 0 auto;
        top: 10%;
        text-align: center;
    }

    .ghost-slider .card-description,
    .ghost-slider .card-description--contact {
        max-width: 520px;
    }

    .ghost-slider .card-title {
        max-width: 520px;
        font-size: 2.4vw;
        line-height: 1.15;
        margin: 12px auto 22px;
    }

    /* روی دسکتاپ: اسلاید ۲ وسط کارت قرار بگیرد (بدون اثر روی اسلاید ۱ و ۳) */
    .ghost-slider .card.slide-2 {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ghost-slider .card.slide-2 .card-content {
        position: relative;
        top: 0;
        margin: 0 auto;
    }

    /* روی دسکتاپ: بزرگ‌تر کردن تصویر و متن در اسلاید ۲ و ۳ */
    .ghost-slider .card.slide-2 img,
    .ghost-slider .card.slide-3 img {
        max-width: 320px !important;
    }

    .ghost-slider .card.slide-2 .card-title,
    .ghost-slider .card.slide-3 .card-title {
        font-size: 2.8vw;
    }

    .ghost-slider .card.slide-2 .card-sub-title,
    .ghost-slider .card.slide-3 .card-sub-title {
        font-size: 1.3vw;
    }

    .ghost-slider .card.slide-2 .card-description,
    .ghost-slider .card.slide-3 .card-description {
        font-size: 1.05vw;
    }
}

@keyframes floatAnim {
    0% {
        transform: translateY(-25px);
    }

    50% {
        transform: translateY(25px);
    }

    100% {
        transform: translateY(-25px);
    }
}

@keyframes glitch-1 {
    0% {
        clip: rect(40px, 800px, 70px, 0);
    }

    15% {
        clip: rect(130px, 800px, 131px, 0);
    }

    50% {
        clip: rect(90px, 800px, 96px, 0);
    }

    75% {
        clip: rect(125px, 800px, 185px, 0);
    }

    87% {
        clip: rect(70px, 800px, 100px, 0);
    }

    100% {
        clip: rect(130px, 800px, 130px, 0);
    }
}

@keyframes glitch-2 {
    0% {
        clip: rect(20px, 800px, 80px, 0);
    }

    15% {
        clip: rect(100px, 800px, 105px, 0);
    }

    50% {
        clip: rect(100px, 800px, 95px, 0);
    }

    75% {
        clip: rect(60px, 800px, 60px, 0);
    }

    87% {
        clip: rect(145px, 800px, 160px, 0);
    }

    100% {
        clip: rect(185px, 800px, 185px, 0);
    }
}

@keyframes move {
    0% {
        transform: none;
    }

    20% {
        transform: translateX(-50px) translateY(10px) scale(0.95);
    }

    25%,
    44% {
        transform: none;
    }

    50%,
    60% {
        transform: translateX(50px) translateY(-20px) scale(0.95);
    }

    66%,
    100% {
        transform: none;
    }
}

@keyframes swing {
    0% {
        transform: translateY(-25px) rotate(10deg) scale(1);
    }

    50% {
        transform: translateY(25px) rotate(-5deg) scale(1.1);
    }

    100% {
        transform: translateY(-25px) rotate(10deg) scale(1);
    }
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

