/* ================================
 * Fonts & Typography Baseline
 * - Variable font (Vazirmatn) with swap
 * - Clean fallback stack for RTL Persian
 * - Smoother rendering; stable metrics to reduce CLS
 * ================================ */

/* Variable font (weight axis 100..900) */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn/static/Vazirmatn[wght].woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap; /* improve LCP: show fallback then swap */
}

/* Root design tokens (can be overridden by theme) */
:root{
  --kw-font-sans: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
                   "Liberation Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --kw-bg: #0b1220;       /* صفحه تیره */
  --kw-bg-2: #0f182a;     /* هرو/نوار تیره‌تر */
  --kw-text: #e7eaf3;     /* متن اصلی روشن */
  --kw-text-dim: #b5bfd3; /* متن ثانویه */
  --kw-primary: #ff2f55;  /* CTA */
  --kw-primary-hover: #e62849;
}

/* Base typography */
html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html[dir="rtl"] body{
  font-family: var(--kw-font-sans);
  line-height: 1.65;           /* خوانایی بهتر */
  letter-spacing: 0;           /* جلوگیری از فاصله اضافی در فارسی */
  color: var(--kw-text);
  background: var(--kw-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prefer variable font where supported */
@supports (font-variation-settings: normal) {
  html[dir="rtl"] body{
    font-variation-settings: "wght" 400;
  }
}

/* Accessible defaults */
b, strong { font-weight: 700; }
em, i     { font-style: italic; }

/* Utility to control font weight steps with variable fonts */
:root{
  --w-thin: 100;
  --w-extralight: 200;
  --w-light: 300;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-extrabold: 800;
  --w-black: 900;
}
