/* =========================================================
   Ibrahim Syouri — Static Portfolio
   Hand-written CSS. Dark premium theme + blue accent.
   ========================================================= */

:root {
  /* Default Light Mode palette from ibrahimsyouri.com */
  --bg: #ffffff;
  --bg-soft: #f2f3f5;
  --bg-elev: #ffffff;
  --fg: #272829;
  --muted: #45505b;
  --border: #e6e9ec;
  --border-strong: #ddd;
  --card: #ffffff;
  --card-soft: #f7f8f9;
  --primary: #0563bb;
  --primary-soft: rgba(5, 99, 187, 0.08);
  --primary-strong: rgba(5, 99, 187, 0.25);
  --primary-fg: #ffffff;
  --accent-blue: #067ded;
  --accent-warm: #f74300;

  --header-bg: rgba(255, 255, 255, 0.72);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.88);
  --nav-border: rgba(0, 0, 0, 0.08);
  --nav-border-scrolled: rgba(0, 0, 0, 0.12);
  --nav-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.12);
  --nav-shadow-scrolled: 0 14px 36px -8px rgba(0, 0, 0, 0.22);
  --nav-pill-radius: 9999px;
  --drawer-bg: rgba(248, 250, 253, 0.96);
  --input-bg: #f9fafb;
  --testimonial-bg: #f7f8f9;
  --shadow-soft: 0 10px 30px -15px rgba(0, 0, 0, 0.08);
  --shadow-lift: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
  --logo-filter: none;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: 'Raleway', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: 'Open Sans', system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding-top: 76px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--primary); color: var(--primary-fg); }

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

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

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg);
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
h2 { font-size: clamp(1.875rem, 4vw, 3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; letter-spacing: -0.01em; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; color: var(--muted); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 768px) { .container { padding: 0 2rem; } }

.section {
  padding: 6rem 0;
}
@media (min-width: 768px) { .section { padding: 8rem 0; } }

.section--tight { padding: 4rem 0; }
.section--top { padding-top: 8rem; padding-bottom: 4rem; }
.section--soft { background: var(--card-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--bordered { border-top: 1px solid var(--border); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-header { max-width: 720px; margin-bottom: 4rem; }
.section-header.center { margin-left: auto; margin-right: auto; text-align: center; }

.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--muted); }
@media (min-width: 768px) { .lead { font-size: 1.25rem; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 4px 14px hsla(212, 100%, 50%, 0.25);
}
.btn--primary:hover { background: hsl(212, 100%, 48%); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--card); border-color: var(--primary-strong); }
.btn--lg { padding: 1.1rem 2.2rem; font-size: 1rem; }

.arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn:hover .arrow, .link-arrow:hover .arrow { transform: translateX(4px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  font-weight: 600;
}
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Header / Nav (iOS Floating Pill Dynamic Island) ---------- */

.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(96%, 1380px);
  z-index: 100;
  border-radius: var(--nav-pill-radius, 9999px);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.35s ease,
              border-color 0.35s ease,
              box-shadow 0.35s ease,
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 899px) {
  .site-header {
    top: 10px;
    width: calc(100% - 1.25rem);
  }
}

/* State 2: Scrolled / Dynamic Island Collapse */
.site-header.is-scrolled {
  width: min(88%, 940px);
  background: var(--nav-bg-scrolled);
  border-color: var(--nav-border-scrolled);
  box-shadow: var(--nav-shadow-scrolled);
}

.site-header.is-scrolled .nav-desktop {
  gap: 1.1rem; /* Reduced space between menu items by 30% on scroll */
}

.site-header.is-scrolled .nav-desktop > a,
.site-header.is-scrolled .mega-menu__trigger {
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.site-header.is-scrolled .nav-cta.btn,
.site-header.is-scrolled .nav-cta .btn {
  height: 32px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* RTL / Arabic scrolled header rules - tighter spacing so "ابدأ مشروعك" button fits cleanly without overflowing */
html[dir="rtl"] .site-header.is-scrolled .nav-desktop {
  gap: 0.75rem;
}

html[dir="rtl"] .site-header.is-scrolled .nav-desktop > a,
html[dir="rtl"] .site-header.is-scrolled .mega-menu__trigger {
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  white-space: nowrap;
}

html[dir="rtl"] .site-header.is-scrolled .nav-cta.btn,
html[dir="rtl"] .site-header.is-scrolled .nav-cta .btn {
  height: 32px;
  padding: 0 0.75rem;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 899px) {
  .site-header.is-scrolled {
    width: calc(100% - 1.25rem);
  }
}

.site-header:has(.mobile-drawer.open),
.site-header:has(.mega-menu:hover),
.site-header:has(.mega-menu.open) {
  background: var(--nav-bg-scrolled);
  border-color: var(--nav-border-scrolled);
  box-shadow: var(--nav-shadow-scrolled);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 1.25rem;
  width: 100%;
  gap: 0.75rem;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1), padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.is-scrolled .site-header__inner {
  height: 52px;
  padding: 0 1rem;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  height: 38px;
  width: auto;
  opacity: 1;
  transition: height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, transform 0.2s ease;
}

.site-header.is-scrolled .brand img {
  height: 32px;
}

.brand:hover img {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Flexible Centered Desktop Navigation (NO absolute positioning!) */
.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.75rem;
  margin-inline: auto;
}
@media (min-width: 900px) { .nav-desktop { display: flex; } }

.nav-desktop > a,
.mega-menu,
.mega-menu__trigger {
  display: inline-flex;
  align-items: center;
  height: 36px;
  box-sizing: border-box;
}

.nav-desktop > a,
.mega-menu__trigger {
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1;
  background: transparent;
  border: none;
  padding: 0.4rem 0.6rem;
  margin: 0;
  cursor: pointer;
  transition: color 0.2s ease, opacity 0.2s ease;
  text-decoration: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  white-space: nowrap;
}

.nav-desktop > a:hover,
.mega-menu__trigger:hover,
.mega-menu:hover .mega-menu__trigger,
.mega-menu:focus-within .mega-menu__trigger,
.mega-menu.open .mega-menu__trigger {
  color: var(--fg);
}

.nav-desktop > a.active,
.mega-menu__trigger.active {
  color: var(--primary) !important;
  font-weight: 600;
  background-image: linear-gradient(var(--primary), var(--primary));
  background-repeat: no-repeat;
  background-position: 50% 100%;
  background-size: 100% 2px;
}

/* Hide inline language link inside main nav */
.nav-desktop > a[hreflang="ar"],
.nav-desktop > a[hreflang="en"] { display: none; }

@media (max-width: 899px) {
  .lang-toggle {
    margin-inline-start: auto;
  }
}

/* ---------- Mega Menu (Desktop Dropdown Card) ---------- */
.mega-menu {
  position: static;
  display: inline-flex;
  align-items: center;
}

.mega-menu__trigger .chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
  color: var(--muted);
  flex-shrink: 0;
  position: relative;
  top: 1px;
}

.mega-menu:hover .mega-menu__trigger .chevron,
.mega-menu:focus-within .mega-menu__trigger .chevron,
.mega-menu.open .mega-menu__trigger .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.mega-menu__dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  right: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.75rem 2rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
  z-index: 105;
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

/* Invisible hover bridge connecting trigger to dropdown */
.mega-menu__dropdown::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  height: 28px;
  display: block;
}

[data-theme="dark"] .mega-menu__dropdown {
  background: rgba(23, 25, 38, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.65);
}

.mega-menu:hover .mega-menu__dropdown,
.mega-menu:focus-within .mega-menu__dropdown,
.mega-menu.open .mega-menu__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-menu__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.mega-menu__col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mega-menu__cat {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.mega-menu__item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.mega-menu__item:hover {
  background: var(--primary-soft);
  transform: translateX(4px);
}

html[dir="rtl"] .mega-menu__item:hover {
  transform: translateX(-4px);
}

.mega-menu__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mega-menu__item:hover .mega-menu__icon {
  background: var(--primary);
  color: var(--primary-fg);
}

.mega-menu__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
}

.mega-menu__desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}

.nav-cta { display: none; order: 12; }
@media (min-width: 900px) { .nav-cta { display: inline-flex; } }
.nav-cta.btn,
.nav-cta .btn {
  height: 36px;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 9999px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.22);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}
