/* ==========================================================================
   In Process Measurement Solutions — design system
   "Instrument / datasheet" minimalism: warm paper, near-black ink, one flat
   orange accent, monospace technical labels, thin rules, crosshair register
   marks. Light (default) + Dark. RTL via logical properties. Restrained motion.
   ========================================================================== */

:root {
  --orange: #D9642C;          /* marks, borders, large accents */
  --orange-solid: #B94E1F;    /* orange BLOCKS carrying text — white on it = 5:1 */
  --orange-600: #A8461A;      /* button hover */
  --orange-ink: #B24A1C;      /* orange text on light — AA */

  /* Light (default) — warm paper */
  --paper: #F7F5F0;
  --surface: #FFFFFF;
  --surface-2: #F1EEE6;
  --ink: #1B1A17;
  --ink-soft: #46433C;
  --ink-mute: #726E64;
  --border: #E4DFD4;
  --border-strong: #D0CABB;
  --band: #17150F;            /* dark footer */
  --band-ink: #F3F0E8;
  --band-ink-soft: #ADA89B;
  --on-orange: #FFFFFF;

  --sidebar-w: 256px;
  --rail-w: 74px;
  --topbar-h: 58px;

  --r: 8px;
  --r-sm: 6px;

  --font-sans: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  --ease: cubic-bezier(0.25, 0.8, 0.35, 1);
  --container: 1120px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --orange: #E0703A;
  --orange-solid: #E0703A;    /* dark text sits on it in dark mode */
  --orange-600: #EC8354;      /* hover brightens in dark so dark text keeps AA */
  --orange-ink: #EE9560;

  --paper: #141310;
  --surface: #1C1A16;
  --surface-2: #23211B;
  --ink: #EFEBE2;
  --ink-soft: #BDB8AC;
  --ink-mute: #938E82;
  --border: #2D2A23;
  --border-strong: #423E35;
  --band: #0E0D0A;
  --band-ink: #F3F0E8;
  --band-ink-soft: #A8A396;
  --on-orange: #16150F;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-ink); }
::selection { background: var(--orange); color: var(--on-orange); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.skip-link {
  position: fixed; inset-inline-start: 1rem; top: -4rem; z-index: 200;
  background: var(--orange-solid); color: var(--on-orange);
  padding: 0.7rem 1.1rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none; font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Eyebrow marker — short orange rule */
.eyebrow::before {
  content: '';
  width: 20px; height: 2px; flex: none;
  background: var(--orange);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ==========================================================================
   HEADER (top navigation)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem clamp(1.2rem, 4vw, 2.6rem);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-logo { width: 38px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 1rem; line-height: 1.12; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-family: var(--font-mono); font-weight: 500; font-size: 0.58rem; letter-spacing: 0.06em; color: var(--ink); text-transform: uppercase; margin-top: 2px; }
:root[data-theme="dark"] .brand { color: var(--orange); }
:root[data-theme="dark"] .brand-sub { color: var(--orange); }

.primary-nav { margin-inline-start: auto; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 0.2rem; margin: 0; padding: 0; }
.nav-link {
  position: relative;
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: '';
  position: absolute;
  inset-inline: 0.9rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.lang-toggle, .theme-toggle, .menu-btn {
  font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--ink-soft);
  border-radius: var(--r-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 0.75rem; font-weight: 600; font-size: 0.82rem; text-decoration: none;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--border-strong); background: var(--surface-2); }
.theme-toggle, .menu-btn { display: grid; place-items: center; width: 38px; height: 38px; }
.theme-toggle:hover, .menu-btn:hover { color: var(--orange-ink); border-color: var(--border-strong); }
.lang-toggle svg, .theme-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-btn { display: none; }

[data-theme-toggle] .ico-moon { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ico-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ico-moon { display: block; }

/* min-width:0 because <main> is a flex item: without it the item's automatic
   minimum size is its min-content width, so a wide child (the comparison
   table in the articles) pushes <main> past the viewport instead of letting
   .article-table-wrap scroll. */
main { flex: 1; min-width: 0; }

/* ==========================================================================
   BUTTONS + LINKS
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: none; border-radius: var(--r-sm);
  font-family: inherit; font-weight: 600; font-size: 1rem;
  padding: 0.8rem 1.5rem; cursor: pointer; text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn-primary { background: var(--orange-solid); color: var(--on-orange); }
.btn-primary:hover { background: var(--orange-600); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-ink); }

.text-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--ink); font-weight: 600; text-decoration: none;
  border-bottom: 1.5px solid var(--border-strong);
  padding-bottom: 2px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.text-link:hover { color: var(--orange-ink); border-color: var(--orange); }
.text-link .arw { transition: transform 0.2s var(--ease); }
.text-link:hover .arw { transform: translateX(3px); }
[dir="rtl"] .text-link .arw { transform: scaleX(-1); }
[dir="rtl"] .text-link:hover .arw { transform: scaleX(-1) translateX(3px); }

/* ==========================================================================
   LAYOUT HELPERS
   ========================================================================== */

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 2.6rem); }
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section-soft { background: var(--surface); border-block: 1px solid var(--border); }

.section-eyebrow { display: flex; justify-content: center; margin-bottom: 0.8rem; }

.section-title {
  text-align: center;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-block: 0 2.2rem;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.2rem, 5vw, 3.5rem) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-align: center;
  /* Fill the first screen so the next section starts below the fold.
     --header-h is the sticky header's own flow height (38px logo + 0.7rem
     padding either side + 1px border); svh keeps mobile URL bars from
     pushing the fold off-screen. */
  --header-h: 62px;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* faint precision baseline grid — structural, not glow */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.5;
  mask-image: radial-gradient(120% 90% at 50% 30%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, black, transparent 72%);
}
/* dark: add a single restrained warm depth glow behind the grid */
:root[data-theme="dark"] .hero {
  background:
    radial-gradient(46rem 32rem at 50% -12%, rgba(224, 112, 58, 0.13), transparent 60%),
    radial-gradient(60rem 40rem at 50% 130%, rgba(224, 112, 58, 0.05), transparent 60%);
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { margin-bottom: 1.4rem; }
.hero-title {
  font-size: clamp(2.2rem, 5.2vw, 3.9rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 auto 1.2rem;
  max-width: 20ch;
  color: var(--ink);
}
.hero-title .accent { color: inherit; }
:root[data-theme="dark"] .hero-title { color: var(--orange); }
.hero-tagline {
  font-size: clamp(1.08rem, 1.5vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 58ch;
  margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: 1.5rem; align-items: center; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 3rem auto 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: fit-content;
  max-width: 100%;
  background: var(--surface);
}
.hero-stat { padding: 1rem 1.6rem; border-inline-end: 1px solid var(--border); }
.hero-stat:last-child { border-inline-end: none; }
.hero-stat b { display: block; font-family: var(--font-mono); font-size: clamp(1.3rem, 2.4vw, 1.8rem); font-weight: 700; color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; }
.hero-stat span { font-size: 0.78rem; color: var(--ink-mute); }

/* ==========================================================================
   PARTNERS
   ========================================================================== */

.partners-row { display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 1rem; }
.partner-logo-link {
  display: grid; place-items: center;
  padding: 1.3rem 1.8rem; min-height: 92px; min-width: 200px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.partner-logo-link:hover { border-color: var(--border-strong); transform: translateY(-5px); box-shadow: 0 10px 24px -14px rgba(20,17,10,0.4); }
.partner-logo-link img { height: 42px; width: auto; filter: grayscale(1); opacity: 0.85; transition: filter 0.2s var(--ease), opacity 0.2s var(--ease); }
.partner-logo-link:hover img { filter: grayscale(0); opacity: 1; }
.partner-logo-link.kacst img { height: 40px; }
.partner-logo-link.ntdp img { height: 34px; }

/* ==========================================================================
   NEWS CARDS
   ========================================================================== */

.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.7rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.card-eyebrow { font-family: var(--font-mono); color: var(--ink-mute); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; margin: 0 0 0.7rem; }
.card-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 0.5rem; }
.card-text { font-size: 1.02rem; color: var(--ink-soft); margin: 0; }

/* ==========================================================================
   PAGE HEADINGS
   ========================================================================== */

.page-heading {
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  padding-inline: 1.5rem;
}

/* ==========================================================================
   SERVICES
   ========================================================================== */

.services-grid {
  max-width: var(--container);
  margin: 2.5rem auto clamp(3rem, 6vw, 5rem);
  padding-inline: clamp(1.2rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: start;
}
.steps-panel { position: relative; }
.steps-panel-title { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 2rem; }
.steps-panel::before {
  content: '';
  position: absolute;
  inset-inline-start: 23px;
  top: 5.4rem; bottom: 1.8rem;
  width: 1px; background: var(--border-strong);
}
.step { position: relative; padding: 0 0 1.8rem; padding-inline-start: 68px; }
.step:last-child { padding-bottom: 0; }
.step-index {
  position: absolute; inset-inline-start: 0; top: 0;
  width: 47px; height: 47px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  color: var(--on-orange); background: var(--orange-solid);
  transition: transform 0.2s var(--ease);
}
.step:hover .step-index { transform: scale(1.08); }
.step-title { font-size: 1.12rem; font-weight: 700; color: var(--ink); margin: 0.4rem 0 0.35rem; }
.step-text { font-size: 1.04rem; color: var(--ink-soft); margin: 0; }

.product-panel {
  position: sticky; top: 2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 1.4rem;
}
.product-panel img { border-radius: var(--r-sm); margin-bottom: 1.3rem; }
.product-title { font-size: 1.3rem; font-weight: 700; color: var(--ink); margin: 0 0 0.5rem; }
.product-text { color: var(--ink-soft); margin: 0; }

@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
  .product-panel { position: static; }
}

/* ==========================================================================
   ABOUT
   ========================================================================== */

.about-panel { max-width: 940px; margin: 2.5rem auto clamp(3rem, 6vw, 5rem); padding-inline: clamp(1.2rem, 4vw, 2.6rem); }
.about-panel .page-heading { margin: 0 0 1.3rem; padding: 0; text-align: start; }
.about-lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-soft); margin: 0 0 1.2rem; max-width: 68ch; }
.about-lede:last-of-type { margin-bottom: 2.6rem; }

.about-mv { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 2.6rem; }
.about-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.6rem 1.7rem;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.about-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.about-card::before {
  content: '';
  position: absolute; inset-inline-start: 0; top: 1.6rem; bottom: 1.6rem;
  width: 3px; background: var(--orange); border-radius: 0 2px 2px 0;
}
[dir="rtl"] .about-card::before { border-radius: 2px 0 0 2px; }
.about-card-label { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-ink); margin: 0 0 0.5rem; }
.about-card-title { font-size: 1.35rem; font-weight: 700; color: var(--ink); margin: 0 0 0.6rem; }
.about-card p { color: var(--ink-soft); margin: 0; }

.about-values-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 0 0 1.2rem; }
.values-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; padding: 0; margin: 0; }
.value-chip {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border); border-radius: var(--r);
  font-weight: 600; color: var(--ink); background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.value-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.value-chip:hover { border-color: var(--orange); transform: translateY(-3px); }

