/* =====================================================================
 * Mirsam (مرسم) — site styles (RTL-first + LTR English, token-driven, light/dark)
 * Ported from the approved design homepage. Keyed to the block classes
 * (not a body class), so this ONE sheet styles both the front end (enqueued on
 * the front page) AND the block editor canvas (via add_editor_style) — the editor
 * preview is therefore pixel-identical to the published page, with no drift.
 * All colours/sizes reference tokens in tokens.css.
 * ===================================================================== */

/* ---------- WordPress / Kadence integration ----------
 * Sections are native core/group blocks marked align:full. On the front end
 * Kadence's content area is neutralised (below) so the sections fill the
 * viewport; in the block editor align:full lifts the content-width cap so the
 * canvas renders them edge-to-edge too. The .alignfull rule then pins full-bleed
 * to a plain "fill the parent" in BOTH contexts — no 100vw negative-margin
 * breakout, so no horizontal scrollbar — while the constrained layout still
 * centres inner content at 1120px. No global overflow is set, so the sticky
 * header references the viewport; the hero and CTA panels clip their decorations. */
body{ background: var(--c-bg); }
/* Kadence's #wrapper carries a fixed white "Site Background" (ID specificity), so
 * transparent sections (hero/services/CTA) showed white in dark. Force the whole
 * content shell to follow the theme background. */
#wrapper.wp-site-blocks,
.wp-site-blocks,
.content-bg,
.content-container { background-color: var(--c-bg) !important; }

/* Mobile safety net: never allow horizontal scroll, and let long Arabic/Latin
 * strings break instead of overflowing the viewport. overflow-x:clip (not hidden)
 * keeps the sticky header working. */
html { overflow-x: clip; }
body { overflow-wrap: break-word; }

/* Kill any residual theme spacing on the canvas; let sections run full-bleed */
.entry-content,
.content-container { margin: 0; padding: 0; max-width: none; }
.entry-content > * { margin-block: 0; }
.content-area { padding: 0; }

/* Deterministic full-bleed for our sections — identical in the editor and the
 * front end. (align:full is what lifts the editor's content-width cap.) */
.bs-header.alignfull, .bs-hero.alignfull, .bs-sec.alignfull,
.bs-services.alignfull, .bs-cta.alignfull, .bs-footer.alignfull {
  margin-left: 0; margin-right: 0; max-width: none; width: auto;
}

/* ---------- Base ---------- */
body,
p,
h1,
h2,
h3,
h4,
ul,
li,
figure,
a {
  font-family: var(--f-ar);
}
body {
  color: var(--c-text);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
:where(h1,h2,h3,h4,p,ul,figure) { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

.lt { font-family: var(--f-lat); direction: ltr; unicode-bidi: isolate; }

.bs-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-primary);
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
}

/* ---------- Header ---------- */
.bs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.bs-header.scrolled { border-bottom-color: var(--c-border); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.wordmark {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  position: relative;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--c-text); }
.nav-links a::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -7px; height: 2px;
  background: var(--c-accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: right;
  transition: transform .26s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-family: var(--f-ar);
  font-size: 15px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}
.nav-cta:hover { background: var(--c-accent-strong); transform: translateY(-1px); }
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  cursor: pointer;
}
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--c-text); position: relative; }
.menu-toggle span::before,
.menu-toggle span::after {
  content: ""; position: absolute; inset-inline-start: 0; width: 18px; height: 2px; background: var(--c-text);
}
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after { top: 6px; }
/* Keep the toggle on-brand on interaction — a bare <button> otherwise picks up
   the Kadence parent button hover/focus/active style (palette2 amber). */
.menu-toggle { -webkit-tap-highlight-color: transparent; }
.menu-toggle:hover,
.menu-toggle:focus,
.menu-toggle:active { background: var(--c-surface); border-color: var(--c-primary); color: var(--c-text); }

/* Mobile slide-down nav panel (injected by JS) */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 24px 20px;
  background: var(--c-header-bg-solid);
  border-bottom: 1px solid var(--c-border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  font-size: 17px; font-weight: 500; color: var(--c-text);
  text-decoration: none; padding: 12px 4px; border-bottom: 1px solid var(--c-border);
}
.mobile-nav a:last-child { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--f-ar);
  font-size: 17px;
  font-weight: 500;
  padding: 15px 28px;
  border-radius: var(--r-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--c-accent); color: var(--c-on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-accent-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn svg { flex-shrink: 0; }
.btn .shine {
  position: absolute; top: 0; bottom: 0; width: 45%; inset-inline-start: -65%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.30), transparent);
  transform: skewX(-18deg); z-index: 0; pointer-events: none;
}

/* Accessible focus state (a11y) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Section rhythm ---------- */
.bs-sec { padding-block: clamp(56px, 9vw, 104px); position: relative; }
.bs-sec--surface {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}
section { scroll-margin-top: 88px; }
[id] { scroll-margin-top: 88px; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-h2);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.section-head p { font-size: var(--fs-body); color: var(--c-text-muted); margin-top: 18px; }

/* ---------- Blueprint line-grid (drafting texture) ----------
 * Declared once; applied via .has-grid on calm sections (Process, Studio).
 * Colour follows --c-primary-rgb so it flips with the theme; edge-masked + very
 * low opacity so it never sits at full strength behind body text. ~300 bytes,
 * pure CSS. The ::before paints above the section background, below content. */
