/* LibTec V4 — main stylesheet
   Logical properties (inline/block) keep one stylesheet for RTL and LTR. */

:root {
  --card-pad: clamp(22px, 2.4vw, 30px);
  --card-title-gap: 10px;
  --card-link-gap: 20px;
  --ink: #07111f;
  --navy: #0c1b2e;
  --navy-2: #12304f;
  --gold: #c9a24b;
  --gold-2: #e6cb86;
  --gold-d: #7a5c14;
  --ivory: #f6f1e7;
  --paper: #fcfaf5;
  --card: #ffffff;
  --text: #14202e;
  --mute: #4f5d6b;
  --line: #e1d8c4;
  --on-dark: #f6f1e7;
  --on-dark-mute: #b3c1cf;
  --teal: #7fd0d2;
  --radius: 6px;
  --wrap: 1180px;
  --header-h: 72px;
  --f-body: 'IBM Plex Sans Arabic', 'IBM Plex Sans', Tahoma, system-ui, sans-serif;
  --f-head: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --f-brand: 'Sora', 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root:lang(en) {
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-head: 'Sora', 'IBM Plex Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.85 var(--f-body);
  text-rendering: optimizeLegibility;
}
:lang(en) body, body:lang(en) { line-height: 1.7; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 700; margin: 0; line-height: 1.4; }
:root:lang(en) h1, :root:lang(en) h2, :root:lang(en) h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.sec-dark :focus-visible, .sec-navy :focus-visible, .hero :focus-visible, .site-header :focus-visible, .site-footer :focus-visible, .page-hero :focus-visible { outline-color: var(--gold-2); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--ink); padding: 10px 18px; border-radius: var(--radius); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; position: relative; }
.narrow { max-width: 780px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 26px; border-radius: 4px;
  background: var(--gold); color: var(--ink); border: 1.5px solid var(--gold);
  font: 700 1rem/1.2 var(--f-body); text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(230, 203, 134, .55); }
.btn-ghost:hover { background: transparent; color: var(--gold-2); border-color: var(--gold-2); }
.link-arrow {
  display: inline-flex; gap: 8px; align-items: center; font-weight: 500; color: var(--gold-d);
  text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.link-arrow:hover { color: var(--text); }
.link-light { color: var(--gold-2); }
.link-light:hover { color: var(--on-dark); }
.cta { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 17, 31, .97); color: var(--on-dark);
  border-bottom: 1px solid rgba(201, 162, 75, .35);
}
.bar { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--on-dark); flex: none; }
.logo img { width: 36px; height: 36px; }
.logo-wm { font: 600 1.55rem/1 var(--f-brand); letter-spacing: -0.03em; }
.logo-wm b { font-weight: 600; color: var(--gold); }
.logo-ar {
  font: 600 .8rem/1 'Noto Kufi Arabic', var(--f-head); color: var(--gold-2);
  writing-mode: vertical-rl; height: 38px; text-align: center;
  /* Vertical writing mode turns the inline axis vertical, so use physical sides here. */
  border-left: 1px solid rgba(201, 162, 75, .5); padding-left: 10px;
}
.logo { direction: ltr; }

.nav-desktop { margin-inline-start: auto; }
.nav-desktop ul { display: flex; align-items: center; gap: 4px; }
.nav-desktop a {
  display: block; padding: 8px 12px; border-radius: 4px; font-size: .94rem; text-decoration: none;
  color: var(--on-dark-mute); transition: color .2s;
}
.nav-desktop a:hover, .nav-desktop a[aria-current='page'] { color: var(--gold-2); }
.nav-desktop .nav-cta, .mobile-panel .nav-cta { color: var(--ink); background: var(--gold); font-weight: 700; margin-inline-start: 8px; }
.nav-desktop .nav-cta:hover, .nav-desktop .nav-cta[aria-current='page'] { background: var(--gold-2); color: var(--ink); }
.bar-end { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: inline-flex; align-items: center; border: 1px solid rgba(201, 162, 75, .45); border-radius: 99px; padding: 3px;
  font: 600 .8rem/1 var(--f-brand); letter-spacing: .06em;
}
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 30px; padding: 0 10px;
  border-radius: 99px; text-decoration: none; color: var(--on-dark-mute);
}
.lang-switch a:hover { color: var(--gold-2); }
.lang-switch a[aria-current] { background: rgba(201, 162, 75, .18); color: var(--gold-2); }
.lang-sep { width: 1px; height: 14px; background: rgba(201, 162, 75, .35); margin-inline: 2px; }
.lang-switch-lg { font-size: .95rem; }
.lang-switch-lg a { min-width: 64px; min-height: 44px; }

