/* ════════════════════════════════════════════════
   JB Studio — Design System v2.0
   ألوان: سماوي #00D4E8 على أسود #000000
   One of the works Violets Studio
════════════════════════════════════════════════ */

/* ══════════════════════════════════════
   1. CSS VARIABLES — الثيم الداكن (افتراضي)
══════════════════════════════════════ */
:root,
html.dark {
  /* ألوان البراند */
  --color-primary: #00d4e8;
  --color-primary-light: #33dded;
  --color-primary-dark: #00a8b8;
  --color-primary-glow: rgba(0, 212, 232, 0.15);

  /* خلفيات */
  --color-bg: #000000;
  --color-bg-alt: #0a0a0a;
  --color-surface: #111111;
  --color-surface-hover: #1a1a1a;
  --color-border: #1f1f1f;
  --color-border-accent: rgba(0, 212, 232, 0.25);

  /* نصوص */
  --color-text-primary: #ffffff;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #475569;

  /* Navbar */
  --color-navbar-bg: rgba(0, 0, 0, 0.72);
  --color-navbar-border: rgba(255, 255, 255, 0.08);

  /* Misc */
  --kick-green: #00e701;
  --section-py: clamp(5rem, 9vw, 9rem);
}

/* ══════════════════════════════════════
   2. LIGHT THEME — الثيم الفاتح
══════════════════════════════════════ */
html.light {
  --color-primary: #00a8b8;
  --color-primary-light: #00c4d6;
  --color-primary-dark: #007d8c;
  --color-primary-glow: rgba(0, 168, 184, 0.12);

  --color-bg: #f8fafc;
  --color-bg-alt: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-hover: #f8fafc;
  --color-border: #e2e8f0;
  --color-border-accent: rgba(0, 168, 184, 0.35);

  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;

  --color-navbar-bg: rgba(248, 250, 252, 0.85);
  --color-navbar-border: rgba(0, 0, 0, 0.08);
}

/* ══════════════════════════════════════
   3. RESET + BASE
══════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: #050a0f;
}

body {
  font-family: "IBM Plex Sans Arabic", sans-serif;
  background: #050a0f;
  color: var(--color-text-primary);
  overflow-x: hidden;
  line-height: 1.7;
  transition:
    background 0.3s ease,
    color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
html.light,
html.light body {
  background: var(--color-bg);
}

/* ══════════════════════════════════════
   AMBIENT BACKGROUND — طبقة الخلفية الثابتة
══════════════════════════════════════ */
.site-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-color: #050a0f;
  overflow: hidden;
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  width: 200vw;
  height: 200vh;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    ellipse 60% 55% at 50% 30%,
    rgba(0, 212, 232, 0.08) 0%,
    rgba(0, 212, 232, 0.025) 45%,
    rgba(5, 10, 15, 0) 70%
  );
  transform: rotate(10deg);
  transform-origin: center;
}

.dot-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

/* في الوضع الفاتح: نخفي الطبقة ونعيد خلفيات CSS الأصلية */
html.light .site-bg-overlay {
  display: none;
}

/* اتجاه العربية */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}
html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

/* الخطوط */
h1,
h2,
h3,
h4 {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 900;
  line-height: 1.2;
}
html[dir="ltr"] h1,
html[dir="ltr"] h2,
html[dir="ltr"] h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
}
/* عنوان الـ hero موحّد بصرياً في كلا اللغتين — يتجاوز قاعدة Barlow للـ h1 */
html[dir="ltr"] .hero__title {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 900;
  letter-spacing: -0.03em;
}

a {
  text-decoration: none;
}
img {
  display: block;
  max-width: 100%;
}

/* ══════════════════════════════════════
   4. CONTAINER
══════════════════════════════════════ */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