:root { --grid-line: rgba(var(--c-primary-rgb), 0.035); --grid-size: 32px; }
[data-theme="dark"] { --grid-line: rgba(var(--c-primary-rgb), 0.05); }
.has-grid { position: relative; isolation: isolate; }
.has-grid::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 50%, #000 30%, transparent 82%);
          mask-image: radial-gradient(120% 90% at 50% 50%, #000 30%, transparent 82%);
}

/* ---------- Diagonal drafting seams (section separators) ----------
 * A thin gradient hairline skewed ~1.1° at the top of each major section — the
 * studio's "drafting guide-line" separator (the chosen section divider). RTL-
 * aware (slant follows text direction). Uses ::after so it coexists with the
 * .has-grid ::before. Replaces the surface hairlines for a consistent seam.
 * inset-inline keeps the skewed ends inside the box (no horizontal overflow). */
.bs-sec--surface { border-top: 0; border-bottom: 0; }
.bs-seam-top { position: relative; }
.bs-seam-top::after {
  content: ""; position: absolute; top: 0; inset-inline: 6%; height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(var(--c-primary-rgb),0.14) 16%, rgba(var(--c-accent-rgb),0.6) 50%, rgba(var(--c-primary-rgb),0.14) 84%, transparent);
  transform: skewY(-1.1deg); transform-origin: center; pointer-events: none;
}
[dir="rtl"] .bs-seam-top::after { transform: skewY(1.1deg); }

/* ---------- Hero ---------- */
.bs-hero { padding: clamp(72px, 12vw, 132px) 0 clamp(60px, 10vw, 112px); position: relative; overflow: hidden; }
.bs-hero::before {
  content: ""; position: absolute; top: -120px; inset-inline-start: -160px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(var(--c-accent-rgb),0.16), transparent 68%);
  pointer-events: none; z-index: 0;
}
/* AI brand backdrop (theme-aware light/dark) with a scrim on the text side (right
   in RTL) so the headline stays legible. Sits below the hero content + decorations. */
