/* Base reset + typography + a11y */

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

html {
  font-family: var(--font-arabic);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[dir="rtl"] { direction: rtl; }
body {
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-text);
  transition: background var(--t-med), color var(--t-med);
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* Focus — WCAG */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  inset-inline-start: 8px;
  top: -40px;
  background: var(--c-text);
  color: var(--c-bg);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 9999;
  font-weight: 600;
  transition: top var(--t-fast);
}
.skip-link:focus-visible { top: 8px; }

/* Type scale */
h1, .h1 { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
h2, .h2 { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.005em; }
h3, .h3 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
h4, .h4 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
h5, .h5 { font-size: var(--fs-md); font-weight: 700; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-3); }
.muted { color: var(--c-text-2); }
.faint { color: var(--c-text-3); font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); }

/* Numerals: Arabic-Indic in Arabic copy can be unwanted in fintech — keep Latin numerals */
html[lang="ar"] { font-feature-settings: "lnum"; }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--sp-6); }
}

/* Utility */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-end { text-align: end; }

/* Animations */
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    transition-duration: 0ms !important;
  }
}

.fade-in { animation: fade-in var(--t-med) var(--ease) both; }

/* Skeletons */
.skel {
  background: linear-gradient(90deg, var(--c-surface-2) 0%, var(--c-border) 50%, var(--c-surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
}

/* Print */
@media print {
  body { background: white; color: black; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
