/* ════════════════════════════════════════════════════
   تواصُل · Base Styles
   ════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--noir);
  color: var(--pearl);
  font-family: var(--font-display);
  font-weight: var(--weight-light);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ─── الخلفية الأطلسية (متعددة الطبقات) ─────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 70% 60% at 50% 20%, var(--turquoise-soft) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(31, 179, 184, 0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 90%, rgba(245, 236, 215, 0.02) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* الحبيبية (Film grain) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

/* ─── الطباعة ───────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-arabic);
  font-weight: var(--weight-regular);
  line-height: 1.2;
  color: var(--pearl);
}

p {
  line-height: 1.7;
  color: var(--pearl-dim);
}

a {
  color: var(--turquoise);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--turquoise-bright);
}

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

input, textarea {
  font-family: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── التحديد ───────────────────────────────────── */
::selection {
  background: var(--turquoise);
  color: var(--noir);
}

/* ─── شريط التمرير ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--noir-elevated);
}

::-webkit-scrollbar-thumb {
  background: var(--turquoise-darker);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--turquoise-deep);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--turquoise-darker) var(--noir-elevated);
}

/* ─── الوصول (Accessibility) ─────────────────────── */
:focus-visible {
  outline: 2px solid var(--turquoise);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── المساعدات ────────────────────────────────── */
.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;
}

.no-scroll {
  overflow: hidden;
}
