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

/* === HTML Root === */
html {
  font-family: var(--font-family-body);
  font-size: 16px;
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-page);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Arabic letter-spacing safety — prevents breaking cursive connections */
:lang(ar) {
  letter-spacing: 0 !important;
}

body {
  overflow-x: hidden;
  min-block-size: 100vh;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }

p {
  line-height: var(--line-height-base);
  color: var(--color-text-secondary);
}

/* === Links === */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-text-link-hover);
}

/* === Media === */
img, video, svg {
  max-inline-size: 100%;
  display: block;
}

/* === Lists === */
ul, ol {
  list-style: none;
}

/* === Focus visible for accessibility === */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
}

/* === Selection color === */
::selection {
  background-color: var(--color-brand-primary);
  color: var(--color-text-inverse);
}
