:root {
  --bg-primary: #f5f8ff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #151326;
  --text-secondary: #61677a;
  --accent: #2b86fb;
  --accent-hover: #0f6df2;
  --brand: #1b0a55;
  --border: #e2e8f4;
  --shadow: 0 22px 58px rgba(27, 10, 85, .1);
  --shadow-accent: 0 18px 42px rgba(43, 134, 251, .22);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --container-width: 1200px;
  --section-padding: 86px 0;
}

body.dark-mode {
  --bg-primary: #0d1020;
  --bg-secondary: #15182a;
  --bg-card: #111526;
  --text-primary: #f4f7ff;
  --text-secondary: #a8b1c7;
  --border: #2a324a;
  --brand: #f4f7ff;
  --shadow: 0 22px 58px rgba(0, 0, 0, .26);
  --shadow-accent: 0 18px 42px rgba(43, 134, 251, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "DM Sans", "Noto Sans Arabic", sans-serif;
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
  overflow-x: hidden;
}
body[dir="rtl"] { font-family: "Noto Sans Arabic", "DM Sans", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
.shell { width: min(var(--container-width), calc(100% - 40px)); margin-inline: auto; }
.lang-en .ar-content, .lang-ar .en-content { display: none !important; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.nav-shell {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { width: 196px; flex: 0 0 auto; }
body.dark-mode .brand img,
body.dark-mode .site-footer img { filter: brightness(0) invert(1); }
.desktop-nav { display: flex; align-items: center; gap: 30px; }
.desktop-nav a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  position: relative;
  transition: color .2s ease;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -8px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}
.desktop-nav a:hover,
.desktop-nav a:focus-visible { color: var(--text-primary); }
.desktop-nav a:hover::after,
.desktop-nav a:focus-visible::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 9px;
}
.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text-primary);
}
.mobile-menu { display: none; }

.hero {
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding: 98px 0 44px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 72px 0 0;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--accent) 10%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.58), transparent 78%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  align-items: center;
  gap: 76px;
}
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.hero h1 {
  max-width: 760px;
  margin: 0;
  color: var(--brand);
  font-size: clamp(48px, 6vw, 82px);
  line-height: 1.04;
  letter-spacing: 0;
  font-weight: 900;
}
.hero p {
  max-width: 690px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.85;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-logo-panel {
  display: flex;
  justify-content: center;
}
.hero-logo-panel img {
  width: 360px;
  max-width: 100%;
  height: 360px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: var(--shadow-accent);
}
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }

.stats-bar {
  background: var(--bg-secondary);
  border-block: 1px solid var(--border);
  padding: 38px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.stats-grid article { display: grid; gap: 4px; }
.stats-grid strong { color: var(--accent); font-size: 34px; line-height: 1; }
.stats-grid span { color: var(--text-secondary); font-size: 14px; font-weight: 700; }

.section { padding: var(--section-padding); }
.section-heading {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-heading h2,
.about-copy h2,
.contact-panel h2 {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
}
.section-heading p,
.about-copy p,
.contact-panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.8;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.service-card,
.product-card,
.value-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.service-card::before,
.product-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.service-card:hover,
.product-card:hover,
.value-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}
.service-card:hover::before,
.product-card:hover::before { transform: scaleX(1); }
.service-card { padding: 34px 28px; }
.service-card > span,
.value-item > span {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  opacity: .72;
}
.service-card h3,
.value-item h3 {
  margin: 0 0 10px;
  color: var(--text-primary);
  font-size: 20px;
}
.service-card p,
.value-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.portfolio-section { background: var(--bg-secondary); }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.product-card { min-height: 100%; }
.product-media {
  aspect-ratio: 16 / 9;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-copy { padding: 26px; }
.product-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.product-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.product-meta span,
.product-type {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}
.product-copy h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 24px;
}
.product-copy p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}
.product-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.product-tags span {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: 700;
}
.product-link {
  color: var(--accent);
  font-weight: 900;
  font-size: 14px;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
  gap: 70px;
  align-items: center;
}
.about-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.value-item { padding: 22px; display: flex; gap: 16px; }
.value-item > span { font-size: 22px; margin: 2px 0 0; flex: 0 0 auto; }

.contact-cta {
  padding: 82px 0;
  background: var(--bg-secondary);
  border-block: 1px solid var(--border);
}
.contact-panel { max-width: 820px; text-align: center; }
.contact-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 34px;
  text-align: start;
}
.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 13px 15px;
  outline: none;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--accent); }
.contact-form .full { grid-column: 1 / -1; }
.form-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status { margin: 0; color: var(--accent); font-weight: 800; text-align: center; }
.btn:disabled {
  cursor: wait;
  opacity: .68;
  transform: none;
}

.site-footer {
  background: var(--bg-primary);
  padding: 60px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 38px;
}
.site-footer img { width: 190px; margin-bottom: 12px; }
.site-footer p,
.site-footer a,
.copyright {
  color: var(--text-secondary);
  font-size: 14px;
}
.site-footer h3 {
  margin: 0 0 14px;
  color: var(--text-primary);
  font-size: 16px;
}
.site-footer a { display: block; margin: 8px 0; transition: color .2s ease; }
.site-footer a:hover { color: var(--accent); }
.copyright {
  margin-top: 38px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.scroll-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.scroll-reveal.visible { opacity: 1; transform: none; }

body[dir="rtl"] .service-card::before,
body[dir="rtl"] .product-card::before {
  transform-origin: right;
}

@media (max-width: 1024px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-menu {
    display: none;
    padding: 18px 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
  }
  .mobile-menu.open { display: grid; gap: 16px; }
  .mobile-menu a { color: var(--text-secondary); font-weight: 800; }
  .hero-content,
  .about-layout { grid-template-columns: 1fr; gap: 46px; text-align: center; }
  .hero-text,
  .about-copy { align-items: center; }
  .hero-logo-panel img { width: min(58vw, 240px); height: min(58vw, 240px); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .shell { width: min(100% - 28px, var(--container-width)); }
  .brand { width: 164px; }
  .nav-btn { min-height: 36px; padding-inline: 10px; font-size: 12px; }
  .hero { min-height: auto; padding-top: 88px; padding-bottom: 18px; }
  .hero h1 { font-size: clamp(32px, 10vw, 42px); }
  .hero p { font-size: 14px; line-height: 1.6; }
  .hero-content { gap: 18px; }
  .hero-logo-panel img { width: min(42vw, 150px); height: min(42vw, 150px); border-radius: var(--radius-md); }
  .hero-buttons,
  .hero-buttons .btn { width: 100%; }
  .hero-buttons .btn { min-height: 42px; }
  .stats-grid,
  .services-grid,
  .values-grid,
  .contact-form,
  .footer-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 28px; }
  .section { padding: 66px 0; }
  .section-heading { margin-bottom: 38px; }
}
