/* Blog article: the classic modern article template (see the blog surface brief in
   .impeccable/surfaces/). Used by the RAG and Wathq articles, Arabic and English.
   Directional rules use logical properties; the English mirror is at the end. */

:root {
    /* site chrome (fetched header/footer) */
    --primary: #1d1d1d;
    --primary-light: #3a3a3a;
    --accent: #37b3e3;
    --text-dark: #1d1d1d;
    --text-light: #666666;
    --bg-light: #f5f5f5;

    --ink: #1D1D1D;
    --ink-2: #4B5563;
    --ink-3: #6B7280;
    --line: #E6E9EE;
    --line-2: #D3D9E0;
    --panel: #F5F7F9;
    --blue: #37B3E3;
    --blue-ink: #0D6A90;
    --blue-wash: #EEF8FC;
    --blue-line: #CDEBF7;
    --lime: #B4E762;
    --lime-wash: #F2FAE3;
    --lime-line: #CDEB98;

    --gutter: clamp(20px, 4vw, 40px);
    --column: 760px;
    --wide: min(1080px, calc(100vw - 2 * var(--gutter)));
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; color: var(--ink); background: #fff; line-height: 1.9; overflow-x: hidden; }
::selection { background: #D6F0FA; color: var(--ink); }
img { display: block; max-width: 100%; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.en { white-space: nowrap; }

/* ---------- head ---------- */
.post-head { max-width: 860px; margin: 0 auto; padding: clamp(118px, 11vw, 150px) var(--gutter) 0; text-align: center; }
.crumbs ol { list-style: none; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 0.875rem; font-weight: 600; color: var(--ink-3); }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: ''; width: 6px; height: 6px; border-top: 1.5px solid #B8C0CA; border-inline-start: 1.5px solid #B8C0CA; transform: rotate(-45deg); }
[dir="rtl"] .crumbs li + li::before { transform: rotate(-45deg) scaleX(-1); }
.crumbs a { color: var(--ink-3); text-decoration: none; transition: color .2s ease; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }

.post-head h1 { margin-top: 22px; font-size: clamp(2rem, 4.4vw, 3.15rem); font-weight: 800; line-height: 1.35; letter-spacing: -0.005em; text-wrap: balance; }
.standfirst { margin: 18px auto 0; max-width: 62ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.85; color: var(--ink-2); text-wrap: pretty; }

.byline { margin-top: 30px; display: inline-flex; align-items: center; gap: 14px; text-align: start; }
.avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; line-height: 1; }
.who-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.who-line .role { font-size: 0.9rem; color: var(--ink-3); }
.byline .who { display: block; font-weight: 800; color: var(--ink); text-decoration: none; line-height: 1.5; }
.byline .who:hover { text-decoration: underline; text-underline-offset: 5px; }
.byline .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 0.9rem; color: var(--ink-3); line-height: 1.6; }
.byline .meta > * + *::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: #B8C0CA; margin-inline-end: 10px; vertical-align: middle; }
.byline .meta > .chip::before { display: none; }
.byline .meta > .chip { margin-inline-start: 4px; }
.chip { display: inline-flex; align-items: center; font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 12px; line-height: 1.8; }

/* ---------- hero: the head sits inside the cover photo (user, 2026-12-02) ----------
   The photo fills a rounded frame; a dark scrim, heaviest where the text sits, keeps the
   white type at AA contrast on any part of the photo. data-header-theme="dark" on the
   frame tells js/header-adaptive.js to switch the fixed header to its dark ink over it. */
.post-hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; justify-content: center; width: min(1200px, calc(100vw - 2 * var(--gutter))); min-height: clamp(540px, 48vw, 620px); margin: clamp(112px, 10vw, 136px) auto 0; overflow: hidden; border-radius: 24px; background: var(--ink); color: #fff; }
.post-hero__media { position: absolute; inset: 0; z-index: -1; }
.post-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.post-hero__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(17, 17, 17, 0.94) 0%, rgba(17, 17, 17, 0.86) 45%, rgba(17, 17, 17, 0.7) 75%, rgba(17, 17, 17, 0.46) 100%); }
.post-hero .post-head { max-width: 900px; padding: clamp(48px, 6vw, 72px) var(--gutter) clamp(40px, 5vw, 60px); }
.post-hero .crumbs ol, .post-hero .crumbs a { color: rgba(255, 255, 255, 0.86); }
.post-hero .crumbs a:hover, .post-hero .crumbs [aria-current] { color: #fff; }
.post-hero .crumbs li + li::before { border-color: rgba(255, 255, 255, 0.6); }
.post-hero h1 { margin-top: 18px; color: #fff; }
.post-hero .standfirst { color: rgba(255, 255, 255, 0.88); }
.post-hero .byline .who { color: #fff; }
.post-hero .who-line .role, .post-hero .byline .meta { color: rgba(255, 255, 255, 0.8); }
.post-hero .byline .meta > * + *::before { background: rgba(255, 255, 255, 0.55); }
.post-hero .avatar { background: #fff; color: var(--ink); }
.post-hero .chip { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.post-hero a:focus-visible { outline-color: #fff; }

/* ---------- body ---------- */
.post-body { max-width: calc(var(--column) + 2 * var(--gutter)); margin: 64px auto 0; padding-inline: var(--gutter); font-size: 1.1875rem; line-height: 2; }
.post-body > p { margin-bottom: 26px; }
.post-body strong { font-weight: 800; }
.post-body a { color: var(--blue-ink); text-decoration: underline; text-decoration-color: rgba(13, 106, 144, 0.35); text-decoration-thickness: 1.5px; text-underline-offset: 6px; transition: text-decoration-color .2s ease; }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body h2 { font-size: clamp(1.45rem, 2.3vw, 1.85rem); font-weight: 800; line-height: 1.45; margin: 72px 0 18px; scroll-margin-top: 120px; text-wrap: balance; }
.post-body .lead { font-size: 1.3rem; line-height: 1.95; color: var(--ink); }

.wide { width: var(--wide); margin-inline-start: calc((100% - var(--wide)) / 2); }
figure { margin: 36px 0 40px; }
figcaption { margin-top: 14px; font-size: 0.875rem; line-height: 1.7; color: var(--ink-3); text-align: center; }

/* Figure 1: how a RAG answer is produced */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 3vw, 36px); }
.flow-arrow { display: grid; place-items: center; align-self: start; height: 210px; color: var(--blue); }
.flow-arrow svg { width: 26px; height: 26px; }
.stage { display: flex; flex-direction: column; }
.screen { height: 210px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12); font-size: 0.875rem; line-height: 1.75; }
.screen-label { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 700; color: var(--ink-3); }
.screen-label svg { width: 16px; height: 16px; }
.bubble-q { align-self: flex-start; max-width: 92%; background: var(--ink); color: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 600; }
[dir="rtl"] .bubble-q { border-radius: 16px 16px 4px 16px; }
.typing { display: flex; gap: 4px; margin-top: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-3); font-size: 0.8125rem; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-weight: 600; }
.doc svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); }
.doc .pg { margin-inline-start: auto; font-size: 0.75rem; font-weight: 700; color: var(--ink-3); }
.doc.hit { background: var(--lime-wash); border-color: var(--lime-line); color: var(--ink); }
.doc.hit svg { color: #4D7A12; }
.doc.hit .pg { color: #3F6410; }
.doc.dim { color: var(--ink-3); }
.doc.dim svg { color: #8A929C; }
.bubble-a { background: var(--panel); border-radius: 16px 16px 4px 16px; padding: 10px 14px; color: var(--ink); }
[dir="rtl"] .bubble-a { border-radius: 16px 16px 16px 4px; }
.source { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; background: var(--blue-wash); border: 1px solid var(--blue-line); color: var(--blue-ink); border-radius: 12px; padding: 5px 12px; line-height: 1.6; font-size: 0.8125rem; font-weight: 700; }
.source svg { width: 14px; height: 14px; flex: none; }
.stage-text { padding: 20px 4px 0; }
.stage-text h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; line-height: 1.5; }
.step-n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 0.875rem; font-weight: 800; }
.stage-text p { margin-top: 6px; font-size: 1rem; line-height: 1.85; color: var(--ink-2); }

/* icon list */
.icon-list { list-style: none; margin: 8px 0 32px; }
.icon-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.icon-list li:last-child { border-bottom: 1px solid var(--line); }
.ico { width: 44px; height: 44px; border-radius: 12px; background: var(--blue-wash); color: var(--blue-ink); display: grid; place-items: center; }
.ico svg { width: 22px; height: 22px; }
.icon-list strong { display: block; font-size: 1.1rem; line-height: 1.6; margin-bottom: 2px; }
.icon-list p { color: var(--ink-2); }

/* comparison table */
.table-card { margin: 8px 0 36px; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.compare { width: 100%; border-collapse: collapse; font-size: 1.0625rem; line-height: 1.7; }
.compare th, .compare td { padding: 16px 20px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare thead th { background: var(--panel); font-size: 0.9375rem; font-weight: 800; color: var(--ink-2); }
.compare thead th.rag { background: var(--blue-wash); color: var(--blue-ink); }
.compare thead th.rag span { display: inline-flex; align-items: center; gap: 8px; }
.compare thead th.rag svg { width: 18px; height: 18px; }
.compare tbody th { font-weight: 800; white-space: nowrap; }
.compare td { color: var(--ink-2); }
.compare td.rag { background: #F8FCFE; color: var(--ink); font-weight: 700; }

/* illustrative example */
.case { margin: 8px 0 40px; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.case-head { background: var(--panel); padding: 20px 24px; border-bottom: 1px solid var(--line); }
.case-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--lime); color: #17210A; border-radius: 999px; padding: 2px 12px; font-size: 0.8125rem; font-weight: 800; line-height: 1.8; }
.badge svg { width: 14px; height: 14px; }
.fact { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9375rem; font-weight: 700; color: var(--ink-2); }
.fact svg { width: 17px; height: 17px; color: var(--ink-3); }
.case-note { margin-top: 10px; font-size: 0.875rem; color: var(--ink-2); line-height: 1.7; }
.case-steps { list-style: none; padding: 8px 24px 12px; }
.case-steps li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 18px 0; }
.case-steps li:not(:last-child)::after { content: ''; position: absolute; top: 62px; bottom: -6px; inset-inline-start: 19.5px; width: 1px; background: var(--line-2); }
.case-steps .dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--ink-2); }
.case-steps .dot svg { width: 20px; height: 20px; }
.case-steps li.done .dot { background: var(--blue-wash); border-color: var(--blue-line); color: var(--blue-ink); }
.case-steps h3 { font-size: 1.1rem; font-weight: 800; line-height: 1.5; margin: 6px 0 4px; }
.case-steps p { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.95; }

/* Figure 2: build stepper */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.stepper li { position: relative; }
.stepper li:not(:last-child)::after { content: ''; position: absolute; top: 21px; inset-inline-start: 60px; inset-inline-end: -16px; height: 2px; background: repeating-linear-gradient(to left, var(--blue) 0 6px, transparent 6px 12px); }
.stepper .big-n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--blue); color: var(--blue-ink); font-weight: 800; font-size: 1.05rem; }
.stepper h3 { margin-top: 16px; font-size: 1.15rem; font-weight: 800; line-height: 1.5; }
.stepper p { margin-top: 6px; font-size: 1.0625rem; line-height: 1.9; color: var(--ink-2); }

