/*
 * base.css: reset, the page ground (haze + dot grid), type defaults, focus,
 * scrollbars. Only values from tokens.css.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid var(--border);
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: var(--font-body);
  line-height: 1.5;
}
body {
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--om-ink);
  background-color: var(--om-base);
  background-image: var(--om-bloom);
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* canvas dot grid: faint dots over the haze, fixed to the screen */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--om-dot) 1px, transparent 1.4px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote {
  margin: 0;
}
ul, ol {
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  background: transparent;
  margin: 0;
}
button {
  cursor: pointer;
  padding: 0;
}
button:disabled {
  cursor: default;
}
img,
svg {
  display: block;
  vertical-align: middle;
}
svg.icon {
  flex-shrink: 0;
}
table {
  border-collapse: collapse;
  text-indent: 0;
}
[hidden] {
  display: none !important;
}

/* headings and figures use Inter, tight */
.heading {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.muted {
  color: var(--om-ink-soft);
}
.mono {
  font-family: var(--font-mono);
}
.tabular {
  font-variant-numeric: tabular-nums;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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;
}

/* one focus model everywhere: a soft ring on keyboard focus only */
:focus {
  outline: none;
}
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring-soft);
}

::selection {
  background: color-mix(in srgb, var(--om-accent) 22%, transparent);
}

/* quiet scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--om-ink) 18%, transparent) transparent;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
}
.skip-link:focus {
  top: 12px;
}

/* the landing page (body.lp-body) keeps its motion: Ameer wants it seen even with Reduce Motion on
   (6 Oct 2026); it handles its own calmer cases in css/pages/landing.css */
@media (prefers-reduced-motion: reduce) {
  body:not(.lp-body) *,
  body:not(.lp-body) *::before,
  body:not(.lp-body) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

[dir="rtl"] .rtl-flip { transform: scaleX(-1); }

/* Arabic: joined letters are never tracked and have no capitals. */
:lang(ar) *,
:lang(ar) *::before,
:lang(ar) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
/* Arabic: links, phone numbers and emails are typed left to right, but stay
   on the form's start (right) edge like every other field. */
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="email"] {
  direction: ltr;
  text-align: right;
}
