/* ============================================================
   Base reset & typography
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui-lat);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body,
html[lang="ar"] { font-family: var(--font-ui-ar); }

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* Numerals always render LTR-shaped even inside RTL flow */
.num, .amount, td.num, th.num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Display / brand typeface — used only at brand moments */
.font-display {
  font-family: var(--font-display-lat);
  font-weight: 400;
  letter-spacing: 0.01em;
}
html[lang="ar"] .font-display { font-family: var(--font-display-ar); font-weight: 700; letter-spacing: 0; }

/* ---- RTL / LTR direction handling ---- */
html[dir="rtl"] { direction: rtl; }
html[dir="ltr"] { direction: ltr; }

:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--rose-300); color: var(--wine-900); }

/* Scrollbar - subtle, warm */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