/* ══════════════════════════════════════
   5. LOADER
══════════════════════════════════════ */
.loader-wrapper {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
.loader-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader {
  width: 44px;
  height: 44px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════
   6. NAVBAR — PILL DESKTOP
══════════════════════════════════════ */

/* الـ header يضع الـ pill في المنتصف */
.site-header {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  /* تأكد أن الـ pill لا يأخذ عرض الصفحة كاملاً */
  width: max-content;
}

/* الـ pill نفسه */
.navbar__pill {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.6rem;
  background: var(--color-navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-navbar-border);
  border-radius: 9999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
  /* الـ pill يبقى LTR دائماً بغض النظر عن اتجاه الصفحة */
  direction: ltr;
}

/* حالة السكرول */
.navbar__pill.is-scrolled {
  background: var(--color-navbar-bg);
  border-color: var(--color-border-accent);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 212, 232, 0.08);
}
html.light .navbar__pill.is-scrolled {
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 168, 184, 0.15);
}

/* فاصل داخل الـ pill */
.pill__sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  flex-shrink: 0;
  margin: 0 0.25rem;
}

/* أيقونة الرئيسية */
.pill__home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--color-text-secondary);
  transition:
    color 0.2s,
    background 0.2s;
  flex-shrink: 0;
}
.pill__home:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

/* روابط التنقل */
.pill__links {
  display: flex;
  list-style: none;
  gap: 0.125rem;
  align-items: center;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 9999px;
  transition:
    color 0.2s,
    background 0.2s;
  white-space: nowrap;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
.nav__link svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.nav__link:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
}
.nav__link:hover svg {
  opacity: 1;
}

/* أزرار التحكم */
.pill__controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ══════════════════════════════════════
   7. BUTTONS — تحكم الثيم واللغة
══════════════════════════════════════ */
.btn-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  letter-spacing: 0.05em;
}
.btn-ctrl:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border-color: var(--color-border-accent);
}

/* ══════════════════════════════════════
   8. MOBILE BAR (موبايل فقط)
══════════════════════════════════════ */
.mobile-bar {
  display: none; /* يظهر فقط على الموبايل */
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  width: 100%;
}
html.light .mobile-bar {
  background: rgba(248, 250, 252, 0.92);
}

.logo-mobile img {
  height: 38px;
  width: auto;
}

.mobile-bar__end {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.hamburger:hover {
  background: var(--color-primary-glow);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}
/* حالة مفتوح */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════
   9. MOBILE DRAWER
══════════════════════════════════════ */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(80%, 320px);
  height: 100vh;
  background: var(--color-surface);
  border-inline-start: 1px solid var(--color-border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 5rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
}
html[dir="ltr"] .mobile-drawer {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  border-inline-start: none;
  border-inline-end: 1px solid var(--color-border);
}
.mobile-drawer.open {
  transform: translateX(0);
}

.drawer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.drawer__link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}
.drawer__link:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
}
.drawer__cta {
  margin-top: auto;
}

/* ══════════════════════════════════════
   10. BUTTONS — CTA
══════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  background: var(--color-primary);
  color: #000000; /* أسود على سماوي — قاعدة ثابتة */
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 232, 0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border-accent);
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-ghost:hover {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
}

/* ══════════════════════════════════════
   11. HERO
══════════════════════════════════════ */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 12vw, 9rem) 0 clamp(4rem, 8vw, 6rem);
  background: radial-gradient(
    ellipse 75% 60% at 50% 45%,
    rgba(0, 212, 232, 0.18) 0%,
    rgba(0, 168, 184, 0.06) 38%,
    transparent 68%
  );
  text-align: center;
}
html.light .hero {
  background:
    radial-gradient(
      ellipse 75% 60% at 50% 45%,
      rgba(0, 168, 184, 0.12) 0%,
      rgba(0, 168, 184, 0.03) 40%,
      transparent 68%
    ),
    var(--color-bg);
}

.hero__container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* شعار في الهيرو */
.hero__logo {
  margin-bottom: 0.5rem; /* 8px */
}
.hero__logo img {
  width: 300px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(0, 212, 232, 0.25));
}

/* Eyebrow tag */
.hero__eyebrow {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-accent);
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