.nav-cta.btn:hover,
.nav-cta .btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(0, 102, 255, 0.35);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  z-index: 102;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  order: 13;
}
.menu-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.menu-toggle[aria-expanded="true"] {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
@media (min-width: 900px) { .menu-toggle { display: none !important; } }

/* Mobile Header Bar (< 900px): Logo far-left, Theme toggle & Menu toggle side-by-side on far-right without button borders */
@media (max-width: 899px) {
  .site-header__inner {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1rem !important;
    gap: 0.35rem !important;
  }

  .site-header__inner > .lang-toggle-pill,
  .site-header__inner > .nav-cta {
    display: none !important;
  }

  .brand {
    margin-right: auto !important;
    margin-left: 0 !important;
  }

  .theme-toggle {
    margin-left: 0 !important;
    margin-right: 0 !important;
    order: 11 !important;
  }

  .menu-toggle {
    margin-left: 0 !important;
    margin-right: 0 !important;
    order: 12 !important;
  }

  .theme-toggle,
  .menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 9999px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--fg) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
  }

  .theme-toggle svg,
  .menu-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2px !important;
    color: currentColor !important;
  }

  .theme-toggle:hover,
  .theme-toggle:focus-visible,
  .menu-toggle:hover,
  .menu-toggle:focus-visible,
  .menu-toggle[aria-expanded="true"] {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
    border: none !important;
  }

  /* RTL / Arabic Mobile Header rules: Logo far-right, Theme & Menu icons side-by-side on far-left */
  html[dir="rtl"] .brand,
  html[lang="ar"] .brand {
    margin-left: auto !important;
    margin-right: 0 !important;
  }
}

/* Mobile Drawer Wrapper (Swell Identical Style) */
.mobile-drawer {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer__list {
  position: relative;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--card);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transform: translateY(-14px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .mobile-drawer__list {
  background: rgba(23, 25, 38, 0.96);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.7);
}

.mobile-drawer.open .mobile-drawer__list {
  transform: translateY(0) scale(1);
}

.mobile-drawer a:not(.btn):not(.lang-toggle__link) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: var(--radius-sm, 12px);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--fg);
  font-weight: 800;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.mobile-drawer a:not(.btn):not(.lang-toggle__link):hover,
.mobile-drawer a:not(.btn):not(.lang-toggle__link):focus {
  background: var(--primary-soft);
  color: var(--primary);
}

.mobile-drawer a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.mobile-drawer .section-label {
  margin: 1.25rem 0.5rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--primary);
  text-transform: uppercase;
}

.mobile-drawer .sub-link {
  min-height: 40px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
}

.mobile-drawer .sub-link:hover {
  color: var(--primary) !important;
  background: var(--primary-soft) !important;
}

/* Mobile Drawer Accordion Dropdown */
.mobile-drawer__accordion {
  border-radius: var(--radius-sm, 12px);
  transition: background-color 0.2s ease;
}
.mobile-drawer__accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 1rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-sm, 12px);
  user-select: none;
  border: 1px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.mobile-drawer__accordion-trigger::-webkit-details-marker {
  display: none;
}
.mobile-drawer__accordion-trigger:hover,
.mobile-drawer__accordion-trigger:focus {
  color: var(--primary);
  background: var(--primary-soft);
}
.mobile-drawer__accordion-trigger .chevron {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  flex-shrink: 0;
}
.mobile-drawer__accordion[open] .mobile-drawer__accordion-trigger .chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.mobile-drawer__accordion[open] .mobile-drawer__accordion-trigger {
  color: var(--primary);
  background: var(--primary-soft);
}
.mobile-drawer__accordion-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem 0.65rem 1.25rem;
}
html[dir="rtl"] .mobile-drawer__accordion-content {
  padding-left: 0.5rem;
  padding-right: 1.25rem;
}

