/* =========================================================
   فونت Kalameh — سلف‌هاست‌شده، تنها فونت سایت (فارسی و انگلیسی)
   ========================================================= */
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/KalamehFaNum-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/KalamehFaNum-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/KalamehFaNum-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Kalameh';
    src: url('../fonts/KalamehFaNum-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   متغیرهای طراحی (Design Tokens)
   ========================================================= */
:root {
    --color-primary: #00443A;      /* رنگ لوگو — تیترها و برند */
    --color-primary-light: #0E6E5C;
    --color-secondary: #6B7280;    /* توسی — لینک‌ها و هایلایت‌ها */
    --color-secondary-dark: #4B5563;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-text: #1F2937;
    --color-gray-light: #E5E7EB;
    --color-bg: #FFFFFF;
    --color-bg-soft: #F8FAFA;

    --font-main: 'Kalameh', 'Tahoma', sans-serif;

    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 24px;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 68, 58, 0.08);
    --shadow-lg: 0 20px 45px rgba(0, 68, 58, 0.12);

    --container-width: 1180px;
    --navbar-height: 132px;
    --navbar-height-scrolled: 84px;
}

/* =========================================================
   ریست پایه
   ========================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

/* افکت نویز ملایم روی کل سایت */
body::after {
    content: '';
    position: fixed;
    inset: -10%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 140px 140px;
    animation: filmGrain 0.6s steps(6) infinite;
}
@keyframes filmGrain {
    0%   { transform: translate(0, 0); }
    16%  { transform: translate(-3%, 2%); }
    33%  { transform: translate(2%, -3%); }
    50%  { transform: translate(-2%, -2%); }
    66%  { transform: translate(3%, 1%); }
    83%  { transform: translate(-1%, 3%); }
    100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    body::after { animation: none; }
}

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

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

ul { list-style: none; }

h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.3;
}

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

section { padding: 90px 0; }

.section__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 50px;
}

.section__tag {
    display: inline-block;
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.section__title {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    margin-bottom: 12px;
}

.section__desc {
    color: #4B5563;
    font-size: 1.05rem;
}

/* دکمه‌ها — حداقل 44px ارتفاع برای دسترسی‌پذیری لمسی */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 28px;
    border-radius: var(--radius-sm);
    /* تگ button فونت را از body ارث نمی‌برد؛ بدون این خط
       دکمه‌ها با فونت پیش‌فرض سیستم نمایش داده می‌شوند */
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }
.btn:active { transform: scale(0.96); }

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn--primary:hover { background: var(--color-primary-light); transform: translateY(-2px); }

.btn--outline {
    background: transparent;
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}
.btn--outline:hover { background: var(--color-secondary); color: #fff; transform: translateY(-2px); }

/* =========================================================
   ناوبار چسبان
   ========================================================= */
.navbar {
    position: fixed;
    top: 0; right: 0; left: 0;
    z-index: 1000;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
}
.navbar.is-scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    height: var(--navbar-height-scrolled);
}

.navbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    /* پایه‌ی موقعیت‌دهی برای منوی وسط‌چین */
    position: relative;
}

.navbar__brand {
    display: flex;
    align-items: center;
}
.navbar__logo {
    width: 108px;
    height: 108px;
    transition: width 0.3s ease, height 0.3s ease;
}
.navbar.is-scrolled .navbar__logo { width: 56px; height: 56px; }

/* منو دقیقاً وسط ناوبار می‌نشیند، مستقل از عرض لوگو و دکمه‌های کناری.
   با چیدمان قبلی (گرید 1fr auto 1fr) چون ستون راست پهن‌تر بود،
   منو به یک سمت کشیده می‌شد. */
