/* reset + طباعة + عناصر عامة */

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

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.6;
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  /* لا scroll-behavior: smooth — التمرير الملساء المتكرّر يرفع p95 إلى ~50ms
     أثناء التمرير (قياس مهمية 5.1)، والمواصفة لا تطلبه */
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s linear, color 0.2s linear;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  line-height: 1.7;
  color: var(--text-2);
}

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

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

/* تركيز مرئي للوحة المفاتيح (site-shell: الوصولية) */
a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow:
    inset 0 0 0 2px var(--bg-elevated),
    0 0 0 3px var(--accent);
  border-radius: var(--radius-s);
}

button:active {
  box-shadow: none;
}

/* تجاوب: تخطيط شبكة عام */
.grid {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
}

.h2-display {
  font-size: var(--fs-h2);
}

.amp {
  font-style: italic;
}

/* إيقاف الحركات عند طلب النظام (design-system + site-interactions) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