.bs-hero::after {
  content: ""; position: absolute; inset: -14% 0; z-index: 0; pointer-events: none;
  transform: translate3d(0, var(--hero-par, 0px), 0); will-change: transform;
  background:
    linear-gradient(to left, var(--c-bg) 4%, rgba(var(--c-bg-rgb),0.42) 46%, transparent 78%),
    url("assets/img/hero-bg-light.webp") center / cover no-repeat;
}
[data-theme="dark"] .bs-hero::after {
  background:
    linear-gradient(to left, var(--c-bg) 4%, rgba(var(--c-bg-rgb),0.50) 48%, transparent 80%),
    url("assets/img/hero-bg-dark.webp") center / cover no-repeat;
}
.hero-inner { max-width: 860px; position: relative; z-index: 1; }
.hero-inner h1 {
  position: relative;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: var(--lh-h1);
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  text-wrap: balance;
}
.hero-inner .sub { font-size: 20px; color: var(--c-text-muted); max-width: 620px; margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
/* The hero highlight may wrap on small screens (no nowrap) so it never forces overflow.
 * box-decoration-break keeps the underline gradient continuous across wrapped lines. */
.hl { position: relative; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hl::after {
  content: ""; position: absolute; inset-inline: -3px; bottom: 6px; height: 13px;
  background: rgba(var(--c-accent-rgb),0.5); border-radius: 6px; z-index: -1;
  transform: scaleX(1); transform-origin: right;
}

/* ---------- About / pitch ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-body { font-size: 18px; color: var(--c-text); }
.about-body h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-h2); letter-spacing: -0.01em; margin-bottom: 24px; }
.about-body p { margin-bottom: 28px; color: var(--c-text-muted); }
.about-figure {
  aspect-ratio: 5 / 4;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  background:
    repeating-linear-gradient(135deg, rgba(var(--c-primary-rgb),0.04) 0 12px, transparent 12px 24px),
    var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted);
  font-family: var(--f-lat); font-size: 13px; letter-spacing: 0.04em;
}

/* ---------- Services ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--c-accent); }
.card.featured { border-color: var(--c-accent); }
.card-tag {
  position: absolute; top: -13px; inset-inline-end: 28px;
  background: var(--c-accent); color: var(--c-on-accent);
  font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  white-space: nowrap; box-shadow: var(--shadow-sm);
}
.card .idx {
  position: absolute; top: 22px; inset-inline-start: 28px;
  font-family: var(--f-lat); direction: ltr;
  font-size: 38px; font-weight: 700; line-height: 1;
  color: var(--c-border); pointer-events: none;
  transition: color .25s ease, transform .25s ease;
}
.card:hover .idx { color: var(--c-accent); transform: translateY(-2px); }
.card h3 {
  position: relative; z-index: 1;
  font-size: var(--fs-h3); font-weight: 500; margin-bottom: 10px;
  min-height: 62px; display: flex; align-items: flex-start;
}
.card .desc { position: relative; z-index: 1; font-size: 15px; color: var(--c-text-muted); margin-bottom: 24px; min-height: 48px; }
.card ul {
  position: relative; z-index: 1;
  list-style: none; margin: 22px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.card ul li { font-size: 15px; color: var(--c-text); display: flex; align-items: flex-start; gap: 10px; }
.card ul li::before {
  content: ""; flex-shrink: 0; margin-top: 7px; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(var(--c-accent-rgb),0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.5 2.5L11 4' fill='none' stroke='%23C56B4A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.price {
  position: relative; z-index: 1;
  display: flex; align-items: baseline; gap: 6px;
  padding-top: 22px; border-top: 1px solid var(--c-border); margin-top: auto;
}
.price .num { font-size: 34px; font-weight: 700; color: var(--c-accent); }
.price .unit { font-size: 15px; color: var(--c-text-muted); }
/* ---------- Native blocks: Services (core group / columns / button) ---------- */
.bs-services { padding-inline: 24px; }
.cards.wp-block-columns { gap: 24px; margin-block: 0; align-items: stretch; }
.cards .wp-block-column.card { padding: 36px 32px; }
.card .svc-icon.wp-block-image { margin: 0 0 12px; }
.card .svc-icon img { width: 80px; height: 80px; object-fit: contain; }
.card ul.feat { margin: 22px 0 0; padding: 0; }
/* WhatsApp CTA rendered as a native core/button */
.card-cta.wp-block-button { width: 100%; margin-top: 18px; }
.card-cta .wp-block-button__link {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  font-family: var(--f-ar); font-size: 15px; font-weight: 500;
  padding: 13px 22px; border-radius: var(--r-sm);
  background: var(--c-accent); color: var(--c-on-accent); border: 1.5px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.card-cta .wp-block-button__link:hover { background: var(--c-accent-strong); transform: translateY(-1px); }
.card-cta.is-style-outline .wp-block-button__link { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.card-cta.is-style-outline .wp-block-button__link:hover { border-color: var(--c-primary); color: var(--c-primary); }
.card-cta .wp-block-button__link::before {
  content: ""; width: 18px; height: 18px; flex-shrink: 0; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2Zm5.8 14.12c-.25.69-1.43 1.32-1.96 1.36-.5.05-1.14.21-3.69-.77-3.1-1.22-5.1-4.35-5.26-4.55-.15-.21-1.26-1.67-1.26-3.19 0-1.52.8-2.26 1.08-2.57.28-.31.61-.39.81-.39.2 0 .41 0 .58.01.19.01.44-.07.69.53.25.6.85 2.07.93 2.22.08.15.13.33.03.53-.1.21-.15.33-.3.51-.15.18-.31.4-.44.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.64-.08.17-.21.74-.86.94-1.16.2-.3.4-.25.67-.15.27.1 1.72.81 2.01.96.3.15.5.22.57.34.07.13.07.74-.18 1.43Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2Zm5.8 14.12c-.25.69-1.43 1.32-1.96 1.36-.5.05-1.14.21-3.69-.77-3.1-1.22-5.1-4.35-5.26-4.55-.15-.21-1.26-1.67-1.26-3.19 0-1.52.8-2.26 1.08-2.57.28-.31.61-.39.81-.39.2 0 .41 0 .58.01.19.01.44-.07.69.53.25.6.85 2.07.93 2.22.08.15.13.33.03.53-.1.21-.15.33-.3.51-.15.18-.31.4-.44.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.64-.08.17-.21.74-.86.94-1.16.2-.3.4-.25.67-.15.27.1 1.72.81 2.01.96.3.15.5.22.57.34.07.13.07.74-.18 1.43Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- Process ("كيف نشتغل") — numbered drafting plates ---------- */
.bs-process { background: var(--c-bg); }
.process-grid.wp-block-columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 0; align-items: stretch; }
.proc-step.wp-block-column {
  position: relative; padding: 28px 24px;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.proc-step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--c-accent); }
.proc-step .pnum {
  display: block; margin: 0 0 14px;
  font-size: 40px; font-weight: 700; line-height: 1;
  color: var(--c-border); transition: color .25s ease;
}
.proc-step:hover .pnum { color: var(--c-accent); }
.proc-step h3 { font-size: var(--fs-h3); font-weight: 500; margin: 0 0 8px; }
.proc-step .desc { font-size: 15px; color: var(--c-text-muted); margin: 0; }
.proc-step > * { margin-block: 0; }
@media (max-width: 980px) { .process-grid.wp-block-columns { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .process-grid.wp-block-columns { grid-template-columns: 1fr; } }

/* ---------- Mobile app (coming soon) ---------- */
.bs-app { background: linear-gradient(180deg, var(--c-bg), rgba(var(--c-accent-rgb),0.06)); }
.app-grid.wp-block-columns { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; margin: 0; }
.app-eyebrow {
  display: inline-block;
  background: var(--c-accent); color: var(--c-on-accent);
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  padding: 5px 14px; border-radius: 999px; margin: 0 0 18px;
}
.app-body h2 { font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-h2); letter-spacing: -0.01em; margin: 0 0 18px; }
/* Body copy only — must NOT swallow the eyebrow badge / subtext (they set their own
   color, e.g. --c-on-accent on the badge), so exclude them by class, not specificity. */
.app-body > p:not(.app-eyebrow):not(.app-subtext) { color: var(--c-text-muted); font-size: var(--fs-body); margin: 0 0 24px; }
.app-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.app-list li { font-size: 15px; color: var(--c-text); display: flex; align-items: flex-start; gap: 10px; }
.app-list li::before { content: ""; flex-shrink: 0; margin-top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.app-subtext { margin: 14px 0 0; font-size: 14px; color: var(--c-text-muted); }
.app-figure.wp-block-image { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--c-border); }
.app-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 980px) { .app-grid.wp-block-columns { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 768px) { .app-list { grid-template-columns: 1fr; } }

/* ---------- Portfolio ---------- */
.portfolio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.project {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project .shot {
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, rgba(var(--c-primary-rgb),0.05) 0 14px, transparent 14px 28px),
    linear-gradient(180deg, var(--c-surface), var(--c-bg));
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); font-family: var(--f-lat); font-size: 13px; letter-spacing: 0.04em;
  overflow: hidden;
}
.project .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project .meta { padding: 24px 26px 26px; }
.project .meta h3 { font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.project .meta p { font-size: 15px; color: var(--c-text-muted); margin-bottom: 16px; }
.project-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-lat); font-size: 14px; font-weight: 500;
  color: var(--c-primary); text-decoration: none;
}
.project-link:hover { color: var(--c-accent); }
.project-link svg { transition: transform 0.18s ease; }
.project-link:hover svg { transform: translateX(-3px); }
.project.placeholder .shot { font-size: 13px; }
.project.placeholder .meta h3 { color: var(--c-text-muted); }

/* ---------- About me ---------- */
.me-grid { display: grid; grid-template-columns: 180px 1fr; gap: 56px; align-items: center; max-width: 880px; margin-inline: auto; }
.monogram-wrap { position: relative; width: 180px; height: 180px; }
.monogram {
  width: 180px; height: 180px; border-radius: 50%;
  background: var(--c-accent); color: var(--c-on-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 72px; font-weight: 700; letter-spacing: 0.06em;
  box-shadow: var(--shadow-md);
  overflow: hidden;   /* clip the avatar artwork to the circle */
  margin: 0;
}
/* The monogram is now a core/image figure — let the avatar fill the circle. */
.monogram img { width: 100%; height: 100%; object-fit: cover; display: block; }
.monogram-ring { position: absolute; inset: -15px; border-radius: 50%; border: 1.5px dashed rgba(var(--c-primary-rgb),0.28); pointer-events: none; }
.monogram-ring.two { inset: -28px; border-style: solid; border-color: rgba(var(--c-accent-rgb),0.30); }
.me-text h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 18px; }
.me-text p { font-size: 18px; color: var(--c-text-muted); }

/* ---------- Final CTA ---------- */
.bs-cta { padding: clamp(72px, 11vw, 120px) 0; }
.cta-box {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--c-bg), rgba(var(--c-accent-rgb),0.16));
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: clamp(48px, 7vw, 80px) clamp(24px, 5vw, 48px);
  text-align: center;
}
.cta-box::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("assets/img/cta-bg-light.webp") center / cover no-repeat;
  opacity: 0.5; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 120% at 70% 30%, #000 35%, transparent 95%);
          mask-image: radial-gradient(120% 120% at 70% 30%, #000 35%, transparent 95%);
}
[data-theme="dark"] .cta-box::before { background-image: url("assets/img/cta-bg-dark.webp"); opacity: 0.6; }
.cta-box::after {
  content: ""; position: absolute; bottom: -160px; inset-inline-start: -120px;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(var(--c-accent-rgb),0.30), transparent 66%);
  pointer-events: none; z-index: 0;
}
.cta-box > * { position: relative; z-index: 1; }
.cta-box .eyebrow { color: var(--c-text); }
.cta-box .eyebrow::before { background: var(--c-accent); }
.cta-box h2 { font-size: var(--fs-h2); font-weight: 700; color: var(--c-text); line-height: var(--lh-h2); margin-bottom: 36px; text-wrap: balance; }
.btn-on-dark { background: var(--c-accent); color: var(--c-on-accent); }
.btn-on-dark:hover { background: var(--c-accent-strong); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.bs-footer { background: var(--c-bg); border-top: 1px solid var(--c-border); padding: 56px 0 48px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 32px; }
.footer-brand .wordmark { display: block; margin-bottom: 10px; }
.footer-brand p { font-size: 14px; color: var(--c-text-muted); }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; font-weight: 700; color: var(--c-text); margin-bottom: 14px; letter-spacing: 0.02em; }
.footer-col a { display: block; font-size: 15px; color: var(--c-text-muted); text-decoration: none; margin-bottom: 10px; transition: color 0.18s ease; }
.footer-col a:hover { color: var(--c-primary); }
.footer-col a.lt { direction: ltr; }
.copyright { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--c-border); font-size: 14px; color: var(--c-text-muted); }