.mobile-drawer__cta {
  margin-top: 1.25rem !important;
  width: 100% !important;
  height: 48px !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

.mobile-drawer__lang-toggle {
  display: inline-flex !important;
  align-self: center !important;
  margin-top: 0.75rem !important;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  margin-top: -76px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(76px + 4rem) 0 4rem;
  overflow: hidden;
  text-align: center;
  background: url("assets/hero-bg.webp") top right no-repeat;
  background-size: cover;
}
.hero__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top right;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.60);
  pointer-events: none;
  transition: background-color 0.3s ease;
}
[data-theme="dark"] .hero::before {
  background: rgba(29, 31, 47, 0.85);
}
.hero__bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.hero__glow-a, .hero__glow-b {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  mix-blend-mode: screen;
}
.hero__glow-a {
  top: 18%; left: 18%;
  width: 38vw; height: 38vw;
  background: hsla(212, 100%, 50%, 0.18);
  animation: pulse-glow 9s ease-in-out infinite;
}
.hero__glow-b {
  bottom: 12%; right: 14%;
  width: 32vw; height: 32vw;
  background: hsla(225, 70%, 35%, 0.28);
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.hero__inner { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 2rem;
  letter-spacing: 0.03em;
}
.badge-pill::before {
  content: "";
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 hsla(212, 100%, 55%, 0.6);
  animation: ping 1.8s ease-out infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 hsla(212, 100%, 55%, 0.6); }
  100% { box-shadow: 0 0 0 10px hsla(212, 100%, 55%, 0); }
}

.hero h1 {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero__sub {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.cycling-word {
  display: inline-block;
  background: linear-gradient(90deg, var(--primary), hsl(220, 90%, 70%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-width: 0;
}
.cycling-word.swap-out { animation: word-out 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.cycling-word.swap-in { animation: word-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes word-out {
  0% { opacity: 1; transform: translateY(0); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-22px); filter: blur(8px); }
}
@keyframes word-in {
  0% { opacity: 0; transform: translateY(22px); filter: blur(8px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) { .hero__ctas { flex-direction: row; } }
.hero__ctas .btn { width: 100%; }
@media (min-width: 640px) { .hero__ctas .btn { width: auto; } }

/* ---------- Stats ---------- */

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

.stat {
  border-left: 2px solid var(--primary-strong);
  padding: 0.4rem 0 0.4rem 1.25rem;
}
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  color: var(--fg);
  margin-bottom: 0.4rem;
}
.stat__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Cards / Grids ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 4rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; } }

.discipline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 3rem;
}
@media (min-width: 768px) { .discipline-grid { grid-template-columns: 1fr 1fr; } }

.discipline .icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: all 0.2s ease;
}
.discipline:hover .icon-tile { background: var(--primary); color: var(--primary-fg); }
.discipline ul { list-style: none; padding: 0; margin: 1rem 0 0; font-size: 0.9rem; }
.discipline li { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; color: var(--fg); }
.discipline li svg { color: var(--primary); flex-shrink: 0; }

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .service-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  position: relative;
}
.service-card:hover {
  border-color: var(--primary-strong);
  background: var(--card);
  transform: translateY(-2px);
}
.service-card .icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}
.service-card:hover .icon-tile { background: var(--primary); color: var(--primary-fg); }
.service-card h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.service-card p { font-size: 0.875rem; margin-bottom: 1.25rem; }
.service-card .explore {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.service-card:hover .explore { opacity: 1; }

.three-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 900px) { .three-col { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }

.tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.tile h3 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.tile p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 900px) { .testimonial-grid { grid-template-columns: repeat(3, 1fr); } }
.testimonial {
  background: hsla(224, 35%, 8%, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}
.testimonial blockquote {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg);
  flex: 1;
}
.testimonial figcaption {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.testimonial figcaption .name { font-weight: 600; color: var(--fg); }
.testimonial figcaption .role { font-size: 0.85rem; color: var(--muted); }
.quote-mark { color: var(--primary); opacity: 0.55; width: 28px; height: 28px; margin-bottom: 1rem; }

.case-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 720px) { .case-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .case-grid { grid-template-columns: repeat(3, 1fr); } }

.case {
  border-radius: var(--radius-lg);
  background: var(--card-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.case:hover { border-color: var(--primary-strong); transform: translateY(-2px); }
.case__image {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 30% 30%, hsla(212, 100%, 50%, 0.18), transparent 50%),
    linear-gradient(135deg, hsl(220, 50%, 15%), hsl(224, 35%, 8%));
  position: relative;
  overflow: hidden;
}
.case__image picture, .case__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .5s ease;
}
.case__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 45%);
  pointer-events: none;
}
.case__brand-logo {
  position: absolute !important;
  top: 1rem;
  left: 1rem;
  right: auto;
  bottom: auto;
  width: auto !important;
  height: 38px !important;
  max-width: 170px;
  z-index: 3;
  padding: 0.35rem 0.65rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  object-fit: contain !important;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
html[dir="rtl"] .case__brand-logo {
  left: auto;
  right: 1rem;
}
.case:hover .case__brand-logo {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
}
.case__body { padding: 1.5rem; }
.case__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.case__category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}
.case__result {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg);
  background: var(--primary-soft);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}
.case h3 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.case .view {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s ease;
}
.case:hover .view { color: var(--primary); }
.case__desc { margin-top: 1rem; padding: 0 0.5rem; color: var(--muted); font-size: 0.875rem; }

