:root {
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #161616;
  --gold: #c9a84c;
  --gold-soft: rgba(201, 168, 76, 0.18);
  --text: #e5e5e5;
  --muted: #888888;
  --line: rgba(229, 229, 229, 0.13);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --font-en: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-ar: "Tajawal", "Cairo", system-ui, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f7f5ef;
  --panel: #ffffff;
  --panel-2: #ede8dc;
  --text: #181818;
  --muted: #66615a;
  --line: rgba(20, 20, 20, 0.14);
  --shadow: 0 24px 80px rgba(40, 32, 14, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, var(--gold-soft), transparent 34rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  font-family: var(--font-en);
  line-height: 1.65;
  min-width: 320px;
}
[dir="rtl"] body { font-family: var(--font-ar); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(900px, calc(100% - 40px)); }
.section { padding: clamp(88px, 9vw, 118px) 0; }
.section-grain { position: relative; overflow: hidden; }
.section-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 100;
  transform: translateY(-140%);
  background: var(--gold);
  color: #111;
  padding: 10px 14px;
  border-radius: var(--radius);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px);
  transition: border-color .3s ease, background .3s ease;
}
:root[data-theme="light"] .site-header { background: rgba(247, 245, 239, 0.78); }
.site-header.is-scrolled { border-color: var(--line); }
.navbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0; }
.brand-text { white-space: nowrap; }
.logo-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: var(--gold);
  background: transparent;
}
.logo-wrap.small { width: 44px; height: 44px; }
.logo-wrap img {
  position: relative;
  z-index: 2;
  width: 92%;
  height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(201, 168, 76, .18));
}
.nav-panel { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; font-weight: 600; }
.nav-panel a { transition: color .3s ease; }
.nav-panel a:hover, .nav-panel a.active { color: var(--gold); }
.nav-actions { display: inline-flex; align-items: center; gap: 12px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.segmented button, .theme-toggle, .icon-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.segmented button { min-width: 38px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.segmented button.active { background: var(--gold); color: #12100a; }
.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  background: var(--panel);
}
.theme-toggle span { position: absolute; inset: 12px; border-radius: 50%; }
.theme-toggle .sun { background: var(--gold); transform: scale(.9); }
.theme-toggle .moon { background: var(--panel); transform: translateX(8px) translateY(-3px); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--text); margin: 4px auto; }

.hero { min-height: calc(100vh - 76px); padding: clamp(68px, 8vw, 92px) 0 clamp(56px, 7vw, 76px); display: grid; align-items: center; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(320px, .82fr); gap: clamp(44px, 6vw, 72px); align-items: center; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; margin: 0 0 18px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(46px, 7vw, 96px); line-height: 1; margin: 0; letter-spacing: 0; color: var(--gold); }
h2 { font-size: clamp(34px, 4vw, 48px); line-height: 1.14; margin: 0 0 20px; }
h3 { font-size: 22px; line-height: 1.25; margin: 0; }
.hero-title { font-size: clamp(21px, 3vw, 32px); line-height: 1.25; color: var(--text); margin: 24px 0 10px; font-weight: 700; }
.hero-line, .lead, .rich-copy p, .contact-panel p { color: var(--muted); font-size: 17px; line-height: 1.72; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 28px; }
.cta-row.centered { justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  font-weight: 800;
  transition: transform .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--gold); color: #12100a; }
.btn.outline { color: var(--gold); background: transparent; }
.stats-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; color: var(--muted); font-size: 13px; }
.stats-row span { border: 1px solid var(--line); border-radius: 999px; padding: 9px 13px; background: rgba(255,255,255,.025); }
.social-link { display: inline-flex; align-items: center; gap: 9px; margin-top: 24px; color: var(--gold); font-weight: 700; }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.portrait-frame {
  position: relative;
  min-height: 420px;
  border: 1px solid rgba(201, 168, 76, .58);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(201,168,76,.16), rgba(255,255,255,.035));
  box-shadow: 0 0 70px rgba(201, 168, 76, .14);
  overflow: hidden;
}
.hero-portrait { min-height: min(640px, 70vh); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 2; }
.asset-fallback {
  position: absolute;
  inset: 12px;
  z-index: 1;
  display: none;
  place-items: center;
  border: 1px dashed #666666;
  color: #d6d6d6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background:
    linear-gradient(rgba(40,40,40,.88), rgba(40,40,40,.88)),
    repeating-linear-gradient(135deg, #333 0, #333 8px, #272727 8px, #272727 16px);
}
.asset-fallback.large { font-size: 16px; }
img.is-missing { display: none; }
img.is-missing + .asset-fallback { display: grid; }

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 46px;
  align-items: start;
  max-width: 920px;
}
.two-column { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(38px, 6vw, 70px); align-items: start; }
.about-portrait { min-height: 520px; }
.lead { max-width: 760px; }
.skill-list { display: grid; gap: 18px; margin-top: 30px; }
.skill {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  color: var(--text);
  font-weight: 700;
}
.skill b { color: var(--gold); font-size: 13px; }
.skill i {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.skill i::before { content: ""; display: block; width: var(--level); height: 100%; background: linear-gradient(90deg, var(--gold), #ffe39a); border-radius: inherit; }
.about-stats { margin-top: 30px; }
.section-head { margin-bottom: 38px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.project-card, .service-grid article, .achievement-grid article, .patent-card, .contact-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: var(--shadow);
}
.project-card { overflow: hidden; }
.project-media { position: relative; aspect-ratio: 16/10; background: var(--panel); overflow: hidden; }
.project-media img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 2; }
.project-media a {
  position: absolute;
  inset: auto 18px 18px auto;
  z-index: 3;
  background: var(--gold);
  color: #12100a;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
}
[dir="rtl"] .project-media a { inset: auto auto 18px 18px; }
.project-card:hover .project-media a { opacity: 1; transform: translateY(0); }
.project-body { padding: 20px; }
.project-body p { color: var(--muted); margin: 8px 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { color: var(--gold); border: 1px solid rgba(201,168,76,.34); border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; }
.service-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.service-grid article { min-height: 196px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.service-grid span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #111; font-weight: 900; font-size: 13px; }
.logo-strip { overflow: hidden; border-block: 1px solid var(--line); padding: 24px 0; margin-bottom: 34px; }
.logo-strip div { display: flex; gap: 48px; width: max-content; animation: marquee 22s linear infinite; }
.logo-strip span { color: var(--muted); font-size: clamp(22px, 3vw, 36px); font-weight: 800; white-space: nowrap; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.achievement-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.achievement-grid article { padding: 24px; }
.achievement-grid p { color: var(--muted); margin: 10px 0 0; }
.contact-panel { text-align: center; padding: clamp(34px, 6vw, 66px); }
.contact-panel h2 { max-width: 800px; margin-inline: auto; }
.mail-link { display: inline-block; margin: 20px 0 0; color: var(--gold); font-size: clamp(24px, 4vw, 42px); font-weight: 800; }
.phone-number {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  white-space: nowrap;
}
.contact-methods {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.contact-methods a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255,255,255,.03);
  font-weight: 800;
}
.contact-methods a:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.openisl-hero { min-height: 64vh; text-align: center; }
.openisl-hero .shell { position: relative; z-index: 1; }
.openisl-hero h1 { color: var(--gold); }
.rich-copy h3 { margin: 30px 0 12px; color: var(--gold); }
.rich-copy ul { margin: 0; padding-inline-start: 22px; color: var(--muted); }
.rich-copy li { margin: 9px 0; }
.rich-copy .strong { color: var(--text); font-weight: 800; }
.patent-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  background:
    linear-gradient(135deg, rgba(201,168,76,.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}
.patent-card::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(201,168,76,.32);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
}
.patent-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  inset-block-start: -70px;
  inset-inline-end: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.2), transparent 68%);
  pointer-events: none;
}
.patent-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.patent-card h2 {
  color: var(--gold);
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: .02em;
  margin-bottom: 0;
}
.patent-seal {
  flex: 0 0 auto;
  width: clamp(86px, 12vw, 122px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(201,168,76,.72);
  border-radius: 50%;
  color: var(--gold);
  background:
    radial-gradient(circle, rgba(201,168,76,.2), transparent 58%),
    rgba(10,10,10,.34);
  box-shadow: inset 0 0 0 8px rgba(201,168,76,.06), 0 18px 50px rgba(0,0,0,.22);
}
.patent-seal span {
  display: grid;
  place-items: center;
  width: 72%;
  aspect-ratio: 1;
  border: 1px solid rgba(201,168,76,.42);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .14em;
}
.patent-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}
.patent-grid span {
  display: grid;
  gap: 8px;
  min-height: 118px;
  align-content: center;
  border: 1px solid rgba(201,168,76,.22);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--muted);
  background: rgba(0,0,0,.16);
}
.patent-grid b {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
[dir="rtl"] .patent-grid b { letter-spacing: 0; }
.patent-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.patent-foot i {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(201,168,76,.55), transparent);
}
[dir="rtl"] .patent-foot i {
  background: linear-gradient(270deg, rgba(201,168,76,.55), transparent);
}
.openisl-name { text-align: center; padding-top: 40px; }
.openisl-name h2 { font-size: clamp(58px, 12vw, 150px); color: var(--gold); margin: 0; }
.openisl-name p { color: var(--muted); font-size: clamp(20px, 3vw, 34px); margin: 0; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a:hover { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
@media (max-width: 1050px) {
  .hero-grid, .about-grid, .two-column { grid-template-columns: 1fr; }
  .hero-portrait { min-height: 520px; max-width: 520px; }
  .project-grid, .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .menu-toggle { display: block; }
  .nav-panel {
    position: fixed;
    inset: 78px 20px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
  }
  .nav-panel.open { display: flex; }
  .nav-panel a { padding: 13px 8px; }
  .nav-actions { padding-top: 12px; justify-content: space-between; }
  .brand-text { display: none; }
  .logo-wrap { width: 48px; height: 48px; }
}
@media (max-width: 640px) {
  .shell, .narrow { width: min(100% - 28px, 1180px); }
  .section { padding: 76px 0; }
  .hero { padding: 48px 0 58px; }
  .hero-grid { gap: 34px; }
  .hero-portrait {
    width: min(100%, 340px);
    min-height: 0;
    aspect-ratio: 4 / 5;
    margin-inline: auto;
  }
  .hero-portrait img {
    object-position: center top;
  }
  .about-portrait { min-height: 360px; }
  .hero-title { margin-top: 20px; }
  .stats-row { margin-top: 24px; }
  .project-grid, .service-grid, .achievement-grid, .patent-grid { grid-template-columns: 1fr; }
  .patent-head { align-items: flex-start; }
  .patent-seal { width: 78px; }
  .patent-grid { margin-top: 24px; }
  .patent-grid span { min-height: 96px; }
  .stats-row span { width: 100%; text-align: center; }
  .btn { width: 100%; }
  .cta-row { width: 100%; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
}
