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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  text-align: start;
}

html[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', Inter, system-ui, -apple-system, sans-serif;
}

/* Keep Arabic copy and embedded Latin words from reordering each other. */
[dir="auto"] { unicode-bidi: plaintext; }
[dir="ltr"] { unicode-bidi: isolate; }

/* Typography Base */
h1, h2, h3, h4, h5, h6 { line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; cursor: pointer; }
button { cursor: pointer; }
ul { list-style: none; }

.text-secondary { color: var(--color-text-dim); }

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--color-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.container {
  width: 100%; max-width: var(--container-width);
  margin: 0 auto; padding: 0 var(--space-6);
}

section { padding: var(--space-32) 0; position: relative; }

/* Scroll Wrap Elements for Reveal Animation */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.8s var(--ease-out-expo);
}
.reveal-active .word-inner {
  transform: translateY(0);
}

/* Monospace Utility */
.font-mono {
  font-family: var(--font-mono);
}
