/* ==========================================================================
   BARSÄZ — Base
   ریست، تایپوگرافی، ابزارهای پایه
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 20px);
    /* جای اسکرول‌بار را همیشه رزرو می‌کند تا با قفل‌شدن اسکرول (باز شدن منوی موبایل)
       عرض صفحه تغییر نکند و منو/هدر نپرند */
    scrollbar-gutter: stable;
    /* قفل کامل حرکت افقی صفحه (به‌ویژه سافاری موبایل که فقط body کافی نیست)؛
       clip برخلاف hidden کانتینر اسکرول نمی‌سازد و stickyها سالم می‌مانند */
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: 400;
    line-height: 2;
    background: var(--bg);
    color: var(--ink);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
    overflow-x: clip;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -.2px;
}

h1 { font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.35; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.7rem); line-height: 1.4; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

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

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* همهٔ سلکت‌های سایت: حذف فلش پیش‌فرض مرورگر و جایگزینی با آیکن SVG */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 14px 14px;
    padding-inline-end: 38px;
    cursor: pointer;
}

select::-ms-expand {
    display: none;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

strong,
b { font-weight: 700; }

small { font-size: .8em; }

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding: 100px 0;
}

.section-tight {
    padding: 70px 0;
}

.section-soft {
    background: var(--surface);
}

.section-head {
    max-width: 640px;
    margin-bottom: 54px;
}

.section-head.center {
    margin-inline: auto;
    text-align: center;
}

.section-head h2 {
    margin-bottom: 14px;
}

.section-head p {
    color: var(--muted);
    margin: 0;
}

.head-split {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 54px;
}

.head-split .side {
    max-width: 430px;
    color: var(--muted);
    margin: 0;
}

.home-section-desc {
    max-width: 480px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.9;
}

/* ---------- Eyebrow / label ---------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent);
}

.eyebrow::before {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
    opacity: .8;
}

/* ---------- Text helpers ---------- */
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.on-dark { color: var(--on-dark); }

.lead {
    font-size: 17px;
    line-height: 2.1;
    color: var(--muted);
}

/* ---------- Scroll reveal (خاموش) ----------
   افکت محو‌شدن هنگام اسکرول حذف شد؛ محتوا همیشه بلافاصله و کامل نمایان است. */
.reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal,
    html.js .reveal:not(.in) { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    /* لینک «همه مقالات/محصولات» در تبلت و موبایل زیر عنوان می‌آید */
    .head-split {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .head-split .side { max-width: none; }
}

@media (max-width: 900px) {
    :root { --gutter: 20px; }
    .section { padding: 74px 0; }
    .head-split {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        margin-bottom: 40px;
    }
    .head-split .side { max-width: none; }
    .section-head { margin-bottom: 40px; }
}

@media (max-width: 560px) {
    :root { --gutter: 20px; }
    body { font-size: 15px; }
    .section { padding: 60px 0; }
    .section-tight { padding: 50px 0; }
    .section-head { margin-bottom: 34px; }
    .head-split { margin-bottom: 34px; }
    .eyebrow {
        margin-bottom: 14px;
        letter-spacing: 2px;
    }
    .eyebrow::before { width: 26px; }
    .lead { font-size: 15.5px; }
}

@media (max-width: 420px) {
    h1 { font-size: 2.05rem; }
    h2 { font-size: 1.6rem; }
}
