@font-face {
    font-family: "YekanBakh";
    src: url("../fonts/YekanBakhFaNum-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "YekanBakh";
    src: url("../fonts/YekanBakhFaNum-SemiBold.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: "YekanBakh", "Yekan Bakh", "IRANYekan", "Yekan", sans-serif;
    direction: rtl;
    text-align: right;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.float-orb {
    animation: orb-float 10s ease-in-out infinite;
}

.stars {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.25) 0, transparent 60%),
        radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.2) 0, transparent 60%),
        radial-gradient(1px 1px at 55% 35%, rgba(255, 255, 255, 0.18) 0, transparent 60%),
        radial-gradient(1px 1px at 72% 60%, rgba(255, 255, 255, 0.22) 0, transparent 60%),
        radial-gradient(1px 1px at 85% 25%, rgba(255, 255, 255, 0.2) 0, transparent 60%),
        radial-gradient(1px 1px at 15% 55%, rgba(255, 255, 255, 0.16) 0, transparent 60%);
    animation: twinkle 8s ease-in-out infinite;
}

@keyframes orb-float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(16px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes twinkle {
    0% {
        opacity: 0.28;
    }
    50% {
        opacity: 0.45;
    }
    100% {
        opacity: 0.28;
    }
}

.hero-svg .scan-overlay {
    mix-blend-mode: screen;
    opacity: 0.45;
}

.hero-frame {
    position: relative;
}

.hero-frame::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: -22px;
    height: 38px;
    background: radial-gradient(60% 100% at 50% 0%, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
    filter: blur(6px);
    pointer-events: none;
}

.card-hover {
    position: relative;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}

.card-hover__overlay {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.8s ease, transform 1.2s ease;
}

.card-hover:hover .card-hover__overlay {
    opacity: 1;
    transform: translateY(0);
}

.card-hover::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(60% 60% at 50% 50%, rgba(120, 140, 255, 0.35), rgba(120, 140, 255, 0));
    opacity: 0;
    transform: translateZ(20px);
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.card-hover::after {
    content: "";
    position: absolute;
    inset: -120% -60%;
    background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.12) 45%, transparent 65%);
    opacity: 0;
    transform: translateX(-30%) translateZ(30px);
    transition: opacity 0.8s ease, transform 1.4s ease;
    pointer-events: none;
}

.card-hover:hover {
    transform: translateY(-4px) rotateX(1deg) rotateY(-0.8deg) scale(1.01);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(140, 160, 255, 0.12);
}

.service-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
    border-radius: 30px;
}

.service-card__link {
    position: absolute;
    left: 14px;
    bottom: 14px;
    right: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(120, 140, 255, 0.22);
    background: rgba(14, 16, 26, 0.75);
    color: #c7d2ff;
    font-size: 12px;
    transform: translate3d(0, 0, 0);
    z-index: 2;
    transition: border-color 0.4s ease, background 0.4s ease;
}

.service-card__link:hover {
    border-color: rgba(120, 140, 255, 0.55);
    background: rgba(20, 24, 40, 0.9);
}

.service-card:hover .service-card__link {
    transform: translate3d(0, 0, 0);
}

.service-card__favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.service-card__link-icon {
    width: 14px;
    height: 14px;
}