/* ---------- Brand imagery (mark, hero figure, about image, service icons) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { height: 34px; width: auto; display: block; flex: 0 0 auto; margin: 0; }

.about-figure { padding: 0; overflow: hidden; }
.about-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Plan illustration icons */
.svc-icon { display: block; width: 80px; height: 80px; margin-bottom: 12px; position: relative; z-index: 1; }
.svc-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

@media (max-width: 768px) {
  .svc-icon { width: 68px; height: 68px; }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; inset-inline-start: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: right;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  z-index: 200; pointer-events: none;
}

/* ---------- Floating WhatsApp ---------- */
.fab {
  position: fixed; bottom: 26px; inset-inline-start: 26px; z-index: 150;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--c-accent); color: var(--c-on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(var(--c-accent-rgb),0.32);
  text-decoration: none;
  opacity: 0; transform: translateY(20px) scale(0.85); pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease), background .2s ease;
}
.fab.show { opacity: 1; transform: none; pointer-events: auto; }
.fab:hover { background: var(--c-accent-strong); transform: translateY(-3px); }
.fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c-accent); opacity: 0; }

/* ---------- Decorative shapes (injected into hero + CTA) ---------- */
.deco { position: absolute; pointer-events: none; z-index: 0; }
.deco.ring { border-radius: 50%; border: 1.5px solid; background: transparent; }
.deco.dot { border-radius: 50%; }
.deco.diamond { border-radius: 4px; transform: rotate(45deg); }
/* Hero decorations show on tablet + desktop; the ≤768px block hides all .deco. */
@media (max-width: 860px) { .hero-deco { display: none; } }