.navbar__menu {
    display: flex;
    align-items: center;
    gap: 32px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.navbar__link {
    font-weight: 500;
    color: var(--color-text);
    position: relative;
    padding: 6px 2px;
    transition: color 0.2s ease, transform 0.2s ease;
}
.navbar__link::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0; left: 0;
    height: 2px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.navbar__link:hover,
.navbar__link:focus-visible { color: var(--color-secondary); transform: translateY(-1px); }
.navbar__link:hover::after,
.navbar__link:focus-visible::after { transform: scaleX(1); }

.navbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar__auth {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
}
.navbar__auth-link {
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s ease;
}
.navbar__auth-link:hover { color: var(--color-secondary); }
.navbar__auth-link--cta {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    padding: 8px 18px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, transform 0.2s ease;
}
.navbar__auth-link--cta:hover { background: var(--color-primary-light); color: #fff; transform: translateY(-1px); }
.navbar__auth-name {
    font-weight: 700;
    color: var(--color-primary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar__auth-link--logout { color: var(--color-warning); font-weight: 600; }

@media (max-width: 860px) {
    .navbar__auth { font-size: 0.84rem; gap: 8px; }
    .navbar__auth-name { max-width: 90px; }
    .navbar__auth-link--cta { padding: 6px 12px; min-height: 34px; }
}
@media (max-width: 400px) {
    .navbar__auth-name { max-width: 56px; }
}

.navbar__social {
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar__social a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    transition: color 0.25s ease, transform 0.25s ease;
}
.navbar__social a svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.navbar__social a:hover {
    color: var(--color-secondary);
    transform: translateY(-2px);
}

.navbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
}
.navbar__toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    margin: 0 auto;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.navbar__toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__toggle.is-active span:nth-child(2) { opacity: 0; }
.navbar__toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
    padding-top: calc(var(--navbar-height) + 60px);
    padding-bottom: 80px;
    background: linear-gradient(180deg, var(--color-bg-soft) 0%, #FFFFFF 100%);
    opacity: 0;
    animation: heroSectionFade 1.1s ease-out forwards;
}
@keyframes heroSectionFade {
    to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .hero { animation: none; opacity: 1; }
}
.hero__inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 50px;
}
.hero__eyebrow {
    color: var(--color-secondary);
    font-weight: 700;
    margin-bottom: 14px;
    display: inline-block;
}
.hero__title {
    font-size: clamp(2.1rem, 4.2vw, 3.2rem);
    font-weight: 900;
    margin-bottom: 16px;
    color: #000000;
}
.hero__subtitle {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 14px;
}
.hero__subtitle--shimmer {
    --shimmer-base: #9CA3AF;
    --shimmer-spread: 70px;
    display: inline-block;
    background-image:
        linear-gradient(90deg, transparent calc(50% - var(--shimmer-spread)), #000 50%, transparent calc(50% + var(--shimmer-spread))),
        linear-gradient(var(--shimmer-base), var(--shimmer-base));
    background-size: 250% 100%, auto;
    background-repeat: no-repeat, no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-position: 100% center, 0 0;
    animation: heroShimmer 2.4s linear infinite;
}
@keyframes heroShimmer {
    to { background-position: 0% center, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hero__subtitle--shimmer {
        animation: none;
        background: none;
        color: var(--shimmer-base);
        -webkit-text-fill-color: var(--shimmer-base);
    }
}
.hero__line {
    color: #4B5563;
    font-size: 1.05rem;
    margin-bottom: 14px;
}
.hero__mission {
    color: #6B7280;
    font-size: 0.98rem;
    max-width: 480px;
    margin-bottom: 32px;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero__media {
    position: relative;
    display: flex;
    justify-content: center;
}
.hero__reveal {
    opacity: 0;
    transform: scale(0.92) translateY(14px);
    animation: heroReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}
.hero__frame {
    position: relative;
    width: clamp(320px, 42vw, 640px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    animation: heroFloat 6s ease-in-out 1s infinite;
}
.hero__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: filter 0.6s ease, transform 0.6s ease;
}
.hero__frame:hover img {
    filter: grayscale(0);
    transform: scale(1.05);
}
@keyframes heroReveal {
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@media (prefers-reduced-motion: reduce) {
    .hero__reveal { animation: none; opacity: 1; transform: none; }
    .hero__frame { animation: none; }
}

/* =========================================================
   کارت‌های تخصص (بنتوگرید ملایم)
   ========================================================= */
.expertise__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.card {
    background: #fff;
    border: 1px solid rgba(229, 231, 235, 0.4);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.5s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-secondary);
}
.card__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(0, 68, 58, 0.08);
    color: var(--color-primary);
    margin-bottom: 18px;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background 0.5s ease;
}
.card__icon svg { width: 26px; height: 26px; }
.card:hover .card__icon {
    transform: scale(1.06) rotate(-2deg);
    background: rgba(0, 68, 58, 0.13);
}
.card__title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.card__desc {
    color: #4B5563;
    font-size: 0.95rem;
}

/* =========================================================
   ویدیوهای یوتیوب
   ========================================================= */
.videos__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.video-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--color-gray-light);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.video-card__frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.video-card__frame iframe { width: 100%; height: 100%; border: 0; }
.video-card__title {
    padding: 16px 18px;
    font-size: 0.98rem;
    font-weight: 500;
}
.videos__empty {
    text-align: center;
    color: #4B5563;
    background: var(--color-bg-soft);
    border-radius: var(--radius);
    padding: 50px 20px;
}
.videos__empty a { color: var(--color-secondary); font-weight: 700; }

/* =========================================================
   تماس با من
   ========================================================= */
.contact__wrapper {
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-bg-soft);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}
.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 1.5px solid var(--color-gray-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea.form-control { min-height: 130px; resize: vertical; }
.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.18);
    transform: translateY(-1px);
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    font-weight: 500;
    font-size: 0.95rem;
}
.alert--success { background: rgba(16, 185, 129, 0.12); color: #047857; border: 1px solid rgba(16,185,129,0.3); }
.alert--error { background: rgba(245, 158, 11, 0.12); color: #92400E; border: 1px solid rgba(245,158,11,0.3); }

/* =========================================================
   صفحات حساب کاربری (ثبت‌نام / ورود / داشبورد)
   ========================================================= */
.auth-section {
    padding-top: calc(var(--navbar-height) + 60px);
    padding-bottom: 80px;
    min-height: 55vh;
}
@media (max-width: 860px) {
    .auth-section { padding-top: 124px; }
}
@media (max-width: 480px) {
    .auth-section { padding-top: 108px; padding-bottom: 56px; }
}
.contact__wrapper--narrow { max-width: 440px; }
.auth-title {
    text-align: center;
    margin-bottom: 24px;
}
.auth-footer-note {
    text-align: center;
    margin-top: 18px;
    font-size: 0.9rem;
    color: #4B5563;
}
.auth-footer-note a { color: var(--color-secondary); font-weight: 700; }

/* =========================================================
   فوتر
   ========================================================= */
.footer {
    background: #000000;
    color: #E5E7EB;
    padding: 50px 0 30px;
}
.footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}
.footer__brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer__logo { width: 120px; height: 120px; filter: brightness(0) invert(1); }
.footer__social { display: flex; gap: 16px; }
.footer__social a {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    transition: background 0.2s ease, transform 0.2s ease;
}
.footer__social a svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.footer__social a:hover { background: var(--color-secondary); transform: translateY(-3px) rotate(6deg); }
.footer__social a:hover svg { transform: scale(1.1); }
.footer__copy { font-size: 0.85rem; color: #9CA3AF; }

/* =========================================================
   ریسپانسیو
   ========================================================= */
@media (max-width: 1024px) {
    .expertise__grid { grid-template-columns: repeat(2, 1fr); }
    .videos__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .navbar { height: 84px; }
    .navbar.is-scrolled { height: 64px; }
    .navbar__logo { width: 64px; height: 64px; }
    .navbar.is-scrolled .navbar__logo { width: 44px; height: 44px; }
    .navbar__social { display: none; }

    .navbar__menu {
        position: fixed;
        top: 84px;
        right: 0; left: 0;
        /* left:0 و translateY زیر، وسط‌چینی دسکتاپ را خنثی می‌کنند */
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
        gap: 4px;
        box-shadow: var(--shadow-md);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .navbar__menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .navbar__link {
        display: block;
        min-height: 48px;
        padding: 13px 14px;
        border-radius: var(--radius-sm);
        transition: background 0.2s ease, color 0.2s ease;
    }
    .navbar__link:active { background: var(--color-bg-soft); }
    .navbar__link::after { display: none; }
    .navbar__toggle { display: flex; }

    .hero { padding-top: 124px; }
    .hero__inner { grid-template-columns: 1fr; text-align: center; }
    .hero__actions { justify-content: center; }
    .hero__mission { margin-left: auto; margin-right: auto; }
    .hero__media { order: -1; margin-bottom: 10px; }

    .footer__logo { width: 80px; height: 80px; }
}

@media (max-width: 640px) {
    section { padding: 64px 0; }
    .section__head { margin-bottom: 36px; }
    .expertise__grid,
    .videos__grid { grid-template-columns: 1fr; }
    .contact__wrapper { padding: 28px 20px; }

    .hero__actions { flex-direction: column; align-items: stretch; }
    .hero__actions .btn { width: 100%; min-height: 52px; }
}

@media (max-width: 480px) {
    section { padding: 48px 0; }
    .hero { padding-top: 108px; padding-bottom: 56px; }
    .section__head { margin-bottom: 28px; }
    .card { padding: 22px 18px; }
    .contact__wrapper { padding: 22px 16px; }
    .footer__logo { width: 64px; height: 64px; }
    .footer { padding: 40px 0 24px; }
}

/* تعامل‌های فقط-موس (hover) روی دستگاه‌های لمسی معنا ندارند؛
   محتوای پشت hover روی موبایل/تبلت همیشه نمایان باشد */
@media (hover: none) {
    .hero__frame img { filter: grayscale(0); }
}

/* =========================================================
   کرسر سفارشی (نقطه + حلقه با تاخیر) و رد هاله‌ی سبز برند
   ========================================================= */
@media (pointer: fine) {
    body.has-custom-cursor,
    body.has-custom-cursor a,
    body.has-custom-cursor button {
        cursor: none;
    }
    body.has-custom-cursor .form-control {
        cursor: text;
    }
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    will-change: transform;
}
.cursor-dot {
    width: 7px;
    height: 7px;
    background: #000;
}
.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--color-secondary);
    transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.cursor-ring.is-hover {
    width: 50px;
    height: 50px;
    border-color: var(--color-primary);
}
.cursor-ring.is-pressed {
    width: 24px;
    height: 24px;
    opacity: 0.6;
}

@media (max-width: 860px), (pointer: coarse) {
    .cursor-dot, .cursor-ring { display: none; }
}

/* =========================================================
   خطوط ظریف متحرک بین بخش‌ها
   ========================================================= */
.section-divider {
    position: relative;
    height: 1px;
    max-width: var(--container-width);
    margin: 0 auto;
    overflow: hidden;
    background: linear-gradient(90deg, transparent, var(--color-gray-light) 20%, var(--color-gray-light) 80%, transparent);
}
.section-divider::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, var(--color-secondary), transparent);
    animation: dividerSweep 4.5s linear infinite;
}
@keyframes dividerSweep {
    from { right: -30%; }
    to { right: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .section-divider::after { animation: none; opacity: 0; }
}

/* =========================================================
   نمایش کلمه‌به‌کلمه تیترها
   ========================================================= */
.word-reveal {
    display: inline-block;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.word-reveal-container.is-visible .word-reveal {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .word-reveal { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   پنل ادمین
   ========================================================= */
.admin-topbar {
    background: #000000;
    padding: 16px 0;
}
.admin-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.admin-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
}
.admin-topbar__logo { width: 40px; height: 40px; filter: brightness(0) invert(1); }
.admin-topbar__logout {
    color: #fff;
    font-weight: 600;
    padding: 8px 16px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.admin-topbar__logout:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.admin-main { padding: 40px 0 80px; background: var(--color-bg-soft); min-height: 70vh; }

.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-soft);
    padding: 24px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 36px;
}
.admin-stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-light);
}
.admin-stat-card__label { color: #4B5563; font-size: 0.95rem; margin-bottom: 8px; }
.admin-stat-card__value { font-size: 2.2rem; font-weight: 900; color: var(--color-primary); }

.admin-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-gray-light);
    padding: 24px;
    margin-bottom: 32px;
}
.admin-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.admin-panel__head h2 { font-size: 1.2rem; }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--color-gray-light);
    white-space: nowrap;
}
.admin-table th { color: var(--color-primary); font-weight: 700; background: var(--color-bg-soft); }
.admin-table tr:hover td { background: rgba(0, 68, 58, 0.03); }
.admin-table__empty { padding: 30px; text-align: center; color: #4B5563; }

@media (max-width: 640px) {
    .admin-stats { grid-template-columns: 1fr; }
    .admin-panel { padding: 16px; }
}

/* =========================================================
   فرم خبرنامه — سه نسخه: hero، bottom، footer
   ========================================================= */
.newsletter { width: 100%; }

.newsletter__head { margin-bottom: 14px; }

.newsletter__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.newsletter__title--sm { font-size: 0.98rem; margin-bottom: 10px; }

.newsletter__desc { font-size: 0.9rem; color: var(--color-secondary); line-height: 1.9; }

/* لیبل فقط برای صفحه‌خوان‌ها؛ از دید پنهان ولی در DOM هست */
.newsletter__label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.newsletter__row { display: flex; gap: 8px; align-items: stretch; }

.newsletter__input {
    flex: 1;
    min-width: 0;                 /* جلوگیری از سرریز flex در موبایل */
    font-family: var(--font-main);
    font-size: 0.95rem;
    padding: 11px 15px;
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-text);
    direction: ltr;               /* ایمیل لاتین است */
    text-align: left;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.newsletter__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 68, 58, .1);
}

