/* ============================================================
   base.css — Reset & Global Typography
   ============================================================ */

/* ── Google Fonts import ───────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* RTL body */
[dir="rtl"] body,
[dir="rtl"] {
  letter-spacing: 0;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ── Typography hierarchy ──────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4 {
  letter-spacing: 0;
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl)); font-weight: 800; }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); font-weight: 700; }
h3 { font-size: clamp(var(--text-xl),  2.5vw, var(--text-3xl)); font-weight: 600; }
h4 { font-size: var(--text-xl); font-weight: 600; }

p {
  font-size: var(--text-base);
  color: var(--c-mute);
  line-height: 1.8;
}

/* ── Layout util ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--sp-8);
  }
}

@media (min-width: 1200px) {
  .container {
    padding-inline: var(--sp-12);
  }
}

/* ── Accessibility ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--c-green);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.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;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-green-light); }

/* ── Animations base ───────────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-up[data-delay="1"] { transition-delay: 100ms; }
.fade-in-up[data-delay="2"] { transition-delay: 200ms; }
.fade-in-up[data-delay="3"] { transition-delay: 300ms; }
.fade-in-up[data-delay="4"] { transition-delay: 400ms; }
.fade-in-up[data-delay="5"] { transition-delay: 500ms; }