/* العنوان الرئيسي */
.hero__title {
  font-size: clamp(3.5rem, 10vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
.hero__title span {
  color: var(--color-primary);
  animation: cyanPulse 3s ease-in-out infinite;
}

/* السطر الوصفي */
.hero__subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 700;
  color: var(--color-text-secondary);
  line-height: 1.9;
  margin-bottom: 2.5rem;
  max-width: 560px;
}
html[dir="ltr"] .hero__subtitle {
  font-family: "Barlow Condensed", sans-serif;
}

/* لون الكلمة المميزة */
.accent {
  color: var(--color-primary);
}

/* أزرار الـ hero */
.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 4rem;
}

/* ══════════════════════════════════════
   12. STATS / FEATURES BAR
══════════════════════════════════════ */
.features-grid {
  display: flex;
  gap: 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
  width: 100%;
  max-width: 640px;
}

.feature-item {
  flex: 1;
  padding: 0 1.75rem;
  text-align: center;
}
/* فاصل بين العناصر — border-inline-start يعمل صح في RTL وLTR */
.feature-item + .feature-item {
  border-inline-start: 1px solid var(--color-border);
}

.feature-item h3 {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1.0625rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
html[dir="ltr"] .feature-item h3 {
  font-family: "Barlow Condensed", sans-serif;
}
.feature-item p {
  font-size: 0.78125rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* ══════════════════════════════════════
   13. SECTIONS — قواعد مشتركة
══════════════════════════════════════ */
section {
  padding: var(--section-py) 0;
}
.section-alt {
  background: transparent;
}
html.light .section-alt {
  background: var(--color-bg-alt);
}

/* #swup يملأ المسافة المتبقية بين الـ navbar والفوتر */
#swup {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* صفحات المحتوى الفرعية: تبدأ من الأعلى مع padding أنيق */
.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: clamp(6rem, 12vw, 10rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

/* الـ hero يملأ كامل #swup (بدلاً من min-height: 100vh) */
.hero {
  flex: 1;
}

/* ══════════════════════════════════════
   PAGE TRANSITIONS — Swup.js
══════════════════════════════════════ */

/* الحالة الطبيعية + مدة انيميشن الدخول (Swup يقرأها) */
.transition-fade {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* المغادرة: الصفحة الحالية تخرج للأعلى خلال 200ms */
html.is-animating.is-leaving .transition-fade {
  opacity: 0;
  transform: translateY(-15px);
  filter: blur(0);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

/* الدخول: الصفحة الجديدة تبدأ من هذه الحالة (فوري، بدون transition) */
html.is-rendering .transition-fade {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(15px);
  transition: none;
}

/* رابط نشط في الـ Navbar */
.nav__link--active,
.nav__link--active:hover {
  color: var(--color-primary) !important;
  background: var(--color-primary-glow) !important;
}

.pill__home--active {
  color: var(--color-primary);
  opacity: 1;
}

.drawer__link--active {
  color: var(--color-primary);
}

/* ══════════════════════════════════════
   PORTFOLIO FILTER
══════════════════════════════════════ */
.portfolio-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--color-border-accent);
  color: var(--color-primary);
  background: var(--color-primary-glow);
}
.filter-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

.work-card.filter-hidden {
  display: none;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-tag {
  display: inline-block;
  font-size: 0.725rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-glow);
  border: 1px solid var(--color-border-accent);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--color-text-primary);
  line-height: 1.3;
}

/* ══════════════════════════════════════
   14. PORTFOLIO
══════════════════════════════════════ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  justify-items: center;
}

.work-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}
/* خط سماوي يظهر أعلى الكارد عند الـ hover */
.work-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(270deg, var(--color-primary), transparent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
  z-index: 1;
}
.work-card:hover {
  border-color: var(--color-border-accent);
  background: var(--color-surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 212, 232, 0.08);
}
.work-card:hover::before {
  transform: scaleX(1);
}
.work-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.work-card:hover img {
  transform: scale(1.03);
}
.work-info {
  padding: 0.875rem 1.25rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.875rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

/* ══════════════════════════════════════
   15. CLIENTS
══════════════════════════════════════ */
.clients-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  max-width: 860px;
  margin: 0 auto;
}

.client-link {
  display: block;
  transition: transform 0.3s ease;
}
.client-link:hover {
  transform: translateY(-4px);
}

.client-logo {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  padding: 5px;
  object-fit: cover;
  background: var(--color-surface);
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.client-link:hover .client-logo {
  border-color: var(--color-primary);
  box-shadow: 0 0 28px rgba(0, 212, 232, 0.25);
}

/* ══════════════════════════════════════
   16. TEAM
══════════════════════════════════════ */
.team-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.member-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  width: 315px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}
/* خط سماوي أعلى الكارد */
.member-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(270deg, var(--color-primary), transparent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.member-card:hover {
  border-color: var(--color-border-accent);
  background: var(--color-surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 212, 232, 0.08);
}
.member-card:hover::before {
  transform: scaleX(1);
}

.member-pfp {
  width: 135px;
  height: 135px;
  border-radius: 50%;
  border: 3px solid var(--color-primary);
  margin: 0 auto 1.5rem;
  overflow: hidden;
}
.member-pfp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-card h3 {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}
.member-card p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.kick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--kick-green);
  color: #000;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}
.kick-link:hover {
  box-shadow: 0 0 20px rgba(0, 231, 1, 0.4);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════
   17. FOOTER
══════════════════════════════════════ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
  background: transparent;
  position: relative;
  z-index: 2;
}
html.light .footer {
  background: var(--color-bg);
}
.footer__text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ══════════════════════════════════════
   18. BACK TO TOP
══════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 42px;
  height: 42px;
  background: var(--color-primary);
  color: #000;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--color-primary-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 212, 232, 0.4);
}

/* ══════════════════════════════════════
   19. ANIMATIONS
══════════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.65s ease both;
}
.animate-fade-up:nth-child(1) {
  animation-delay: 0s;
}
.animate-fade-up:nth-child(2) {
  animation-delay: 0.1s;
}
.animate-fade-up:nth-child(3) {
  animation-delay: 0.2s;
}
.animate-fade-up:nth-child(4) {
  animation-delay: 0.3s;
}
.animate-fade-up:nth-child(5) {
  animation-delay: 0.4s;
}
.animate-fade-up:nth-child(6) {
  animation-delay: 0.5s;
}
.animate-fade-up:nth-child(7) {
  animation-delay: 0.55s;
}

/* توهج نبضي للون الـ accent في الـ hero */
@keyframes cyanPulse {
  0%,
  100% {
    text-shadow: 0 0 20px rgba(0, 212, 232, 0.3);
  }
  50% {
    text-shadow: 0 0 55px rgba(0, 212, 232, 0.8);
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════
   20. RESPONSIVE — TABLET (≤1024px)
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pill__links .nav__link span {
    font-size: 0.75rem;
  }
}

/* ══════════════════════════════════════
   21. RESPONSIVE — MOBILE (≤768px)
══════════════════════════════════════ */
@media (max-width: 768px) {
  /* الـ header يصبح full-width */
  .site-header {
    top: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
  }

  /* إخفاء الـ pill، إظهار الـ mobile bar */
  .navbar__pill {
    display: none !important;
  }
  .mobile-bar {
    display: flex;
  }

  /* الـ hero يأخذ مسافة لأعلى بسبب الـ mobile bar (~58px) */
  .hero {
    padding-top: calc(58px + 3.5rem);
    text-align: center;
  }
  .hero__cta {
    justify-content: center;
  }

  /* Stats bar تتكدس */
  .features-grid {
    flex-direction: column;
    border-top: none;
    gap: 0.75rem;
    max-width: 100%;
  }
  .feature-item {
    padding: 1.125rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    border-inline-end: none !important;
    text-align: right;
  }
  html[dir="ltr"] .feature-item {
    text-align: left;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Clients */
  .client-logo {
    width: 88px;
    height: 88px;
  }
  .clients-flex {
    gap: 1.25rem;
  }

  /* Team */
  .member-card {
    width: 100%;
    max-width: 330px;
  }
}

/* ══════════════════════════════════════
   22. RESPONSIVE — SMALL (≤480px)
══════════════════════════════════════ */
@media (max-width: 480px) {
  .hero__title {
    font-size: clamp(2.75rem, 14vw, 3.5rem);
  }
  .hero__cta {
    flex-direction: column;
    width: 100%;
  }
  .btn-primary,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════
   23. SERVICES — قسم خدماتنا
══════════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin: 3rem auto 0;
  max-width: 1020px;
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(270deg, var(--color-primary), transparent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.service-card:hover {
  border-color: var(--color-border-accent);
  background: var(--color-surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 212, 232, 0.08);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card--featured {
  border-color: var(--color-border-accent);
  background: linear-gradient(
    160deg,
    rgba(0, 212, 232, 0.06) 0%,
    var(--color-surface) 60%
  );
}

.service-card--featured::before {
  transform: scaleX(1);
}

.service-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  background: var(--color-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
}

.service-name {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-text-primary);
  margin-top: 0.25rem;
}

.service-card--featured .service-name {
  color: var(--color-primary);
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.service-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.service-features li::before {
  content: "✓";
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.service-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.875rem 2rem;
  background: var(--color-primary);
  color: #000000;
  font-weight: 700;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-top: auto;
}

.service-cta:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 232, 0.4);
}

.service-platforms {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.service-platform {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--color-text-secondary);
}

.platform-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.platform-icon-fallback {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  flex-shrink: 0;
}

.platform-icon-fallback--yt {
  background: #ff0000;
  color: #fff;
}

.platform-icon-fallback--tt {
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.service-platform--unavailable {
  color: var(--color-text-muted);
}

.platform-icon-x {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ── Services Section Background ── */
#services {
  background: radial-gradient(
    ellipse 80% 70% at 50% 50%,
    rgba(0, 212, 232, 0.15) 0%,
    rgba(0, 212, 232, 0.04) 50%,
    transparent 75%
  );
}

/* ── Service Card Entry Animation ── */
@keyframes serviceCardIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.service-card.reveal {
  opacity: 0;
  transform: scale(0.95) translateY(20px);
}

.service-card.reveal.visible {
  animation: serviceCardIn 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════
   TERMS OF SERVICE MODAL & ELEMENTS
══════════════════════════════════════ */

.service-terms-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.75rem;
  opacity: 0.8;
}

.terms-btn-wrapper {
  text-align: center;
  margin-top: 3.5rem;
}

.terms-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-family: "IBM Plex Sans Arabic", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.terms-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-glow);
  transform: translateY(-2px);
}

/* Modal Overlay */
.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.terms-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Box */
.terms-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.terms-modal-overlay.active .terms-modal {
  transform: scale(1) translateY(0);
}

/* Close Button */
.terms-modal__close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
  z-index: 2;
}

.terms-modal__close:hover {
  background: rgba(255, 50, 50, 0.2);
  color: #ff4444;
}

/* Modal Header */
.terms-modal h3 {
  padding: 1.5rem;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1.25rem;
  text-align: center;
}

/* Modal Body (Scrollable) */
.terms-modal__body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.terms-modal__body h1,
.terms-modal__body h2,
.terms-modal__body h3 {
  color: var(--color-text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-family: "Noto Kufi Arabic", sans-serif;
}

.terms-modal__body h1:first-child,
.terms-modal__body h2:first-child,
.terms-modal__body h3:first-child {
  margin-top: 0;
}

.terms-modal__body p {
  margin-bottom: 1rem;
}

.terms-modal__body ul,
.terms-modal__body ol {
  margin-bottom: 1.25rem;
  padding-right: 1.5rem; /* RTL padding */
}

.terms-modal__body li {
  margin-bottom: 0.5rem;
}

.terms-modal__body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .terms-modal {
    max-height: 95vh;
    border-radius: 0.75rem;
  }

  .terms-modal__body {
    padding: 1.25rem;
    font-size: 0.9rem;
  }
}
