/* ==========================================================================
   بلند چینه دژ — توکن‌های طراحی
   زبان بصری: بتن، فولاد اکسیدشده، نقشه سازه
   ========================================================================== */

/* --- وزیرمتن: متن فارسی --------------------------------------------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}

/* --- JetBrains Mono: داده فنی، کد تجهیز، مقادیر اندازه‌گیری ---------- */
@font-face {
  font-family: 'JetBrainsMono';
  src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrainsMono';
  src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* --- پالت: بتن، فولاد اکسیدشده، مرکب نقشه --- */
  --ink:          #14181C;
  --ink-soft:     #3A424B;
  --ink-faint:    #6B7580;
  --concrete:     #E9E5DD;
  --concrete-dk:  #D3CCC1;
  --paper:        #F8F6F2;
  --white:        #FFFFFF;
  --blueprint:    #16394E;
  --blueprint-lt: #2C6285;
  --oxide:        #C25A2B;
  --oxide-lt:     #E0793F;
  --oxide-pale:   #FBF0EA;
  --brass:        #A8843E;

  --line:         rgba(20, 24, 28, 0.10);
  --line-mid:     rgba(20, 24, 28, 0.16);
  --line-strong:  rgba(20, 24, 28, 0.26);

  /* --- وضعیت --- */
  --ok:        #2F7A4F;
  --ok-pale:   #EDF5F0;
  --warn:      #A8701A;
  --warn-pale: #FBF3E6;
  --danger:    #B3341F;
  --danger-pale: #FBEDEA;
  --idle:      #79838E;
  --idle-pale: #F1F2F4;

  /* --- تایپوگرافی --- */
  --font-body: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrainsMono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* مقیاس: نسبت ۱٫۲ — برای رابط داده‌محور مناسب است */
  --t-2xs:  0.6875rem;   /* 11px — برچسب ریز */
  --t-xs:   0.75rem;     /* 12px — کمکی */
  --t-sm:   0.8125rem;   /* 13px — جدول */
  --t-base: 0.9375rem;   /* 15px — متن */
  --t-md:   1.0625rem;   /* 17px */
  --t-lg:   1.25rem;     /* 20px */
  --t-xl:   1.5rem;      /* 24px */
  --t-2xl:  1.875rem;    /* 30px */
  --t-3xl:  2.25rem;     /* 36px */

  /* --- فاصله: مقیاس ۴ پیکسلی --- */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;  --s-6: 28px;  --s-7: 40px;  --s-8: 56px;
  --s-9: 80px;  --s-10: 112px;

  --radius:    3px;
  --radius-lg: 5px;

  --shadow-sm: 0 1px 2px rgba(20,24,28,.05);
  --shadow:    0 1px 3px rgba(20,24,28,.07), 0 6px 16px rgba(20,24,28,.05);
  --shadow-lg: 0 2px 6px rgba(20,24,28,.09), 0 20px 44px rgba(20,24,28,.11);

  --wrap: 1320px;
  --side-w: 244px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--concrete);
  color: var(--ink);
  font-size: var(--t-base);
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'ss02';
}

/* --- داده فنی: همیشه ارقام لاتین، چپ‌چین ---------------------------
   کد تجهیز، شماره سریال، مقادیر اندازه‌گیری و تاریخ باید دقیقاً
   مثل برچسب روی دستگاه خوانده شوند. تبدیل ذهنی منبع خطاست.       */
.num, .ref, .mono, [data-num] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ارقام فارسی — فقط برای شمارش و آمار */
.fa-num {
  font-family: var(--font-body);
  font-feature-settings: 'ss01';
}

a { color: inherit; text-decoration: none; }
a:not(.btn):not(.logo):hover { color: var(--oxide); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  font-family: var(--font-body);
}

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

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

::selection { background: var(--oxide); color: #fff; }

/* --- عنصر امضا: خط سازه‌ای -----------------------------------------
   خط مویی با نشانه‌های پیچ — ارجاع به دهانه تیر فولادی            */
.span-rule {
  height: 1px;
  background: var(--line-mid);
  position: relative;
  margin-block: var(--s-6);
}
.span-rule::before,
.span-rule::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.span-rule::before { inset-inline-start: 14%; }
.span-rule::after  { inset-inline-start: 78%; }

/* برچسب بالای عنوان — مثل شماره برگه نقشه */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--oxide);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--oxide);
  flex-shrink: 0;
}

/* --- دکمه‌ها --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 9px var(--s-5);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease,
              color .16s ease, transform .1s ease;
}
.btn:hover  { background: var(--oxide); border-color: var(--oxide); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.btn--sm { padding: 6px var(--s-4); font-size: var(--t-xs); }
.btn--icon { padding: 7px; width: 32px; height: 32px; }

/* --- زمینه شبکه نقشه --- */
.blueprint-bg {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 30px 30px;
}