.menu-btn {
  display: none; width: 46px; height: 46px; border-radius: 6px; border: 1px solid rgba(201, 162, 75, .45);
  background: transparent; color: var(--on-dark); cursor: pointer; align-items: center; justify-content: center;
}
.menu-icon { display: grid; gap: 5px; width: 20px; }
.menu-icon span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s, opacity .2s; }
.menu-btn[aria-expanded='true'] .menu-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded='true'] .menu-icon span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded='true'] .menu-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-panel {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; overflow-y: auto;
  background: var(--ink); padding: 20px 24px 40px; border-top: 1px solid rgba(201, 162, 75, .25);
}
.mobile-panel ul { display: grid; gap: 2px; margin-bottom: 28px; }
.mobile-panel a:not(.lang-switch a) {
  display: block; padding: 14px 4px; font-size: 1.2rem; text-decoration: none; color: var(--on-dark);
  border-bottom: 1px solid rgba(201, 162, 75, .15);
}
.mobile-panel ul a[aria-current='page']:not(.nav-cta) { color: var(--gold-2); }
.mobile-panel .nav-cta { margin: 18px 0 0; padding: 14px 18px !important; border-radius: 4px; text-align: center; border: 0 !important; }
html.menu-open { overflow: hidden; }

@media (max-width: 1060px) {
  .nav-desktop, .bar-end > .lang-switch { display: none; }
  .menu-btn { display: inline-flex; }
  .bar-end { margin-inline-start: auto; }
}
@media (min-width: 1061px) { .mobile-panel { display: none !important; } }

/* ---------- Section scaffolding ---------- */
.sec { padding-block: clamp(64px, 9vw, 112px); }
.sec-dark { background: var(--ink); color: var(--on-dark); }
.sec-navy {
  color: var(--on-dark);
  background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' fill='none' stroke='%23C9A24B' stroke-opacity='.1'%3E%3Crect x='20' y='20' width='40' height='40'/%3E%3Crect x='20' y='20' width='40' height='40' transform='rotate(45 40 40)'/%3E%3C/svg%3E");
}
.sec-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head h2, .why-head h2, .training h2, .contact-intro h2, .contact-intro h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); margin-bottom: 14px; }
.lead { color: var(--mute); font-size: 1.12rem; max-width: 40em; }
.sec-dark .lead, .sec-navy .lead, .page-hero .lead { color: var(--on-dark-mute); }
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  color: var(--gold-d); font-size: .92rem; font-weight: 600; letter-spacing: .02em;
}
.eyebrow::before { content: ''; width: 36px; height: 2px; background: var(--gold); flex: none; }
.eyebrow-light, .sec-dark .eyebrow, .sec-navy .eyebrow { color: var(--gold-2); }
.sec-foot { margin: 36px 0 0; }
.fineprint { font-size: .86rem; color: var(--mute); max-width: 60em; margin: 0; }