.newsletter__btn { white-space: nowrap; padding: 11px 22px; }

/* ---------- پیام نتیجه ---------- */
.newsletter__alert {
    font-size: 0.88rem;
    line-height: 1.9;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid;
}
.newsletter__alert--success { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.35); color: #047857; }
.newsletter__alert--info    { background: rgba(0,68,58,.06);    border-color: rgba(0,68,58,.25);    color: var(--color-primary); }
.newsletter__alert--error   { background: rgba(220,38,38,.06);  border-color: rgba(220,38,38,.28);  color: #991B1B; }

/* ---------- نسخه‌ی Hero ---------- */
.newsletter--hero {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--color-gray-light);
    max-width: 440px;
}

/* ---------- نوار انتهای صفحه ---------- */
.newsletter-band { padding: 56px 0; background: var(--color-bg-soft); }
.newsletter--bottom {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
    background: var(--color-bg);
    padding: 32px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.newsletter--bottom .newsletter__row { max-width: 460px; margin: 0 auto; }

/* ---------- موبایل: دکمه زیر ورودی ---------- */
@media (max-width: 560px) {
    .newsletter__row { flex-direction: column; }
    .newsletter__btn { width: 100%; }
    .newsletter-band { padding: 40px 0; }
    .newsletter--bottom { padding: 24px 18px; }
}

/* =========================================================
   صفحه‌ی لغو عضویت در خبرنامه
   ========================================================= */
.unsub-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: calc(var(--navbar-height) + 50px) 0 80px;
    background: var(--color-bg-soft);
}

