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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

[lang="ar"], .ar, .font-arabic {
  font-family: var(--font-arabic);
}

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

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

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

ul, ol {
  list-style: none;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-arabic);
  font-weight: 700;
  line-height: 1.2;
}

.font-display {
  font-family: var(--font-display);
}

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }
.text-4xl  { font-size: var(--text-4xl); }
.text-5xl  { font-size: var(--text-5xl); }
.text-hero { font-size: var(--text-hero); }

.text-muted { color: var(--color-text-muted); }
.text-lime  { color: var(--color-lime); }
.text-ember { color: var(--color-ember); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-2xl);
  }
}

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

.section--dark {
  background: var(--color-slate);
  color: var(--color-parchment);
}

.section--lime {
  background: var(--color-lime);
  color: var(--color-ink);
}

/* Grid utilities */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
.grid-5 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Visibility */
.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;
}

/* Animations */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* English blocks */
[dir="ltr"], .en {
  font-family: var(--font-body);
  direction: ltr;
  text-align: left;
}

/* Section labels */
.section-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-lime);
  margin-block-end: var(--space-md);
}

.section-title {
  font-size: var(--text-3xl);
  margin-block-end: var(--space-xl);
}

@media (min-width: 768px) {
  .section-title {
    font-size: var(--text-4xl);
  }
}

/* Lime underline */
.lime-underline {
  text-decoration: underline;
  text-decoration-color: var(--color-lime);
  text-decoration-thickness: 4px;
  text-underline-offset: 6px;
}

/* Label tag */
.label-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  padding-inline-start: var(--space-md);
  border-inline-start: 3px solid var(--color-lime);
  color: var(--color-text-muted);
}

.section--dark .label-tag {
  color: var(--color-fog);
}
