:root {
    --bg-dark: #0A0A10;
    --bg-card: rgba(22, 27, 34, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #EAEAEA;
    --text-secondary: #A0A0A0;
    --accent-glow: #4dffaf;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 25px 25px;
}

#cursor-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(77, 255, 175, 0.08) 0%, rgba(77, 255, 175, 0) 60%);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.3s;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

nav {
    background-color: rgba(10, 10, 16, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    z-index: 1000;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo a {
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
}

nav .logo span {
    color: var(--accent-glow);
}

.desktop-nav {
    list-style-type: none;
    display: flex;
}

.desktop-nav li {
    margin-right: 30px;
}

.desktop-nav li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.desktop-nav li a i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.desktop-nav li a:hover, .desktop-nav li a.active {
    color: var(--accent-glow);
}

.desktop-nav li a:hover i, .desktop-nav li a.active i {
    transform: scale(1.1);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 10, 16, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 8px 0;
    z-index: 999;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    font-size: 0.7rem;
    padding: 5px 10px;
}

.bottom-nav-link i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.bottom-nav-link.active {
    color: var(--accent-glow);
}

header {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

#three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-content {
    z-index: 1;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 700;
    line-height: 1.4;
}

.hero-content h1 span {
    color: var(--accent-glow);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
}

.scroll-down-indicator {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.scroll-down-indicator a {
    color: inherit;
    text-decoration: none;
}

.scroll-down-indicator .mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 60px;
    position: relative;
    margin: 0 auto 10px auto;
}

.scroll-down-indicator .mouse::before {
    content: '';
    width: 6px;
    height: 6px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-secondary);
    border-radius: 50%;
    opacity: 1;
    animation: wheel 2s infinite;
}

@keyframes wheel {
    to {
        opacity: 0;
        top: 20px;
    }
}

.section {
    padding: 100px 0;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 70px;
    font-weight: 700;
    color: #fff;
}

.section-title span {
    color: var(--accent-glow);
}

#about {
    background-color: rgba(22, 27, 34, 0.3);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 3rem;
}

.about-image {
    text-align: center;
}

.about-image img {
    width: 100%;
    max-width: 250px;
    border-radius: 50%;
    border: 3px solid var(--accent-glow);
}

.about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.about-content p {
    color: var(--text-secondary);
}

#journey {
    background-color: var(--bg-dark);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    right: 50%;
    margin-right: -2px;
}

.timeline-container {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-container.left {
    right: 50%;
}

.timeline-container.right {
    right: 0;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--bg-dark);
    border: 4px solid var(--accent-glow);
    top: 20px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-container.left::after {
    left: -10px;
}

.timeline-container.right::after {
    right: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    position: relative;
    border-radius: 8px;
}

.timeline-content h3 {
    color: var(--accent-glow);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 40px rgba(77, 255, 175, 0.15);
}

.project-card .project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-card .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 25px;
}

.project-content h3 {
    color: #fff;
    margin-bottom: 10px;
}

.project-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 16, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header h2 {
    color: var(--accent-glow);
    margin-bottom: 15px;
}

.modal-body img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 20px;
}

.modal-tech h4, .modal-links h4 {
    color: #fff;
    margin-bottom: 10px;
}

.modal-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin-bottom: 20px;
}

.modal-tech-list li {
    background-color: rgba(77, 255, 175, 0.1);
    color: var(--accent-glow);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal-links a {
    margin-left: 20px;
}

#skills {
    background-color: rgba(22, 27, 34, 0.3);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    width: 130px;
    text-align: center;
    transition: transform 0.3s;
}

.skill-card:hover {
    transform: scale(1.1);
}

.skill-card i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.skill-card p {
    font-weight: 500;
}

#contact .contact-intro {
    text-align: center;
    max-width: 600px;
    margin: -20px auto 50px auto;
    color: var(--text-secondary);
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.contact-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.contact-item i {
    font-size: 2.5rem;
    color: var(--accent-glow);
    margin-bottom: 15px;
}

.contact-item h3 {
    margin-bottom: 10px;
    color: #fff;
}

.contact-item p, .contact-item a {
    color: var(--text-secondary);
    font-size: 1rem;
    text-decoration: none;
    word-break: break-all;
}

.contact-item a:hover {
    color: var(--accent-glow);
}

footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
}

@media (max-width: 992px) {
    .desktop-nav {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    header {
        text-align: center;
    }

    #three-canvas {
        opacity: 0.2;
    }

    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 50px;
    }

    .section {
        padding: 80px 0;
    }

    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-image {
        margin-bottom: 2rem;
    }

    .timeline::after {
        right: auto;
        left: 20px;
        margin-right: 0;
    }

    .timeline-container {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
    }

    .timeline-container.right, .timeline-container.left {
        right: auto;
        left: 0;
    }

    .timeline-container.left::after, .timeline-container.right::after {
        left: 10px;
        right: auto;
    }

    .timeline-content {
        padding: 20px;
    }

    .projects-grid {
        gap: 20px;
    }

    .project-content {
        padding: 20px;
    }

    .skill-card {
        width: 100px;
        padding: 15px;
    }

    .skill-card i {
        font-size: 2.5rem;
    }

    .skill-card p {
        font-size: 0.9rem;
    }
}