.case__services {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.chip svg {
  width: 11px;
  height: 11px;
  color: var(--primary);
  flex-shrink: 0;
}
.chip:hover {
  color: var(--fg);
  border-color: var(--primary-strong);
}
[dir="rtl"] .chip { direction: rtl; }

/* ---------- About / Experience ---------- */

.about-portrait {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.about-portrait:hover {
  transform: translateY(-4px);
  border-color: var(--primary-strong);
}

.about-portrait__img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.about-portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}
.about-portrait:hover .about-portrait__img {
  transform: scale(1.03);
}

.about-portrait__badge {
  position: absolute;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.12);
  z-index: 2;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .about-portrait__badge {
  background: rgba(29, 31, 47, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 35px -10px rgba(0, 0, 0, 0.5);
}

.about-portrait__status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse-status 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-status {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

.about-portrait__loc {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.02em;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  max-width: 820px;
}
.timeline__item {
  position: relative;
  padding-left: 2rem;
  border-left: 1px solid var(--primary-strong);
}
.timeline__dot {
  position: absolute;
  left: -8.5px; top: 4px;
  width: 16px; height: 16px;
  background: var(--primary);
  border-radius: 50%;
}
.timeline__item:not(:first-child) .timeline__dot { background: hsla(212, 100%, 55%, 0.4); }
.timeline__date {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.timeline__role { font-size: 1.4rem; margin-bottom: 0.25rem; }
.timeline__company { font-size: 1.05rem; color: var(--muted); margin-bottom: 1rem; font-weight: 500; }
.timeline ul { padding-left: 1.25rem; color: var(--muted); }
.timeline ul li { margin-bottom: 0.5rem; }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
@media (min-width: 768px) { .stack-grid { grid-template-columns: repeat(4, 1fr); } }
.stack-col h4 {
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 0.9rem;
}
.stack-col ul { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.stack-col li { padding: 0.4rem 0; }

.edu-cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 900px) { .edu-cert-grid { grid-template-columns: 1fr 1fr; } }
.edu-card, .cert-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.cert-item { padding: 1rem 1.25rem; align-items: center; }
.cert-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.icon-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.cv-download {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
  border: 1px solid var(--primary-strong);
  background: var(--primary-soft);
  border-radius: var(--radius-xl);
}
@media (min-width: 768px) { .cv-download { flex-direction: row; align-items: center; justify-content: space-between; } }
.cv-download h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.cv-download p { margin: 0; color: var(--muted); max-width: 600px; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.contact-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 2rem; }
.contact-row { display: flex; align-items: center; gap: 1rem; }
.contact-row .icon-pill { width: 48px; height: 48px; border-radius: 999px; transition: all 0.2s ease; }
.contact-row:hover .icon-pill { background: var(--primary); color: var(--primary-fg); }
.contact-row .label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.contact-row .value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  transition: color 0.2s ease;
}
.contact-row:hover .value { color: var(--primary); }

.form-card {
  background: var(--primary-soft);
  border: 1px solid var(--primary-strong);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.12);
}
[data-theme="dark"] .form-card {
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.4);
}
@media (min-width: 768px) { .form-card { padding: 2.5rem; } }

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--fg);
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field textarea { min-height: 130px; resize: vertical; }
.field .error {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: hsl(0, 80%, 65%);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: hsl(0, 70%, 55%); }
.field.has-error .error { display: block; }

.hp-field {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
}

.field--captcha {
  background: hsla(212, 100%, 55%, 0.05);
  border: 1px dashed var(--primary-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}
.field--captcha label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.math-question {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: monospace, system-ui, sans-serif;
  font-size: 1rem;
  letter-spacing: 1px;
}

.toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  border: 1px solid var(--primary-strong);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: 0 20px 40px hsla(0, 0%, 0%, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
  max-width: 380px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast strong { display: block; color: var(--fg); margin-bottom: 0.25rem; }
.toast small { color: var(--muted); font-size: 0.85rem; }

/* ---------- CTA Strip ---------- */

.cta-strip {
  border-top: 1px solid var(--border);
  background: var(--primary-soft);
  padding: 6rem 0;
  text-align: center;
}
.cta-strip h2 { margin-bottom: 1rem; }
.cta-strip p { max-width: 640px; margin: 0 auto 2.5rem; font-size: 1.1rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 5rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h3 {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 0.75rem; font-size: 0.9rem; color: var(--muted); }
.footer-grid li a { transition: color 0.15s ease; }
.footer-grid li a:hover { color: var(--primary); }
.footer-brand img { height: 70px; width: auto; margin-bottom: 1.25rem; opacity: 1; }
.footer-brand p { font-size: 0.9rem; max-width: 320px; }
.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Logo Bar ---------- */

.logo-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin-top: 3rem;
  opacity: 0.55;
  filter: grayscale(1);
}
.logo-bar > span { font-weight: 700; font-size: 1.4rem; }
@media (min-width: 768px) { .logo-bar { gap: 4rem; } .logo-bar > span { font-size: 1.6rem; } }

/* ---------- Prose (Blog) ---------- */

.prose {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--muted);
}
.prose h2 {
  color: var(--fg);
  font-size: 1.875rem;
  margin: 3.5rem 0 1.25rem;
}
.prose h3 {
  color: var(--fg);
  font-size: 1.375rem;
  margin: 2.5rem 0 0.85rem;
}
.prose p { margin: 0 0 1.25em; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.5em; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { color: var(--fg); font-weight: 700; }
.prose a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }
.prose code {
  background: var(--card);
  color: var(--primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.prose pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 1.5em 0;
}
.prose pre code { background: transparent; padding: 0; color: var(--fg); }
.prose blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 1.25rem;
  color: var(--fg);
  margin: 1.5em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1.75em 0;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.prose th { color: var(--fg); font-weight: 700; }

.insight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.insight-meta .tag { color: hsla(212, 100%, 70%, 0.8); }
.insight-meta time, .insight-meta .reading { display: inline-flex; align-items: center; gap: 0.4rem; }

.insight-list { display: grid; gap: 1.5rem; }
.insight-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.insight-card:hover { border-color: var(--primary-strong); transform: translateY(-2px); }
.insight-card h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
  color: var(--fg);
  transition: color 0.2s ease;
}
.insight-card:hover h2 { color: var(--primary); }
.insight-card p { margin-bottom: 1.5rem; max-width: 640px; }
@media (min-width: 768px) {
  .insight-card { padding: 2.5rem; }
  .insight-card h2 { font-size: 1.875rem; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--primary); }

.faq-block { max-width: 720px; margin-top: 5rem; padding-top: 3rem; border-top: 1px solid var(--border); }
.faq-block > h2 { margin-bottom: 2rem; }
.faq {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.25rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--primary);
  transition: transform 0.2s ease;
}
.faq[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--primary); }
.faq__answer { padding: 0 0 1.25rem; color: var(--muted); }