.hero-cta,
.hero-cta-outline {
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hero-cta__label {
    line-height: 1;
    display: inline-block;
    transform: translateY(1px);
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(120, 140, 255, 0.35);
    background: rgba(16, 18, 30, 0.88);
    color: #d7ddff;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 120;
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: rgba(120, 140, 255, 0.7);
    background: rgba(22, 26, 44, 0.95);
}

.service-card::before {
    content: "";
    position: absolute;
    inset: -60% -40%;
    background: radial-gradient(40% 40% at 50% 50%, rgba(120, 140, 255, 0.25), rgba(120, 140, 255, 0));
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}

.service-card::after {
    content: "";
    position: absolute;
    inset: -120% -80%;
    background: conic-gradient(from 120deg, rgba(110, 130, 255, 0.0), rgba(110, 130, 255, 0.2), rgba(110, 130, 255, 0.0));
    opacity: 0;
    transform: translateZ(20px) rotate(0deg);
    transition: opacity 0.6s ease, transform 1.4s ease;
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(120, 140, 255, 0.18);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover::after {
    opacity: 1;
    transform: translateZ(20px) rotate(180deg);
}

.service-card .text-indigo-500,
.service-card h2,
.service-card p {
    transition: transform 0.7s ease, color 0.7s ease, opacity 0.7s ease;
}

.service-card:hover h2 {
    transform: translateY(-2px);
}

.service-card:hover .text-indigo-500 {
    color: #9fb1ff;
}

.icon-spark {
    position: relative;
    overflow: visible;
    transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.icon-spark::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 10px;
    background: radial-gradient(60% 60% at 50% 50%, rgba(120, 160, 255, 0.6), rgba(120, 160, 255, 0));
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.4s ease, transform 0.6s ease;
    pointer-events: none;
}

.icon-spark img {
    filter: drop-shadow(0 0 0 rgba(140, 170, 255, 0));
    transition: filter 0.4s ease, transform 0.4s ease;
}

.icon-spark:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(140, 170, 255, 0.3);
}

.icon-spark:hover::after {
    opacity: 1;
    transform: scale(1.1);
}

.icon-spark:hover img {
    filter: drop-shadow(0 0 10px rgba(140, 170, 255, 0.75));
    transform: translateY(-1px);
}

.project-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    background: linear-gradient(180deg, rgba(20, 22, 36, 0.6), rgba(10, 10, 18, 0.9));
    border: 1px solid rgba(120, 140, 255, 0.18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.project-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-card__lang {
    font-size: 12px;
    color: #9fb1ff;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(120, 140, 255, 0.35);
    background: rgba(120, 140, 255, 0.08);
}

.project-card__title {
    min-height: 28px;
}

.project-card__desc {
    min-height: 54px;
}

.project-card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.project-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(120, 140, 255, 0.35);
    background: rgba(120, 140, 255, 0.08);
    color: #c7d2ff;
    transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.project-card__btn:hover {
    transform: translateY(-2px);
    background: rgba(120, 140, 255, 0.18);
    border-color: rgba(120, 140, 255, 0.6);
}

.github-icon {
    width: 16px;
    height: 16px;
}

.news-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
    background: linear-gradient(180deg, rgba(16, 18, 30, 0.7), rgba(8, 8, 14, 0.95));
    border: 1px solid rgba(90, 110, 220, 0.2);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.news-card__title {
    min-height: 28px;
}

.news-card__excerpt {
    min-height: 64px;
}

.news-card__meta {
    margin-top: auto;
}

@media (max-width: 768px) {
    .mobile-app {
        border-radius: 28px;
        padding: 18px;
        background: rgba(12, 12, 20, 0.75);
        border: 1px solid rgba(120, 140, 255, 0.22);
        box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(18px) saturate(120%);
    }

    .hero-frame {
        display: none;
    }

    .service-card {
        margin: 0 5px;
    }
    
}
.card-hover:hover::before {
    opacity: 1;
}

.card-hover:hover::after {
    opacity: 1;
    transform: translateX(30%) translateZ(30px);
}

.hero-svg [fill="#2b2b2b"],
.hero-svg [fill="#2d2d2d"],
.hero-svg [fill="#282828"],
.hero-svg [fill="#303030"] {
    animation: line-pulse 2.6s ease-in-out infinite;
}

.hero-svg [fill="#2f2f2f"] {
    animation: line-pulse 3.1s ease-in-out infinite;
}

.hero-svg [fill="#2b2b2b"] {
    animation-delay: 0ms;
}

.hero-svg [fill="#2d2d2d"] {
    animation-delay: 300ms;
}

.hero-svg [fill="#282828"] {
    animation-delay: 600ms;
}

.hero-svg [fill="#303030"] {
    animation-delay: 900ms;
}

@keyframes line-pulse {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a12;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4f6bff, #6d3bff, #9b3dff);
    border-radius: 999px;
    border: 2px solid #0a0a12;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5f7bff, #7a49ff, #b64bff);
}

* {
    scrollbar-width: thin;
    scrollbar-color: #3529a7 #000000;
}
