/* AJAJ.me — الواجهة العامة
   خصائص منطقية (inline/block) لتعمل التصاميم في الاتجاهين RTL و LTR */

:root {
  --bg: #F5F1EA;
  --bg-alt: #ECE6DB;
  --surface: #FFFDF9;
  --ink: #16201C;
  --ink-2: #4A554F;
  --line: #DCD4C6;
  --accent: #0E6B57;
  --accent-ink: #FFFFFF;
  --accent-soft: #D7EBE3;
  --warm: #E9A23B;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(22 32 28 / .06), 0 12px 32px -12px rgb(22 32 28 / .18);
  --f-body: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-head: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --wrap: 1160px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111412; --bg-alt: #171B18; --surface: #1C211E; --ink: #EDEBE4; --ink-2: #A7AFA9;
    --line: #2C332F; --accent: #3FB592; --accent-ink: #0B1A14; --accent-soft: #173229; --warm: #F0B457;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 16px 40px -16px rgb(0 0 0 / .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.75 var(--f-body); -webkit-font-smoothing: antialiased;
}
[lang="en"] body, html[lang="en"] body { line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
.ic { flex: none; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.muted { color: var(--ink-2); font-weight: 400; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* أزرار */
.btn {
  display: inline-flex; align-items: center; gap: .55em; justify-content: center;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  font: 600 1rem/1 var(--f-head); padding: 15px 24px; border-radius: 999px; border: 1.5px solid var(--accent);
  cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); box-shadow: none; }
.btn--sm { padding: 10px 18px; font-size: .92rem; }
.btn--block { width: 100%; }
[dir="rtl"] .btn .ic, [dir="rtl"] .link .ic:not(:last-child) { transform: scaleX(-1); }

/* الشريط العلوي */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 1.05rem var(--f-head); }
.brand__mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 1.15rem; padding-bottom: 2px; }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links a:not(.btn) { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .96rem; transition: color .2s; }
.nav__links a:not(.btn):hover { color: var(--ink); }
.lang { display: inline-flex; align-items: center; gap: 6px; }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.burger span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* البطل */
.hero { padding: 64px 0 96px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px; background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); opacity: .9; pointer-events: none; }
[dir="rtl"] .hero::before { inset: -40% auto auto -10%; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; position: relative; }
.hero h1 { max-width: 16ch; }
[lang="en"] .hero h1 { max-width: 18ch; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.badge { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: .9rem; color: var(--ink-2); margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: ping 2.2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }

/* الرسم التوضيحي */
.stack { position: relative; height: 440px; }
.card { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card--site { inset-inline-start: 0; top: 10px; width: 74%; height: 230px; }
.card__bar { display: flex; gap: 6px; margin-bottom: 18px; }
.card__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.sk { height: 10px; border-radius: 6px; background: var(--bg-alt); margin-bottom: 10px; width: 80%; }
.sk--h { height: 18px; width: 62%; background: var(--ink); opacity: .85; margin-bottom: 16px; }
.sk--s { width: 52%; }
.sk-btn { width: 96px; height: 30px; border-radius: 999px; background: var(--accent); margin-top: 22px; }
.card--crm { inset-inline-end: 0; top: 150px; width: 66%; padding: 16px; }
.pipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pipe__col { display: flex; flex-direction: column; gap: 8px; }
.pipe__col b { height: 8px; width: 60%; border-radius: 4px; background: var(--ink-2); opacity: .5; margin-bottom: 4px; }
.pipe__col span { height: 34px; border-radius: 10px; background: var(--bg-alt); border: 1px solid var(--line); }
.pipe__col span.hot { background: var(--accent-soft); border-color: var(--accent); }
.card--chart { inset-inline-start: 8%; bottom: 0; width: 46%; height: 130px; display: flex; align-items: flex-end; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 100%; width: 100%; }
.bars i { flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px; background: linear-gradient(to top, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--warm))); transform-origin: bottom; animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both .4s; }
.bars i:nth-child(2) { animation-delay: .5s } .bars i:nth-child(3) { animation-delay: .6s } .bars i:nth-child(4) { animation-delay: .7s } .bars i:nth-child(5) { animation-delay: .8s }
@keyframes grow { from { transform: scaleY(0); } }
.chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--bg); font: 500 .85rem var(--f-head); padding: 7px 13px; border-radius: 999px; box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.chip--1 { top: -6px; inset-inline-end: 6%; }
.chip--2 { top: 128px; inset-inline-start: 62%; animation-delay: -2s; background: var(--accent); color: var(--accent-ink); }
.chip--3 { bottom: 24px; inset-inline-end: 4%; animation-delay: -4s; background: var(--warm); color: #231A08; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* الأقسام */
.sec { padding: 96px 0; }
.sec--alt { background: var(--bg-alt); }
.sec__head { max-width: 640px; margin-bottom: 48px; }
.sec__head p { color: var(--ink-2); font-size: 1.08rem; }

.services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.svc { grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .25s, border-color .25s, box-shadow .25s; }
.svc:nth-child(4), .svc:nth-child(5) { grid-column: span 3; }
.svc:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.svc__ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.svc p { color: var(--ink-2); margin: 0; }

.about { display: grid; grid-template-columns: 300px 1fr; gap: 64px; align-items: start; }
.about__side { position: sticky; top: 110px; text-align: center; }
.monogram { aspect-ratio: 1; border-radius: 28px; background: var(--ink); color: var(--bg); display: grid; place-items: center; position: relative; overflow: hidden; margin-bottom: 18px; }
.monogram::after { content: ""; position: absolute; width: 70%; height: 70%; border-radius: 50%; background: var(--accent); inset-inline-end: -20%; bottom: -20%; opacity: .9; }
.monogram span { font: 700 5rem var(--f-head); padding-bottom: .1em; position: relative; z-index: 1; }
.about__name { font: 600 1.2rem var(--f-head); margin: 0; }
.about__role { color: var(--ink-2); margin: 0; }
.about__body p { font-size: 1.08rem; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-weight: 500; }
.ticks .ic { color: var(--accent); margin-top: 4px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: s; }
.step { position: relative; padding: 28px 24px 24px; border-top: 2px solid var(--ink); }
.step__n { font: 700 2.4rem/1 var(--f-head); color: var(--accent); display: block; margin-bottom: 14px; }
.step p { color: var(--ink-2); margin: 0; }

.work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.proj { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.proj__media { aspect-ratio: 16 / 9; background: var(--bg-alt); overflow: hidden; }
.proj__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.proj:hover .proj__media img { transform: scale(1.04); }
.proj__ph { width: 100%; height: 100%; display: grid; place-items: center; background:
  radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--warm) 40%, transparent), transparent 40%),
  linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--ink))); }
