/* ============================================================
   Base — the Thmanyah type system, reset, shared typography.

   Thmanyah carries both Arabic and Latin, so the bilingual
   toggle never changes typeface, only direction. Three roles:
   Serif Display for cinematic headlines, Serif Text for
   narrative prose, Sans for labels and interface.
   ============================================================ */

/* — Thmanyah Sans : UI, labels, data ——————————————————————— */
@font-face { font-family: "Thmanyah Sans"; src: url("../../public/fonts/thmanyahsans-Light.woff2")   format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../../public/fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../../public/fonts/thmanyahsans-Medium.woff2")  format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../../public/fonts/thmanyahsans-Bold.woff2")    format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("../../public/fonts/thmanyahsans-Black.woff2")   format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

/* — Thmanyah Serif Text : narrative prose —————————————————— */
@font-face { font-family: "Thmanyah Serif"; src: url("../../public/fonts/thmanyahseriftext-Light.woff2")   format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Serif"; src: url("../../public/fonts/thmanyahseriftext-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Serif"; src: url("../../public/fonts/thmanyahseriftext-Medium.woff2")  format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Serif"; src: url("../../public/fonts/thmanyahseriftext-Bold.woff2")    format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* — Thmanyah Serif Display : cinematic headlines ——————————— */
@font-face { font-family: "Thmanyah Display"; src: url("../../public/fonts/thmanyahserifdisplay-Light.woff2")   format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Display"; src: url("../../public/fonts/thmanyahserifdisplay-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Display"; src: url("../../public/fonts/thmanyahserifdisplay-Medium.woff2")  format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Display"; src: url("../../public/fonts/thmanyahserifdisplay-Bold.woff2")    format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Display"; src: url("../../public/fonts/thmanyahserifdisplay-Black.woff2")   format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --font-display: "Thmanyah Display", "Thmanyah Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-serif:   "Thmanyah Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans:    "Thmanyah Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
}

/* — reset ——————————————————————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, canvas, svg { display: block; max-width: 100%; }

/* Arabic sizing is handled in tokens.css by scaling the type
   tokens themselves, NOT by overriding font-size on components —
   an override here outranks the component rule and silently
   flattens the hierarchy. */

/* — shared type roles ——————————————————————————————————— */
.label {
  font-family: var(--font-sans);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lead {
  font-family: var(--font-serif);
  font-size: var(--t-lead);
  line-height: 1.68;
  color: var(--ink-soft);
  max-width: var(--measure);
  font-weight: 300;
}

.prose {
  font-family: var(--font-serif);
  max-width: var(--measure);
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.72;
}

.display-1 { font-size: var(--t-d1); }
.display-2 { font-size: var(--t-d2); }
.display-3 { font-size: var(--t-d3); font-weight: 400; letter-spacing: -0.012em; }

.em { font-style: italic; color: var(--world); font-weight: 400; }

.mono-num { font-variant-numeric: tabular-nums; }

/* — focus, always visible ——————————————————————————————— */
:focus-visible {
  outline: 2px solid var(--world);
  outline-offset: 3px;
  border-radius: var(--radius);
}

::selection { background: var(--accent-soft); color: var(--accent-ink); }

.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;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 999;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--ground);
  font-size: var(--t-small);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

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