/* ==========================================================================
   base.css — تهيئة، طباعة، عناصر تخطيط أساسية، ومحرك حركة الظهور
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

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

:focus-visible {
  outline: 2px solid var(--brand-aqua);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--brand-aqua); color: var(--brand-ink); }

/* --- تخطيط ---------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.section--dark {
  background: var(--brand-ink);
  color: var(--on-dark-body);
}
.section--dark h2,
.section--dark h3 { color: var(--on-dark-strong); }

.section--mono { background: var(--brand-mono); color: var(--on-dark-body); }
.section--mono h2, .section--mono h3 { color: var(--on-dark-strong); }

.section__head { max-width: 62ch; margin-bottom: var(--sp-7); }
.section__lead {
  margin-top: var(--sp-4);
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
}

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 999;
  background: var(--brand-aqua);
  color: var(--brand-ink);
  padding: var(--sp-3) var(--sp-5);
  font-weight: 600;
}
.skip-link:focus { inset-inline-start: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- الموتيف: شريط الشعار المائل (Offset) --------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--aqua-700);
  text-transform: uppercase;
}
.section--dark .eyebrow,
.section--mono .eyebrow { color: var(--brand-aqua); }

/* الشريطان المتزاحفان — نفس هندسة الشعار */
.eyebrow::before {
  content: "";
  width: 26px;
  height: 16px;
  flex: none;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 18px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 11px / 18px 5px no-repeat;
  transform: skewX(var(--skew));
  opacity: .95;
}

.offset-rule {
  width: 44px; height: 26px;
  background:
    linear-gradient(var(--brand-aqua), var(--brand-aqua)) 0 0 / 30px 8px no-repeat,
    linear-gradient(currentColor, currentColor) 13px 18px / 30px 8px no-repeat;
  transform: skewX(var(--skew));
  opacity: .5;
}

/* --- حركة الظهور عند التمرير ---------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
