/* DHUHA — shared base. Tokens, type, language switching, nav, cursor.
   Page-specific styles live in index.css / clients.css / work.css. */

:root {
  /* Four colours, nothing else. Dhuha's palette. */
  --ink:  #0A0C0B;  /* ground */
  --bone: #F3F3F3;  /* primary text */
  --lime: #D2FF56;  /* accent 1: active, hover, highlight. Text on a lime fill is always ink */
  --blue: #0040C2;  /* accent 2: the second voice, used sparingly */
  --dim:  rgba(243, 243, 243, 0.56);  /* secondary text: bone at reduced strength, ~5.6:1 on ink */
  --line: rgba(243, 243, 243, 0.18);

  /* Oswald: condensed grotesque for every Latin role; plain zero, so numbers stay clean */
  --f-display: "Oswald", "Arial Narrow", sans-serif;
  --f-body: "Oswald", "Arial Narrow", sans-serif;
  --f-label: "Oswald", "Arial Narrow", sans-serif;
  /* Alan Sans: one Arabic family for every role (Arabic subset verified to join) */
  --f-ar: "Alan Sans", "Segoe UI", Tahoma, sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 300 17px/1.55 var(--f-body);
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--lime); color: var(--ink); }

/* ---- language: CSS decides what is visible ---- */
html[lang="ar"] .lang-en,
html[lang="en"] .lang-ar { display: none !important; }

html[lang="ar"] body { font-family: var(--f-ar); }
/* Arabic never takes Latin tracking; display weight 300, roomier leading */
html[lang="ar"] .display { font-family: var(--f-ar); font-weight: 300; letter-spacing: 0; line-height: 1.3; }
html[lang="ar"] .mono { font-family: var(--f-ar); letter-spacing: 0; text-transform: none; font-size: 13px; }

/* ---- type roles ---- */
/* Oswald is tall and narrow: no negative tracking, leading near 1 */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}
/* .mono is the small-label role (name kept from the first build); now Oswald, not monospaced */
.mono {
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
}
/* live numbers: fixed-width digits so counters do not jitter */
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.accent { color: var(--lime); }
.accent-2 { color: var(--blue); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; transform-origin: left center; }
html[dir="rtl"] .rule { transform-origin: right center; }

/* masked line: child rises from below its own box */
.mask { display: block; overflow: hidden; padding-block-end: 0.06em; }
.mask > * { display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; inset-inline-start: var(--gutter); top: 8px; z-index: 200; background: var(--bone); color: var(--ink); padding: 8px 12px; transform: translateY(-200%); }
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }

/* ---- nav: difference blend so it reads over ink and over colour ---- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.nav a { text-decoration: none; }
.nav__links { display: flex; gap: clamp(14px, 3vw, 32px); align-items: center; }
.nav__links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.nav__brand { font-family: var(--f-display); font-weight: 500; font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 420px) {
  .nav { gap: 10px; }
  .nav__brand { font-size: 18px; }
  .nav__links { gap: 12px; }
}
html[lang="ar"] .nav__brand { font-family: var(--f-ar); font-weight: 500; font-size: 18px; }
.nav__lang { min-width: 28px; min-height: 28px; }

/* thin ink bar on the bottom edge; body padding keeps the page end clear of it */
.sample-note {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90; margin: 0;
  padding: 6px var(--gutter);
  background: var(--ink); border-top: 1px solid var(--line);
  color: var(--lime); pointer-events: none;
}
body.has-sample { padding-block-end: 44px; } /* bar height plus room for taller Arabic line */

/* ---- cursor ---- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 300;
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--lime);
  pointer-events: none;
  opacity: 0; /* hidden until the first pointer move places it */
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), opacity .25s;
}
.cursor.is-live { opacity: 1; }
.cursor.is-hot { width: 70px; height: 70px; margin: -35px 0 0 -35px; opacity: .35; }
@media (pointer: coarse) { .cursor { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .cursor { display: none; }
}

/* ---- no-JS fallback, generated by scripts/build.mjs ---- */
.nojs { padding: 24px var(--gutter) 64px; max-width: 72ch; }
.nojs .display { font-size: clamp(56px, 12vw, 160px); margin-block: 32px 16px; }
.nojs h2 { margin-block: 40px 12px; color: var(--dim); }
.nojs ul { margin: 0; padding: 0; list-style: none; }
.nojs li { padding-block: 10px; border-top: 1px solid var(--line); }
.nojs small { display: block; color: var(--dim); }
.nojs [lang="ar"] { font-family: var(--f-ar); }
.nojs__sample { color: var(--lime); }

/* ---- signpost to the Clients page (Dhuha.toClients): quiet, never a button ---- */
.to-clients {
  display: inline-flex; align-items: baseline; gap: .5em;
  font: 400 12px/1.4 var(--f-label); letter-spacing: .14em; text-transform: uppercase;
  color: var(--bone); text-decoration: none;
  text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.to-clients__arr::before { content: "→"; }
html[dir="rtl"] .to-clients__arr::before { content: "←"; }
.to-clients:hover, .to-clients:focus-visible { text-decoration-line: underline; text-decoration-color: var(--lime); }
.to-clients:hover .to-clients__arr { color: var(--lime); }
html[lang="ar"] .to-clients { font-family: var(--f-ar); letter-spacing: 0; text-transform: none; font-size: 13px; }

/* carousel rows (see Dhuha.swipe) */
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: pan-x pan-y; user-select: none; }
.slides::-webkit-scrollbar { display: none; }
.slides__i { flex: 0 0 100%; min-width: 0; min-height: 0; display: block; scroll-snap-align: start; scroll-snap-stop: always; }
.slides__i img { width: 100%; height: 100%; object-fit: contain; }
.slides.is-dragging, .wk__track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