/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--on-dark);
  background: radial-gradient(900px 520px at 18% 35%, var(--navy-2) 0, transparent 70%), var(--ink);
}
:root:lang(en) .hero { background: radial-gradient(900px 520px at 82% 35%, var(--navy-2) 0, transparent 70%), var(--ink); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to left, rgba(7, 17, 31, .95) 0, rgba(7, 17, 31, .62) 48%, rgba(7, 17, 31, .1) 85%);
}
:root:lang(en) .hero::after { background: linear-gradient(to right, rgba(7, 17, 31, .95) 0, rgba(7, 17, 31, .62) 48%, rgba(7, 17, 31, .1) 85%); }
.hero-in { position: relative; z-index: 1; padding-block: clamp(84px, 13vw, 150px) clamp(72px, 10vw, 120px); }
.hero-in > * { max-width: 660px; }
.hero-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 22px; }
.hero-brand-name { font: 600 clamp(1.7rem, 2.8vw, 2.25rem)/1 var(--f-brand); letter-spacing: -0.03em; color: var(--on-dark); }
.hero-brand-name b { font-weight: 600; color: var(--gold); }
.hero-brand-tag { padding-inline-start: 16px; border-inline-start: 1px solid rgba(201, 162, 75, .55); color: var(--gold-2); font-size: .98rem; font-weight: 500; line-height: 1.5; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); line-height: 1.38; margin-bottom: 22px; max-width: 14em; text-wrap: balance; }
:root:lang(en) .hero h1 { font-size: clamp(2rem, 4.2vw, 3.15rem); line-height: 1.12; max-width: 15em; }
.hero-text { text-wrap: pretty; }
.hero-text { color: var(--on-dark-mute); font-size: clamp(1.05rem, 1.6vw, 1.22rem); margin-bottom: 36px; }
.strip { position: relative; z-index: 1; background: rgba(12, 27, 46, .9); border-top: 1px solid rgba(201, 162, 75, .35); }
.strip ul { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 22px; padding-block: 16px; font: 400 .85rem var(--f-mono); color: var(--gold-2); letter-spacing: .04em; }

