/* Every inner page (services, about, articles, 404), on top of site.css: the homepage's look — lapis and
   gold on marble — with one interactive moment per page, driven by assets/js/pages.js. Without the script
   every page still reads in full; nothing moves under reduced motion. Logical properties throughout. */

.pg {
  --marble: #F6F7FB; --surface: #FFFFFF; --ink: #0F1433; --ink-2: #1A2150; --body: #4A5072; --soft: #7E84A3; --line: #E1E4EF;
  --lapis: #3049D6; --lapis-2: #5A6FF0; --lapis-tint: #E3E8FF; --lapis-wash: #F0F3FF; --gold: #D6A043; --gold-soft: #FAF0DB; --coral: #E9806E;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--marble);
}
.pg .site-header { background: rgba(246, 247, 251, 0.9); }
.pg-wrap { width: 100%; max-width: calc(1312px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.pg-sec { padding-block: clamp(72px, 8vw, 120px); }
.pg-sec.is-white { background: var(--surface); }
.pg-sec.is-wash { background: var(--lapis-wash); }
.pg-sec.is-ink { background: var(--ink); color: #EEF0FA; }
.pg-h2 { margin: 0; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
html[lang="ar"] .pg-h2 { line-height: 1.4; letter-spacing: 0; }
.pg-lead { max-width: 620px; margin: 16px 0 0; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.65; color: var(--body); text-wrap: pretty; }
html[lang="ar"] .pg-lead { line-height: 1.9; }
.is-ink .pg-lead { color: #AEB5D8; }
.pg-head { max-width: 760px; margin-bottom: clamp(36px, 4.5vw, 56px); }

.pg .btn { border-radius: 14px; transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s; }
.pg .btn-primary { box-shadow: 0 8px 24px rgba(48, 73, 214, 0.26); }
.pg .btn-primary:hover { transform: translateY(-2px); }
.pg .btn-secondary:hover { transform: translateY(-2px); }

/* Breadcrumbs: where this page sits, as links */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; color: var(--soft); }
html[lang="ar"] .crumbs { font-size: 15px; }
.crumbs li + li::before { content: "/"; margin-inline-end: 8px; color: var(--line); }
.crumbs a { color: var(--body); }
.crumbs a:hover { color: var(--lapis); }

/* ---------- Page hero: words and one live visual ---------- */

.pg-hero { position: relative; overflow: hidden; padding-block: clamp(48px, 6vw, 88px) clamp(56px, 7vw, 104px); }
.pg-hero::before { content: ""; position: absolute; inset: -30% -10% auto auto; width: 64vw; height: 64vw; max-width: 900px; max-height: 900px; border-radius: 50%; background: radial-gradient(closest-side, rgba(90, 111, 240, 0.13), rgba(90, 111, 240, 0)); pointer-events: none; }
[dir="rtl"] .pg-hero::before { inset: -30% auto auto -10%; }
.pg-hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.pg-hero h1 { margin: 0; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.04; font-weight: 600; letter-spacing: -0.04em; text-wrap: balance; }
html[lang="ar"] .pg-hero h1 { font-size: clamp(34px, 3.9vw, 56px); line-height: 1.35; letter-spacing: 0; }
.pg-hero .button-row { margin-top: 30px; }
.pg-card { position: relative; padding: clamp(18px, 2vw, 26px); border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(15, 20, 51, 0.04), 0 40px 90px rgba(15, 20, 51, 0.12); }
.pg-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 14px; color: var(--soft); }
.pg-card-h b { font-size: 16px; color: var(--ink); }
.replay { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.replay:hover { border-color: var(--ink); }
.replay[hidden] { display: none; }

/* ---------- Flow: a job or a payment moving step by step ---------- */

.flow-box { position: relative; }
.flow { position: relative; margin: 0; padding: 0; list-style: none; }
.flow::before { content: ""; position: absolute; inset-block: 22px; inset-inline-start: 21px; width: 2px; background: var(--line); }
.flow-box .bar { position: absolute; z-index: 1; inset-block-start: 22px; inset-inline-start: 21px; width: 2px; height: 0; background: var(--lapis); transition: height .7s var(--ease); }
.flow li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding-block: 10px; }
.flow .dot { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); color: var(--soft); transition: background .4s, border-color .4s, color .4s, transform .4s var(--ease); }
.flow .dot svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.flow b { display: block; font-size: 15.5px; }
.flow small { display: block; margin-top: 2px; font-size: 13px; color: var(--soft); }
html[lang="ar"] .flow small { font-size: 14px; }
.flow .chip { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--marble); color: var(--soft); white-space: nowrap; transition: background .4s, color .4s; }
.flow li.done .dot { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.flow li.done .chip { background: var(--lapis-tint); color: var(--lapis); }
.flow li.now .dot { border-color: var(--gold); color: var(--gold); transform: scale(1.08); box-shadow: 0 0 0 6px var(--gold-soft); }
.flow li.now .chip { background: var(--gold-soft); color: #8A5A00; }
.pg-card .sum { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; opacity: 0.35; transition: opacity .5s; }
.pg-card .sum b { color: var(--gold); font-size: 18px; font-variant-numeric: tabular-nums; }
.pg-card .sum.on { opacity: 1; }
/* Without the script a flow reads as finished. */
.flow:not(.is-live) li .dot { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.pg-card:not(:has(.flow.is-live)) .sum { opacity: 1; }

/* ---------- Feature list: icon, name, one line ---------- */

.feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); margin: 0; padding: 0; list-style: none; }
.feats li { padding-block: 26px; border-top: 1px solid var(--line); }
.feats svg { width: 26px; height: 26px; fill: none; stroke: var(--lapis); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feats h3 { margin: 14px 0 0; font-size: 19px; font-weight: 600; line-height: 1.35; }
.feats p { margin: 8px 0 0; font-size: 16px; line-height: 1.65; color: var(--body); }
html[lang="ar"] .feats p { font-size: 17px; line-height: 1.85; }

/* ---------- Proof: Atriom, built and run by us ---------- */

.proof-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 0; padding: 0; list-style: none; }
.figs li { padding: 20px; border-radius: 18px; background: var(--ink-2); border: 1px solid rgba(238, 240, 250, 0.08); }
.figs b { display: block; font-size: clamp(30px, 3vw, 42px); font-weight: 600; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.figs span { font-size: 14.5px; color: #AEB5D8; }
.shot { overflow: hidden; border-radius: 20px; border: 1px solid rgba(238, 240, 250, 0.1); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.35); }
.shot img { width: 100%; }

/* ---------- Rules kept with money (navy) ---------- */

.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 5vw, 80px); margin: 0; padding: 0; list-style: none; }
.rules li { padding-block: 22px; border-top: 1px solid var(--line); }
.rules h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); }
.rules p { margin: 6px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--body); }
.is-ink .rules li { border-top-color: rgba(238, 240, 250, 0.12); }
.is-ink .rules h3 { color: #fff; }
.is-ink .rules p { color: #AEB5D8; }
html[lang="ar"] .rules p { font-size: 16.5px; line-height: 1.85; }

/* ---------- Steps (a real sequence) ---------- */

.steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps4 li { position: relative; padding-top: 60px; counter-increment: s; }
.steps4 li::before { content: counter(s); position: absolute; inset-block-start: 0; inset-inline-start: 0; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--lapis); color: var(--lapis); font-weight: 600; background: var(--surface); }
.steps4 li::after { content: ""; position: absolute; inset-block-start: 20px; inset-inline: 52px -20px; height: 2px; background: var(--line); }
.steps4 li:last-child::after { display: none; }
.steps4 h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.steps4 p { margin: 8px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--body); }
html[lang="ar"] .steps4 p { line-height: 1.85; }

