/**
 * پایه: ریست + تایپوگرافی + رفتار کلی صفحه
 */

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

html {
    scroll-behavior: auto; /* اسکرول نرم واقعی را Lenis مدیریت می‌کند، نه CSS */
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden; /* شبکه‌ی ایمنی در برابر هر عنصر شناور/دکوراتیوِ سرکش */
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--ink-300);
    line-height: 1.9;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    max-width: 100vw;
}

/* وقتی پریلودر فعال است، اسکرول صفحه قفل می‌شود */
body.is-loading { overflow: hidden; height: 100vh; }

img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font-family: inherit; color: inherit; }

::selection { background: var(--gold-500); color: var(--ink-on-gold); }

/* اسکرول‌بار سفارشی (فقط مرورگرهای وبکیت) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--ink-900); border-radius: 10px; border: 2px solid var(--bg-void); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-900); }

/* کرسر سفارشی: روی همه‌چیز پیش‌فرض مخفی می‌شود مگر جایی که لازم است */
@media (hover: hover) and (pointer: fine) {
    body.cursor-ready, body.cursor-ready * { cursor: none !important; }
}

h1, h2, h3, h4 { font-family: var(--font); color: var(--ink-100); line-height: 1.35; font-weight: 800; }

p { color: var(--ink-500); }
strong, b { color: var(--ink-100); font-weight: 700; }

/* اعداد فارسی برای المان‌هایی که عدد لاتین دارند (ltr) */
.ltr { direction: ltr; unicode-bidi: isolate; }

.skip-link {
    position: fixed; top: -80px; right: 20px; z-index: var(--z-toast);
    background: var(--gold-500); color: var(--ink-on-gold);
    padding: 12px 22px; border-radius: var(--r-md); font-weight: 700; font-size: 14px;
    transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: 20px; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold-500); outline-offset: 3px; border-radius: 4px;
}

/* برای anchor-scroll، جای هدر ثابت را جبران کن */
section[id], div[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