/* ---------- Page hero (small) ---------- */

.page-hero {
  padding: 8rem 0 4rem;
}
.page-hero h1 { margin-bottom: 1.5rem; }
.page-hero p { max-width: 680px; font-size: 1.15rem; }

/* ---------- Reveal on scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  .hero__glow-a { animation: none; }
  .badge-pill::before { animation: none; }
}

/* ---------- Utility ---------- */

.text-center { text-align: center; }
.mt-16 { margin-top: 4rem; }
.mt-12 { margin-top: 3rem; }
.mt-8 { margin-top: 2rem; }
.hidden { display: none; }


/* ---------- Dual-Pill Language Segment Switcher (Swell Aesthetic) ---------- */
.lang-toggle-pill {
  display: inline-flex;
  align-items: center;
  background: var(--card-soft, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
  height: 36px;
  box-sizing: border-box;
  order: 10;
  margin: 0 0.15rem;
}

[data-theme="dark"] .lang-toggle-pill {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.lang-toggle__active,
.lang-toggle__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1;
  box-sizing: border-box;
}

.lang-toggle__active {
  background: var(--card);
  color: var(--fg);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
}

[data-theme="dark"] .lang-toggle__active {
  background: #ffffff;
  color: #0d1322;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.lang-toggle__link {
  color: var(--muted);
}

.lang-toggle__link:hover {
  color: var(--fg);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .lang-toggle__link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Arabic / RTL overrides ---------- */
html[lang="ar"], html[dir="rtl"] {
  font-family: "Cairo", "Tajawal", "Open Sans", system-ui, sans-serif;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .brand,
html[lang="ar"] .nav-desktop,
html[lang="ar"] .btn,
html[lang="ar"] .eyebrow,
html[lang="ar"] .hero h1,
html[lang="ar"] .cycling-word {
  font-family: "Cairo", "Tajawal", "Raleway", system-ui, sans-serif;
}
html[lang="ar"] .hero h1 { line-height: 1.35; padding-bottom: 0.2em; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.4; }
html[lang="ar"] .cycling-word { display: inline-block; padding-bottom: 0.18em; line-height: 1.5; }

[dir="rtl"] .arrow,
[dir="rtl"] .case .arrow,
[dir="rtl"] .view .arrow,
[dir="rtl"] .explore .arrow,
[dir="rtl"] .link-arrow .arrow {
  display: inline-block;
  transform: scaleX(-1);
}

[dir="rtl"] .timeline { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .timeline::before { left: auto; right: 0.4rem; }
[dir="rtl"] .timeline__item { padding-left: 0; padding-right: 2rem; }
[dir="rtl"] .timeline__dot { left: auto; right: -0.4rem; }

[dir="rtl"] .stat { border-left: 0; border-right: 3px solid var(--primary); padding-left: 0; padding-right: 1rem; }

[dir="rtl"] .prose blockquote {
  border-left: 0;
  border-right: 3px solid var(--primary);
  padding-left: 0;
  padding-right: 1.25rem;
}
[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.4rem; }

[dir="rtl"] .toast { border-left: 1px solid var(--primary-strong); border-right: 4px solid var(--primary); }

[dir="rtl"] .back-link svg,
[dir="rtl"] .nav-cta + .menu-toggle,
[dir="rtl"] .case .view svg {
  transform: scaleX(-1);
}

[dir="rtl"] .footer-brand p,
[dir="rtl"] .hero__sub,
[dir="rtl"] .lead { text-align: right; }

[dir="rtl"] .prose th,
[dir="rtl"] .prose td { text-align: right; }

[dir="rtl"] .insight-meta { letter-spacing: 0; }
[dir="rtl"] .badge-pill { letter-spacing: 0; }
[dir="rtl"] .eyebrow,
[dir="rtl"] .case__category,
[dir="rtl"] .case__result { letter-spacing: 0.02em; }

[dir="rtl"] .field input,
[dir="rtl"] .field textarea,
[dir="rtl"] .field select { text-align: right; direction: rtl; }

[dir="rtl"] .menu-toggle { margin-left: 0; margin-right: auto; }

@media (max-width: 767px) {
  [dir="rtl"] .mobile-drawer__list a { text-align: right; }
}

/* ===== Case study visuals ===== */
.case-hero {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px -30px rgba(0,0,0,.55);
  line-height: 0;
  background: #0a0a0a;
}
.case-hero picture, .case-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1408 / 768;
  object-fit: cover;
}
.case-hero__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
  line-height: 1.3;
}
.case-hero__eyebrow {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .85;
  font-weight: 600;
}
.case-hero__headline {
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  font-weight: 700;
  font-family: 'Raleway', system-ui, sans-serif;
}

.case-inline {
  margin: 0;
  border-radius: var(--radius-md, 14px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px -24px rgba(0,0,0,.45);
  background: #0a0a0a;
}
.case-inline picture, .case-inline img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 840;
  object-fit: cover;
}
.case-inline figcaption {
  padding: .65rem .9rem;
  font-size: .82rem;
  color: var(--muted, #888);
  background: var(--surface, #111);
  text-align: center;
}

.case-transform {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: .75rem;
  margin: 0;
}
.case-transform__panel {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
}
.case-transform__lbl {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: .35rem;
}
.case-transform__val {
  font-family: var(--font-display, 'Raleway', system-ui, sans-serif);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.05;
}
.case-transform__arrow {
  align-self: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.5);
}
.case-transform__cap {
  grid-column: 1 / -1;
  font-size: .82rem;
  opacity: .7;
  text-align: center;
  margin-top: .25rem;
}
@media (max-width: 560px) {
  .case-transform { grid-template-columns: 1fr; }
  .case-transform__arrow { transform: rotate(90deg); justify-self: center; }
  [dir="rtl"] .case-transform__arrow { transform: rotate(-90deg); }
}

.case-stack {
  margin: 0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card-soft);
}
.case-stack__title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 1rem;
  text-align: center;
}
.case-stack__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem;
}
.case-stack__node {
  display: inline-flex;
  align-items: center;
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: .88rem;
  font-weight: 600;
  white-space: nowrap;
}
.case-stack__sep {
  font-weight: 800;
  font-size: 1.1rem;
  opacity: .8;
}
/* =========================================================
   Theme system — light/dark toggle
   ========================================================= */

