:root {
    --bg-primary: #050816;
    --bg-secondary: #0B1026;
    --accent1: #5B5FEF;
    --accent2: #8E2DE2;
    --accent3: #00E5FF;
    --text: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: .3s ease;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-primary);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.8;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

p {
    line-height: 2;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    z-index: 9999;
    background: linear-gradient(90deg,
            var(--accent1),
            var(--accent3));
}

.back-to-top {

    position: fixed;

    bottom: 30px;

    left: 30px;

    width: 55px;

    height: 55px;

    border: none;

    border-radius: 50%;

    cursor: pointer;

    background: rgba(255, 255, 255, .08);

    backdrop-filter: blur(15px);

    border: 1px solid rgba(255, 255, 255, .15);

    color: var(--accent3);

    font-size: 20px;

    display: flex;

    align-items: center;

    justify-content: center;

    opacity: 0;

    visibility: hidden;

    transform: translateY(20px);

    transition: var(--transition);

    z-index: 999;

}

.back-to-top.show {

    opacity: 1;

    visibility: visible;

    transform: translateY(0);

}

.back-to-top:hover {

    transform: translateY(-6px);

    color: white;

    background: linear-gradient(135deg,
            var(--accent1),
            var(--accent2));

    box-shadow: 0 10px 30px rgba(91, 95, 239, .35);

}

#star-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.mouse-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 95, 239, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: left var(--transition) ease, top var(--transition) ease;
}

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.navbar-custom {
    background: rgba(5, 8, 22, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.navbar-custom .nav-link {
    color: var(--text);
    font-weight: 500;
    transition: color var(--transition);
}

.navbar-custom .nav-link:hover {
    color: var(--accent3);
}

.navbar-brand {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent1), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section {
    min-height: calc(100 * min(var(--vh, 1vh), 1vh));
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
}

.hero-subtitle {
    color: var(--accent3);
    font-size: 1.2rem;
    min-height: 2em;
}

.hero-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--accent3);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-right: 4px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0
    }
}

.profile-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.profile-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.glow-ring {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    border: 2px solid var(--accent1);
    animation: rotateRing 6s linear infinite;
}

.glow-ring:nth-child(2) {
    inset: -25px;
    border-color: var(--accent2);
    animation-duration: 8s;
    animation-direction: reverse;
}

.glow-ring:nth-child(3) {
    inset: -35px;
    border-color: var(--accent3);
    animation-duration: 10s;
    opacity: 0.5;
}

@keyframes rotateRing {
    to {
        transform: rotate(360deg)
    }
}

.btn-cosmic {
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    border: none;
    color: #fff;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    transition: transform var(--transition), box-shadow 0.3s;
}

.btn-cosmic:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(91, 95, 239, 0.4);
    color: #fff;
}

.btn-cosmic:active {
    transform: scale(0.97);
}

.btn-outline-cosmic {
    border: 2px solid var(--accent3);
    color: var(--accent3);
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    background: transparent;
    transition: all var(--transition);
}

.btn-outline-cosmic:hover {
    background: var(--accent3);
    color: var(--bg-primary);
}


.contact-heading {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.contact-description {
    color: rgba(255, 255, 255, .7);
    line-height: 1.9;
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 18px;
}

.contact-info {
    flex: 1;
}

.copy-btn {

    width: 42px;
    height: 42px;

    border: none;

    border-radius: 50%;

    background: rgba(255, 255, 255, .06);

    color: var(--accent3);

    cursor: pointer;

    transition: .3s;

}


.copy-btn:hover {

    background: var(--accent1);

    color: #fff;

    transform: scale(1.08);

}


.contact-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);

    color: var(--accent3);

    font-size: 22px;

    transition: .3s;
}

.contact-item:hover .contact-icon {

    transform: translateY(-5px);

    background: var(--accent1);

    color: #fff;

    box-shadow: 0 10px 25px rgba(91, 95, 239, .35);

}

.contact-item h6 {

    margin: 0;

    font-weight: 700;

    color: #fff;

}

.contact-item span {

    color: rgba(255, 255, 255, .65);

    font-size: .95rem;

}


/* focus */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent3);
    outline-offset: 4px;
}

section {
    scroll-margin-top: 90px;
    position: relative;
    z-index: 2;
    padding: 100px 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
}

.section-title span {
    background: linear-gradient(135deg, var(--accent1), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-bar-wrap {
    margin-bottom: 24px;
}

.skill-bar-wrap label {
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.skill-bar {
    height: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent3), var(--accent1));
    width: 0;
    transition: width 1.5s ease;
}

.timeline {
    position: relative;
    padding-right: 30px;
    border-right: 2px solid var(--accent1);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-right: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    right: -36px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent3);
    box-shadow: 0 0 10px var(--accent3);
}

.timeline-date {
    color: var(--accent3);
    font-size: 0.85rem;
    font-weight: 600;
}

.project-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: transform 0.4s, box-shadow 0.4s;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(91, 95, 239, 0.3);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-card .card-body {
    padding: 20px;
}

.tech-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: rgba(91, 95, 239, 0.2);
    color: var(--accent3);
    margin: 2px;
}

.stat-card {
    text-align: center;
    padding: 40px 20px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent1), var(--accent3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.interest-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-size: 1.8rem;
    color: var(--accent3);
    margin: 0 auto 10px;
    transition: transform 0.3s;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

.form-control-cosmic {
    background: rgba(255, 255, 255, 0.05);
    direction: rtl;
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 12px;
    padding: 14px;
    transition: border-color 0.3s;
}

.form-control-cosmic:focus {
    border-color: var(--accent3);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.form-control-cosmic::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 40px 0 20px;
    position: relative;
    z-index: 2;
}

.footer a {
    color: var(--accent3);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--accent1);
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.shooting-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    z-index: 0;
    animation: shoot 2s linear infinite;
    opacity: 0;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), transparent);
    transform: rotate(45deg);
    transform-origin: right;
}



::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent1);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent3);
}

::selection {
    background: var(--accent1);
    color: #fff;
}

@keyframes shoot {
    0% {
        transform: translate(0, 0);
        opacity: 1
    }

    100% {
        transform: translate(300px, 300px);
        opacity: 0
    }
}

@media(max-width:768px) {
    .profile-wrapper {
        width: 200px;
        height: 200px;
    }

    .scroll-progress {
        display: none !important;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    section {
        padding: 60px 0;
    }
}

@media (max-width:992px) {

    .profile-wrapper {

        margin-bottom: 40px;

    }

}



@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto;
    }
}