.unsub-card {
    max-width: 560px;
    margin: 0 auto;
    background: var(--color-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
    text-align: center;
}

.unsub-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.unsub-text { font-size: 1rem; line-height: 2.1; margin-bottom: 12px; }

/* ایمیل لاتین است و باید چپ‌چین بماند حتی داخل متن فارسی */
.unsub-email { direction: ltr; display: inline-block; unicode-bidi: isolate; }

.unsub-hint { font-size: 0.9rem; color: var(--color-secondary); line-height: 1.9; }

.unsub-link { color: var(--color-primary); font-weight: 500; text-decoration: underline; }

.unsub-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 26px;
}

@media (max-width: 480px) {
    .unsub-card { padding: 28px 20px; }
    .unsub-title { font-size: 1.25rem; }
    .unsub-actions .btn { width: 100%; }
}

/* =========================================================
   بخش آمار — شمارنده‌های متحرک
   ========================================================= */
.stats { padding: 60px 0; }

.stats__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* بدون کادر — فقط عدد و برچسب روی زمینه‌ی صفحه */
.stat {
    text-align: center;
    padding: 20px 12px;
}

.stat__value {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.2;
    color: var(--color-primary);
    /* عدد همیشه چپ‌چین شمرده می‌شود تا موقع تغییر رقم نلرزد */
    font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}