.proj__ph { gap: 10px; align-content: center; color: rgb(255 255 255 / .92); }
.proj__ph span { font: 600 clamp(1.3rem, 2.4vw, 1.9rem) var(--f-head); letter-spacing: .01em; }
.proj__body { padding: 26px; display: flex; flex-direction: column; flex: 1; }
.proj__body p { color: var(--ink-2); }
.tag { align-self: flex-start; font-size: .82rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 12px; border-radius: 999px; margin-bottom: 12px; }
.link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--accent); }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

.faq { max-width: 820px; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0; font: 600 1.1rem var(--f-head); }
.qa summary::-webkit-details-marker { display: none; }
.qa__pm { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); transition: transform .3s, background .3s; flex: none; }
.qa[open] .qa__pm { transform: rotate(45deg); background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.qa p { color: var(--ink-2); padding-bottom: 22px; margin: 0; max-width: 68ch; }

.contact { background: var(--ink); color: var(--bg); }
.contact .lead, .contact__or { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.contact__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact__or { margin-top: 36px; font-size: .95rem; }
.socials { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.socials a { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; padding: 10px 0; font-weight: 500; transition: color .2s; }
.socials a:hover { color: var(--warm); }
@media (prefers-color-scheme: dark) { .contact { background: var(--surface); color: var(--ink); } .contact .lead, .contact__or { color: var(--ink-2); } }

.form { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 32px; display: grid; gap: 16px; box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .form { background: var(--bg); border: 1px solid var(--line); } }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fld { display: grid; gap: 6px; }
.fld span { font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.fld input, .fld select, .fld textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.fld textarea { resize: vertical; min-height: 130px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fld .is-bad { border-color: #C2410C; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__msg { margin: 0; font-weight: 500; min-height: 1.5em; }
.form__msg.is-ok { color: var(--accent); }
.form__msg.is-err { color: #C2410C; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.foot { padding: 28px 0; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.foot__in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot a { text-decoration: none; }

/* ظهور تدريجي */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; }
}

/* متجاوب */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .stack { height: 380px; max-width: 560px; }
  .services { grid-template-columns: 1fr 1fr; }
  .svc, .svc:nth-child(4), .svc:nth-child(5) { grid-column: auto; }
  .svc:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .about__side { position: static; display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; column-gap: 18px; text-align: start; align-items: center; }
  .monogram { grid-row: 1 / 3; margin: 0; border-radius: 22px; }
  .monogram span { font-size: 1.8rem; }
  .about__name { align-self: end; }
  .about__role { align-self: start; }
  .steps { grid-template-columns: 1fr 1fr; }
  .contact__grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .burger { display: flex; }
  .nav__links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 20px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s; }
  .nav__links.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__links a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__links .btn { margin-top: 16px; }
  .hero { padding: 36px 0 64px; }
  .stack { height: 330px; }
  .card--site { width: 82%; height: 190px; }
  .card--crm { width: 72%; top: 120px; }
  .card--chart { width: 54%; height: 110px; }
  .chip--2 { top: 100px; }
  .sec { padding: 68px 0; }
  .services, .work, .ticks, .row2 { grid-template-columns: 1fr; }
  .svc:last-child:nth-child(odd) { grid-column: auto; }
  .steps { grid-template-columns: 1fr; gap: 6px; }
  .form { padding: 22px; }
}