.callout { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; margin: 8px 0 36px; background: var(--blue-wash); border: 1px solid var(--blue-line); border-radius: 20px; padding: 22px 24px; }
.callout .ico { background: #fff; }
.callout p { font-size: 1.0625rem; line-height: 1.95; color: var(--ink); }

/* ---------- end of article ---------- */
.post-end { max-width: calc(var(--column) + 2 * var(--gutter)); margin: 56px auto 0; padding-inline: var(--gutter); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 20px 0; border-block: 1px solid var(--line); }
.share-label { font-weight: 800; font-size: 0.95rem; margin-inline-end: auto; }
.share a, .share button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 700 0.875rem 'Cairo', sans-serif; text-decoration: none; cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.share a:hover, .share button:hover { border-color: var(--ink); }
.share svg { width: 17px; height: 17px; }
.share .copied { color: #2F6B0E; }

.author { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; margin-top: 28px; padding: 24px; background: var(--panel); border-radius: 20px; }
.author .avatar { width: 64px; height: 64px; font-size: 1.4rem; }
.author-name { font-size: 1.1rem; font-weight: 800; color: var(--ink); text-decoration: none; }
.author-name:hover { text-decoration: underline; text-underline-offset: 5px; }
.author-role { font-size: 0.9375rem; color: var(--ink-2); }
.author p { margin-top: 8px; font-size: 1rem; line-height: 1.9; color: var(--ink-2); }
.author-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9375rem; font-weight: 700; }
.author-links a { color: var(--blue-ink); text-decoration: underline; text-decoration-color: rgba(13,106,144,.35); text-underline-offset: 5px; }
.author-links a:hover { text-decoration-color: currentColor; }

/* Closing band: one centred message over a LEAP photo behind a heavy scrim
   (design 2 of four, 2026-12-02). The photo is a Saudi office shot that no
   article uses as its cover, so the close never repeats the hero. */
.cta { position: relative; isolation: isolate; overflow: hidden; width: var(--wide); margin: 80px auto 0; padding: clamp(60px, 8vw, 104px) clamp(24px, 5vw, 64px); border-radius: 28px; background: var(--ink); color: #fff; text-align: center; }
.cta > .cta-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.cta::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(17, 17, 17, 0.84); }
.cta h2 { max-width: 22ch; margin: 0 auto; font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; line-height: 1.4; text-wrap: balance; }
.cta p { max-width: 50ch; margin: 16px auto 0; color: rgba(255, 255, 255, 0.86); font-size: 1.125rem; line-height: 1.9; }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1.5px solid transparent; font: 700 1rem/1.2 'Cairo', sans-serif; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn svg { width: 18px; height: 18px; }
.btn-lime { background: var(--lime); color: #17210A; }
.btn-lime:hover { background: #C6EE86; }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: #fff; }
.cta a:focus-visible { outline-color: var(--lime); }

.related { width: var(--wide); margin: 80px auto 96px; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.related-head h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 800; }
.related-head a { font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.related-head a svg { width: 18px; height: 18px; }
.related-head a:hover { text-decoration: underline; text-underline-offset: 5px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; }
.r-card { display: block; color: inherit; text-decoration: none; }
.r-img { border-radius: 18px; overflow: hidden; background: var(--panel); aspect-ratio: 16 / 9; }
.r-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.r-card:hover .r-img img { transform: scale(1.03); }
.r-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; font-size: 0.875rem; color: var(--ink-3); }
.r-card h3 { margin-top: 8px; font-size: 1.2rem; font-weight: 800; line-height: 1.6; text-wrap: balance; }
.r-card:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.r-card .r-by { margin-top: 6px; font-size: 0.9rem; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .flow { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .flow-arrow { height: 44px; align-self: center; }
    .flow-arrow svg { transform: rotate(-90deg); }
    .screen { height: auto; min-height: 0; }
    .stage-text { padding-bottom: 4px; }
    .stepper { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .stepper li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 18px; padding-bottom: 26px; }
    .stepper li > div { grid-column: 2; }
    .stepper .big-n { grid-row: 1 / span 2; }
    .stepper h3 { margin-top: 6px; }
    .stepper li:not(:last-child)::after { top: 52px; bottom: 4px; inset-inline-start: 21px; inset-inline-end: auto; width: 2px; height: auto; background: repeating-linear-gradient(to bottom, var(--blue) 0 6px, transparent 6px 12px); }
    .post-hero { min-height: 0; padding-top: 140px; }
    .related-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 600px) {
    .post-body { font-size: 1.125rem; }
    .post-body .lead { font-size: 1.2rem; }
    .post-hero { margin-top: 96px; padding-top: 120px; border-radius: 18px; }
    .post-hero .post-head { padding-top: 0; }
    .byline { gap: 12px; }
    .compare { font-size: 0.975rem; }
    .compare th, .compare td { padding: 13px 12px; }
    .compare tbody th { white-space: normal; }
    .case-head, .case-steps { padding-inline: 18px; }
    .author { grid-template-columns: minmax(0, 1fr); }
    .cta-actions .btn { width: 100%; }
    .share-label { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* ---------- technical articles (Wathq) ---------- */
.post-body h3.sub { display: flex; align-items: center; gap: 12px; margin: 44px 0 12px; font-size: 1.25rem; font-weight: 800; line-height: 1.55; }
.post-body h3.sub .sub-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--blue-wash); color: var(--blue-ink); display: grid; place-items: center; font-size: 0.9375rem; font-weight: 800; }

.dot-list { list-style: none; margin: 4px 0 28px; }
.dot-list li { position: relative; padding-inline-start: 26px; margin-bottom: 8px; }
.dot-list li::before { content: ''; position: absolute; inset-inline-start: 4px; top: 0.85em; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }

/* code */
.code { margin: 8px 0 32px; background: #0F1419; color: #E6EDF3; border-radius: 18px; overflow: hidden; direction: ltr; text-align: left; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.code-lang { font: 700 0.8125rem/1 'Cairo', sans-serif; color: #9AA5B1; }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #E6EDF3; font: 700 0.8125rem 'Cairo', sans-serif; cursor: pointer; transition: border-color .2s ease; }
.code-copy:hover { border-color: rgba(255, 255, 255, 0.45); }
.code-copy:focus-visible { outline-color: var(--blue); }
.code-copy svg { width: 15px; height: 15px; }
.code-copy.copied { border-color: var(--lime); color: var(--lime); }
.code pre { margin: 0; padding: 18px 20px 22px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'Cairo', monospace; /* Cairo catches Arabic comments and strings */ font-size: 0.875rem; line-height: 1.8; tab-size: 2; }
.code pre::selection, .code pre *::selection { background: rgba(55, 179, 227, 0.35); color: #fff; }
.code .comment { color: #8B98A5; }
[dir="rtl"] .code .comment { word-spacing: -0.3em; }
.code .keyword, .code .const { color: #7DCFF7; }
.code .string { color: var(--lime); }
.code .func { color: #fff; font-weight: 600; }

/* three services */
.services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: clamp(22px, 3vw, 34px) clamp(8px, 1.5vw, 16px); }
.service { padding: 6px 24px 8px; }
.service + .service { border-inline-start: 1px solid var(--line-2); }
.service .s-head { display: flex; align-items: center; gap: 14px; }
.service .ico { flex: none; }
.service h3 { font-size: 1.15rem; font-weight: 800; line-height: 1.5; }
.service .src { display: inline-flex; margin-top: 8px; font-size: 0.8125rem; font-weight: 700; color: var(--blue-ink); background: var(--blue-wash); border-radius: 999px; padding: 1px 10px; line-height: 1.8; }
.service p { margin-top: 10px; font-size: 1rem; line-height: 1.85; color: var(--ink-2); }

/* layered architecture */
.arch { display: flex; flex-direction: column; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: clamp(20px, 3vw, 36px); }
.layer { width: min(100%, 640px); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; text-align: center; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12); }
.layer > b { display: block; font-size: 1.05rem; font-weight: 800; line-height: 1.6; }
.layer > span { display: block; margin-top: 2px; font-size: 0.875rem; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.layer.is-service { background: var(--blue-wash); border-color: var(--blue-line); }
.layer .mods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.layer .mods span { background: #fff; border: 1px solid var(--blue-line); border-radius: 10px; padding: 8px 6px; color: var(--blue-ink); font-size: 0.9rem; font-weight: 700; line-height: 1.5; }
.layer.is-external { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.layer.is-external > span { color: #B8C0CA; }
.arch-link { display: grid; place-items: center; height: 40px; color: var(--blue); }
.arch-link svg { width: 22px; height: 22px; }

/* vertical stepper (four steps or more) */
.stepper.is-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.stepper.is-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 18px; padding-bottom: 26px; }
.stepper.is-list li > div { grid-column: 2; }
.stepper.is-list .big-n { grid-row: 1 / span 2; }
.stepper.is-list h3 { margin-top: 6px; }
.stepper.is-list li:not(:last-child)::after { top: 52px; bottom: 4px; inset-inline-start: 21px; inset-inline-end: auto; width: 2px; height: auto; background: repeating-linear-gradient(to bottom, var(--blue) 0 6px, transparent 6px 12px); }

@media (max-width: 900px) {
    .services { grid-template-columns: minmax(0, 1fr); padding-block: 8px; }
    .service { padding: 20px 16px; }
    .service + .service { border-inline-start: 0; border-top: 1px solid var(--line-2); }
}
@media (max-width: 600px) {
    .layer .mods { grid-template-columns: minmax(0, 1fr); }
    .code pre { font-size: 0.8125rem; padding: 16px; }
}

/* App screens: a row of phone screenshots (super app article, Kizza) */
.phones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 24px); background: var(--panel); border: 1px solid var(--line); border-radius: 28px; padding: clamp(16px, 3vw, 32px); }
.phones img { width: 100%; height: auto; border-radius: clamp(16px, 2.6vw, 26px); border: 1px solid var(--line); background: #F2F2F4; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 32px -18px rgba(16, 24, 40, 0.28); }
@media (max-width: 600px) {
    .phones { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
    .phones::-webkit-scrollbar { display: none; }
    .phones img { scroll-snap-align: start; }
}

/* ---------- left-to-right mirror (English pages) ---------- */
[dir="ltr"] .crumbs li + li::before { transform: rotate(135deg); }
[dir="ltr"] .flow-arrow svg, [dir="ltr"] .dir-icon { transform: scaleX(-1); }
@media (max-width: 900px) {
    [dir="ltr"] .flow-arrow svg { transform: rotate(-90deg); }
}
[dir="ltr"] .post-body, [dir="ltr"] .standfirst { line-height: 1.8; }
[dir="ltr"] .post-head h1 { line-height: 1.2; letter-spacing: -0.015em; }