.stat__label {
    font-size: 0.95rem;
    color: var(--color-secondary);
    font-weight: 500;
}

/* =========================================================
   بخش درباره‌ی من
   ========================================================= */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: center;
}

.about__media { position: relative; }

/* =========================================================
   المان شبکه‌ی عصبی — خطی، مینیمال، با رنگ برند
   ========================================================= */
.neural {
    color: var(--color-primary-light); /* رنگ خطوط و گره‌ها از همین ارث می‌رسد */
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}
.neural__svg { width: 100%; height: auto; display: block; overflow: visible; }

/* ---------- حالت اولیه: همه‌چیز پنهان تا لحظه‌ی ورود به دید ---------- */
.neural__links line {
    opacity: .38;
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
}
.neural__nodes circle,
.neural__cores circle {
    opacity: 0;
    transform-box: fill-box;   /* تا مرکز چرخش خودِ دایره باشد */
    transform-origin: center;
}

/* ---------- انیمیشن فقط بعد از افزوده شدن کلاس is-visible ---------- */

/* اتصال‌ها: خط‌به‌خط کشیده می‌شوند */
.neural.is-visible .neural__links line {
    /* هر خط با تاخیر خودش شروع می‌شود: --d ضربدر ۰٫۰۶ ثانیه */
    animation: neuralDraw .9s ease-out forwards;
    animation-delay: calc(var(--d) * .06s);
}