/* ---------- Cards that link somewhere ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.tile { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.tile:hover { transform: translateY(-4px); border-color: #C9D2F5; box-shadow: 0 24px 60px rgba(15, 20, 51, 0.1); }
.tile h3 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; }
html[lang="ar"] .tile h3 { line-height: 1.55; letter-spacing: 0; }
.tile h3 a { color: var(--ink); }
.tile h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 22px; }
.tile p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--body); }
html[lang="ar"] .tile p { font-size: 16.5px; line-height: 1.85; }
.tile .go { margin-top: auto; padding-top: 6px; font-weight: 600; color: var(--lapis); }
.tile .art { height: 120px; margin: -8px -8px 8px; border-radius: 16px; overflow: hidden; background: var(--lapis-wash); }
.tile .art svg { display: block; width: 100%; height: 100%; }

/* ---------- Closing call ---------- */

.cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: clamp(32px, 5vw, 60px); border-radius: 28px; background: linear-gradient(135deg, var(--lapis) 0%, var(--ink) 100%); color: #fff; }
.cta h2 { margin: 0; font-size: clamp(28px, 3vw, 42px); line-height: 1.12; letter-spacing: -0.02em; }
html[lang="ar"] .cta h2 { line-height: 1.45; letter-spacing: 0; }
.cta p { margin: 12px 0 0; max-width: 560px; color: #C9D0F2; font-size: 17px; line-height: 1.6; }
.cta .btn-white { background: #fff; color: var(--ink); }
.cta .btn-white:hover { background: var(--gold); color: var(--ink); }
.cta .btn-ghost { border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; }
.cta .btn-ghost:hover { border-color: #fff; color: #fff; }

/* ---------- Two languages, one app (web and mobile apps page) ---------- */

.duo { position: relative; aspect-ratio: 1.75; perspective: 1600px; }
.duo .face { position: absolute; inset-inline-start: 0; inset-block-start: 50%; translate: 0 -50%; width: 80%; }
.duo .face img { display: block; width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: 0 20px 50px rgba(15, 20, 51, 0.12); }
.duo .face .ar { position: absolute; inset: 0; opacity: 0; }
.duo[data-lang="ar"] .face .ar { opacity: 1; }
.duo[data-lang="ar"] .face .en { opacity: 0; }
.duo .face.phone { position: absolute; inset-block: 0 auto; inset-inline: auto 0; translate: none; width: 30%; padding: 6px; border-radius: 26px; background: #0E1230; box-shadow: 0 30px 60px rgba(15, 20, 51, 0.3); }
.duo .face.phone img { border: 0; border-radius: 20px; box-shadow: none; }
.duo .face.phone .ar { inset: 6px; width: calc(100% - 12px); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--marble); }
.seg button { padding: 7px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--body); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button:lang(ar) { font-family: var(--font-ar); }

/* ---------- Articles: a reading page with a contents rail and a progress line ---------- */

.read-bar { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 60; height: 3px; background: transparent; }
.read-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lapis), var(--gold)); }
[dir="rtl"] .read-bar i { margin-inline-start: auto; background: linear-gradient(270deg, var(--lapis), var(--gold)); }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(32px, 5vw, 80px); align-items: start; }
.toc { position: sticky; inset-block-start: calc(var(--header-h) + 24px); padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.toc b { display: block; margin-bottom: 10px; font-size: 13px; color: var(--soft); }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 7px 10px; border-inline-start: 2px solid var(--line); color: var(--body); font-size: 14.5px; line-height: 1.45; }
html[lang="ar"] .toc a { font-size: 15.5px; }
.toc a:hover { color: var(--ink); }
.toc a.on { border-color: var(--lapis); color: var(--lapis); font-weight: 600; }
.art-head { max-width: 760px; }
.art-head h1 { margin: 0; font-size: clamp(36px, 4vw, 56px); line-height: 1.06; letter-spacing: -0.035em; }
html[lang="ar"] .art-head h1 { line-height: 1.4; letter-spacing: 0; }
.art-head .pg-lead { max-width: 700px; }
.art-meta { margin-top: 16px; font-size: 14.5px; color: var(--soft); }
.pg .prose { max-width: 720px; margin-top: 36px; font-size: 18px; line-height: 1.8; color: var(--ink-soft); }
html[lang="ar"] .pg .prose { font-size: 19px; line-height: 2; }
.pg .prose h2 { scroll-margin-top: calc(var(--header-h) + 20px); }
.pg .prose .callout { border-inline-start-color: var(--lapis); background: var(--lapis-wash); border-color: #D6DCF8; }

/* ---------- 404: a vacant unit ---------- */

.vacant { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 72px); align-items: center; min-height: 70vh; }
.vacant .u { fill: #EEF0F7; stroke: #CBD1E6; stroke-width: 1.5; }
.vacant .u.occ { fill: var(--lapis-tint); stroke: #A9B8F5; }
.vacant .u.here { fill: #fff; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 8 6; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }

/* ---------- Narrow screens and reduced motion ---------- */

@media (max-width: 1023px) {
  .pg-hero-grid, .proof-grid, .vacant { grid-template-columns: minmax(0, 1fr); }
  .feats, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .steps4 li::after { display: none; }
  .art-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; order: -1; }
}
@media (max-width: 720px) {
  .feats, .tiles, .rules, .steps4, .figs { grid-template-columns: minmax(0, 1fr); }
  .cta { grid-template-columns: minmax(0, 1fr); }
  .flow li { grid-template-columns: 40px minmax(0, 1fr); }
  .flow .chip { grid-column: 2; justify-self: start; }
  .pg-hero .button-row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pg .btn, .tile, .flow .dot, .flow-box .bar, .pg-card .sum { transition: none; }
  .tile:hover { transform: none; }
  .vacant .u.here { animation: none; }
}

/* ---------- About: what we build and run, alive ---------- */

.runs .run { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: center; padding-block: 16px; border-top: 1px solid var(--line); }
.runs .run b { display: block; font-size: 17px; }
.runs .run small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--soft); }
.mini-units { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.mini-units i { height: 22px; border-radius: 5px; background: var(--lapis-tint); border: 1px solid #C9D2F5; }
.mini-units i.v { background: #fff; border-style: dashed; }
.mini-units i.n { background: var(--gold-soft); border-color: #E8C27A; }
.mini-units i.p { animation: unitping 2.4s ease-in-out infinite; }
@keyframes unitping { 50% { background: var(--gold); border-color: var(--gold); } }
.mini-chat { display: grid; gap: 6px; font-size: 12.5px; }
.mini-chat p { margin: 0; padding: 6px 10px; border-radius: 12px; max-width: 92%; }
.mini-chat .in { justify-self: start; background: var(--marble); }
.mini-chat .out { justify-self: end; background: #DCF8C6; }
.mini-chat .typing { justify-self: start; display: inline-flex; gap: 4px; background: var(--marble); }
.mini-chat .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--soft); animation: blink 1.2s infinite; }
.mini-chat .typing i:nth-child(2) { animation-delay: .2s; } .mini-chat .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.mini-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-chips span { padding: 5px 10px; border-radius: 999px; background: var(--lapis-wash); color: var(--lapis); font-size: 12.5px; font-weight: 600; }
@media (max-width: 1023px) { .feats[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 720px) { .feats[style] { grid-template-columns: minmax(0, 1fr) !important; } .runs .run { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .mini-units i.p, .mini-chat .typing i { animation: none; } }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .tiles.two { grid-template-columns: minmax(0, 1fr); } }