@media (max-width: 620px) { .about-mv { grid-template-columns: 1fr; } }

/* ==========================================================================
   CONTACT
   ========================================================================== */

.contact-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.contact-grid { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 2.6rem); display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.contact-eyebrow { font-family: var(--font-mono); color: var(--ink-mute); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; }
.contact-title { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0.4rem 0 0.6rem; }
.contact-description { color: var(--ink-soft); margin: 0 0 2rem; font-size: 1.02rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-field { flex: 1 1 200px; display: flex; flex-direction: column; gap: 0.4rem; }
.form-field.full { flex-basis: 100%; }
.form-field label { font-family: var(--font-mono); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-mute); }
.field-optional { text-transform: none; letter-spacing: 0; }
.form-field input, .form-field textarea {
  width: 100%; padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: 16px; font-family: inherit;
  background: var(--surface); color: var(--ink);
  transition: border-color 0.15s var(--ease);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--ink-mute); }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--orange); }
.form-field textarea { resize: vertical; min-height: 130px; }
.contact-form .btn { align-self: flex-start; margin-top: 0.3rem; }
.contact-illustration { display: grid; place-items: center; }
.contact-illustration img { max-width: 360px; width: 100%; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-illustration { order: -1; }
}

/* ==========================================================================
   BLOG
   ========================================================================== */

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.4rem; margin-top: 2.5rem; }
.blog-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color 0.2s var(--ease), transform 0.25s var(--ease);
}
.blog-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.blog-card-media { position: relative; height: 200px; overflow: hidden; border-bottom: 1px solid var(--border); }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s var(--ease); }
.blog-card:hover .blog-card-media img { transform: scale(1.05); }
.blog-tag {
  position: absolute; top: 0.9rem; inset-inline-start: 0.9rem;
  background: var(--orange-solid); color: var(--on-orange);
  padding: 0.3rem 0.7rem; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em;
}
.blog-card-body { padding: 1.4rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.blog-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; color: var(--ink-mute); font-size: 0.8rem; font-family: var(--font-mono); }
.blog-meta .separator { width: 3px; height: 3px; background: var(--ink-mute); border-radius: 50%; }
.blog-card-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); line-height: 1.35; margin: 0; }
.blog-excerpt { color: var(--ink-soft); margin: 0; font-size: 1.03rem; }

