/* ==========================================================================
   PRIMITIVES — Reset, base HTML elements, global typography
   Depends on: tokens.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Box model reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Root & scroll
   -------------------------------------------------------------------------- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Direction & font per locale
   -------------------------------------------------------------------------- */
html[lang='ar'] body {
  font-family: var(--font-ar);
  direction: rtl;
}

html[lang='en'] body {
  font-family: var(--font-en);
  direction: ltr;
}

/* Arabic paragraph / list line-height */
html[lang='ar'] p,
html[lang='ar'] li {
  line-height: 2;
  letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   Body base
   -------------------------------------------------------------------------- */
body {
  color: var(--color-text);
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(14, 165, 198, 0.12), transparent 48%),
    radial-gradient(900px 500px at 88% -8%, rgba(11, 122, 90, 0.1), transparent 44%),
    var(--color-bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

html.dark body {
  background: #0b1f17;
  color: #e8fff4;
}

/* --------------------------------------------------------------------------
   Heading scale
   -------------------------------------------------------------------------- */
h1,
h2,
h3 {
  margin-top: 0;
  color: var(--color-text);
  letter-spacing: -0.01em;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  line-height: 1.12;
  margin-bottom: var(--space-3);
}

h2 {
  font-size: clamp(1.4rem, 2.1vw, 2.1rem);
  line-height: 1.22;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.35rem);
  line-height: 1.3;
  margin-bottom: var(--space-2);
}

/* --------------------------------------------------------------------------
   Body copy
   -------------------------------------------------------------------------- */
p,
li {
  font-size: 1.04rem;
  line-height: 1.9;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   Images
   -------------------------------------------------------------------------- */
img[loading='lazy'],
img {
  max-width: 100%;
  height: auto;
  display: block;
  aspect-ratio: auto;
}

picture img {
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Responsive typography floor
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  p,
  li {
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 22px;
  }
}
