:root {
    --primary: #0d9488;
    --primary-dark: #134e4a;
    --bg: #020617;
    --card-bg: #ffffff;
    --muted: #64748b;
    --border-soft: #e2e8f0;
    --radius-lg: 18px;
    --radius-full: 999px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: radial-gradient(circle at top left, #0f766e 0, #020617 45%, #000000 100%);
    color: #0f172a;
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resume-shell {
    max-width: 1100px;
    width: 100%;
    background: rgba(15, 23, 42, 0.82);
    border-radius: 26px;
    padding: 2px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7), 0 0 0 1px rgba(148, 163, 184, 0.1);
    backdrop-filter: blur(18px);
}

.resume {
    background: radial-gradient(circle at top, #f9fafb 0, #eff3f8 40%, #e2e8f0 100%);
    border-radius: 24px;
    padding: 26px 26px 22px;
}

header.resume-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 26px;
}

.header-main {
    flex: 1;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.name-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.name-block h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.name-block .role {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--muted);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-toggle {
    border-radius: 999px;
    padding: 3px;
    background: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.language-toggle button {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    color: #cbd5f5;
    min-width: 40px;
    transition: all 0.18s ease;
}

.language-toggle button.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #f9fafb;
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.6), 0 10px 25px rgba(15, 118, 110, 0.6);
}

.subtitle-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}

.subtitle-chip span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(226,232,240,0.7);
}

.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: conic-gradient(from 160deg, #22c55e, #22d3ee, #6366f1, #22c55e);
    padding: 2px;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(circle at top, #0f172a 0, #020617 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 6px;
}

.header-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-meta i {
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel {
    background: rgba(255,255,255,0.96);
    border-radius: var(--radius-lg);
    padding: 14px 16px 16px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    font-size: 0.95rem;
    color: var(--primary);
}

.panel-tag {
    font-size: 0.68rem;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(226,232,240,0.9);
}

.about-text {
    font-size: 0.84rem;
    color: #111827;
    line-height: 1.9;
}

.about-text bdo {
    font-weight: 600;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(148,163,184,0.6);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-side {
    font-size: 0.74rem;
    color: var(--muted);
    padding-inline-end: 8px;
    border-inline-end: 2px solid rgba(148,163,184,0.7);
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

body[dir="ltr"] .timeline-side {
    border-inline-start: 2px solid rgba(148,163,184,0.7);
    border-inline-end: none;
    padding-inline-start: 8px;
    padding-inline-end: 0;
}

.timeline-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.timeline-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.experience-placeholder {
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
    text-align: center;
    padding: 10px 0 4px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(15,23,42,0.02);
    border: 1px solid rgba(148,163,184,0.7);
    font-size: 0.78rem;
    font-weight: 500;
    color: #0f172a;
}

.skill-pill i {
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(248,250,252,0.85);
}

.contact-item i {
    width: 22px;
    text-align: center;
    color: var(--primary-dark);
}

.contact-item a,
.contact-item span {
    color: #0f172a;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-item a:hover {
    text-decoration: underline;
}

footer.resume-footer {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px dashed rgba(148,163,184,0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    color: rgba(51,65,85,0.95);
}

.footer-left span {
    opacity: 0.85;
}

.footer-right a {
    text-decoration: none;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.9);
    color: #020617;
    font-weight: 500;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #e5f6ff, #fefce8);
}

.footer-right a:hover {
    background: linear-gradient(135deg, #22c55e, #22d3ee);
    color: #0b1120;
    border-color: transparent;
}

@media (max-width: 900px) {
    body {
        padding: 14px;
    }

    .resume-shell {
        border-radius: 22px;
    }

    .resume {
        border-radius: 20px;
        padding: 18px 16px 16px;
    }

    header.resume-header {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .avatar-wrapper {
        margin-inline: auto;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    footer.resume-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .name-block h1 {
        font-size: 1.6rem;
    }

    .header-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}