/* ==========================================================================
   OUR FUTURE — Base layer
   Modern reset + global typography + accessibility primitives + layout
   utilities. Authored mobile-first and with CSS logical properties so the
   entire site mirrors correctly in RTL (Arabic) with zero per-component work.
   ========================================================================== */

/* ----- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt", "ss01";
  overflow-x: hidden;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; height: auto; }
img, video { object-fit: cover; }

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

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

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

:where(h1, h2, h3, h4, h5, h6) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }

/* ----- Typography ------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  font-weight: var(--weight-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-snug);
}

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-extra);
}
h1, .h1 { font-size: var(--fs-h1); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); font-weight: var(--weight-extra); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); font-weight: var(--weight-semibold); }
h4, .h4 { font-size: var(--fs-h4); font-weight: var(--weight-semibold); }

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--color-text-soft);
  font-weight: var(--weight-regular);
}

small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
strong, b { font-weight: var(--weight-semibold); }

/* Gradient text — used sparingly on a single hero word for emphasis. */
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* graceful fallback handled via @supports below */
}
@supports not (background-clip: text) {
  .text-gradient { color: var(--brand-600); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-eyebrow);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--brand-600);
}
.on-dark .eyebrow { color: var(--brand-300); }

/* ----- Accessibility ---------------------------------------------------- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--s-4);
  inset-block-start: -100%;
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  transition: inset-block-start var(--dur-2) var(--ease-out);
}
.skip-link:focus { inset-block-start: var(--s-4); }

:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.on-dark :focus-visible { outline-color: #fff; }

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

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

/* ----- Layout primitives ------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--prose { max-width: var(--container-prose); }

.section { padding-block: var(--section-y); position: relative; }
.section--sm { padding-block: var(--section-y-sm); }
.section--tint { background: var(--bg-subtle); }
.section--flush-top { padding-block-start: 0; }

/* Section heading block */
.section-head { max-width: 46rem; margin-bottom: var(--s-8); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: var(--s-4); }
.section-head h2 { margin-top: var(--s-3); }

/* Grid helpers */
.grid { display: grid; gap: var(--s-5); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.stack > * + * { margin-top: var(--s-4); }

@media (max-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

/* Utilities */
.text-center { text-align: center; }
.text-soft { color: var(--color-text-soft); }
.text-muted { color: var(--color-text-muted); }
.text-brand { color: var(--brand-600); }
.mx-auto { margin-inline: auto; }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-0 { margin-bottom: 0; }
.full { width: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }

@media (max-width: 760px) { .hide-mobile { display: none !important; } }
@media (min-width: 761px) { .hide-desktop { display: none !important; } }

/* Decorative layers should never trap AT or pointer events. */
[aria-hidden="true"] { pointer-events: none; }
.deco { position: absolute; z-index: 0; pointer-events: none; user-select: none; }

/* Scroll-reveal base state — JS adds .is-in to animate. Without JS or with
   reduced motion, content is fully visible (progressive enhancement). */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}
