@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
    --primary-color: #21e6c1;
    --primary-dim: #1a9e8a;
    --accent-color: #4f8dff;
    --secondary-color: #0a1628;
    --light-color: #dce6f5;
    --dark-color: #7d8bab;
    --bg-color: #060d1a;
    --bg-color-alt: #0a1424;
    --card-bg-color: #0e1c33;
    --card-border: #1c2f4d;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-color);
    color: var(--light-color);
    line-height: 1.6;
    direction: rtl;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 5rem 2rem;
}

section:nth-of-type(even) {
    background-color: var(--bg-color-alt);
}

h1, h2, h3 {
    color: var(--light-color);
    font-weight: 700;
}

.eyebrow {
    display: block;
    font-family: var(--font-mono);
    direction: ltr;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

h2 {
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a.tel-link {
    color: inherit;
    transition: color 0.3s;
}

a.tel-link:hover {
    color: var(--primary-color);
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Header (STICKY POSITION) */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(6, 13, 26, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(33, 230, 193, 0.12);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
    padding: 1rem 2rem;
}

header .logo a {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--light-color);
    letter-spacing: 0.5px;
}

header .logo a span {
    color: var(--primary-color);
}

header ul {
    list-style: none;
    display: flex;
}

header ul li {
    padding: 0 15px;
}

header ul li a {
    color: var(--light-color);
    transition: color 0.3s;
    font-size: 0.95rem;
    position: relative;
}

header ul li a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

header ul li a:hover {
    color: var(--primary-color);
}

header ul li a:hover::after {
    width: 100%;
}

/* Hero Section */
#hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-color);
}

/* Signature element: faint animated network / node grid, echoing a network engineer's world */
#hero::before {
    content: '';
    position: absolute;
    inset: -10%;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(33, 230, 193, 0.10) 0, transparent 8%),
        radial-gradient(circle at 80% 20%, rgba(79, 141, 255, 0.10) 0, transparent 8%),
        radial-gradient(circle at 70% 75%, rgba(33, 230, 193, 0.08) 0, transparent 8%),
        radial-gradient(circle at 25% 80%, rgba(79, 141, 255, 0.08) 0, transparent 8%),
        linear-gradient(rgba(28, 47, 77, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 47, 77, 0.35) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, 46px 46px, 46px 46px;
    animation: drift 22s linear infinite;
    z-index: 0;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-46px, -46px); }
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-text {
    text-align: right;
    flex-basis: 55%;
}

.hero-text .eyebrow {
    text-align: right;
}

.hero-text h1 {
    font-size: 3.4rem;
    margin-bottom: 0.5rem;
}

.hero-text .role {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-text .role strong {
    color: var(--primary-color);
    font-weight: 500;
}

.hero-image {
    flex-basis: 45%;
    text-align: center;
    position: relative;
}

.hero-image::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px dashed rgba(33, 230, 193, 0.35);
    animation: spin 30s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hero-image img {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 0 0 40px rgba(33, 230, 193, 0.25);
    position: relative;
    z-index: 1;
}

.hero-socials {
    margin-top: 1.5rem;
}

.hero-socials a {
    font-size: 1.8rem;
    margin-left: 1rem;
    color: var(--light-color);
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.hero-socials a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cta-button {
    display: inline-block;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--primary-color);
    color: #05100e;
}

.cta-button.secondary {
    color: var(--light-color);
    border-color: var(--card-border);
}

.cta-button.secondary:hover {
    background: var(--card-border);
    color: var(--light-color);
}

/* About */
#about p {
    font-size: 1.1rem;
}

.about-flex {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    max-width: 900px;
    margin: auto;
}

.about-text {
    flex: 2;
    line-height: 2;
}

.about-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.stat-box {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
}

.stat-box .num {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 600;
    display: block;
}

.stat-box .label {
    font-size: 0.9rem;
    color: var(--dark-color);
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
}

.skill-card i {
    font-size: 2.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h3 {
    font-size: 1.1rem;
}

/* Services */
.services-list ul {
    list-style: none;
    max-width: 750px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.services-list li {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.1rem 1.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.services-list li:hover {
    border-color: var(--primary-color);
    transform: translateX(-4px);
}

.services-list li i {
    color: var(--primary-color);
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
}

.cert-item {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.4rem 1rem;
    text-align: center;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.cert-item:hover {
    transform: translateY(-6px);
    border-color: var(--primary-color);
}

/* Experience */
.experience-item {
    max-width: 750px;
    margin: auto;
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    border-right: 3px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.6rem 2rem;
}

.experience-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
}

.experience-item .company {
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.experience-item .date {
    color: var(--dark-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Web Design Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 950px;
    margin: auto;
}

.portfolio-item {
    background: var(--card-bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1.6rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: block;
    color: var(--light-color);
}

a.portfolio-item:hover h3 {
    color: var(--primary-color);
}

.portfolio-item:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color);
}

.portfolio-item .p-icon {
    color: var(--accent-color);
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}

.portfolio-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.portfolio-item .p-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dark-color);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2px 10px;
    margin-top: 0.5rem;
}

.portfolio-note {
    text-align: center;
    color: var(--dark-color);
    margin-top: 2rem;
    font-size: 0.95rem;
}

/* Contact & Footer */
.contact-info {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.2rem;
}

#contact form {
    max-width: 700px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#contact input,
#contact textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--card-border);
    background: var(--card-bg-color);
    color: var(--light-color);
    border-radius: 5px;
    font-family: 'Vazirmatn', sans-serif;
    transition: border-color 0.3s ease;
}

#contact input:focus,
#contact textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

footer {
    text-align: center;
    padding: 2.5rem 1rem;
    background: var(--card-bg-color);
    border-top: 1px solid var(--card-border);
}

footer .footer-socials a {
    font-size: 1.5rem;
    color: var(--light-color);
    margin-bottom: 1rem;
    display: inline-block;
    transition: color 0.3s;
}

footer .footer-socials a:hover {
    color: var(--primary-color);
}

footer p {
    color: var(--dark-color);
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 3.5rem 1rem;
    }

    h2 {
        font-size: 1.9rem;
    }

    header nav {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    header ul {
        flex-wrap: wrap;
        justify-content: center;
        column-gap: 10px;
        row-gap: 5px;
        padding-top: 0.5rem;
    }
    header ul li {
        padding: 0 5px;
    }

    #hero {
        min-height: auto;
        padding: 4rem 1rem;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }
    .hero-text {
        text-align: center;
    }
    .hero-text .eyebrow {
        text-align: center;
    }
    .hero-text h1 {
        font-size: 2.3rem;
    }
    .hero-text .role {
        font-size: 1.1rem;
    }
    .cta-group {
        justify-content: center;
    }
    .hero-image img {
        width: 190px;
        height: 190px;
    }
    .hero-image::before {
        width: 220px;
        height: 220px;
    }

    .about-flex {
        flex-direction: column;
    }
}
