/* ===========================================================
   استایل سایت رزومه/پورتفولیو - مینیمال، راست‌چین
   =========================================================== */

:root {
    --bg: #ffffff;
    --bg-alt: #f7f7f9;
    --text: #1a1a1a;
    --text-muted: #6b6b73;
    --border: #e7e7ea;
    --accent: #2b6cee;
    --accent-soft: #eaf1ff;
    --card-bg: #ffffff;
    --radius: 14px;
    --shadow: 0 4px 18px rgba(0,0,0,0.05);
    --max-width: 980px;
    --transition: 0.25s ease;
}

[data-theme="dark"] {
    --bg: #111114;
    --bg-alt: #18181c;
    --text: #f1f1f3;
    --text-muted: #9a9aa3;
    --border: #2a2a30;
    --accent: #5b8cff;
    --accent-soft: #1d2740;
    --card-bg: #1a1a1f;
    --shadow: 0 4px 18px rgba(0,0,0,0.35);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.9;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ----------------- Header / Nav ----------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    font-weight: 700;
    font-size: 1.05rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.nav-link:hover { color: var(--accent); }

.theme-toggle {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ----------------- Hero ----------------- */
.hero {
    text-align: center;
    padding: 90px 24px 70px;
}

.hero-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 24px;
    border: 3px solid var(--accent-soft);
    box-shadow: var(--shadow);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-name {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.hero-role {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 30px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-outline {
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ----------------- Sections ----------------- */
.section { padding-top: 70px; padding-bottom: 70px; }
.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 34px;
    position: relative;
    padding-right: 16px;
}
.section-title::before {
    content: "";
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 5px;
    border-radius: 4px;
    background: var(--accent);
}

.about-text {
    color: var(--text-muted);
    max-width: 760px;
    margin-bottom: 36px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.95rem;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.empty-state code {
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85em;
}

/* ----------------- Info Grid (شخصی) ----------------- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.info-label { font-size: 0.82rem; color: var(--text-muted); }
.info-value { font-weight: 700; }

/* ----------------- Skills ----------------- */
.skills-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.skills-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    font-size: 0.95rem;
}
.skills-bullet {
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* ----------------- Language bars ----------------- */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.lang-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.92rem;
}
.lang-score { color: var(--text-muted); }
.lang-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    overflow: hidden;
}
.lang-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #7aa6ff);
    transition: width 1s ease;
}
.lang-bar-fill.in-view { width: var(--target-width); }

/* ----------------- Timeline (تجربه) ----------------- */
.timeline {
    position: relative;
    padding-right: 24px;
    border-right: 2px solid var(--border);
}
.timeline-item {
    position: relative;
    padding: 0 30px 36px 0;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    right: -31px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-alt);
}
.timeline-date {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 700;
}
.timeline-content h3 { margin-top: 6px; font-size: 1.1rem; }
.timeline-content h4 { color: var(--text-muted); font-weight: 500; font-size: 0.92rem; margin-bottom: 8px; }
.timeline-content p { color: var(--text-muted); font-size: 0.92rem; }

/* ----------------- Cards grid (تحصیلات/گواهینامه) ----------------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}
.simple-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.simple-card-date {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}
.simple-card h3 { margin: 8px 0 4px; font-size: 1.02rem; }
.simple-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ----------------- Portfolio ----------------- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}
.portfolio-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.portfolio-img { aspect-ratio: 16/10; background: var(--bg-alt); overflow: hidden; }
.portfolio-img img { width: 100%; height: 100%; object-fit: cover; }
.portfolio-info { padding: 18px; }
.portfolio-info h3 { font-size: 1.02rem; margin-bottom: 6px; }
.portfolio-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-size: 0.75rem;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 999px;
}

/* ----------------- Contact ----------------- */
.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 0.92rem;
    transition: border-color var(--transition);
}
.contact-row:hover { border-color: var(--accent); }
.contact-icon { font-size: 1.1rem; }

.social-links { display: flex; gap: 12px; margin-top: 6px; }
.social-links a {
    font-size: 0.85rem;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; color: var(--text-muted); }
.form-group input,
.form-group textarea {
    font-family: inherit;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 0.92rem;
    resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-note { font-size: 0.85rem; color: var(--text-muted); min-height: 18px; }

/* ----------------- Footer ----------------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
}
.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.back-to-top {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition);
}
.back-to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ----------------- Reveal on scroll ----------------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------- Responsive ----------------- */
@media (max-width: 760px) {
    .container { padding: 0 18px; }

    .nav-toggle { display: flex; }
    .nav-wrap { height: 60px; }

    .main-nav {
        position: absolute;
        top: 60px;
        right: 0;
        left: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
        gap: 16px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: all var(--transition);
    }
    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .hero { padding: 56px 18px 48px; }
    .hero-avatar { width: 110px; height: 110px; }

    .section { padding-top: 48px; padding-bottom: 48px; }
    .section-title { font-size: 1.3rem; margin-bottom: 24px; }

    .info-grid,
    .skills-list,
    .lang-grid,
    .cards-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* تایم‌لاین: حذف فاصله اضافه سمت چپ تا از حاشیه صفحه بیرون نزنه */
    .timeline {
        padding-right: 18px;
        margin-right: 4px;
    }
    .timeline-item { padding: 0 0 30px 0; }
    .timeline-dot { right: -25px; width: 12px; height: 12px; }

    .contact-wrap { grid-template-columns: 1fr; gap: 24px; }
    .contact-form { padding: 18px; }

    .footer-wrap { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 420px) {
    .container { padding: 0 14px; }
    .hero { padding: 44px 14px 40px; }
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; text-align: center; }
}