/* ---------- Services grid (homepage) ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.svc {
  position: relative; padding: var(--card-pad); display: flex; flex-direction: column; text-align: start; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line);
  background: var(--paper); transition: background-color .25s;
}
.svc:hover { background: var(--card); }
.svc::before { content: ''; position: absolute; inset-inline: 0; top: -1px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right; transition: transform .35s; }
:root:lang(en) .svc::before { transform-origin: left; }
.svc:hover::before, .svc:focus-within::before { transform: scaleX(1); }
.svc-n { display: block; font: 400 .85rem var(--f-mono); color: var(--gold-d); margin-bottom: 16px; letter-spacing: .08em; }
.svc h3 { font-size: 1.22rem; margin-bottom: var(--card-title-gap); }
.svc h3 a { text-decoration: none; }
.svc h3 a::after { content: ''; position: absolute; inset: 0; }
.svc p { color: var(--mute); font-size: .97rem; margin: 0 0 var(--card-link-gap); }
.svc-more { font-size: .9rem; font-weight: 600; color: var(--gold-d); margin-top: auto; }

/* ---------- AI showcase ---------- */
.ai { background-image: linear-gradient(rgba(201, 162, 75, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(201, 162, 75, .05) 1px, transparent 1px); background-size: 48px 48px; }
.ai-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; margin-bottom: 44px; }
.ai-top .sec-head { margin-bottom: 0; }
.flow { margin: 0 0 56px; padding: clamp(14px, 2.4vw, 28px); border: 1px solid rgba(201, 162, 75, .3); border-radius: 10px; background: rgba(12, 27, 46, .65); }
.flow-grid { display: grid; grid-template-columns: 1.15fr 54px 1fr 54px 1fr 54px 1.1fr; align-items: center; }
.flow-node {
  display: grid; gap: 6px; text-align: start; justify-items: start; align-content: center; min-height: 148px; padding: 18px;
  border: 1px solid rgba(201, 162, 75, .35); border-radius: 8px; background: rgba(7, 17, 31, .8);
}
.flow-k { font-weight: 700; color: var(--on-dark); font-size: 1rem; }
.flow-s { color: var(--on-dark-mute); font-size: .88rem; line-height: 1.5; }
.flow-sources ul { display: grid; gap: 6px; }
.flow-sources li { font-size: .86rem; color: var(--on-dark-mute); padding: 4px 10px; border: 1px solid rgba(127, 208, 210, .3); border-radius: 4px; }
.flow-core { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 162, 75, .08), 0 18px 40px -20px rgba(201, 162, 75, .5); }
.flow-core img { width: 28px; height: 28px; margin-bottom: 4px; }
.flow-user { border-color: rgba(127, 208, 210, .5); }
.flow-lines { display: grid; gap: 6px; margin-top: 6px; }
.flow-lines i { display: block; height: 6px; border-radius: 3px; background: rgba(179, 193, 207, .25); }
.flow-lines i:nth-child(2) { width: 70%; }
.flow-lines i.cite { width: auto; height: auto; background: none; font: 400 .75rem var(--f-mono); font-style: normal; color: var(--gold-2); }
.flow-link { position: relative; height: 2px; margin-inline: 6px; background: rgba(201, 162, 75, .25); overflow: hidden; }
.flow-link span { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--gold-2), transparent); background-size: 50% 100%; background-repeat: no-repeat; }
.flow.is-live .flow-link span { animation: flow 2.4s linear infinite; }
[dir='rtl'] .flow.is-live .flow-link span { animation-name: flow-rtl; }
@keyframes flow { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes flow-rtl { from { background-position: 200% 0; } to { background-position: -100% 0; } }
/* The diagram stays horizontal while its own width allows readable nodes (container query),
   gets compact on tablets, and stacks vertically only on narrow screens. */
.flow { container: flow / inline-size; }
@container flow (max-width: 900px) {
  .flow-grid { grid-template-columns: 1.15fr 28px 1fr 28px 1fr 28px 1.1fr; }
  .flow-node { min-height: 128px; padding: 12px; }
  .flow-k { font-size: .92rem; }
  .flow-s, .flow-sources li { font-size: .8rem; }
  .flow-sources li { padding: 3px 7px; }
  .flow-link { margin-inline: 3px; }
}
@container flow (max-width: 600px) {
  .flow-grid { grid-template-columns: 1fr; gap: 0; max-width: 460px; margin-inline: auto; }
  .flow-node { min-height: 0; padding: 16px; }
  .flow-link { width: 2px; height: 34px; margin: 0 auto; }
  .flow-link span { background: linear-gradient(180deg, transparent, var(--gold-2), transparent); background-size: 100% 50%; background-repeat: no-repeat; }
  .flow.is-live .flow-link span, [dir='rtl'] .flow.is-live .flow-link span { animation-name: flow-v; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 700px) {
    .flow-grid { grid-template-columns: 1fr; gap: 0; }
    .flow-link { width: 2px; height: 34px; margin: 0 auto; }
  }
}
.flow figcaption { margin-top: 18px; font-size: .84rem; color: var(--on-dark-mute); }
.ai-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid rgba(201, 162, 75, .3); }
.ai-list li { display: flex; flex-direction: column; align-items: flex-start; padding: var(--card-pad); text-align: start; border-inline-end: 1px solid rgba(201, 162, 75, .18); }
.ai-list li:last-child { border-inline-end: 0; }
.ai-tag { display: inline-block; unicode-bidi: isolate; font: 400 .72rem/1.5 var(--f-mono); color: var(--teal); letter-spacing: .04em; margin-bottom: 12px; }
.ai-list h3 { font-size: 1.05rem; margin-bottom: var(--card-title-gap); color: var(--gold-2); }
.ai-list p { font-size: .92rem; color: var(--on-dark-mute); margin: 0; }

