* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --matrix-green: #00ff00;
    --matrix-dark-green: #008000;
    --matrix-black: #000000;
    --matrix-dark: #0a0a0a;
    --matrix-gray: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #cccccc;
}

body {
    font-family: var(--font-primary);
    background: var(--matrix-black);
    color: var(--text-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Matrix Background */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--matrix-green);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo .matrix-text {
    font-family: var(--font-code);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
    font-family: var(--font-primary);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-green);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--matrix-green);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 0 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.profile-image {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.profile-image img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--matrix-green);
    filter: brightness(0.9) contrast(1.2);
}

.matrix-frame {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--matrix-green);
    border-radius: 50%;
    animation: matrix-pulse 2s infinite;
}

@keyframes matrix-pulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--matrix-green);
    }
    50% {
        box-shadow: 0 0 20px var(--matrix-green), 0 0 30px var(--matrix-green);
    }
}

.hero-text {
    text-align: right;
}

.matrix-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    color: var(--matrix-green);
    text-shadow: 0 0 20px var(--matrix-green);
    margin-bottom: 1rem;
}

.typing-effect {
    border-left: 3px solid var(--matrix-green);
    padding-left: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-color: var(--matrix-green); }
    51%, 100% { border-color: transparent; }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
    font-family: var(--font-code);
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-family: var(--font-text);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: flex-end;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: var(--font-code);
}

.social-btn:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 20px var(--matrix-green);
}

.cta-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid var(--matrix-green);
    color: var(--matrix-green);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.cta-btn:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 20px var(--matrix-green);
}

/* Section Styles */
section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.matrix-text {
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green);
}

.matrix-line {
    width: 100px;
    height: 3px;
    background: var(--matrix-green);
    margin: 0 auto;
    box-shadow: 0 0 10px var(--matrix-green);
}

/* About Section */
.about-section {
    background: var(--matrix-gray);
    opacity: 0.8;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    text-align: justify;
    font-family: var(--font-text);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--matrix-gray);
    opacity: 0.7;
    padding: 5PX 10PX;
    border: 1px solid var(--matrix-dark-green);
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 15PX;
}

.skill-card:hover {
    border-color: var(--matrix-green);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    translate: 0PX -10PX  ;
    cursor: pointer;
}

.skill-icon {
    font-size: 2rem;
    color: var(--matrix-green);
    margin-bottom: 0.5rem;
}

.skill-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-code);
}

.skill-bar {
    width: 100%;
    height: 10px;
    background: var(--matrix-dark);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--matrix-green);
    width: 0;
    animation: fillSkill 2s ease-in-out forwards;
    box-shadow: 0 0 10px var(--matrix-green);
}

@keyframes fillSkill {
    from { width: 0; }
    to { width: var(--skill-width, 0%); }
}

.skill-percent {
    color: var(--matrix-green);
    font-weight: bold;
    font-family: var(--font-code);
}

/* Portfolio Section */
.portfolio-section {
    background: var(--matrix-gray);
    opacity: 0.7;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-card {
    background: var(--matrix-dark);
    border: 1px solid var(--matrix-dark-green);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 15px;
}

.portfolio-card:hover {
    border-color: var(--matrix-green);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    
}

.portfolio-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 255, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.portfolio-card:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay i {
    font-size: 2rem;
    color: var(--matrix-black);
    margin-bottom: 0.5rem;
}

.portfolio-overlay span {
    color: var(--matrix-black);
    font-weight: bold;
    font-family: var(--font-primary);
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--matrix-green);
    font-family: var(--font-primary);
}

.portfolio-info p {
    color: var(--text-gray);
    font-family: var(--font-code);
}

/* Contact Section */
.contact-content {
    display: flex;
    justify-content: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-family: var(--font-text);
}

.contact-item i {
    color: var(--matrix-green);
    font-size: 1.5rem;
    width: 30px;
}

.contact-item a {
    color: var(--matrix-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-item a:hover {
    text-shadow: 0 0 5px var(--matrix-green);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    
}

.modal-content {
    background-color: var(--matrix-dark);
    margin: auto;
    padding: 2rem;
    border: 1px dashed var(--matrix-green);
    width: 80%;
    max-width: 800px;
    margin-top: 10px;
    position: relative;
    font-family: var(--font-text);
    border-radius: 15px;
}

.close-modal {
    color: var(--matrix-green);
    float: left;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.close-modal:hover {
    text-shadow: 0 0 10px var(--matrix-green);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .matrix-title {
        font-size: 2rem;
    }
    
    /* Navigation Mobile - Horizontal Menu */
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-link {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
        min-width: auto;
    }
    
    .profile-image {
        width: 250px;
        height: 250px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin:  auto;
        padding: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .matrix-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .profile-image {
        width: 200px;
        height: 200px;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .social-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

footer {
    text-align: center;
  }

/* Profile Video Styles */
.profile-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
    border: 3px solid var(--matrix-green);
    filter: brightness(0.9) contrast(1.2);
}

.profile-image:hover .profile-video {
    opacity: 1;
}

.profile-image:hover img {
    opacity: 0;
}

/* تنظیمات بیشتر برای عکس */
.profile-image img {
    position: relative;
    z-index: 1;
    transition: opacity 0.5s ease;
}

/* Cursor Pointer for Profile Image */
.profile-image img,
.profile-image .profile-video {
    cursor: pointer;
}