/* ==========================================================================
   yousefnasr.com — shared stylesheet (Arabic RTL + English LTR)
   Logical properties everywhere; [dir] is used only to flip motion direction.
   ========================================================================== */

/* ---------- Fonts (official Thmanyah OTFs, unmodified) ----------
   local() first: when the page is opened straight from disk (file://), Chrome blocks
   font files, so the installed Thmanyah fonts are used. On a server, url() is used. */
@font-face {
  font-family: "Thmanyah Serif Display";
  src: local("thmanyah serif display Black"), local("thmanyahserifdisplay-Black"),
       url("../fonts/thmanyahserifdisplay-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
/* English pages only (html[lang="en"]): Marcellus for headings, Arsenal for everything else (SIL OFL, see fonts/en) */
@font-face {
  font-family: "Marcellus";
  src: url("../fonts/en/Marcellus-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Arsenal";
  src: url("../fonts/en/Arsenal-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Arsenal";
  src: url("../fonts/en/Arsenal-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: local("thmanyah sans Regular"), local("thmanyahsans-Regular"),
       url("../fonts/thmanyahsans-Regular.otf") format("opentype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: local("thmanyah sans Bold"), local("thmanyahsans-Bold"),
       url("../fonts/thmanyahsans-Bold.otf") format("opentype");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  --blue-600: #1E6FC4;
  --blue-700: #174F8C;
  --blue-500: #2B8DE8;
  --blue-400: #5AA9EE;
  --blue-300: #9CC6EF;
  --blue-250: #C5DBF5;
  --blue-200: #D6E2FB;
  --blue-100: #EAF2FD;
  --blue-50: #EEF3FD;
  --steel: #2E5F8A;
  --ink: #0B1220;
  --ink-2: #2C3A4A;
  --text-2: #3A4352;
  --muted: #5B6472;
  --border: #E1E9F6;
  --border-2: #E6ECF7;
  --border-blue: #DCE8FB;
  --surface: #F5F7FB;
  --chip: #F4F7FC;
  --space-1: #0E2A52;
  --space-2: #071225;
  --space-3: #040A16;
  --green: #5EE0A0;
  --green-600: #1FA35B;

  --font-sans: "Thmanyah Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Thmanyah Serif Display", "IBM Plex Sans Arabic", Georgia, serif;

  --radius-pill: 999px;
  --container: 1240px;
  --gutter: 24px;
  --shadow-glass: 0 14px 34px rgba(46, 95, 138, 0.14);
  --ease-slide: cubic-bezier(.65, 0, .35, 1);

  /* +1 in LTR, -1 in RTL: flips every horizontal motion with one variable */
  --dir: 1;
}
[dir="rtl"] { --dir: -1; }
html[lang="en"] {
  --font-sans: "Arsenal", system-ui, sans-serif;
  --font-display: "Marcellus", Georgia, serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
picture { display: contents; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue-600); }
a:hover { color: var(--blue-700); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible, .cta :focus-visible, .site-footer :focus-visible { outline-color: #8EC5F5; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* Display type: headings only */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  font-feature-settings: "ss01";
  line-height: 1.4;
}
/* English: Marcellus has a single weight, so no faked bold and no Thmanyah "ss01" */
html[lang="en"] .display { font-weight: 400; font-synthesis: none; font-feature-settings: normal; line-height: 1.3; }
html[lang="en"] :is(h1, h2).display { line-height: 1.2; }
/* A thin stroke in the text's own colour makes Marcellus read a little bolder without faked bold;
   smaller titles (cards, process, FAQ, header/footer name) get the lighter one */
html[lang="en"] .display { -webkit-text-stroke: 0.35px currentColor; }
html[lang="en"] :is(h1, h2).display { -webkit-text-stroke: 0.5px currentColor; }
.accent { color: var(--blue-600); }
.one-line { white-space: nowrap; }
@media (max-width: 760px) { .one-line { white-space: normal; } }

/* Section heading block (eyebrow + h2) */
.section-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.eyebrow { font-size: 16px; color: var(--muted); }
.section-title { font-size: clamp(30px, 3vw + 14px, 48px); }
:lang(en) .section-title { font-size: clamp(28px, 2.4vw + 8px, 42px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-pill);
  font-weight: 600; text-decoration: none; white-space: nowrap;
  border: 0; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--blue-600); color: #FFFFFF; }
.btn--primary:hover { background: #1A62AE; color: #FFFFFF; }
.btn--soft { background: #E6ECF7; color: var(--ink); }
.btn--soft:hover { background: #DCE5F4; color: var(--ink); }
.btn--sm { font-size: 15px; padding: 12px 22px; min-height: 44px; }
.btn--md { font-size: 16px; padding: 14px 26px; min-height: 48px; }
.btn--lg { font-size: 17px; padding: 16px 30px; min-height: 54px; }
.btn--shadow { box-shadow: 0 10px 24px rgba(30, 111, 196, 0.28); }
.btn--shadow:hover { box-shadow: 0 14px 30px rgba(30, 111, 196, 0.34); }
.btn--light { background: #FFFFFF; color: var(--ink); font-weight: 700; font-size: 18px; padding: 17px 32px; min-height: 56px; }
.btn--light:hover { background: #EAF2FD; color: var(--ink); }
.btn--ghost-dark {
  color: #FFFFFF; font-weight: 500; font-size: 16px; padding: 16px 28px; min-height: 56px;
  border: 1.5px solid #3A5F8A; background: transparent;
}
.btn--ghost-dark:hover { color: #FFFFFF; border-color: #8EC5F5; background: rgba(142, 197, 245, 0.08); }

/* ==========================================================================
   1. Header
   ========================================================================== */
.site-header {
  max-width: var(--container); margin: 0 auto; padding: 22px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__avatar {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover; object-position: center top;
  background: linear-gradient(160deg, #D6E2FB, #9CC6EF);
  box-shadow: 0 4px 14px rgba(30, 111, 196, 0.25);
}
.brand__name { font-size: 32px; line-height: 1; }
.site-nav { font-size: 16px; }
.site-nav__list { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; }
.site-nav a { color: var(--text-2); text-decoration: none; transition: color .2s; }
.site-nav a:hover { color: var(--blue-600); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-blue);
  color: var(--blue-600); text-decoration: none; font-weight: 700; font-size: 14px;
  transition: background-color .2s, border-color .2s;
}
.lang-switch:hover { background: var(--blue-50); border-color: var(--blue-300); }

/* Mobile header (900px and below): avatar + name and a menu toggle; the nav, the language
   switch and the "Start your project" button move into the drawer */
.menu-toggle {
  display: none; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 44px; height: 44px; padding: 0; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border-blue); background: #FFFFFF; color: var(--ink);
  transition: background-color .2s, border-color .2s;
}
.menu-toggle:hover { background: var(--blue-50); border-color: var(--blue-300); }
@media (max-width: 900px) {
  .site-header { flex-wrap: nowrap; padding-block: 16px; }
  .site-nav, .header-actions { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 600px) {
  .site-header { padding-inline: 16px; }
  .brand { gap: 10px; }
  .brand__avatar { width: 38px; height: 38px; border-radius: 10px; }
  .brand__name { font-size: 22px; }
}

/* Drawer: slides in from the inline-end side (left in Arabic, right in English) */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(11, 18, 32, 0.5);
  opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility 0s linear .28s;
}
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 100;
  width: min(82vw, 340px); background: #FFFFFF; box-shadow: 0 0 40px rgba(11, 18, 32, 0.18);
  display: flex; flex-direction: column; gap: 8px; padding: 14px 20px 24px;
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(calc(100% * var(--dir))); visibility: hidden;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .28s;
}
.drawer-open .drawer { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s; }
.drawer-open .drawer-overlay { opacity: 1; visibility: visible; transition: opacity .28s ease, visibility 0s; }
html.drawer-open, html.drawer-open body { overflow: hidden; }
.drawer__top { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.drawer__close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--border-2); border-radius: 12px; background: #FFFFFF; color: var(--ink); cursor: pointer;
}
.drawer__close:hover { background: var(--blue-50); }
.drawer__nav ul { display: flex; flex-direction: column; }
.drawer__nav a {
  display: flex; align-items: center; min-height: 52px; padding-inline: 4px;
  font-size: 18px; font-weight: 600; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--border-2);
}
.drawer__nav a:hover { color: var(--blue-600); }
.drawer__lang { align-self: flex-start; margin-top: 16px; }
.drawer__cta { margin-top: auto; width: 100%; }
@media (min-width: 901px) { .drawer, .drawer-overlay { display: none; } }

/* ==========================================================================
   2. Hero + project cover-flow
   ========================================================================== */
.hero { position: relative; background: linear-gradient(180deg, #FFFFFF 0%, var(--blue-50) 100%); padding: 72px var(--gutter) 0; }
.hero__inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 26px; }
.hero__title { font-size: clamp(30px, 4.4vw + 14px, 64px); }
.hero__lead { font-size: clamp(17px, 0.5vw + 15px, 20px); line-height: 1.85; color: var(--muted); max-width: 640px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 600px) { .hero { padding-top: 40px; } .hero__inner { gap: 20px; } }

.showcase { position: relative; max-width: var(--container); margin: 56px auto 0; padding: 0 0 40px; }
.showcase__path { position: absolute; top: -40px; left: 0; width: 100%; height: 120px; }
.showcase__stage {
  --card-w: min(580px, 86vw);
  --off-1: min(390px, 58vw);
  --off-2: min(720px, 110vw);
  position: relative;
  height: calc(var(--card-w) * 0.75 + 35px);
  overflow: hidden;
  perspective: 1800px;
  perspective-origin: 50% 40%;
}
.slide {
  position: absolute; top: 10px; left: 50%;
  width: var(--card-w); aspect-ratio: 4 / 3;
  padding: 10px; border: 0; border-radius: 34px; background: #FFFFFF; cursor: pointer;
  will-change: transform, opacity;
  transition: transform .8s var(--ease-slide), opacity .8s ease, box-shadow .8s ease;
  /* default = far, hidden */
  transform: translateX(-50%) translateZ(-320px) scale(0.7);
  opacity: 0; z-index: 1; box-shadow: none;
}
.slide img { width: 100%; height: 100%; border-radius: 24px; object-fit: cover; background: var(--blue-50); }
.slide[data-pos="0"] {
  transform: translateX(-50%) translateZ(0) rotateY(0deg) scale(1);
  z-index: 5; opacity: 1; box-shadow: 0 30px 60px rgba(46, 95, 138, 0.28);
}
/* The slider moves in the reading direction: the next card (+1) waits on the right in Arabic
   (and moves right to left), and on the left in English (moving left to right). */
.slide[data-pos="-1"] {
  transform: translateX(calc(-50% + var(--off-1) * var(--dir))) translateZ(-160px) rotateY(calc(-28deg * var(--dir))) scale(0.86);
  z-index: 3; opacity: 0.95; box-shadow: 0 20px 40px rgba(46, 95, 138, 0.16);
}
.slide[data-pos="1"] {
  transform: translateX(calc(-50% - var(--off-1) * var(--dir))) translateZ(-160px) rotateY(calc(28deg * var(--dir))) scale(0.86);
  z-index: 3; opacity: 0.95; box-shadow: 0 20px 40px rgba(46, 95, 138, 0.16);
}
.slide[data-pos="-2"] {
  transform: translateX(calc(-50% + var(--off-2) * var(--dir))) translateZ(-320px) rotateY(calc(-40deg * var(--dir))) scale(0.7);
}
.slide[data-pos="2"] {
  transform: translateX(calc(-50% - var(--off-2) * var(--dir))) translateZ(-320px) rotateY(calc(40deg * var(--dir))) scale(0.7);
}
.slide:focus-visible { outline-offset: 4px; border-radius: 34px; }
.showcase__caption { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 58px; text-align: center; margin-top: 8px; padding-inline: var(--gutter); }
.showcase__title { font-size: 20px; font-weight: 700; color: var(--ink); }
.showcase__role { font-size: 15px; color: var(--muted); }
@media (max-width: 600px) {
  .showcase { margin-top: 40px; }
  .showcase__path { top: -24px; height: 80px; }
  .showcase__stage { --card-w: 76vw; --off-1: 56vw; }
  .slide { padding: 7px; border-radius: 24px; }
  .slide img { border-radius: 18px; }
}

/* ==========================================================================
   3. Organizations (logo marquee)
   ========================================================================== */
.logos { border-block: 1px solid var(--border-2); }
.logos__inner { max-width: var(--container); margin: 0 auto; padding: 30px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.logos__label { font-size: 16px; font-weight: 600; color: var(--ink); }
.logos__marquee {
  flex: 1 1 600px; min-width: 0; overflow: hidden;
  container-type: inline-size;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.logos__track { display: flex; align-items: center; width: max-content; padding: 6px 0; animation: marquee-x 30s linear infinite; }
.logos__marquee:hover .logos__track { animation-play-state: paused; }
/* Each copy is exactly the container width (min 560px on phones), so each logo appears once */
.logos__set { flex: 0 0 auto; width: max(100cqi, 560px); display: flex; align-items: center; justify-content: space-around; }
.logos__set li { display: flex; align-items: center; justify-content: center; max-width: 14%; }
.logo { height: 48px; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .6; transition: filter .3s, opacity .3s; }
.logo:hover { filter: none; opacity: 1; }
@media (max-width: 600px) { .logos__inner { justify-content: center; gap: 18px; padding-block: 24px; } .logo { height: 40px; } }

@keyframes marquee-x { from { transform: translateX(0); } to { transform: translateX(calc(-50% * var(--dir))); } }

/* ==========================================================================
   5. Services (bento)
   ========================================================================== */
.services { max-width: var(--container); margin: 0 auto; padding: 40px var(--gutter) 110px; display: flex; flex-direction: column; gap: 44px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.svc-card {
  background: linear-gradient(165deg, #F7FAFF 0%, var(--blue-100) 100%);
  border: 1px solid var(--border-blue); border-radius: 26px;
  padding: 30px 30px 0; display: flex; flex-direction: column; gap: 8px; min-height: 380px; overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.svc-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(46, 95, 138, 0.12); border-color: var(--blue-250); }
.svc-card--wide { grid-column: span 2; }
.svc-card--full { grid-column: span 3; min-height: 0; padding: 30px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 30px; }
.svc-card__title { font-size: 28px; color: var(--ink); }
.svc-card__text { font-size: 16px; line-height: 1.8; color: var(--muted); }
.svc-card__art { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-top: 22px; }
.svc-card__copy { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  .svc-grid { grid-template-columns: 1fr; }
  .svc-card--wide, .svc-card--full { grid-column: auto; }
}
@media (max-width: 480px) { .svc-card { padding: 24px 22px 0; min-height: 340px; } .svc-card--full { padding: 24px 22px; } .svc-card__title { font-size: 24px; } }

/* shared illustration bits */
.glass { background: rgba(255, 255, 255, 0.85); border: 1px solid var(--border-blue); box-shadow: var(--shadow-glass); }
.bar { display: block; height: 8px; border-radius: 99px; background: var(--blue-200); }
.bar--blue { background: var(--blue-500); }
.bar--pale { background: var(--blue-100); }
.bar--35 { width: 35%; } .bar--50 { width: 50%; } .bar--55 { width: 55%; } .bar--60 { width: 60%; }
.bar--70 { width: 70%; } .bar--80 { width: 80%; } .bar--90 { width: 90%; }
.bar--thick { height: 14px; }

/* Websites */
.art-web { gap: 22px; }
.art-browser { width: 440px; max-width: 70%; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 14px; }
.art-browser__dots { display: flex; gap: 6px; margin-bottom: 12px; }
.art-browser__dots span { width: 9px; height: 9px; border-radius: 99px; }
.art-browser__dots span:nth-child(1) { background: #F2B8B5; }
.art-browser__dots span:nth-child(2) { background: #F6D58B; }
.art-browser__dots span:nth-child(3) { background: #A8DDB5; }
.art-browser__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.art-product { border-radius: 12px; background: #fff; border: 1px solid var(--border-2); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.art-product__img { height: 54px; border-radius: 8px; }
.art-product:nth-child(1) .art-product__img { background: linear-gradient(135deg, #D6E2FB, #9CC6EF); }
.art-product:nth-child(2) .art-product__img { background: linear-gradient(135deg, #EAF1FC, #C5DBF5); }
.art-product:nth-child(3) .art-product__img { background: linear-gradient(135deg, #D6E2FB, #B4D3F3); }
.art-product .bar:nth-of-type(2) { width: 80%; } .art-product .bar:nth-of-type(3) { width: 50%; }
.art-product:nth-child(2) .bar:nth-of-type(2) { width: 70%; } .art-product:nth-child(2) .bar:nth-of-type(3) { width: 40%; }
.art-product:nth-child(3) .bar:nth-of-type(2) { width: 85%; } .art-product:nth-child(3) .bar:nth-of-type(3) { width: 45%; }
.art-gauge { margin-bottom: 40px; width: 120px; flex: 0 0 auto; border-radius: 22px; padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.art-gauge__label { font-size: 13px; color: var(--muted); }
@media (max-width: 480px) { .art-web { gap: 12px; } .art-browser { max-width: 66%; padding: 10px; } .art-browser__grid { gap: 6px; } .art-gauge { width: 96px; margin-bottom: 24px; } .art-gauge svg { width: 60px; height: 60px; } }

/* Mobile apps */
.art-phone { position: relative; width: 150px; height: 220px; border-radius: 28px 28px 0 0; border-bottom: 0; padding: 16px 12px; display: flex; flex-direction: column; gap: 9px; }
.art-phone__notch { align-self: center; width: 44px; height: 6px; border-radius: 99px; background: var(--border-blue); }
.art-phone__hero { height: 64px; border-radius: 14px; background: linear-gradient(135deg, #D6E2FB, #9CC6EF); }
.art-phone__block { height: 40px; border-radius: 12px; background: var(--blue-100); }
.art-toast {
  position: absolute; top: 40px; inset-inline-start: -54px;
  background: var(--ink); color: #fff; font-size: 13px; padding: 8px 12px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 24px rgba(11, 18, 32, 0.25); white-space: nowrap;
}
.art-toast__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--green); }

/* Backend & APIs */
.art-api { padding-bottom: 34px; }
.art-api svg { width: 300px; height: auto; }
.art-api text, .art-gauge text { font-family: var(--font-sans); }

/* Dashboards */
.art-dash { width: 270px; max-width: 100%; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.art-dash__kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.art-dash__kpi { background: #fff; border: 1px solid var(--border-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.art-dash__up { font-size: 18px; font-weight: 700; color: var(--blue-600); line-height: 1.2; }
.art-dash__chart { display: flex; align-items: flex-end; gap: 7px; height: 96px; padding: 0 4px; }
.art-dash__chart span { flex: 1; border-radius: 6px 6px 0 0; }
.art-dash__chart span:nth-child(1) { height: 35%; background: #C5DBF5; }
.art-dash__chart span:nth-child(2) { height: 50%; background: #9CC6EF; }
.art-dash__chart span:nth-child(3) { height: 42%; background: #C5DBF5; }
.art-dash__chart span:nth-child(4) { height: 68%; background: #5AA9EE; }
.art-dash__chart span:nth-child(5) { height: 60%; background: #9CC6EF; }
.art-dash__chart span:nth-child(6) { height: 90%; background: #2B8DE8; }

/* Search & AI */
.art-search { flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; padding-bottom: 30px; }
.art-search__box { width: 270px; max-width: 100%; border-radius: var(--radius-pill); padding: 11px 16px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.art-search__result { width: 270px; max-width: 100%; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.art-search__row { display: flex; align-items: center; gap: 8px; }
.art-search__badge { background: var(--blue-600); color: #fff; border-radius: 8px; padding: 2px 10px; font-weight: 600; }
.art-search__meta { color: var(--muted); }

/* Servers & support */
.art-status { flex: 2 1 480px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.art-status__item { border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.art-status__dot { width: 10px; height: 10px; border-radius: 99px; background: var(--green-600); box-shadow: 0 0 0 4px #DDF3E5; flex: 0 0 auto; }
.art-status__dot--blue { background: var(--blue-500); box-shadow: 0 0 0 4px #DCEBFA; }
@media (max-width: 600px) { .art-status { flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); } .art-status__item { font-size: 14px; padding: 12px; } }

/* ==========================================================================
   6. Work (tabs)
   ========================================================================== */
.work { background: var(--surface); }
.work__inner { max-width: var(--container); margin: 0 auto; padding: 64px var(--gutter); display: flex; flex-direction: column; gap: 28px; }
.work__layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.tablist { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tab {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; cursor: pointer;
  color: var(--ink); padding: 11px 16px; border-radius: 16px;
  border: 1px solid var(--border-2); background: #FFFFFF;
  transition: background-color .25s, border-color .25s;
}
.tab:hover { border-color: var(--blue-250); }
.tab[aria-selected="true"] { border-color: var(--blue-300); background: var(--blue-100); }
.tab__num { font-size: 13px; font-weight: 700; color: var(--blue-600); direction: ltr; min-width: 22px; }
.tab__text { display: flex; flex-direction: column; gap: 2px; text-align: start; }
.tab__title { font-size: 16px; font-weight: 700; }
.tab__tag { font-size: 13px; color: var(--muted); }
.panel-wrap { flex: 999 1 640px; min-width: 0; background: linear-gradient(165deg, #FFFFFF, var(--blue-100)); border: 1px solid var(--border-blue); border-radius: 30px; padding: 18px; }
.panel { display: flex; flex-direction: column; gap: 14px; animation: fade-in .45s ease; }
.panel[hidden] { display: none; }
.panel__media { aspect-ratio: 2 / 1; max-height: 46vh; width: 100%; border-radius: 22px; overflow: hidden; background: linear-gradient(180deg, #F2F7FE, #FBFCFF); }
/* contain: the 4:3 screenshots show in full inside the 2:1 box; the background matches their edges */
.panel__media img {
  height: 100%; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.panel__body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; justify-content: space-between; padding: 0 6px 6px; }
.panel__copy { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; }
.panel__title { font-size: 26px; line-height: 1.35; }
.panel__blurb { font-size: 16px; line-height: 1.75; color: var(--text-2); }
.panel__role { font-size: 15px; color: var(--ink-2); }
.panel__role strong { color: var(--blue-600); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Mobile (900px and below): the list becomes an accordion; each project's details open
   directly under its row (main.js switches the ARIA roles and animates the height). */
@media (max-width: 900px) {
  .work__layout { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .tablist, .panel-wrap { display: contents; }
  .tab { margin-bottom: 8px; }
  .tab[aria-expanded="true"] { border-color: var(--blue-300); background: var(--blue-100); }
  .tab::after {
    content: ""; flex: 0 0 auto; margin-inline-start: auto; width: 9px; height: 9px;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: translateY(-3px) rotate(45deg); transition: transform .25s ease;
  }
  .tab[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
  .panel {
    margin-bottom: 14px; padding: 14px; border-radius: 20px; animation: none;
    background: linear-gradient(165deg, #FFFFFF, var(--blue-100)); border: 1px solid var(--border-blue);
  }
  .tablist .tab:nth-child(1) { order: 1; }  .panel-wrap .panel:nth-child(1) { order: 2; }
  .tablist .tab:nth-child(2) { order: 3; }  .panel-wrap .panel:nth-child(2) { order: 4; }
  .tablist .tab:nth-child(3) { order: 5; }  .panel-wrap .panel:nth-child(3) { order: 6; }
  .tablist .tab:nth-child(4) { order: 7; }  .panel-wrap .panel:nth-child(4) { order: 8; }
  .tablist .tab:nth-child(5) { order: 9; }  .panel-wrap .panel:nth-child(5) { order: 10; }
  .tablist .tab:nth-child(6) { order: 11; } .panel-wrap .panel:nth-child(6) { order: 12; }
}
@media (max-width: 600px) {
  .panel-wrap { padding: 14px; border-radius: 24px; }
  .panel__media { border-radius: 16px; }
  .panel__copy { flex-basis: 100%; }
}

/* ==========================================================================
   7. Process
   ========================================================================== */
.process { max-width: var(--container); margin: 0 auto; padding: 80px var(--gutter); display: flex; flex-direction: column; gap: 40px; }
.steps-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.step {
  background: #FFFFFF; border: 1px solid var(--border-2); border-radius: 24px; padding: 24px 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .3s ease, box-shadow .3s ease;
}
.step:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(46, 95, 138, 0.1); }
.step__head { display: flex; align-items: center; gap: 12px; }
.step__num { flex: 0 0 auto; background: var(--blue-50); color: var(--blue-600); font-weight: 700; font-size: 14px; padding: 5px 13px; border-radius: var(--radius-pill); direction: ltr; }
.step__title { font-size: 24px; }
:lang(en) .step__title { font-size: 21px; }
.step__text { font-size: 15px; line-height: 1.75; color: var(--muted); }
.process__note { margin: 10px auto 0; max-width: 460px; text-align: center; font-size: 16px; line-height: 1.8; color: var(--muted); }

@media (max-width: 1000px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   4. About (sits after Process, as in the design)
   ========================================================================== */
.about { padding: 70px 0 60px; overflow: hidden; }
.about__intro { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 36px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.about__text { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.about__p { font-size: 17px; line-height: 1.85; color: var(--text-2); max-width: 680px; }
:lang(en) .about__p { font-size: 16px; }
.about__tools { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.about__tools-label { font-size: 15px; color: var(--muted); }
.tools {
  height: 340px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 2px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 14%, #000 86%, transparent);
}
.tools__col { height: 100%; overflow: hidden; }
.tools__track { display: flex; flex-direction: column; gap: 10px; animation: marquee-y 26s linear infinite; }
.tools__track--down { animation-duration: 30s; animation-direction: reverse; }
@keyframes marquee-y { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 5px)); } }
.tool {
  direction: ltr; display: flex; align-items: center; gap: 10px; padding: 12px;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 6px 16px rgba(46, 95, 138, 0.07);
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden;
}
.tool__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 5px; border-radius: 10px;
  background: var(--c, var(--blue-600)); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 1;
}
.skills-head { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 14px; display: flex; align-items: center; gap: 14px; }
.skills-head__title { font-size: 22px; font-weight: 700; color: var(--ink); }
.skills-head__rule { flex: 1; border-top: 2px dashed var(--blue-250); }
.skill-rows { display: flex; flex-direction: column; gap: 12px; }
.skill-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.skill-row__track { display: flex; width: max-content; padding: 4px 0; animation: marquee-x 55s linear infinite; }
.skill-row__track--b { animation-duration: 48s; animation-direction: reverse; }
.skill-row__track:hover { animation-play-state: paused; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px; margin-inline: 7px; padding: 12px 22px;
  border-radius: var(--radius-pill); background: var(--chip); border: 1px solid var(--border);
  font-size: 17px; color: var(--ink-2); white-space: nowrap;
}
.chip__dot { width: 7px; height: 7px; border-radius: 99px; background: var(--blue-500); }
.chip--tech { direction: ltr; }
.chip--tech .badge { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; font-size: 12px; }
@media (max-width: 600px) {
  .about__intro { gap: 36px; }
  .tools { gap: 8px; }
  .tool { padding: 10px 8px; gap: 8px; font-size: 13px; }
  .chip { font-size: 15px; padding: 10px 18px; }
}

/* ==========================================================================
   8. FAQ
   ========================================================================== */
.faq__inner { max-width: 860px; margin: 0 auto; padding: 64px var(--gutter); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.faq__list { width: 100%; border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { display: flex; align-items: center; gap: 18px; padding: 16px 4px; min-height: 44px; cursor: pointer; list-style: none; border-radius: 8px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item__num { flex: 0 0 auto; font-size: 15px; font-weight: 600; color: var(--blue-600); direction: ltr; min-width: 26px; }
.faq-item__q { flex: 1; font-size: clamp(19px, 0.6vw + 14px, 21px); line-height: 1.5; color: var(--ink); transition: color .2s; }
.faq-item summary:hover .faq-item__q { color: var(--blue-600); }
.chev { flex: 0 0 auto; transition: transform .3s; }
.faq-item[open] .chev { transform: rotate(180deg); }
.faq-item__a { margin-top: -4px; padding-block: 0 18px; padding-inline: 48px 40px; font-size: 16px; line-height: 1.75; color: var(--muted); }
.faq__more { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.faq__more p { font-size: 17px; color: var(--muted); }
@media (max-width: 600px) {
  .faq-item summary { gap: 12px; }
  .faq-item__a { padding-inline: 42px 8px; }
}

/* ==========================================================================
   9. CTA — "internet space"
   ========================================================================== */
.cta {
  position: relative; overflow: hidden; margin-top: 110px; color: #FFFFFF;
  background: radial-gradient(ellipse at 50% 30%, var(--space-1) 0%, var(--space-2) 55%, var(--space-3) 100%);
}
.cta__sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.cta__inner { position: relative; max-width: 980px; margin: 0 auto; padding: 170px var(--gutter) 120px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 24px; }
.cta__title { font-size: clamp(30px, 3.4vw + 14px, 56px); text-shadow: 0 4px 30px rgba(4, 10, 22, 0.6); }
:lang(en) .cta__title { font-size: clamp(28px, 2.6vw + 9px, 46px); line-height: 1.35; }
.cta__accent { color: #8EC5F5; }
.cta__lead { font-size: clamp(17px, 0.5vw + 15px, 20px); line-height: 1.8; color: #C9D6E6; max-width: 640px; }
.cta .btn-row { margin-top: 8px; }
@media (max-width: 600px) { .cta { margin-top: 60px; } .cta__inner { padding-block: 170px 110px; } }

.twinkle { animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: .95; } }
.drift { animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-30px, 14px); } }
.beam { stroke-dasharray: 4 14; animation: beam 2.4s linear infinite; opacity: .55; }
@keyframes beam { to { stroke-dashoffset: -36; } }
.pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.8s ease-out infinite; }
.pulse--late { animation-delay: 1.4s; }
@keyframes pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(5); opacity: 0; } }

/* ==========================================================================
   10. Footer — continues the space
   ========================================================================== */
.site-footer { position: relative; overflow: hidden; background: var(--space-3); color: #FFFFFF; padding: 30px var(--gutter) 34px; }
.site-footer__sky {
  position: absolute; top: 0; left: 0; width: 100%; height: 220px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.site-footer__inner { position: relative; max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 26px; text-align: center; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: var(--radius-pill); font-size: 14px; }
.pill--live { background: rgba(31, 163, 91, 0.12); border: 1px solid rgba(94, 224, 160, 0.3); color: #BFF0D4; }
.pill--clock { gap: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(156, 195, 236, 0.18); color: #C9D6E6; }
.pill__time { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--green); position: relative; }
/* pulse drawn with transform + opacity on a pseudo-element */
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--green);
  animation: live 2s ease-out infinite;
}
@keyframes live { from { transform: scale(1); opacity: .6; } to { transform: scale(3); opacity: 0; } }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 30px; }
.footer-nav a { color: #C9D6E6; text-decoration: none; font-size: 16px; transition: color .2s; }
.footer-nav a:hover { color: #FFFFFF; }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.social {
  width: 48px; height: 48px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(156, 195, 236, 0.18);
  display: inline-flex; align-items: center; justify-content: center; color: #C9D6E6; text-decoration: none;
  transition: transform .2s, background-color .2s, color .2s;
}
.social:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }
.site-footer__bottom { width: 100%; border-top: 1px solid rgba(156, 195, 236, 0.14); padding-top: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.site-footer__name { font-size: 26px; }
.site-footer__copy { font-size: 14px; color: #8A97A8; }
.to-top { display: inline-flex; align-items: center; gap: 8px; color: #C9D6E6; text-decoration: none; font-size: 14px; min-height: 44px; }
.to-top:hover { color: #FFFFFF; }
.to-top__icon { width: 34px; height: 34px; border-radius: var(--radius-pill); border: 1px solid rgba(156, 195, 236, 0.25); display: inline-flex; align-items: center; justify-content: center; transition: transform .2s; }
.to-top:hover .to-top__icon { transform: translateY(-2px); }
@media (max-width: 600px) { .site-footer__bottom { flex-direction: column; } }

/* ==========================================================================
   Placeholder pages (projects, resources, CV, tips)
   ========================================================================== */
.ph-page { min-height: 60vh; background: linear-gradient(180deg, #FFFFFF 0%, var(--blue-50) 100%); padding: 72px var(--gutter) 110px; }
.ph-page__inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.ph-page__title { font-size: clamp(34px, 4vw + 12px, 56px); }
.ph-page__lead { font-size: 19px; line-height: 1.9; color: var(--text-2); }
.ph-page__media { border-radius: 24px; overflow: hidden; background: #fff; padding: 10px; box-shadow: 0 30px 60px rgba(46, 95, 138, 0.18); }
.ph-page__media img { width: 100%; height: auto; border-radius: 18px; }
.ph-page .btn-row { justify-content: flex-start; }

/* ==========================================================================
   Project detail pages (/ar|en/projects/<slug>/): one shared template
   ========================================================================== */
.p-hero { background: linear-gradient(180deg, #FFFFFF 0%, var(--blue-50) 100%); padding: 28px var(--gutter) 64px; }
.p-hero__inner { max-width: var(--container); margin: 0 auto; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-inline-end: 6px; color: var(--blue-300); }
[dir="rtl"] .breadcrumb li + li::before { content: "‹"; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-600); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 600; }
.p-hero__copy { max-width: 860px; margin: 40px auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.p-hero__title { font-size: clamp(30px, 3.6vw + 14px, 56px); }
.p-hero__tagline { font-size: clamp(17px, 0.5vw + 15px, 20px); line-height: 1.8; color: var(--muted); max-width: 680px; }
.p-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.p-tag { padding: 7px 14px; border-radius: var(--radius-pill); background: #FFFFFF; border: 1px solid var(--border-blue); font-size: 14px; font-weight: 600; color: var(--steel); }
.p-hero__copy .btn-row { margin-top: 6px; }
.p-hero__media { max-width: 960px; margin: 44px auto 0; padding: 10px; border-radius: 30px; background: #FFFFFF; box-shadow: 0 30px 60px rgba(46, 95, 138, 0.22); }
.p-hero__media img { width: 100%; height: auto; border-radius: 22px; background: var(--blue-50); }

.p-facts { max-width: 960px; margin: -28px auto 0; padding: 0 var(--gutter); position: relative; }
.p-facts__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.p-fact { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px; border-radius: 20px; background: #FFFFFF; border: 1px solid var(--border-2); box-shadow: 0 10px 26px rgba(46, 95, 138, 0.08); }
.p-fact__label { font-size: 13px; font-weight: 600; color: var(--blue-600); }
.p-fact__value { font-size: 15px; line-height: 1.6; font-weight: 600; color: var(--ink); }

.p-body { max-width: 960px; margin: 0 auto; padding: 64px var(--gutter) 0; display: flex; flex-direction: column; gap: 56px; }
.p-section { display: flex; flex-direction: column; gap: 18px; }
.p-section__title { font-size: 32px; line-height: 1.35; }
:lang(en) .p-section__title { font-size: 28px; }
.p-text { font-size: 17px; line-height: 1.9; color: var(--text-2); }
:lang(en) .p-text { font-size: 16px; }
.p-bullets { display: flex; flex-direction: column; gap: 10px; }
.p-bullets li { position: relative; padding-inline-start: 22px; font-size: 17px; line-height: 1.8; color: var(--text-2); }
:lang(en) .p-bullets li { font-size: 16px; }
.p-bullets li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .8em; width: 7px; height: 7px; border-radius: 99px; background: var(--blue-500); }
.p-did { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-did__item {
  padding: 18px 20px; border-radius: 20px; font-size: 16px; line-height: 1.8; color: var(--text-2);
  background: linear-gradient(165deg, #F7FAFF 0%, var(--blue-100) 100%); border: 1px solid var(--border-blue);
}
.p-did__item strong { color: var(--ink); }
.p-tech { display: flex; flex-wrap: wrap; gap: 10px; }
.p-tech .chip { margin: 0; font-size: 15px; padding: 10px 18px; }
.p-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
/* Same white frame and soft shadow as the hero image */
.p-shot { padding: 8px; border-radius: 26px; background: #FFFFFF; box-shadow: 0 18px 40px rgba(46, 95, 138, 0.16); }
.p-shot--wide { grid-column: 1 / -1; }
.p-shot__link { display: block; overflow: hidden; border-radius: 18px; cursor: zoom-in; }
.p-shot img { display: block; width: 100%; height: auto; border-radius: 18px; background: var(--blue-50); transition: transform .3s ease; }
.p-shot__link:hover img { transform: scale(1.015); }
.p-gallery__note { font-size: 14px; color: var(--muted); }

/* Gallery lightbox (built by main.js) */
.lightbox {
  width: 100vw; max-width: none; height: 100vh; max-height: none; height: 100dvh; max-height: 100dvh;
  margin: 0; padding: 56px 72px; border: 0; background: rgba(6, 16, 34, 0.92); color: #FFFFFF;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: transparent; }
.lightbox__img { max-width: 100%; max-height: calc(100% - 36px); width: auto; height: auto; border-radius: 14px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); background: #FFFFFF; touch-action: pan-y; }
.lightbox__caption { margin: 0; font-size: 15px; color: #C9D6E6; text-align: center; }
.lightbox__btn {
  position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF; font: inherit; font-size: 24px; line-height: 1; cursor: pointer; transition: background .2s ease;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox__btn:focus-visible { outline-color: #8EC5F5; }
.lightbox__close { top: 14px; inset-inline-end: 14px; font-size: 28px; }
.lightbox__prev { top: 50%; inset-inline-start: 14px; transform: translateY(-50%); }
.lightbox__next { top: 50%; inset-inline-end: 14px; transform: translateY(-50%); }
html.lightbox-open, html.lightbox-open body { overflow: hidden; }
@media (max-width: 760px) {
  .lightbox { padding: 64px 12px 84px; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 18px; transform: none; }
  .lightbox__prev { inset-inline-start: calc(50% - 60px); }
  .lightbox__next { inset-inline-end: calc(50% - 60px); }
}

.p-pager { max-width: 960px; margin: 72px auto 0; padding: 0 var(--gutter); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.p-pager__link {
  display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border-radius: 20px; text-decoration: none;
  background: #FFFFFF; border: 1px solid var(--border-2); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.p-pager__link:hover { transform: translateY(-2px); border-color: var(--blue-300); box-shadow: 0 14px 30px rgba(46, 95, 138, 0.1); }
.p-pager__link--next { text-align: end; align-items: flex-end; }
.p-pager__label { font-size: 14px; color: var(--muted); }
.p-pager__name { font-size: 22px; line-height: 1.35; color: var(--ink); }

@media (max-width: 760px) {
  .p-facts { margin-top: -20px; }
  .p-facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-did, .p-gallery, .p-pager { grid-template-columns: 1fr; }
  .p-pager__link--next { text-align: start; align-items: flex-start; }
}
@media (max-width: 600px) {
  .p-hero { padding-bottom: 48px; }
  .p-hero__copy { margin-top: 28px; gap: 14px; }
  .p-hero__title { font-size: clamp(30px, 4vw + 15px, 34px); line-height: 1.35; }
  .p-hero__tagline { font-size: 16px; }
  .p-hero__media { margin-top: 32px; padding: 7px; border-radius: 22px; }
  .p-hero__media img { border-radius: 16px; }
  .p-fact { padding: 14px; border-radius: 16px; }
  .p-fact__value { font-size: 14px; }
  .p-body { padding-top: 48px; gap: 44px; }
  .p-section__title, :lang(en) .p-section__title { font-size: 24px; }
  .p-text, :lang(en) .p-text, .p-bullets li, :lang(en) .p-bullets li, .p-did__item { font-size: 16px; }
  .p-pager { margin-top: 56px; }
  .p-pager__name { font-size: 19px; }
}

/* ==========================================================================
   Mobile type and spacing (600px and below)
   ========================================================================== */
@media (max-width: 600px) {
  .hero__title { font-size: clamp(30px, 4vw + 15px, 34px); line-height: 1.35; }
  .hero__lead { font-size: 16px; }
  .section-title, :lang(en) .section-title { font-size: clamp(28px, 2vw + 21px, 30px); }
  .cta__title, :lang(en) .cta__title { font-size: clamp(28px, 2vw + 21px, 30px); }
  .svc-card__title, .panel__title, .faq-item__q { font-size: 20px; }
  .step__title, :lang(en) .step__title { font-size: 19px; }
  .svc-card__text, .panel__blurb, .about__p, :lang(en) .about__p, .faq-item__a, .cta__lead { font-size: 16px; }
  .step__text, .process__note, .faq__more p, .panel__role { font-size: 15px; }
  .btn--sm, .btn--md, .btn--lg, .btn--light, .btn--ghost-dark { font-size: 15px; min-height: 48px; padding: 12px 24px; }
  /* section paddings: about 56px */
  .services { padding-block: 24px 56px; }
  .work__inner, .process, .faq__inner { padding-block: 56px; }
  .about { padding-block: 56px; }
  .cta { margin-top: 56px; }
  .cta__inner { padding-block: 140px 64px; }
}

/* ==========================================================================
   Rendering performance: below-the-fold sections skip layout/paint until they
   approach the viewport (Arabic text shaping is the most expensive part of layout).
   ========================================================================== */
.services, .work, .process, .about, .faq, .cta, .site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* ==========================================================================
   Motion controls
   ========================================================================== */
/* Sections that scroll off-screen pause their loops (class set by main.js) */
.is-offscreen .logos__track, .is-offscreen .tools__track, .is-offscreen .skill-row__track,
.is-offscreen .twinkle, .is-offscreen .drift, .is-offscreen .beam,
.is-offscreen .pulse, .is-offscreen .live-dot::after { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .btn:hover, .svc-card:hover, .step:hover, .social:hover { transform: none; }
}