/* گره‌ها: با کمی بزرگ‌نمایی ظاهر می‌شوند */
.neural.is-visible .neural__nodes circle {
    animation: neuralPop .5s cubic-bezier(.34, 1.56, .64, 1) forwards;
    animation-delay: calc(.35s + var(--d) * .07s);
}

/* نقطه‌ی مرکزی: بعد از ظاهر شدن، آرام نبض می‌زند */
.neural.is-visible .neural__cores circle {
    animation:
        neuralPop .4s ease-out forwards,
        neuralPulse 2.6s ease-in-out infinite;
    animation-delay:
        calc(1s + var(--d) * .18s),
        calc(1.4s + var(--d) * .18s);
}

@keyframes neuralDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes neuralPop {
    from { opacity: 0; transform: scale(.4); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes neuralPulse {
    0%, 100% { opacity: 1;   transform: scale(1); }
    50%      { opacity: .45; transform: scale(1.7); }
}

/* اگر کاربر انیمیشن کمتر خواسته، همه‌چیز ثابت و کامل نمایش داده شود */
@media (prefers-reduced-motion: reduce) {
    .neural__links line,
    .neural__nodes circle,
    .neural__cores circle {
        animation: none;
        opacity: 1;
        stroke-dashoffset: 0;
    }
    .neural__links line { opacity: .38; }
}

.about__title { text-align: right; margin-bottom: 18px; }

.about__text {
    font-size: 1.02rem;
    line-height: 2.1;
    color: #4B5563;
    margin-bottom: 14px;
}
.about__text:last-of-type { margin-bottom: 0; }

.about__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

/* =========================================================
   بخش نظرات
   ========================================================= */
.testimonials__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.testimonial {
    position: relative;
    background: var(--color-bg);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    padding: 28px 24px 22px;
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.testimonial:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

/* علامت نقل‌قول تزئینی گوشه‌ی کارت */
.testimonial__quote {
    position: absolute;
    top: 6px;
    right: 20px;
    font-size: 3.6rem;
    line-height: 1;
    color: var(--color-primary);
    opacity: .12;
    font-family: Georgia, serif;
    pointer-events: none;
}

.testimonial__text {
    font-size: 0.98rem;
    line-height: 2.1;
    color: #4B5563;
    margin: 0 0 20px;
    flex: 1;
    position: relative;
}

.testimonial__author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--color-gray-light);
}

/* آواتار ساده با حرف اول نام */
.testimonial__avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.testimonial__meta { display: flex; flex-direction: column; line-height: 1.6; }
.testimonial__name { font-weight: 700; color: var(--color-text); font-size: 0.95rem; }
.testimonial__role { font-size: 0.82rem; color: var(--color-secondary); }

/* =========================================================
   ریسپانسیو بخش‌های جدید
   ========================================================= */
@media (max-width: 900px) {
    /* درباره‌ی من تک‌ستونی؛ تصویر بالا می‌رود */
    .about__grid { grid-template-columns: 1fr; gap: 34px; }
    .about__media { max-width: 340px; margin: 0 auto; }
    .about__media::before { inset: -12px -12px 12px 12px; }
}

@media (max-width: 640px) {
    .stats { padding: 40px 0; }
    .stats__grid { grid-template-columns: 1fr; gap: 14px; }
    .stat { padding: 22px 16px; }
    .about__actions .btn { width: 100%; }
}

/* =========================================================
   وبلاگ — فهرست مقاله‌ها
   ========================================================= */
/* فاصله از ناوبار ثابت، وگرنه محتوا زیرش می‌افتد */
.blog-hero { padding: calc(var(--navbar-height) + 40px) 0 20px; }
.blog-list { padding: 30px 0 90px; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 26px;
}

.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.post-card__link { display: flex; flex-direction: column; height: 100%; }

.post-card__media {
    aspect-ratio: 16 / 9;
    background: var(--color-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }

/* جایگزین تصویر: حرف اول عنوان روی زمینه‌ی برند */
.post-card__placeholder {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-primary);
    opacity: .18;
}

.post-card__body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__date { font-size: 0.82rem; color: var(--color-secondary); margin-bottom: 8px; }

.post-card__title {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 10px;
    transition: color .2s ease;
}
.post-card:hover .post-card__title { color: var(--color-primary-light); }

.post-card__excerpt {
    font-size: 0.92rem;
    line-height: 2;
    color: #4B5563;
    flex: 1;
    margin-bottom: 14px;
}

.post-card__more {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-primary);
}
.post-card__more::after { content: ' ←'; transition: margin .2s ease; }
.post-card:hover .post-card__more::after { margin-right: 4px; }