/* Default theme variables defined in main :root at top of stylesheet */


[data-theme="dark"] {
  /* Exact Dark Mode palette from ibrahimsyouri.com */
  --bg: #1d1f2f;
  --bg-soft: #181a28;
  --bg-elev: #25283c;
  --fg: #ffffff;
  --muted: #ddd;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.25);
  --card: #1d1f2f;
  --card-soft: rgba(255, 255, 255, 0.04);
  --primary: #5de6de;
  --primary-soft: rgba(93, 230, 222, 0.12);
  --primary-strong: rgba(93, 230, 222, 0.35);
  --primary-fg: #1d1f2f;
  --accent-blue: #5de6de;
  --accent-lavender: #ddd;
  --accent-mint: #00f1b5;

  --header-bg: rgba(29, 31, 47, 0.88);
  --nav-bg: rgba(13, 19, 26, 0.78);
  --nav-bg-scrolled: rgba(13, 19, 26, 0.90);
  --nav-border: rgba(255, 255, 255, 0.15);
  --nav-border-scrolled: rgba(255, 255, 255, 0.22);
  --nav-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.35);
  --nav-shadow-scrolled: 0 16px 40px -8px rgba(0, 0, 0, 0.55);
  --drawer-bg: rgba(29, 31, 47, 0.97);
  --input-bg: #161825;
  --testimonial-bg: #1d1f2f;
  --shadow-soft: 0 14px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 25px 50px -10px rgba(0, 0, 0, 0.65);
  --logo-filter: invert(1);
  --case-image-grad: radial-gradient(circle at 30% 30%, rgba(93, 230, 222, 0.18), transparent 50%),
                     linear-gradient(135deg, #181a28, #1d1f2f);
  --portrait-grad: linear-gradient(135deg, #181a28, #1d1f2f);
  --hero-grid-color: rgba(93, 230, 222, 0.06);
  --cta-bg: rgba(93, 230, 222, 0.08);
}

html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body,
.site-header,
.mobile-drawer,
.site-footer,
.card, .case, .service-card, .insight-card, .form-card, .testimonial,
.field input, .field select, .field textarea,
.btn, .toast, .cta-strip {
  transition: background-color 0.3s ease, color 0.25s ease,
              border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Bind hardcoded backgrounds to theme tokens */
.site-header.is-scrolled, .site-header:has(.mobile-drawer.open) { background: var(--header-pill-bg-scrolled); }
.mobile-drawer { background: var(--drawer-bg); }
.field input, .field select, .field textarea { background: var(--input-bg); }
.testimonial { background: var(--testimonial-bg); }
.case__image { background: var(--case-image-grad); }
.about-portrait { background: var(--portrait-grad); }
.form-card { box-shadow: var(--shadow-soft); }
.toast { box-shadow: var(--shadow-lift); }


/* Dark-mode targeted refinements */
[data-theme="dark"] .nav-desktop a { color: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .nav-desktop a:hover { color: var(--primary); }
[data-theme="dark"] .stat__value,
[data-theme="dark"] .case__result { color: var(--primary); }
[data-theme="dark"] .insight-meta .tag { color: var(--primary); }
[data-theme="dark"] ::selection { background: var(--primary); color: #1d1f2f; }

/* =========================================================
   Theme toggle button
   ========================================================= */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  margin: 0 0.15rem;
  padding: 0;
  position: relative;
  order: 11;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--primary-strong);
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; transition: opacity 0.25s ease, transform 0.4s ease; }
/* In Light Mode (default), show Moon icon (click to switch to dark) */
.theme-toggle .theme-icon--sun { display: none; }
.theme-toggle .theme-icon--moon { display: block; }
/* In Dark Mode, show Sun icon (click to switch to light) */
[data-theme="dark"] .theme-toggle .theme-icon--sun { display: block; }
[data-theme="dark"] .theme-toggle .theme-icon--moon { display: none; }

/* =========================================================
   Design polish + motion
   ========================================================= */



/* Hero entrance */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero__inner > * { animation: hero-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero__inner > *:nth-child(1) { animation-delay: 0.05s; }
.hero__inner > *:nth-child(2) { animation-delay: 0.18s; }
.hero__inner > *:nth-child(3) { animation-delay: 0.30s; }
.hero__inner > *:nth-child(4) { animation-delay: 0.42s; }

/* Card lift polish */
.service-card, .case, .insight-card { will-change: transform; }
.service-card:hover, .case:hover, .insight-card:hover { box-shadow: var(--shadow-soft); }

/* Button polish */
.btn--primary {
  background: linear-gradient(135deg, var(--primary), hsl(220, 90%, 52%));
}
.btn--primary:hover { background: linear-gradient(135deg, hsl(212, 100%, 50%), hsl(220, 95%, 48%)); box-shadow: 0 10px 24px hsla(212, 100%, 50%, 0.32); }
.btn--primary:active { transform: translateY(0); box-shadow: 0 4px 10px hsla(212, 100%, 50%, 0.2); }
.btn--ghost:active { transform: translateY(0); }

/* Animated underline on prose & inline links */
.prose a {
  background-image: linear-gradient(var(--primary), var(--primary));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1.5px;
  transition: background-size 0.3s ease, color 0.2s ease;
  padding-bottom: 1px;
}
.prose a:hover { background-size: 100% 1.5px; text-decoration: none; }

/* Section divider */
.section--bordered { border-top: 1px solid var(--border); position: relative; }
.section--bordered::before {
  content: "";
  position: absolute; left: 50%; top: -1px;
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  transform: translateX(-50%);
  opacity: 0.6;
}

/* Reveal stagger — children of a [data-reveal-group] cascade */
[data-reveal-group] > [data-reveal] { transition-delay: calc(var(--i, 0) * 70ms); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body, .site-header, .mobile-drawer, .site-footer,
  .card, .case, .service-card, .insight-card, .form-card, .testimonial,
  .field input, .field select, .field textarea,
  .btn, .toast, .cta-strip, .theme-toggle, .theme-toggle svg {
    transition: none !important;
  }
  .hero__inner > * { animation: none !important; }
  .cycling-word.swap-out, .cycling-word.swap-in { animation: none !important; }
  .hero::before { display: none; }
}

/* RTL toggle margin */
[dir="rtl"] .theme-toggle { margin: 0 0.25rem; }

/* =========================================================
   Header & Footer enhancements (light + dark)
   ========================================================= */

/* Brand: stronger logo treatment */
.brand img { transition: opacity 0.2s ease, filter 0.25s ease; }
.brand:hover img { opacity: 1; }
[data-theme="light"] .brand img { opacity: 1; }

/* Language pill polish */
.lang-toggle {
  height: 36px;
  min-width: 44px;
  border-color: var(--border-strong);
}
.lang-toggle:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* CTA button in header — tighter */
.nav-cta .btn { padding: 0.55rem 1.15rem; font-size: 0.875rem; box-shadow: 0 6px 18px -8px hsla(212, 100%, 50%, 0.55); }

/* Menu toggle (mobile) */
.menu-toggle {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.menu-toggle:hover { border-color: var(--primary-strong); color: var(--primary); }
@media (min-width: 900px) { .menu-toggle { display: none; } }

/* Mobile drawer polish */
.mobile-drawer {
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.mobile-drawer__list a { transition: color 0.2s ease, background 0.2s ease, padding 0.2s ease; border-radius: 8px; }
.mobile-drawer__list a:hover { color: var(--primary); background: var(--primary-soft); padding-left: 0.75rem; }
[dir="rtl"] .mobile-drawer__list a:hover { padding-left: 0; padding-right: 0.75rem; }

/* ============== Footer ============== */
.site-footer {
  background:
    radial-gradient(ellipse 60% 80% at 15% 0%, var(--primary-soft) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 90% 100%, hsla(220, 80%, 50%, 0.06) 0%, transparent 55%),
    var(--bg-soft);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  padding-top: 4rem;
  padding-bottom: 1.75rem;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.5;
}
.site-footer .container { position: relative; z-index: 1; }

.footer-grid {
  padding-bottom: 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.footer-grid::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -3px;
  transform: translateX(-50%);
  width: 56px; height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.55;
}

.footer-grid h3 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.9;
  margin-bottom: 1.1rem;
  position: relative;
  padding-bottom: 0.6rem;
}
.footer-grid h3::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 20px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  opacity: 0.85;
}
.footer-grid li a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-grid li a::before {
  content: "";
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.25s ease;
}
.footer-grid li a:hover::before { width: 12px; }
.footer-grid li a:hover { color: var(--primary); }

/* Two-column Services list (2nd grid item) */
.footer-grid > div:nth-child(2) ul {
  columns: 2;
  column-gap: 1.5rem;
}
.footer-grid > div:nth-child(2) li {
  break-inside: avoid;
}
@media (max-width: 520px) {
  .footer-grid > div:nth-child(2) ul { columns: 1; }
}

.footer-brand p { color: var(--muted); line-height: 1.65; max-width: 32ch; }
.footer-brand img { height: 70px; width: auto; opacity: 1; }
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.footer-brand .footer-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--primary-strong);
  background: var(--primary-soft);
}
.footer-brand .footer-tag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Mobile Footer Refinements (< 767px): All elements centered, 50%/50% 2-column grid layout with 1-to-1 height matching & centered title underlines */
@media (max-width: 767px) {
  .site-footer {
    text-align: center !important;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 50% / 50% width columns */
    gap: 1.25rem 1rem !important;
    text-align: center !important;
    align-items: start !important;
  }

  /* Full width centered brand logo & text at top (Row 1) */
  .footer-brand {
    grid-column: 1 / -1 !important;
    grid-row: 1 / 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    margin-bottom: 0.5rem !important;
  }

  .footer-brand img {
    margin: 0 auto 0.75rem !important;
  }

  .footer-brand p {
    text-align: center !important;
    margin: 0 auto !important;
    max-width: 340px !important;
  }

  .footer-brand .footer-tag {
    align-self: center !important;
  }

  /* Column 1 (50% width): Services Menu spans Rows 2 and 3 */
  .footer-grid > div:nth-child(2) {
    grid-column: 1 / 2 !important;
    grid-row: 2 / 4 !important;
    text-align: center !important;
  }

  .footer-grid > div:nth-child(2) ul {
    columns: 1 !important;
  }

  /* Column 2 (50% width): Company Menu in Row 2, Contact Menu in Row 3 (stacked to match Services total height) */
  .footer-grid > div:nth-child(3) {
    grid-column: 2 / 3 !important;
    grid-row: 2 / 3 !important;
    text-align: center !important;
  }

  .footer-grid > div:nth-child(4) {
    grid-column: 2 / 3 !important;
    grid-row: 3 / 4 !important;
    text-align: center !important;
    margin-top: 0 !important;
  }

  /* Centered headers & centered underline shape */
  .footer-grid h3 {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    margin: 0 auto 0.85rem !important;
    padding-bottom: 0.5rem !important;
    position: relative !important;
  }

  .footer-grid h3::after {
    content: "" !important;
    position: absolute !important;
    inset-inline-start: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    width: 24px !important;
    height: 2px !important;
    background: var(--primary) !important;
    border-radius: 2px !important;
    opacity: 0.85 !important;
    transform: translateX(-50%) !important;
  }

  .footer-grid ul {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    text-align: center !important;
  }

  .footer-grid li {
    text-align: center !important;
    width: 100% !important;
    margin-bottom: 0.45rem !important;
  }

  .footer-grid li a {
    justify-content: center !important;
    text-align: center !important;
  }

  .footer-bottom {
    text-align: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }
}

.footer-bottom::before {
  content: "© " counter(year) " Ibrahim Syouri · All rights reserved · Crafted in Amman";
  letter-spacing: 0.01em;
  order: 1;
}
[dir="rtl"] .footer-bottom::before {
  content: "© " counter(year) " إبراهيم السيوري · جميع الحقوق محفوظة · صُمّم في عمّان";
}
.footer-bottom { counter-reset: year 2026; }
.footer-bottom::after {
  content: "Amman · Riyadh · Remote";
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.85;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--primary-strong);
  background: var(--primary-soft);
  order: 2;
}
[dir="rtl"] .footer-bottom::after { content: "عمّان · الرياض · عن بُعد"; letter-spacing: 0.04em; }
/* Hide the original inline text since ::before now owns it */
.footer-bottom { font-size: 0; }
.footer-bottom::before, .footer-bottom::after { font-size: 0.85rem; }
.footer-bottom::after { font-size: 0.7rem; }