/* ==========================================================================
   ARTICLE
   ========================================================================== */

/* min(…, 100%) so the column can never exceed the viewport: <main> is a flex
   item, and without the cap the comparison table's intrinsic width widened the
   whole article past a 390px screen instead of scrolling inside
   .article-table-wrap. */
.article { max-width: min(720px, 100%); margin: clamp(2rem, 4vw, 3rem) auto clamp(3rem, 6vw, 5rem); padding-inline: clamp(1.2rem, 4vw, 1.5rem); }
/* Back to the article index. Mono + uppercase so it reads as a wayfinding
   label rather than part of the article. The arrow mirrors in RTL. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  margin-bottom: 1.3rem;
  transition: color 0.2s var(--ease);
}
.back-link:hover { color: var(--orange); }
.back-link .arw { transition: transform 0.2s var(--ease); }
.back-link:hover .arw { transform: translateX(-3px); }
[dir="rtl"] .back-link .arw { transform: scaleX(-1); }
[dir="rtl"] .back-link:hover .arw { transform: scaleX(-1) translateX(-3px); }

.article-title { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.18; color: var(--ink); margin: 0 0 1rem; }
.article .blog-meta { margin-bottom: 1.5rem; }
.article-hero-img { width: 100%; border-radius: var(--r); margin-bottom: 2rem; border: 1px solid var(--border); }
.article-body { font-size: 1.14rem; line-height: 1.8; color: var(--ink-soft); }
.article-body p { margin: 0 0 1.3em; }
.article-body h2 { font-size: 1.4rem; font-weight: 700; color: var(--ink); margin: 2.2rem 0 0.8rem; letter-spacing: -0.01em; }
.article-body ul { margin: 0 0 1.3em; padding-inline-start: 1.3em; }
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: var(--orange); }
.article-body a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; word-break: break-word; }
.article-body figure { margin: 2rem 0; }
.article-body figure img { border-radius: var(--r-sm); border: 1px solid var(--border); }
.article-body figcaption { font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink-mute); margin-top: 0.7rem; text-align: center; }

.article-table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--border); border-radius: var(--r-sm); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.article-body th, .article-body td { padding: 0.75rem 1rem; border: 1px solid var(--border); text-align: start; }
.article-body thead { background: var(--surface-2); }
.article-body thead th { color: var(--ink); }
.article-body tbody th { background: var(--surface-2); }
.article-references { font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.7; color: var(--ink-mute); }
.article-references p { margin: 0 0 0.9em; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  background: var(--band); color: var(--band-ink-soft);
  padding: clamp(2rem, 4vw, 2.75rem) 1.5rem; text-align: center; margin-top: auto;
  border-top: 2px solid var(--orange);
}
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; margin-bottom: 1.3rem; color: var(--band-ink); font-size: 0.9rem; }
.footer-contact span { display: flex; align-items: center; gap: 0.5rem; }
.footer-icon { flex-shrink: 0; width: 17px; height: 17px; color: var(--orange); }
.site-footer a { color: var(--band-ink); text-decoration: none; font-weight: 500; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-copy { margin: 0 0 0.75rem; font-size: 0.85rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0; font-size: 0.88rem; font-family: var(--font-mono); }
.footer-nav .sep { color: #56534a; }

/* ==========================================================================
   MOTION — single restrained fade
   ========================================================================== */

