:root {
    --primary: #198754;
    --primary-rgb: 25, 135, 84;
    --primary-soft: rgba(25, 135, 84, 0.12);
    --body-bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --hero-grad-1: #ecfdf5;
    --hero-grad-2: #eff6ff;
    --hero-grad-3: #f8fafc;
    --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 20px;
    --radius-sm: 14px;
    --header-h: 64px;
    --font-fa: 'Vazirmatn', system-ui, sans-serif;
    --font-en: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html[data-theme="dark"] {
    --primary: #3fb950;
    --primary-rgb: 63, 185, 80;
    --primary-soft: rgba(63, 185, 80, 0.14);
    --body-bg: #0d1117;
    --surface: #1c2128;
    --surface-2: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --border: rgba(255, 255, 255, 0.08);
    --hero-grad-1: #0f172a;
    --hero-grad-2: #111827;
    --hero-grad-3: #0d1117;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-fa);
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.65;
    transition: background 0.35s ease, color 0.35s ease;
}

html[lang="en"] body { font-family: var(--font-en); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
    width: min(1140px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    min-width: 0;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
}

.brand-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-text span {
    font-size: 0.7rem;
    line-height: 1.15;
    color: var(--text-muted);
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.header-nav a {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease, background 0.2s ease;
}

.header-nav a:hover,
.header-nav a.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    justify-content: flex-end;
}

.header-btn {
    height: 38px;
    padding: 0 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-decoration: none;
    white-space: nowrap;
}

.header-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.35);
    color: var(--primary);
}

.header-btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.header-btn--primary:hover {
    background: color-mix(in srgb, var(--primary) 88%, #000);
    border-color: color-mix(in srgb, var(--primary) 88%, #000);
    color: #fff;
}

.header-btn--program {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--primary);
}

.header-btn--program:hover {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--primary-rgb), 0.35);
}

.lang-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.lang-btn:hover {
    border-color: rgba(var(--primary-rgb), 0.35);
    color: var(--primary);
}

.version-badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
    font-weight: 600;
}

.site-footer {
    padding: 2rem 0 2.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.footer-brand strong { color: var(--text); }

.footer-brand a {
    color: var(--primary);
    font-weight: 700;
}

.footer-brand a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header-nav { display: none; }
}

@media (max-width: 640px) {
    .brand-text span {
        display: none;
    }

    .header-btn {
        padding: 0 0.7rem;
        font-size: 0.76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .icon-btn:hover { transform: none; }
}