/* ---------- Platforms ---------- */
.platforms { background: var(--ivory); }
.plat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-bottom: 36px; }
.plat {
  position: relative; display: flex; flex-direction: column; text-align: start; padding: clamp(28px, 4vw, 44px); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 30px 60px -40px rgba(7, 17, 31, .35);
}
.plat::before { content: ''; position: absolute; top: 0; inset-inline-start: clamp(28px, 4vw, 44px); width: 56px; height: 3px; background: var(--gold); }
.plat h3 { font: 600 clamp(2.2rem, 4vw, 3rem)/1 var(--f-brand); letter-spacing: -0.03em; color: var(--navy); margin-bottom: 14px; }
.plat-sub { font-weight: 700; color: var(--gold-d); font-size: 1.1rem; margin-bottom: 10px; }
.plat p { color: var(--mute); }
.plat .plat-sub { color: var(--gold-d); }
.plat p:not(.plat-sub):not(.plat-links) { margin: 0 0 var(--card-link-gap); }
.plat-links { display: flex; flex-wrap: wrap; gap: 14px 26px; margin: auto 0 0; }
.plat-beyond { font-size: 1.08rem; max-width: 46em; margin-bottom: 12px; }

/* ---------- Demo ---------- */
.demo-sec { background: var(--paper); }
.demo-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.demo-intro .sec-head { margin-bottom: 24px; }
.badge {
  display: inline-block; font-size: .85rem; color: var(--gold-d); background: rgba(201, 162, 75, .12);
  border: 1px solid rgba(201, 162, 75, .45); border-radius: 6px; padding: 6px 14px; margin: 0;
}
.demo { background: var(--ink); color: #dce8f0; border-radius: 10px; border: 1px solid rgba(201, 162, 75, .45); overflow: hidden; box-shadow: 0 30px 70px -36px rgba(7, 17, 31, .6); }
.tabs { display: flex; border-bottom: 1px solid #20374d; overflow-x: auto; }
.tab {
  flex: 1 0 auto; min-height: 52px; padding: 12px 16px; background: none; border: 0; cursor: pointer;
  color: #9db0c3; font: 500 .95rem var(--f-body); box-shadow: inset 0 -3px transparent; transition: color .2s, box-shadow .2s;
}
.tab:hover { color: var(--on-dark); }
.tab[aria-selected='true'] { color: var(--gold-2); box-shadow: inset 0 -3px var(--gold); }
.pane { padding: 24px; min-height: 380px; }
.pane:focus-visible { outline-offset: -4px; }
.marc { margin: 0; font: 400 .82rem/1.9 var(--f-mono); white-space: normal; text-align: left; overflow-x: auto; }
.m-line { display: block; padding-left: 7.5ch; text-indent: -7.5ch; white-space: pre-wrap; }
.m-tag { color: var(--gold); }
.m-ind { color: var(--teal); }
.m-data b { color: var(--gold-2); font-weight: 400; }
.rec-card { background: #fff; color: var(--text); border-radius: 8px; padding: 22px; border-top: 3px solid var(--gold); }
.rec-card h3 { font: 600 1.15rem/1.45 var(--f-brand); margin-bottom: 14px; text-align: start; }
.rec-card dl { margin: 0 0 14px; display: grid; gap: 6px; font-size: .92rem; }
.rec-card dl div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; }
.rec-card dt { color: var(--mute); }
.rec-card dd { margin: 0; }
.rec-subj-label { font-size: .85rem; color: var(--mute); margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--ivory); border: 1px solid var(--line); padding: 2px 12px; border-radius: 99px; font-size: .84rem; }
.ask, .answer { border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.ask { background: #0a1626; border: 1px solid #2a4259; }
.ask p, .answer p { margin: 0; color: #fff; }
.answer { background: rgba(201, 162, 75, .08); border: 1px solid rgba(201, 162, 75, .35); }
.ask-label { display: block; font-size: .78rem; color: #8fa6b8; margin-bottom: 6px; }
.cite { color: var(--gold-2); font-family: var(--f-mono); font-size: .85em; text-decoration: none; }
.src-list li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid #20374d; font-size: .9rem; }
.src-list small { color: var(--teal); font-size: .8rem; }
.cap { margin: 18px 0 0; font-size: .82rem; color: #8fa6b8; }

/* ---------- Why ---------- */
.why { background: var(--card); border-top: 1px solid var(--line); }
.why-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); }
.why-head { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.why-quote { font-family: var(--f-head); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.6; color: var(--navy); border-inline-start: 3px solid var(--gold); padding-inline-start: 22px; margin: 28px 0 0; }
:root:lang(en) .why-quote { line-height: 1.4; }
.why-list li { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 12px 32px; padding: 34px 0; border-top: 1px solid var(--line); }
.why-list li:last-child { border-bottom: 1px solid var(--line); }
.why-list h3 { font-size: 1.3rem; color: var(--navy); }
.why-list p { margin: 0; color: var(--mute); }

/* ---------- Process ---------- */
.process { background: var(--ivory); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; position: relative; }
.steps::before { content: ''; position: absolute; top: 21px; inset-inline: 0; height: 1px; background: linear-gradient(90deg, var(--gold), rgba(201, 162, 75, .2)); }
[dir='rtl'] .steps::before { background: linear-gradient(270deg, var(--gold), rgba(201, 162, 75, .2)); }
.steps li { position: relative; }
.step-n {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px;
  font: 400 .85rem var(--f-mono); color: var(--gold-d); background: var(--ivory); border: 1px solid var(--gold); border-radius: 50%;
}
.steps li { text-align: start; }
.steps h3 { font-size: 1.25rem; margin-bottom: var(--card-title-gap); }
.steps p { color: var(--mute); font-size: .97rem; margin: 0; }

/* ---------- Training ---------- */
.training-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.training .cta { margin-top: 30px; }
.themes { border: 1px solid rgba(201, 162, 75, .35); border-radius: 10px; padding: 28px 30px; background: rgba(7, 17, 31, .55); }
.themes-label { font-size: .88rem; color: var(--on-dark-mute); margin-bottom: 10px; }
.themes li { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid rgba(201, 162, 75, .18); font-size: 1.1rem; font-weight: 500; }
.themes li::before { content: ''; width: 9px; height: 9px; background: var(--gold); flex: none; }
.themes li:nth-child(2)::before { width: 7px; height: 7px; }
.themes li:nth-child(3)::before { width: 6px; height: 6px; }
.themes li:nth-child(4)::before { width: 5px; height: 5px; }

/* ---------- Contact ---------- */
.contact { background: var(--paper); }
.contact-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.next-box { margin-top: 28px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.next-box h3 { font-size: 1rem; margin-bottom: 6px; }
.next-box p { margin: 0; color: var(--mute); font-size: .95rem; }
.cform { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: clamp(22px, 4vw, 36px); box-shadow: 0 30px 60px -44px rgba(7, 17, 31, .4); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.field { margin-bottom: 20px; }
.field label, .field-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.req { font-weight: 400; color: var(--mute); font-size: .82rem; }
.field-help { font-size: .86rem; color: var(--mute); margin: -2px 0 8px; }
.field input[type='text'], .field input[type='email'], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid #c9bea5; border-radius: 6px;
  background: var(--paper); color: var(--text); font: 400 1rem/1.5 var(--f-body);
}
.field textarea { resize: vertical; min-height: 140px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold-d) 50%), linear-gradient(135deg, var(--gold-d) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 40px; }
[dir='rtl'] .field select { background-position: 15px 21px, 20px 21px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(201, 162, 75, .55); outline-offset: 1px; border-color: var(--gold-d); }
.field [aria-invalid='true'] { border-color: #a3261f; background: #fff7f6; }
.field-err { color: #a3261f; font-size: .88rem; margin: 6px 0 0; }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; }
.field-check input { width: 22px; height: 22px; margin: 4px 0 0; accent-color: var(--gold-d); }
.field-check label { font-weight: 400; font-size: .95rem; margin: 0; }
.field-check label a { color: var(--gold-d); }
.field-check .field-err { grid-column: 2; }
.cform-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.cform-fields:disabled { opacity: .5; }
.cform-fields:disabled * { cursor: not-allowed; }
.form-notice { margin: 0 0 22px; padding: 14px 18px; border: 1px solid rgba(201, 162, 75, .6); border-inline-start-width: 4px; background: #fbf5e6; color: #4a3a12; border-radius: 6px; font-weight: 600; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err-summary { border: 1px solid #a3261f; background: #fff7f6; color: #7d1d17; padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-status { margin: 0; font-weight: 600; }
.form-status.is-ok { color: #1d6b3a; }
.form-status.is-err { color: #a3261f; }
.cform.is-done .field, .cform.is-done .field-row, .cform.is-done [data-submit] { display: none; }
.cform.is-done .form-status { font-size: 1.1rem; padding: 18px; border: 1px solid #b7d9c3; background: #f1faf4; border-radius: 6px; }

/* Align card parts across each row where subgrid is supported; heights stay flexible. */
@supports (grid-template-rows: subgrid) {
  .svc { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; }
  .svc-more { align-self: end; margin-top: 0; }
  .ai-list li { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; align-items: start; justify-items: start; }
  .plat { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; }
  .plat-links { align-self: end; margin-top: 0; }
  .steps li { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 0; align-content: start; }
  .steps .step-n { justify-self: start; }
}

/* ---------- Inner pages ---------- */
.page-hero {
  color: var(--on-dark); padding-block: clamp(48px, 7vw, 88px) clamp(44px, 6vw, 72px);
  background: radial-gradient(700px 360px at 85% 0%, var(--navy-2) 0, transparent 70%), var(--ink);
  border-bottom: 1px solid rgba(201, 162, 75, .35);
}
.page-hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin-bottom: 14px; max-width: 22em; }
.page-hero .lead { margin: 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--on-dark-mute); margin-bottom: 22px; }
.crumbs li + li::before { content: '/'; margin-inline-end: 6px; color: rgba(201, 162, 75, .7); }
.crumbs a { color: var(--gold-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.svc-rows { border-top: 1px solid var(--line); }
.svc-row { display: grid; grid-template-columns: 64px minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 18px 32px; padding: 34px 0; border-bottom: 1px solid var(--line); align-items: start; }
.svc-row .svc-n { margin: 6px 0 0; }
.svc-row h2 { font-size: 1.35rem; margin-bottom: 10px; }
.svc-row h2 a { text-decoration: none; }
.svc-row h2 a:hover { color: var(--gold-d); }
.svc-row p { color: var(--mute); margin: 0; }
.svc-row-caps { display: grid; gap: 6px; font-size: .92rem; color: var(--mute); }
.svc-row-caps li { padding-inline-start: 16px; position: relative; }
.svc-row-caps li::before { content: ''; position: absolute; inset-inline-start: 0; top: .8em; width: 6px; height: 6px; background: var(--gold); }
.svc-row-caps .more::before { background: transparent; border: 1px solid var(--gold); }
.svc-row-link { margin-top: 6px; white-space: nowrap; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.detail-n { font: 400 .85rem var(--f-mono); color: var(--gold-d); letter-spacing: .08em; text-align: end; }
:root:lang(en) .detail-n { text-align: start; }
.detail-intro { font-size: 1.22rem; line-height: 1.8; color: var(--navy); margin-bottom: 18px; }
.detail-note { padding: 14px 18px; border-inline-start: 3px solid var(--gold); background: var(--ivory); color: var(--mute); font-size: .97rem; }
.detail-main h2 { font-size: 1.4rem; margin: 40px 0 18px; }
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.caps li { position: relative; padding: 14px 0 14px; padding-inline-start: 22px; border-bottom: 1px solid var(--line); }
.caps li::before { content: ''; position: absolute; inset-inline-start: 0; top: 1.45em; width: 8px; height: 8px; background: var(--gold); }
.detail-aside { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 28px); }
.aside-card { background: var(--ink); color: var(--on-dark); border-radius: 10px; padding: 26px; border: 1px solid rgba(201, 162, 75, .4); }
.aside-card p { color: var(--on-dark-mute); font-size: .97rem; }
.aside-related h2 { font-size: 1.05rem; margin-bottom: 10px; }
.aside-related ul { margin-bottom: 16px; }
.aside-related li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--mute); }
.aside-related li a:hover { color: var(--gold-d); }

.cta-band { background: var(--navy); color: var(--on-dark); border-top: 1px solid rgba(201, 162, 75, .35); }
.cta-band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-block: 44px; }
.cta-band p { font: 700 clamp(1.3rem, 2.4vw, 1.8rem)/1.4 var(--f-head); margin: 0; }

.prose h2 { font-size: 1.3rem; margin: 34px 0 10px; }
.prose p { color: var(--mute); }

.not-found .nf-grid { display: grid; grid-template-columns: auto 1fr 1fr; gap: 40px; align-items: start; }
.nf-code { font: 600 clamp(4rem, 10vw, 7rem)/1 var(--f-brand); color: var(--gold); margin: 0; }
.nf-block h1, .nf-block h2 { font-size: 1.6rem; margin-bottom: 10px; }
.nf-block[lang='en'] h2 { font-family: 'Sora', 'IBM Plex Sans', sans-serif; }
.nf-block[lang='en'] { font-family: 'IBM Plex Sans', system-ui, sans-serif; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark-mute); border-top: 1px solid rgba(201, 162, 75, .35); font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr); gap: 40px; padding-block: 56px 40px; }
.footer-brand p { margin: 18px 0 22px; max-width: 26em; }
.footer-col h2 { font: 600 .95rem var(--f-head); color: var(--gold-2); margin-bottom: 14px; }
.footer-col li a { display: inline-block; padding: 5px 0; text-decoration: none; }
.footer-col li a:hover { color: var(--gold-2); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-block: 20px 28px; border-top: 1px solid rgba(201, 162, 75, .18); font-size: .85rem; }
.footer-bottom p { margin: 0; }
.logo-compact .logo-wm { font-size: 1.35rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ai-list { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
  .ai-list li { border-inline-end: 0; border-top: 1px solid rgba(201, 162, 75, .18); }
}
@keyframes flow-v { from { background-position: 0 -100%; } to { background-position: 0 200%; } }
@media (max-width: 960px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-layout, .why-layout, .training-layout, .contact-layout, .detail-layout { grid-template-columns: 1fr; }
  .why-head, .detail-aside { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .steps::before { display: none; }
  .svc-row { grid-template-columns: 48px minmax(0, 1fr); }
  .svc-row-caps, .svc-row-link { grid-column: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .not-found .nf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --header-h: 64px; }
  .wrap { padding-inline: 20px; }
  .logo-wm { font-size: 1.35rem; }
  .logo img { width: 32px; height: 32px; }
  .hero-brand { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hero-brand-tag { padding-inline-start: 0; border-inline-start: 0; font-size: .95rem; }
  /* On phones the Arabic name reads horizontally at a legible size. */
  .logo-ar { writing-mode: horizontal-tb; height: auto; font-size: 1rem; line-height: 1.3; padding: 2px 0 2px 10px; }
  .svc-grid, .plat-grid, .ai-list, .steps, .field-row, .caps { grid-template-columns: 1fr; }

  .ai-list li { padding-inline: 0; }
  .why-list li { grid-template-columns: 1fr; padding: 26px 0; }
  .pane { padding: 18px; min-height: 0; }
  .rec-card dl div { grid-template-columns: 1fr; gap: 0; }
  .tab { font-size: .88rem; padding: 10px 12px; }
  .hero::after { background: rgba(7, 17, 31, .74) !important; }
  .strip ul { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .hero-canvas, .menu-btn, .mobile-panel, .cform, .skip { display: none !important; }
  body { background: #fff; }
}