.site-header.is-scrolled { box-shadow: var(--header-pill-shadow-scrolled); }

@media (prefers-reduced-motion: reduce) {
  .mobile-drawer__list a:hover { padding-left: 0; padding-right: 0; }
  .footer-grid li a::before { transition: none; }
}

/* =========================================================
   Light mode professional refinements
   ========================================================= */
[data-theme="light"] body {
  background:
    radial-gradient(ellipse at top, hsla(212, 100%, 50%, 0.05), transparent 50%),
    radial-gradient(ellipse at bottom right, hsla(220, 80%, 50%, 0.04), transparent 60%),
    var(--bg);
}

[data-theme="light"] .section--soft {
  background: linear-gradient(180deg, var(--bg-soft) 0%, hsla(220, 28%, 95%, 0.5) 100%);
  border-color: var(--border);
}

/* Cards with subtle gradient border + softer surface */
[data-theme="light"] .service-card,
[data-theme="light"] .case,
[data-theme="light"] .insight-card,
[data-theme="light"] .testimonial,
[data-theme="light"] .edu-card,
[data-theme="light"] .cert-item,
[data-theme="light"] .stat {
  background: linear-gradient(180deg, hsl(220, 30%, 99%) 0%, hsl(220, 25%, 97%) 100%);
  border-color: hsla(218, 22%, 55%, 0.18);
  box-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.8) inset,
              0 1px 2px hsla(218, 40%, 22%, 0.04),
              0 8px 22px -14px hsla(218, 40%, 22%, 0.1);
}