:root.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease); }
:root.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :root.js-reveal .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ==========================================================================
   RESPONSIVE — header nav → dropdown
   ========================================================================== */

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .header-actions { margin-inline-start: auto; }

  .primary-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin-inline-start: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px -18px rgba(20, 17, 10, 0.4);
    display: none;
  }
  .primary-nav.open { display: block; }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-width: var(--container);
    margin-inline: auto;
    padding: 0.6rem clamp(1.2rem, 4vw, 2.6rem) 0.9rem;
  }
  .nav-link { padding: 0.8rem 0.8rem; font-size: 1rem; }
  .nav-link.active { background: var(--surface-2); }
  .nav-link.active::after { display: none; }
}

/* Very small phones. The brand and the action buttons are both flex-shrink:0,
   and on the Arabic pages the pair ran ~4px past a 390px viewport. Tighten the
   frame rather than let the logo lockup truncate. */
@media (max-width: 420px) {
  .header-inner { padding-inline: 0.9rem; gap: 0.6rem; }
  .header-actions { gap: 0.35rem; }
}

/* ---- Justified body prose (all pages, LTR + RTL) ---------------------- */
/* Running paragraph text is justified for a clean block edge; short/centered
   text (hero tagline, labels, headings) is intentionally left untouched. */
.hero-tagline,
.card-text,
.about-lede,
.about-card p,
.article-body p,
.article-body li,
.blog-excerpt,
.step-text,
.section-lead {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Theme-aware figure images (light/dark variants) */
.fig-dark { display: none; }
:root[data-theme="dark"] .fig-light { display: none; }
:root[data-theme="dark"] .fig-dark { display: block; }

/* ==========================================================================
   EXPLAINER VIDEO (autoplaying, muted, looping — "GIF-like")
   ========================================================================== */

/* A 9:16 clip in a flat bordered frame. Never full-bleed: a vertical video at
   container width would be absurdly tall, so the frame is capped and paired
   with text beside it (stacking below 900px). */
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #141310; /* matches the clips' own paper so letterboxing is invisible */
}
.video-frame video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Pause control — required: the clips loop for >5s, so WCAG 2.2.2 needs a way
   to stop the motion. Always rendered, not JS-injected, so it works if the
   video element is focused before main.js runs. */
.video-toggle {
  position: absolute;
  inset-block-end: 0.6rem;
  inset-inline-end: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #efebe2;
  background: rgba(20, 19, 16, 0.72);
  border: 1px solid rgba(239, 235, 226, 0.28);
  border-radius: var(--r-sm);
  padding: 0.36rem 0.62rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.video-toggle:hover { background: rgba(20, 19, 16, 0.9); border-color: var(--orange); }

/* Services: clip on the leading side, supporting copy beside it */
.video-band {
  max-width: var(--container);
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  padding-inline: clamp(1.2rem, 4vw, 2.6rem);
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
}
.video-band-body { min-width: 0; }
.video-band-title {
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.7rem;
}
.video-band-text { font-size: 1.04rem; color: var(--ink-soft); margin: 0; }

/* Article bodies: a centred figure, same width cap */
.article-body .video-figure { margin: 2rem auto; max-width: 340px; }

@media (max-width: 900px) {
  /* minmax(0,…) so the column can shrink below the video's intrinsic width */
  .video-band { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .video-band .video-frame { width: 100%; max-width: min(340px, 100%); }
}