/* ---------- حالت خالی و صفحه‌بندی ---------- */
.blog-empty { text-align: center; padding: 70px 20px; color: var(--color-secondary); }
.blog-empty__hint { font-size: 0.9rem; margin: 6px 0 22px; }

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 46px;
    flex-wrap: wrap;
}
.blog-pagination__info { font-size: 0.92rem; color: var(--color-secondary); }

/* =========================================================
   صفحه‌ی تکی مقاله
   ========================================================= */
.container--narrow { max-width: 760px; }

/* فاصله از ناوبار ثابت، وگرنه لینک بازگشت زیرش می‌افتد */
.post { padding: calc(var(--navbar-height) + 40px) 0 90px; }

/* نوار پیش‌نمایش پیش‌نویس (فقط برای ادمین واردشده دیده می‌شود) */
.post__draft-note {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.92rem;
    line-height: 2;
    color: #78350F;
}
.post__draft-note strong { color: #92400E; }
.post__draft-note a {
    color: var(--color-primary);
    text-decoration: underline;
    margin-inline-start: 6px;
}

.post__head { margin-bottom: 28px; }

.post__back {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 18px;
    transition: color .2s ease;
}
.post__back:hover { color: var(--color-primary); }

.post__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.5;
    margin-bottom: 12px;
}

.post__meta { font-size: 0.88rem; color: var(--color-secondary); }

.post__figure {
    margin: 0 0 32px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.post__figure img { width: 100%; height: auto; }

/* ---------- متن مقاله ---------- */
.post__content { font-size: 1.05rem; line-height: 2.2; color: #374151; }

.post__content p { margin-bottom: 20px; }

.post__content h2 {
    font-size: 1.5rem;
    margin: 38px 0 14px;
    line-height: 1.6;
}
.post__content h3 {
    font-size: 1.22rem;
    margin: 30px 0 12px;
    line-height: 1.6;
}

.post__content ul,
.post__content ol { margin: 0 22px 20px 0; padding-right: 20px; }
.post__content ul { list-style: disc; }
.post__content ol { list-style: decimal; }
.post__content li { margin-bottom: 8px; }

.post__content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.post__content a:hover { color: var(--color-primary-light); }

.post__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.post__content blockquote {
    margin: 24px 0;
    padding: 16px 22px;
    background: var(--color-bg-soft);
    border-right: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    color: #4B5563;
}

.post__content code {
    background: var(--color-bg-soft);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.9em;
    direction: ltr;
    display: inline-block;
}
.post__content pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 18px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    margin: 22px 0;
}
.post__content pre code { background: none; padding: 0; color: inherit; }

/* ---------- خبرنامه ته مقاله ---------- */
.post__newsletter { margin-top: 54px; padding-top: 34px; border-top: 1px solid var(--color-gray-light); }

/* ---------- صفحه‌ی مقاله پیدا نشد ---------- */
.post-missing { padding: calc(var(--navbar-height) + 70px) 0 110px; text-align: center; }
.post-missing .section__desc { margin-bottom: 26px; }

/* ---------- ویرایشگر بلند در پنل ---------- */
.ad-textarea--tall { min-height: 420px; font-family: var(--ad-font, inherit); }

@media (max-width: 640px) {
    .blog-list { padding: 20px 0 60px; }
    .post { padding: 40px 0 60px; }
    .post__content { font-size: 1rem; line-height: 2.05; }
}