[data-theme="light"] .service-card:hover,
[data-theme="light"] .case:hover,
[data-theme="light"] .insight-card:hover {
  border-color: hsla(212, 92%, 44%, 0.35);
  box-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.9) inset,
              0 12px 28px -14px hsla(212, 80%, 35%, 0.22),
              0 4px 10px -3px hsla(218, 40%, 22%, 0.08);
  transform: translateY(-3px);
}

/* Inputs */
[data-theme="light"] .field input,
[data-theme="light"] .field select,
[data-theme="light"] .field textarea {
  background: hsl(220, 35%, 99.5%);
  border-color: hsla(218, 22%, 45%, 0.28);
  box-shadow: 0 1px 2px hsla(218, 40%, 22%, 0.03) inset;
}
[data-theme="light"] .field input::placeholder,
[data-theme="light"] .field textarea::placeholder { color: hsla(218, 16%, 50%, 0.65); }
[data-theme="light"] .field input:focus,
[data-theme="light"] .field select:focus,
[data-theme="light"] .field textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(212, 100%, 50%, 0.14);
}


[data-theme="light"] .nav-desktop a { color: hsl(218, 18%, 30%); }
[data-theme="light"] .nav-desktop a:hover { color: var(--fg); }
[data-theme="light"] .lang-toggle,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .menu-toggle {
  background: hsla(220, 30%, 99%, 0.7);
  border-color: hsla(218, 22%, 45%, 0.3);
}

/* Footer in light mode — richer */
[data-theme="light"] .site-footer {
  background:
    radial-gradient(ellipse at 20% 0%, hsla(212, 100%, 50%, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 100%, hsla(220, 80%, 50%, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, hsl(220, 28%, 95%) 0%, hsl(220, 24%, 92%) 100%);
  border-top-color: hsla(218, 22%, 45%, 0.22);
}
[data-theme="light"] .footer-bottom { border-top-color: hsla(218, 22%, 45%, 0.18); }



/* CTA strip — gradient border on top */
.cta-strip { position: relative; }
[data-theme="light"] .cta-strip {
  background: linear-gradient(180deg, hsla(212, 100%, 50%, 0.06) 0%, hsla(220, 80%, 50%, 0.03) 100%);
  border-top: 1px solid hsla(212, 92%, 44%, 0.18);
}

/* Buttons — better light-mode ghost */
[data-theme="light"] .btn--ghost {
  background: hsl(220, 30%, 99%);
  border-color: hsla(218, 22%, 40%, 0.32);
  color: var(--fg);
}
[data-theme="light"] .btn--ghost:hover {
  background: hsl(220, 35%, 99.5%);
  border-color: var(--primary);
  color: var(--primary);
}

/* Toast in light mode */
[data-theme="light"] .toast {
  background: hsl(220, 30%, 99%);
  border-color: hsla(212, 92%, 44%, 0.4);
}

/* Badge pill, eyebrow */
[data-theme="light"] .badge-pill {
  background: linear-gradient(135deg, hsla(212, 100%, 50%, 0.10), hsla(220, 80%, 50%, 0.06));
  border-color: hsla(212, 92%, 44%, 0.28);
  color: hsl(212, 92%, 30%);
}

/* Code block in light mode */
[data-theme="light"] .prose code {
  background: hsl(220, 30%, 95%);
  color: hsl(212, 92%, 35%);
}
[data-theme="light"] .prose pre {
  background: hsl(222, 30%, 14%);
  border-color: hsla(218, 22%, 30%, 0.4);
}
[data-theme="light"] .prose pre code { color: hsl(220, 20%, 90%); }

/* Logo bar in light mode — keep grayscale but a bit darker */
[data-theme="light"] .logo-bar { opacity: 0.7; filter: grayscale(1) brightness(0.7); }