/* ---------- Reveal-on-scroll ----------
 * Gated on <html class="anim-on">, which the pre-paint adds ONLY when
 * IntersectionObserver is supported AND motion is allowed. Without it (no JS,
 * old browser, reduced-motion) every .reveal stays fully visible — fail-open.
 * A pre-paint failsafe also reveals everything if custom.js never runs, so
 * content is NEVER stuck hidden. */
.anim-on .bs-home .reveal { transition: opacity .6s var(--ease), transform .75s var(--ease); }
.anim-on .bs-home .reveal:not(.is-visible) { opacity: 0; transform: translateY(36px); }
.anim-on .bs-home .reveal:not(.is-visible) .hl::after { transform: scaleX(0); }
.anim-on .bs-home .hl::after { transition: transform .7s var(--ease) .4s; }

/* Per-section variety + staggered children (lively). The sections with staggering
   don't slide themselves — their children ride in — to avoid double movement. The
   children use `animation` (not transition) with `backwards` fill so the cards' own
   hover transform/transition is untouched and there's no flash during the delay. */
.anim-on .bs-home .bs-services.reveal:not(.is-visible),
.anim-on .bs-home .bs-app.reveal:not(.is-visible),
.anim-on .bs-home .bs-cta.reveal:not(.is-visible) { transform: none; }

.anim-on .bs-home .bs-services.reveal.is-visible .cards .card { animation: bs-risein .6s var(--ease) backwards; }
.anim-on .bs-home .bs-services.reveal.is-visible .cards .card:nth-child(2) { animation-delay: .12s; }
.anim-on .bs-home .bs-services.reveal.is-visible .cards .card:nth-child(3) { animation-delay: .24s; }
.anim-on .bs-home .bs-app.reveal.is-visible .app-list li { animation: bs-risein .55s var(--ease) backwards; }
.anim-on .bs-home .bs-app.reveal.is-visible .app-list li:nth-child(2) { animation-delay: .08s; }
.anim-on .bs-home .bs-app.reveal.is-visible .app-list li:nth-child(3) { animation-delay: .16s; }
.anim-on .bs-home .bs-app.reveal.is-visible .app-list li:nth-child(4) { animation-delay: .24s; }
@keyframes bs-risein { from { opacity: 0; transform: translateY(28px) scale(.98); } to { opacity: 1; transform: none; } }

/* CTA panel pops in (scale) instead of the section sliding. */
.anim-on .bs-home .bs-cta.reveal .cta-box { transition: transform .7s var(--ease), opacity .6s var(--ease); }
.anim-on .bs-home .bs-cta.reveal:not(.is-visible) .cta-box { transform: scale(.96); opacity: 0; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn:hover .shine { animation: bs-btnshine .85s var(--ease); }
  @keyframes bs-btnshine { from { inset-inline-start: -65%; } to { inset-inline-start: 130%; } }

  /* Floating decorations — livelier drift; diamonds also rotate. */
  .deco.float { animation: bs-floaty 7s ease-in-out infinite; }
  .deco.float.slow { animation-duration: 11s; }
  @keyframes bs-floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
  .deco.diamond.float { animation-name: bs-floatyd; }
  @keyframes bs-floatyd { 0%,100% { transform: rotate(45deg) translateY(0); } 50% { transform: rotate(45deg) translateY(-20px); } }

  .monogram-ring { animation: bs-spin 30s linear infinite; }
  .monogram-ring.two { animation: bs-spin 44s linear infinite reverse; }
  @keyframes bs-spin { to { transform: rotate(360deg); } }

  .fab.show::before { animation: bs-fabpulse 2.6s ease-out infinite; }
  @keyframes bs-fabpulse { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.7); opacity: 0; } }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .bs-inner { padding-inline: 20px; }
  .fab { width: 54px; height: 54px; bottom: 18px; inset-inline-start: 18px; }
  .card .idx { font-size: 34px; }
  .deco.hide-mobile { display: none; }

  .nav-links { display: none; }
  .nav-cta { display: none; }
  .menu-toggle { display: inline-flex; }

  .bs-hero { padding: 72px 0 64px; }
  .hero-inner h1 { font-size: var(--fs-h1); line-height: 1.2; }
  .hero-inner .sub { font-size: 16px; margin-bottom: 32px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; font-size: 16px; padding: 14px 24px; }

  .bs-sec { padding-block: 64px; }
  .section-head { margin-bottom: 40px; }

  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-body { font-size: 16px; }
  .about-figure { aspect-ratio: 16/11; }

  .cards { grid-template-columns: 1fr; gap: 18px; }
  .card h3 { min-height: 0; }
  .card .desc { min-height: 0; }
  .portfolio-grid { grid-template-columns: 1fr; gap: 20px; }

  /* About-me → centred profile card. The columns resolve to flex-stretch on
     mobile (not grid), so justify-items doesn't centre the avatar — centre it and
     the (capped) bio with margin-inline:auto, which works either way. Monogram
     sized fluidly to match the clamp() type scale. */
  .me-grid { grid-template-columns: 1fr; gap: 22px; text-align: center; }
  .monogram-wrap { margin-inline: auto; }
  .me-text { max-width: 420px; margin-inline: auto; }
  .monogram-wrap, .monogram { width: clamp(104px, 30vw, 140px); height: clamp(104px, 30vw, 140px); }
  .monogram { font-size: clamp(34px, 9vw, 46px); }

  .bs-cta { padding: 72px 0; }
  .cta-box { padding: 56px 24px; }

  .footer-inner { flex-direction: column; gap: 36px; }
}

