/* ==========================================================================
   base.css — reset, document defaults, typographic primitives, the reveal
   system, and accessibility affordances.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-block-start: calc(var(--nav-h) + var(--sp-5));
}

body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color var(--d-3) var(--e-out), color var(--d-3) var(--e-out);
}

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

img,
video {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:where(p, li, figcaption) {
  text-wrap: pretty;
}

:where(h1, h2, h3, h4) {
  text-wrap: balance;
}

hr {
  border: 0;
  border-block-start: 1px solid var(--border);
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: var(--on-scrim);
}

/* ── Focus ────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: fixed;
  inset-block-start: var(--sp-3);
  inset-inline-start: var(--sp-3);
  z-index: calc(var(--z-drawer) + 10);
  padding: var(--sp-3) var(--sp-5);
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--d-2) var(--e-spring);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════════
   Typographic primitives
   ══════════════════════════════════════════════════════════════════════════ */
.h1 {
  font-family: var(--font-read);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--headline);
}

.h2 {
  font-family: var(--font-read);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--headline);
}

.h3 {
  font-family: var(--font-read);
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--headline);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--track-widest);
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: var(--fs-md);
  line-height: var(--lh-read);
  color: var(--fg-mute);
  max-inline-size: 52ch;
}

/* Latin runs inside Arabic (SPSS, Word, E-Management) stay LTR */
.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════════════
   Layout helpers
   ══════════════════════════════════════════════════════════════════════════ */
.wrap {
  inline-size: min(100% - var(--gutter) * 2, var(--mid));
  margin-inline: auto;
}

.wrap--wide {
  inline-size: min(100% - var(--gutter) * 2, var(--wide));
  margin-inline: auto;
}

.wrap--narrow {
  inline-size: min(100% - var(--gutter) * 2, var(--narrow));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--alt {
  background: var(--bg-alt);
}

.section__head {
  display: grid;
  gap: var(--sp-3);
  margin-block-end: var(--sp-7);
  max-inline-size: 60ch;
}

.section__head--split {
  max-inline-size: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
}

.section__head--split > div {
  display: grid;
  gap: var(--sp-3);
  max-inline-size: 60ch;
}

.stack {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   Reveal — a quiet fade + rise, distinct from any scroll-driven effect
   ══════════════════════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity var(--d-4) var(--e-out), transform var(--d-4) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

[data-stagger] > * {
  --reveal-delay: calc(var(--i, 0) * var(--stagger-step, 60ms));
}

/* ══════════════════════════════════════════════════════════════════════════
   Reduced motion
   ══════════════════════════════════════════════════════════════════════════ */
@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;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

html[data-motion="reduced"] [data-reveal] {
  opacity: 1;
  transform: none;
}

html[data-motion="reduced"] .ticker__track {
  animation: none !important;
}

html[data-motion="reduced"] .carousel__track {
  transition: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   Print
   ══════════════════════════════════════════════════════════════════════════ */
@media print {
  .nav,
  .ticker,
  .to-top,
  .sidebar,
  .hero__carousel-dots {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
