/**
 * Bitpedia — Base
 * ریست مدرن + قواعد پایه + پریمیتیوهای قابل‌استفاده‌ی مجدد (شیشه، دکمه، فوکوس).
 * همه‌چیز از styles/tokens.css تغذیه می‌شود.
 */

/* ══════════════════════════════════════
   ریست
   ══════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-1);
  background-image: var(--gradient-mesh);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

/* اعداد همیشه چپ‌به‌راست و تک‌فاصله (tabular) داخل بافت راست‌چین بمانند —
   برای نرخ ارز، تیکر، مبدل، آمار. */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}

/* رشته‌های صرفاً لاتین که باید با Poppins/Inter رندر شوند (نه گلیف Vazirmatn) */
.font-latin-heading {
  font-family: var(--font-latin-heading);
  direction: ltr;
  unicode-bidi: isolate;
}
.font-latin-body {
  font-family: var(--font-latin-body);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ══════════════════════════════════════
   دسترس‌پذیری
   ══════════════════════════════════════ */
.skip-link {
  position: fixed;
  inset-inline-start: var(--space-4);
  top: -100px;
  z-index: var(--z-modal);
  background: var(--bp-blue-500);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  transition: top var(--dur-fast) var(--ease-flow);
}
.skip-link:focus-visible {
  top: var(--space-4);
}

:focus-visible {
  outline: 2px solid var(--bp-blue-400);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

::selection {
  background: var(--bp-blue-500);
  color: #fff;
}

/* اسکرول‌بار نازک و برندشده (وبکیت) */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-0);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bp-blue-700);
}

/* ══════════════════════════════════════
   کانتینر و ریتم بخش‌ها
   ══════════════════════════════════════ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  position: relative;
  padding-block: var(--section-gap);
}

.section-head {
  max-width: 46rem;
  margin-bottom: var(--space-8);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--bp-blue-300);
  margin-bottom: var(--space-3);
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: var(--radius-pill);
}

.section-title {
  /* ۲۵٪ کوچک‌تر از پلهٔ --fs-2xl (که مشترک با مقیاسِ مدولار است، پس همان‌جا override شده،
     نه در tokens.css، تا آن پله برای مصارف دیگر دست‌نخورده بماند) */
  font-size: clamp(1.6875rem, 1.35rem + 1.5vw, 2.4375rem);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   پریمیتیو شیشه‌ای (Glass) — سطح مشترک همه‌ی کارت‌ها/پنل‌ها
   ══════════════════════════════════════ */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-base) var(--ease-flow),
              box-shadow var(--dur-base) var(--ease-flow),
              transform var(--dur-base) var(--ease-flow);
}
.glass:hover {
  border-color: var(--glass-border-hi);
  box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════
   دکمه‌ها
   ══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 52px;
  padding-inline: var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring),
              box-shadow var(--dur-base) var(--ease-flow),
              background var(--dur-base) var(--ease-flow),
              border-color var(--dur-base) var(--ease-flow);
  will-change: transform;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--gradient-brand);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-glow-brand);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--glass-glow);
}

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.btn-ghost:hover {
  border-color: var(--glass-border-hi);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════
   کمکی‌ها (utilities)
   ══════════════════════════════════════ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}