/* =====================================================================
 * Native-block reconciliation — pixel-match the design on the core-block
 * DOM (buttons → core/button, images → figures, monogram rings, header/
 * footer/CTA layout). Appended last so it wins over the legacy .btn rules.
 * ===================================================================== */

/* Section side gutter. Kadence's parent theme zeroes padding on EVERY full-bleed
   block (`.entry-content .alignfull { padding-inline: 0 }`, specificity 0,2,0),
   which overrode this gutter and left all content — and the nav bar — flush
   against the screen edge on mobile (the "no side margin / navbar too tight"
   report). The framework rule isn't !important, so this wins it at every width. */
.bs-header, .bs-hero, .bs-sec, .bs-services, .bs-cta, .bs-footer {
  padding-inline: var(--gutter) !important;
}
/* Hero eyebrow ("مطور مواقع · الرياض") stays pinned to the start (right in RTL),
   its dot leading — robust even if the hero column resolves to a flex context. */
.bs-hero .hero-inner .eyebrow { align-self: flex-start; }

/* Kill core block-gap between stacked blocks; design margins drive rhythm */
.hero-inner > * + *, .about-body > * + *, .app-body > * + *,
.me-text > * + *, .section-head > * + *,
.footer-brand > * + *, .footer-col > * + * { margin-block-start: 0; }

/* Buttons: neutralise the core/button wrapper, style the link */
.wp-block-buttons { gap: 16px; margin: 0; }
.wp-block-button.btn-primary,
.wp-block-button.btn-outline,
.wp-block-button.btn-on-dark,
.wp-block-button.nav-cta { background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; }
.btn-primary .wp-block-button__link,
.btn-outline .wp-block-button__link,
.btn-on-dark .wp-block-button__link,
.nav-cta .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-ar); font-weight: 500; line-height: 1.2;
  border: 1.5px solid transparent; border-radius: var(--r-sm); text-decoration: none;
  transition: background .18s ease, transform .18s ease, border-color .18s ease, color .18s ease;
}
.btn-primary .wp-block-button__link,
.btn-outline .wp-block-button__link,
.btn-on-dark .wp-block-button__link { font-size: 17px; padding: 15px 28px; }
.btn-primary .wp-block-button__link { background: var(--c-accent); color: var(--c-on-accent); box-shadow: var(--shadow-sm); }
.btn-primary .wp-block-button__link:hover { background: var(--c-accent-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline .wp-block-button__link { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-outline .wp-block-button__link:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-on-dark .wp-block-button__link { background: var(--c-accent); color: var(--c-on-accent); }
.btn-on-dark .wp-block-button__link:hover { background: var(--c-accent-strong); transform: translateY(-2px); }
.nav-cta .wp-block-button__link { background: var(--c-accent); color: var(--c-on-accent); font-size: 15px; padding: 10px 18px; }
.nav-cta .wp-block-button__link:hover { background: var(--c-accent-strong); transform: translateY(-1px); }
.is-wa .wp-block-button__link::before,
.nav-cta .wp-block-button__link::before {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2Zm5.8 14.12c-.25.69-1.43 1.32-1.96 1.36-.5.05-1.14.21-3.69-.77-3.1-1.22-5.1-4.35-5.26-4.55-.15-.21-1.26-1.67-1.26-3.19 0-1.52.8-2.26 1.08-2.57.28-.31.61-.39.81-.39.2 0 .41 0 .58.01.19.01.44-.07.69.53.25.6.85 2.07.93 2.22.08.15.13.33.03.53-.1.21-.15.33-.3.51-.15.18-.31.4-.44.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.64-.08.17-.21.74-.86.94-1.16.2-.3.4-.25.67-.15.27.1 1.72.81 2.01.96.3.15.5.22.57.34.07.13.07.74-.18 1.43Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2 22l5.25-1.38a9.9 9.9 0 0 0 4.79 1.22h.01c5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2Zm5.8 14.12c-.25.69-1.43 1.32-1.96 1.36-.5.05-1.14.21-3.69-.77-3.1-1.22-5.1-4.35-5.26-4.55-.15-.21-1.26-1.67-1.26-3.19 0-1.52.8-2.26 1.08-2.57.28-.31.61-.39.81-.39.2 0 .41 0 .58.01.19.01.44-.07.69.53.25.6.85 2.07.93 2.22.08.15.13.33.03.53-.1.21-.15.33-.3.51-.15.18-.31.4-.44.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.64-.08.17-.21.74-.86.94-1.16.2-.3.4-.25.67-.15.27.1 1.72.81 2.01.96.3.15.5.22.57.34.07.13.07.74-.18 1.43Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nav-cta .wp-block-button__link::before { width: 18px; height: 18px; }

/* Wordmark lockup (mark + text) — force a single nowrap row so the mark and the
 * "مرسم" text share one baseline (WP's flex layout otherwise wraps them). */
.wordmark.wp-block-group,
.bs-header .wordmark,
.bs-footer .wordmark { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center; gap: 10px; margin: 0; }
.wordmark .brand-mark.wp-block-image { flex: 0 0 auto; }
.wordmark .wordmark-text { flex: 0 0 auto; }
/* Higher specificity (.wordmark …) so a Kadence/core .wp-block-image bottom
   margin can't sneak back in and shove the logo above the wordmark text. */
.wordmark .brand-mark { margin: 0; align-self: center; }
.wordmark .wordmark-text { margin: 0; line-height: 1.2; font-size: 20px; font-weight: 700; color: var(--c-text); letter-spacing: -0.01em; white-space: nowrap; }

/* Header nav bar — all three items share one vertical centre line */
.bs-header .nav.wp-block-group {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: nowrap; min-height: 72px;
}
.bs-header .nav.wp-block-group > * { margin-block: 0; align-self: center; }
.nav-links { margin: 0; display: flex; align-items: center; gap: 36px; line-height: 1.2; flex-wrap: wrap; }
.nav-cta-wrap.wp-block-buttons { margin: 0; align-items: center; }

/* About figure + portfolio shot (core/image) */
.about-figure.wp-block-image { margin: 0; aspect-ratio: 5 / 4; border-radius: var(--r-lg); overflow: hidden; }
.about-figure img { width: 100%; height: 100%; object-fit: cover; }
.project .shot.wp-block-image { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; }
.project .shot img { width: 100%; height: 100%; object-fit: cover; }
.project .meta.wp-block-group > * { margin-block: 0; }

/* Monogram rings (the ring spans are now CSS pseudo-elements) */
p.monogram, .monogram.wp-block-image { margin: 0; }
.monogram.wp-block-image { width: 100%; height: 100%; }
.monogram-wrap::before, .monogram-wrap::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.monogram-wrap::before { inset: -15px; border: 1.5px dashed rgba(var(--c-primary-rgb),0.28); }
.monogram-wrap::after  { inset: -28px; border: 1.5px solid rgba(var(--c-accent-rgb),0.30); }
@media (prefers-reduced-motion: no-preference) {
  .monogram-wrap::before { animation: bs-spin 30s linear infinite; }
  .monogram-wrap::after  { animation: bs-spin 44s linear infinite reverse; }
}

/* Portfolio: 2 columns, each stacking 2 cards (28px gaps) */
.portfolio-grid.wp-block-columns { gap: 28px; align-items: stretch; }
.portfolio-grid .wp-block-column { display: flex; flex-direction: column; gap: 28px; }
/* Single featured work card — centred, capped width (no lonely 2-col gap). */
.portfolio-grid.one.wp-block-columns { justify-content: center; }
.portfolio-grid.one .wp-block-column { max-width: 580px; flex: 0 1 580px; }

/* Footer (core flex groups) */
.footer-inner.wp-block-group { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 32px; }
.footer-links.wp-block-group { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-brand .footer-tag { margin: 10px 0 0; font-size: 14px; color: var(--c-text-muted); }
.footer-col.wp-block-group p { margin: 0 0 10px; }
.footer-col.wp-block-group p a { color: var(--c-text-muted); text-decoration: none; font-size: 15px; }
.footer-col.wp-block-group p a:hover { color: var(--c-primary); }
/* Footer columns: consistent right-aligned (RTL) stacks. The Latin links
   (.lt → direction:ltr) otherwise flip to the left and break the column; pin
   everything to the right edge so heading + links line up, and stop the columns
   collapsing to a sliver. */
.footer-col.wp-block-group { flex: 0 0 auto; }
.footer-col.wp-block-group h4,
.footer-col.wp-block-group p,
.footer-col.wp-block-group p a { text-align: right; white-space: nowrap; }

/* Final-CTA button: centre it under the centred heading (the core/buttons
   block defaults to start/right, which left it hanging off to the side). */
.cta-actions.wp-block-buttons { justify-content: center; }

@media (max-width: 768px) {
  .hero-actions .wp-block-button { width: 100%; }
  .hero-actions .wp-block-button__link { width: 100%; font-size: 16px; padding: 14px 24px; }
  .footer-inner.wp-block-group { flex-direction: column; gap: 36px; }
}

/* ---------- Hero trust chips ---------- */
.hero-inner .sub { margin-bottom: 22px; }
.hero-inner .hero-trust { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 32px; }
.hero-trust .chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--c-text-muted);
  border: 1px solid var(--c-border); border-radius: 999px; padding: 7px 14px;
  background: rgba(var(--c-surface-rgb), 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.hero-trust .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-accent); flex-shrink: 0; }

/* ---------- Studio (merged about) — roomier than the old bio card ---------- */
.bs-sec--surface .me-grid { max-width: 980px; }
.me-text .wp-block-buttons { margin: 24px 0 0; }

/* ---------- App band — demoted/slim ---------- */
.bs-app.bs-sec { padding-block: clamp(40px, 6vw, 72px); }
.bs-app .app-grid.wp-block-columns { gap: 40px; }
.bs-app .app-figure.wp-block-image { aspect-ratio: 16 / 10; max-height: 320px; }

/* ---------- Theme toggle (injected into the header nav) ---------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
/* Filled on hover so the icon stays high-contrast. A bare colour change made the
   icon vanish (the parent header's button-hover background turned terracotta under
   it); this sets the background explicitly and is scoped to .bs-header to win. */
.bs-header .theme-toggle:hover, .bs-header .theme-toggle:focus-visible {
  background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent);
}
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* Smooth light <-> dark crossfade. :where() = 0 specificity so it never overrides
   the snappier hover transitions on links/buttons. */
:where(body, .wp-site-blocks, .bs-header, .bs-sec, .bs-sec--surface, .bs-services,
  .card, .project, .cta-box, .bs-footer, .mobile-nav, .theme-toggle, .menu-toggle,
  h1, h2, h3, h4, .desc, .sub, .price, .copyright, .footer-tag) {
  transition: background-color var(--t-theme) ease, border-color var(--t-theme) ease, color var(--t-theme) ease;
}

/* ---------- Language switcher (AR | EN) ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.lang-switch .lang-link { color: var(--c-text-muted); text-decoration: none; transition: color .18s ease; }
.lang-switch .lang-link:hover { color: var(--c-text); }
.lang-switch .lang-link.current { color: var(--c-text); border-bottom: 2px solid var(--c-accent); }
.lang-sep { color: var(--c-border); }

/* ---------- English pages (LTR): IBM Plex Sans everywhere + LTR fixes ---------- */
html[lang^="en"] { --f-ar: 'IBM Plex Sans', system-ui, sans-serif; }
html[lang^="en"] .footer-col.wp-block-group h4,
html[lang^="en"] .footer-col.wp-block-group p,
html[lang^="en"] .footer-col.wp-block-group p a { text-align: left; white-space: normal; }
/* Mirror the hero backdrop so the arch sits opposite the (now left-aligned) headline. */
html[lang^="en"] .bs-hero::after { transform: scaleX(-1) translate3d(0, var(--hero-par, 0px), 0); }

/* ---------- Smooth anchor scroll (sticky-header offset already via scroll-margin) ---------- */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Hero staggered load (above the fold; no scroll-reveal) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .anim-on .bs-home .hero-load .hero-inner > * { opacity: 0; animation: bs-rise .7s var(--ease) both; }
  .anim-on .bs-home .hero-load .hero-inner > :nth-child(1) { animation-delay: .06s; }
  .anim-on .bs-home .hero-load .hero-inner > :nth-child(2) { animation-delay: .16s; }
  .anim-on .bs-home .hero-load .hero-inner > :nth-child(3) { animation-delay: .28s; }
  .anim-on .bs-home .hero-load .hero-inner > :nth-child(4) { animation-delay: .4s; }
  .anim-on .bs-home .hero-load .hero-inner > :nth-child(5) { animation-delay: .5s; }
  @keyframes bs-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
}

/* ---------- Button interaction (per brand spec: filled = darken, no lift, press on active) ---------- */
.btn-primary .wp-block-button__link:hover,
.btn-on-dark .wp-block-button__link:hover,
.nav-cta .wp-block-button__link:hover { transform: none; box-shadow: var(--shadow-sm); }
.btn-primary .wp-block-button__link:active,
.btn-on-dark .wp-block-button__link:active,
.nav-cta .wp-block-button__link:active,
.card-cta .wp-block-button__link:active { transform: translateY(1px); }
.btn-outline .wp-block-button__link:hover { background: rgba(var(--c-primary-rgb),0.06); border-color: var(--c-border); color: var(--c-text); }

/* =====================================================================
 * Mobile navigation — AUTHORITATIVE (must be last).
 * The desktop nav layout is re-declared unconditionally higher up (the
 * native-block reconciliation block, e.g. `.nav-links { display:flex }`).
 * At equal specificity the later rule wins and media queries add none, so a
 * mid-file `@media{ .nav-links{display:none} }` was being overridden — the
 * desktop links + CTA stayed visible at phone widths and no hamburger showed.
 * Fix: scope to the header (higher specificity) and place last (later source),
 * so the collapse reliably wins. Gated on `.js` because the hamburger is
 * JS-injected — with JS off the inline links remain reachable.
 * ===================================================================== */
@media (max-width: 768px) {
  .js .bs-header .nav-links,
  .js .bs-header .nav-cta-wrap { display: none; }
  /* Hamburger sits at the START (right in RTL) — the conventional drawer-trigger
     position; the wordmark flows to the end (left). `order` does this without
     touching the markup (it's appended last in the DOM). */
  .bs-header .menu-toggle { display: inline-flex; order: -1; }

  /* Footer — mobile-friendly: brand on top, then two compact, balanced link
     columns spanning the full width (they were content-width flex items clustered
     to one side). */
  .footer-inner.wp-block-group { flex-direction: column; gap: 32px; align-items: stretch; }
  .footer-brand, .footer-links.wp-block-group { width: 100%; }
  .footer-links.wp-block-group { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 18px; }
  .footer-col.wp-block-group { flex: initial; }
  .copyright { margin-top: 32px; }

  /* iOS overflow guard. iOS browsers (all WebKit, incl. iOS Chrome) don't
     reliably clip negatively-positioned / animated decorations inside
     overflow:hidden|clip boxes, so the large off-canvas glows + floating shapes
     pushed a sideways scroll near the end of the page. Drop them on phones —
     they add little at this size — so nothing can overflow regardless of clip. */
  .deco { display: none; }
  .bs-hero::before,
  .cta-box::after { display: none; }
}

/* ---------- Scroll-driven enhancement (progressive) ----------
 * Only where supported AND motion is allowed. The IntersectionObserver reveal
 * (baseline) still drives section content; this adds a GPU-cheap per-step
 * draw-in for the Process plates and a fade-in of the blueprint grid. Transform/
 * opacity only, off the main thread; animation declared before animation-timeline. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .anim-on .bs-home .bs-process .proc-step {
      animation: bs-proc-in linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 26%;
    }
    @keyframes bs-proc-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

    .bs-home .has-grid::before {
      animation: bs-grid-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    @keyframes bs-grid-in { from { opacity: 0; } to { opacity: 1; } }
  }
}
