/* FirModel — site styles.
   Brand colours live in the two palette blocks below; the final brand colours replace palette A in one place.
   Preview palette B by adding ?palette=b to any address. */

:root {
  /* Palette A: Rafid's approved logo colours, ink #0D1A23 + teal #047C94 (default) */
  --ink: #0d1a23;
  --ink-2: #1d3349;
  --text: #1a2a3a;
  --muted: #4f5f6f;
  --line: #d8dee4;
  --field-border: #7d8c9a;
  --paper: #f2f4f6;
  --surface: #ffffff;
  --accent: #047c94;
  --accent-strong: #035f72;
  --accent-soft: #e1f1f4;
  --accent-on-dark: #1c98ae;
  --on-dark: #e6ecf2;
  --on-dark-muted: #a9b8c6;

  --font-en: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", Tahoma, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --wrap: 1180px;
  --gutter: 16px;
  --header-h: 64px;
  --section-y: clamp(64px, 9vw, 120px);
  --radius-paper: 6px;
  --radius-control: 8px;
  --radius-card: 14px;
  --shadow-paper: 0 1px 2px rgba(13, 26, 35, .06), 0 14px 30px -14px rgba(13, 26, 35, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* FirModel's own pages (home, legal, 404) use its blue; Rafid's page keeps Rafid's colours above.
   FirModel's logo is not final: when it is, its colours replace these. */
:root {
  --fm-blue: #0058be;
  --fm-blue-on-dark: #4a8fe7;
  --rafid-teal-on-dark: #1c98ae;
}
html[data-brand="firmodel"] {
  /* FirModel logo colours, measured from the owner's logo file: ink #131E28, blue #0058BE. */
  --ink: #131e28;
  --accent: #0058be;
  --accent-strong: #00479b;
  --accent-soft: #e5eefa;
  --accent-on-dark: #4a8fe7;
  --radius-card: 18px;
}
/* FirModel's pages: rounder, lighter, more fluid than Rafid's working look. */
html[data-brand="firmodel"] .btn { border-radius: 999px; }
html[data-brand="firmodel"] .status { padding-inline: 12px; }

:root[data-palette="b"] {
  /* Palette B: charcoal + emerald */
  --ink: #23272b;
  --ink-2: #33393f;
  --text: #202528;
  --muted: #555d63;
  --line: #dcdfdc;
  --field-border: #808983;
  --paper: #f3f4f2;
  --accent: #0e7246;
  --accent-strong: #0a5a37;
  --accent-soft: #e3f1e8;
  --accent-on-dark: #62c99b;
  --on-dark: #eceeec;
  --on-dark-muted: #b3bab5;
}

@media (min-width: 640px) { :root { --gutter: 24px; --header-h: 72px; } }
@media (min-width: 1100px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-en);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(ar) { font-family: var(--font-ar); }
html[lang="ar"] body { font-size: 1.125rem; line-height: 1.75; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
[dir="rtl"] .icon-dir { transform: scaleX(-1); }

.sr-only {
  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: var(--radius-control);
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; white-space: nowrap; }
.pn { font-family: var(--font-mono); font-size: .92em; unicode-bidi: isolate; white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-control);
  font-weight: 500; font-size: .975rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1.025rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-quiet { color: var(--ink); background: transparent; }
.btn-quiet:hover { background: var(--paper); color: var(--ink); }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  /* Solid, not blurred: a backdrop-filter here would trap the fixed menu panel inside the header. */
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-row { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }

.wordmark {
  font-family: var(--font-en);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -.015em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px;
}
.wordmark:hover { color: var(--ink); }
.fm-logo { height: 24px; width: auto; }
.fm-logo-sm { height: 14px; width: auto; }
.base-logo { height: 22px; width: auto; }
.wm-m { color: var(--fm-blue); }
.trust .wm-m, .product-live .wm-m, .platform-base .wm-m { color: var(--fm-blue-on-dark); }

/* Rafid's page: its own logo, and a quiet way back to FirModel. */
.brand-pair { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rafid-logo-link { display: inline-flex; align-items: center; min-height: 44px; }
.rafid-logo-link img { height: 28px; width: auto; }
.by-link {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px;
  padding-inline-start: 12px; border-inline-start: 1px solid var(--line);
  color: var(--muted); font-size: .875rem; text-decoration: none; white-space: nowrap;
}
.by-link:hover { color: var(--ink); }
.wordmark-sm { font-family: var(--font-en); font-weight: 600; color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }

.lang-switch {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.lang-switch:hover { background: var(--paper); color: var(--ink); }

.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: var(--radius-control);
  background: transparent; color: var(--ink); cursor: pointer;
}
.menu-toggle:hover { background: var(--paper); }
.menu-toggle .icon { width: 24px; height: 24px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-menu { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Small screens: the links open in a panel under the header. */
.site-nav {
  display: none;
  position: fixed; top: var(--header-h); inset-inline: 0; bottom: 0;
  background: var(--surface);
  padding: 8px var(--gutter) 32px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.site-nav.is-open { display: block; }
.nav-links a {
  white-space: nowrap;
  display: flex; align-items: center; min-height: 52px;
  border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: 1.15rem; font-weight: 500; text-decoration: none;
}
.nav-panel-actions { display: grid; gap: 10px; margin-top: 24px; }
.nav-panel-actions .btn-quiet { border-color: var(--line); }
.header-wide { display: none; }

@media (min-width: 640px) {
  .header-wide { display: inline-flex; }
  .nav-panel-actions { display: none; }
}

/* FirModel's header has three links, so they fit from tablet width up. */
@media (min-width: 760px) {
  .site-nav-short {
    display: block; position: static; padding: 0; background: none; border: 0; overflow: visible;
    margin-inline-start: 28px;
  }
  .site-nav-short .nav-links { display: flex; gap: 2px; }
  .site-nav-short .nav-links a {
    min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-control);
    font-size: .975rem; color: var(--muted);
  }
  .site-nav-short .nav-links a:hover { color: var(--ink); background: var(--paper); }
  .site-nav-short .nav-panel-actions { display: none; }
  .site-nav-short ~ .header-actions .menu-toggle { display: none; }
}

@media (min-width: 1280px) {
  .site-nav {
    display: block; position: static; padding: 0; background: none; border: 0; overflow: visible;
    margin-inline-start: 28px;
  }
  .nav-links { display: flex; gap: 2px; }
  .nav-links a {
    min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-control);
    font-size: .975rem; color: var(--muted);
  }
  .nav-links a:hover { color: var(--ink); background: var(--paper); }
  .menu-toggle { display: none; }
}

/* ---------- Status pills ---------- */

.status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-size: .875rem; font-weight: 500; line-height: 1.5;
}
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .status-dot::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    background: var(--accent); animation: pulse 2.4s ease-out infinite;
  }
}
@keyframes pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(2.8); opacity: 0; } }
.status-soon { background: transparent; color: var(--muted); border: 1px dashed var(--field-border); padding-inline: 12px; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; gap: clamp(40px, 6vw, 64px); align-items: center; }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: start; }
  .hero-copy { padding-top: clamp(24px, 4vw, 56px); }
}

.hero-copy { max-width: 39rem; }
.hero h1 {
  margin-top: 22px;
  font-size: clamp(2.3rem, 1.4rem + 3.4vw, 3.6rem);
  line-height: 1.06; letter-spacing: -.028em;
}
html[lang="ar"] .hero h1 { line-height: 1.3; letter-spacing: 0; font-size: clamp(2.1rem, 1.3rem + 3.3vw, 3.4rem); }
.lead { margin-top: 22px; font-size: clamp(1.1rem, 1rem + .4vw, 1.25rem); color: var(--muted); max-width: 34rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 22px; font-size: .95rem; color: var(--muted); }
.hero-note a { display: inline-block; padding-block: 10px; margin-block: -10px; }

/* The desk: one request travelling from the inbox to a stamped quotation. */
.desk {
  position: relative; margin: 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: clamp(18px, 2.4vw, 28px) clamp(14px, 3vw, 32px) 40px;
  border-radius: var(--radius-card);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(15, 34, 54, .09) 1px, transparent 0);
  background-size: 22px 22px;
  font-size: .8125rem; line-height: 1.45;
}
.sheet {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
  padding: 14px 16px 16px;
}
.sheet-mail { grid-column: 1 / span 9; grid-row: 1; z-index: 1; }
.sheet-sources { grid-column: 4 / span 9; grid-row: 2; margin-top: -10px; z-index: 2; }
.sheet-quote { grid-column: 2 / span 10; grid-row: 3; margin-top: -10px; z-index: 3; padding-bottom: 70px; }

.sheet-head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); font-size: .875rem; }
.sheet-head .icon { color: var(--accent); width: 18px; height: 18px; }
.sheet-sub { color: var(--muted); margin-top: 2px; }
.mail-lines, .source-lines, .quote-lines { margin-top: 10px; display: grid; gap: 0; }
.mail-lines li, .source-lines li, .quote-lines li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; border-top: 1px solid var(--line);
}
.qty { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; unicode-bidi: isolate; }
.read-tag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  color: var(--accent-strong); font-weight: 500;
}
.read-tag .icon { width: 16px; height: 16px; }

.source { border-radius: 4px; }
.source-lines li.source { padding-inline: 8px; margin-inline: -8px; }
.source.is-chosen { background: var(--accent-soft); border-top-color: transparent; }
.source.is-chosen + .source { border-top-color: transparent; }
.source-who { color: var(--text); }
.source-tag {
  display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 4px;
  font-size: .72rem; font-weight: 500; line-height: 1.6;
  background: var(--surface); color: var(--accent-strong); border: 1px solid currentColor;
}
.source:not(.is-chosen) .source-tag { color: var(--muted); }
.is-chosen .num { font-weight: 600; color: var(--accent-strong); }

.letterhead {
  display: flex; align-items: center; gap: 8px;
  margin: -14px -16px 12px; padding: 10px 16px;
  border-bottom: 2px solid var(--ink);
  color: var(--muted); font-size: .75rem;
}
.letterhead-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--ink); }
.sheet-head-plain { font-size: 1rem; }
.quote-total {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 4px; padding-top: 8px; border-top: 2px solid var(--ink);
  font-weight: 600; color: var(--ink);
  padding-inline-end: 0;
}
.quote-total span:first-child { margin-inline-end: auto; }

.stamp {
  position: absolute; inset-inline-end: 26px; bottom: -10px;
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  border: 2.5px solid var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5.5px var(--accent);
  background: rgba(255, 255, 255, .72);
  color: var(--accent); font-weight: 600; font-size: .78rem; line-height: 1.2;
  transform: rotate(-12deg);
  padding: 14px;
}
.desk-caption {
  position: absolute; inset-inline-start: clamp(14px, 3vw, 32px); bottom: 14px;
  color: var(--muted); font-size: .75rem;
}

@media (max-width: 520px) {
  .desk { grid-template-columns: 1fr; padding-bottom: 48px; }
  .sheet-mail, .sheet-sources, .sheet-quote { grid-column: 1; }
  .sheet-sources { display: none; }
  .sheet-quote { grid-row: 2; margin-top: -10px; margin-inline-start: 18px; }
  .sheet-mail { margin-inline-end: 18px; }
  .stamp { width: 80px; height: 80px; font-size: .72rem; inset-inline-end: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-in .7s var(--ease) both; }
  .sheet-mail { animation-delay: .1s; }
  .sheet-sources { animation-delay: .5s; }
  .sheet-quote { animation-delay: .95s; }
  .source.is-chosen { animation: chosen 1s ease .9s both; }
  .stamp { animation: stamp-in .5s var(--ease) 1.7s both; }
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes chosen { from { background-color: transparent; } to { background-color: var(--accent-soft); } }
@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(-12deg) scale(1.7); }
  60% { opacity: 1; transform: rotate(-12deg) scale(.94); }
  100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}

/* ---------- Sections ---------- */

.section { padding-block: var(--section-y); }
.section-title { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; }
html[lang="ar"] .section-title { line-height: 1.4; letter-spacing: 0; }
.section-lead { margin-top: 14px; color: var(--muted); font-size: 1.125rem; max-width: 40rem; }
.section-head { margin-bottom: clamp(36px, 5vw, 56px); }

.split { display: grid; gap: 32px 64px; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split > .section-head { margin-bottom: 0; }
  .split-sticky .sticky-head { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
}

/* About */
.about { background: var(--paper); }
.about-title { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 3.6rem); line-height: 1.05; letter-spacing: -.03em; }
html[lang="ar"] .about-title { line-height: 1.3; letter-spacing: 0; }
.prose { display: grid; gap: 18px; max-width: 40rem; }
.about-lead { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.3rem); color: var(--ink); }
.about-origin { padding-inline-start: 16px; border-inline-start: 3px solid var(--accent); color: var(--ink); font-weight: 500; }

/* Problem */
.problem { background: var(--paper); padding-top: 0; }
.problem .section-title { margin-bottom: 32px; }
.problem-list { display: grid; gap: 28px; }
@media (min-width: 900px) { .problem-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }
.problem-item { padding-top: 20px; border-top: 1px solid var(--field-border); }
.problem-item .icon { width: 28px; height: 28px; color: var(--accent); }
.problem-item h3 { margin-top: 16px; font-size: 1.2rem; }
.problem-item p { margin-top: 8px; color: var(--muted); }

/* FirModel home: the platform with its models standing on it. */
.platform {
  margin: 0; display: grid; gap: 12px;
  padding: clamp(18px, 3vw, 32px);
  border-radius: var(--radius-card);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(13, 26, 35, .09) 1px, transparent 0);
  background-size: 22px 22px;
}
.modules { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.module {
  display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  min-height: 190px; padding: 16px; border-radius: 10px;
}
.module-live { min-height: 236px; background: #0d1a23; color: var(--on-dark-muted); box-shadow: var(--shadow-paper); }
.module-live img { width: 104px; height: auto; }
.module-soon { background: rgba(255, 255, 255, .7); border: 1.5px dashed var(--field-border); color: var(--muted); }
.module-state { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 500; }
.module-live .module-state { color: #fff; }
.module-live .status-dot, .module-live .status-dot::after { background: var(--rafid-teal-on-dark); }
.module-name { font-size: 1.15rem; font-weight: 600; color: var(--ink); line-height: 1.25; }
.module-text { font-size: .875rem; line-height: 1.45; }
.platform-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  padding: 14px 18px; border-radius: 10px; background: var(--ink); color: var(--on-dark-muted); font-size: .9rem;
}
.base-wordmark { font-family: var(--font-en); font-size: 1.25rem; font-weight: 600; color: #fff; }
@media (max-width: 560px) {
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .module-live { grid-column: 1 / -1; }
  .module, .module-live { min-height: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .platform-base { animation: sheet-in .6s var(--ease) .1s both; }
  .module { animation: module-in .7s var(--ease) both; }
  .module:nth-child(1) { animation-delay: .35s; }
  .module:nth-child(2) { animation-delay: .55s; }
  .module:nth-child(3) { animation-delay: .75s; }
}
@keyframes module-in { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }

.fm-model .problem-list { margin-top: 0; }
.fm-who { background: var(--paper); }
.who-grid { display: grid; gap: 28px 40px; }
@media (min-width: 640px) { .who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.who-item { padding-top: 20px; border-top: 1px solid var(--field-border); }
.who-item .icon { width: 30px; height: 30px; color: var(--accent); }
.who-item h3 { margin-top: 14px; font-size: 1.25rem; }
.who-item p { margin-top: 8px; color: var(--muted); }

.product-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.product-live .product-actions .btn-primary { margin-top: 0; }
.btn-on-dark { border-color: rgba(255, 255, 255, .45); color: #fff; background: transparent; }
.btn-on-dark:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* Memory */
.memory .section-title { max-width: 18ch; }
.memory-prose { margin-top: 20px; color: var(--muted); }
@media (min-width: 900px) { .memory .split { align-items: center; } }
.ledger {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-paper);
  box-shadow: var(--shadow-paper);
  padding: clamp(20px, 3vw, 32px);
  border-top: 4px solid var(--accent);
}
.ledger-title { font-size: 1.3rem; }
.ledger-list { margin-top: 14px; display: grid; }
.ledger-list li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.ledger-list .icon { width: 24px; height: 24px; color: var(--accent); }
.ledger-closing { margin-top: 6px; padding-top: 16px; border-top: 2px solid var(--ink); color: var(--muted); }

/* Products */
.products { border-top: 1px solid var(--line); }
.product-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .product-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); } }
.product { border-radius: var(--radius-card); padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.product-name { font-size: 1.6rem; line-height: 1.2; }
.product-logo { margin-block: 4px 2px; }
.product-logo img { width: 138px; height: auto; }
.product-alt { margin-inline-start: 6px; font-weight: 400; font-size: .7em; }
.product-text { color: var(--muted); }
.product-live { background: var(--ink); color: var(--on-dark); }
.product-live .product-name { color: #fff; }
.product-live .product-alt, .product-live .product-text { color: var(--on-dark-muted); }
.product-live .status { background: rgba(255, 255, 255, .1); color: #fff; }
.product-live .status-dot, .product-live .status-dot::after { background: var(--accent-on-dark); }
.product-live .btn-primary { background: #fff; color: var(--ink); margin-top: auto; }
.product-live .btn-primary:hover { background: var(--accent-soft); color: var(--ink); }
.product-live :focus-visible { outline-color: var(--accent-on-dark); }
.product-soon { border: 1px dashed var(--field-border); }
.product-soon .product-name { color: var(--ink-2); }

.checks { display: grid; gap: 8px; margin-bottom: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .icon { width: 18px; height: 18px; margin-top: .3em; color: var(--accent); }
.product-live .checks .icon { color: var(--accent-on-dark); }

/* How it works */
.how { background: var(--paper); }
.steps { display: grid; position: relative; }
.steps-beam {
  position: absolute; inset-inline-start: 22.5px; top: 24px; width: 3px; border-radius: 2px;
  background: var(--accent); transform-origin: top; transform: scaleY(0); pointer-events: none;
}
.step { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 20px; padding-bottom: 36px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; inset-inline-start: 23.5px; top: 52px; bottom: 4px;
  width: 1px; background: var(--field-border);
}
.step:last-child::before { display: none; }
.step-node {
  position: relative; z-index: 1;
  transition: border-color .3s ease, background-color .3s ease;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
}
.step-node .icon { width: 22px; height: 22px; }
.step.is-reached .step-node { border-color: var(--accent); background: var(--accent-soft); }
.step-body { padding-top: 2px; }
.step-num { font-size: .875rem; color: var(--accent-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.2rem; margin-top: 2px; }
.step p:last-child { margin-top: 6px; color: var(--muted); max-width: 36rem; }

/* Awn */
.modes { display: grid; gap: 16px; }
@media (min-width: 900px) { .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; } }
.mode {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: clamp(22px, 2.6vw, 30px);
}
.mode-semi { border: 2px solid var(--accent); background: linear-gradient(var(--accent-soft), var(--surface) 55%); }
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.badge {
  padding: 3px 10px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .8rem; font-weight: 500;
}
.mode h3 { font-size: 1.35rem; }
.mode-text { color: var(--muted); }
.mode-split { display: grid; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.mode-split dt { font-size: .85rem; font-weight: 600; color: var(--accent-strong); }
.mode-split dd { font-size: .975rem; }

/* The three-position switch drawn on each mode. */
.dial { position: relative; width: 74px; height: 30px; border-radius: 15px; background: var(--line); }
.dial span {
  position: absolute; top: 3px; inset-inline-start: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(15, 34, 54, .3);
}
.mode-semi .dial { background: linear-gradient(to right, var(--accent) 50%, var(--line) 50%); }
[dir="rtl"] .mode-semi .dial { background: linear-gradient(to left, var(--accent) 50%, var(--line) 50%); }
.mode-semi .dial span { inset-inline-start: 25px; }
.mode-auto .dial { background: var(--accent); }
.mode-auto .dial span { inset-inline-start: 47px; }

.footnote {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 28px; max-width: 46rem; color: var(--ink); font-weight: 500;
}
.footnote .icon { width: 24px; height: 24px; color: var(--accent); margin-top: .1em; }

/* Features */
.features { border-top: 1px solid var(--line); }
.features .section-title { margin-bottom: clamp(36px, 5vw, 56px); max-width: 30ch; }
.feature-grid { display: grid; gap: 36px 32px; }
@media (min-width: 600px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feature .icon { width: 28px; height: 28px; color: var(--accent); }
.feature h3 { margin-top: 14px; font-size: 1.075rem; }
.feature p { margin-top: 6px; color: var(--muted); font-size: .975rem; }

/* Trust */
.trust { background: var(--ink); color: var(--on-dark); }
.trust .section-title { color: #fff; }
.trust .section-lead { color: var(--on-dark-muted); }
.trust-list { display: grid; gap: 28px 40px; }
@media (min-width: 640px) { .trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trust-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; }
.trust-item .icon { width: 26px; height: 26px; color: var(--accent-on-dark); margin-top: .15em; }
.trust-item h3 { color: #fff; font-size: 1.1rem; }
.trust-item p { margin-top: 4px; color: var(--on-dark-muted); }
.trust :focus-visible { outline-color: var(--accent-on-dark); }

/* Plans */
.plans-announce {
  margin-top: 16px; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); font-weight: 500; color: var(--ink);
}
.plan-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .plan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.plan { border: 1px solid var(--line); border-radius: var(--radius-card); padding: clamp(22px, 2.6vw, 30px); }
.plan h3 { font-size: 1.3rem; }
.plan-for { margin-top: 4px; color: var(--muted); min-height: 3.2em; }
.plan-rows { margin-top: 18px; display: grid; }
.plan-rows > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.plan-rows dt { font-size: .95rem; }
.meter { display: inline-flex; gap: 4px; }
.meter i { display: block; width: 18px; height: 8px; border-radius: 2px; background: #c5cdd5; }
.meter[data-level="1"] i:nth-child(-n+1),
.meter[data-level="2"] i:nth-child(-n+2),
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--accent); }
.plans-cta { margin-top: 32px; }

/* FAQ */
.faq { background: var(--paper); }
.faq-list { border-top: 1px solid var(--field-border); }
.faq-item { border-bottom: 1px solid var(--field-border); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 14px 0;
  cursor: pointer; list-style: none;
  font-weight: 500; font-size: 1.1rem; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { width: 22px; height: 22px; color: var(--muted); transition: transform .2s ease; }
.faq-item[open] summary .icon { transform: rotate(180deg); }
.faq-answer { overflow: hidden; }
.faq-item p { padding-bottom: 20px; color: var(--muted); max-width: 42rem; }

/* Contact */
.email-list { margin-top: 28px; display: grid; }
.email-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.email-list li:last-child { border-bottom: 1px solid var(--line); }
.email-label { color: var(--muted); }
.email-list a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }

.contact-form {
  background: var(--paper); border-radius: var(--radius-card);
  padding: clamp(20px, 3vw, 32px);
  display: grid; gap: 16px;
}
.form-title { font-size: 1.25rem; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; }
.field label { font-size: .925rem; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius-control);
}
.field textarea { resize: vertical; min-height: 128px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-hint { font-size: .9rem; color: var(--muted); flex: 1 1 14rem; }
.form-status:empty { display: none; }
.form-status { padding: 12px 14px; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent-strong); }

/* Footer */
.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding-top: 56px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); } }
.footer-brand p { margin-top: 4px; color: var(--muted); }
.footer-brand .lang-switch { margin-top: 12px; margin-inline-start: -12px; }
.footer-head { font-size: .95rem; color: var(--ink); margin-bottom: 8px; }
.footer-list li a, .footer-list li span { display: inline-flex; align-items: center; min-height: 40px; }
.footer-list a { color: var(--text); text-decoration: none; }
.footer-list a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-base { margin-top: 40px; padding-block: 20px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
html[lang="ar"] .footer-base p { text-align: end; }

/* Legal pages */
.legal-wrap { max-width: calc(760px + 2 * var(--gutter)); padding-block: clamp(40px, 6vw, 72px) clamp(64px, 8vw, 104px); }
.legal h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); line-height: 1.15; letter-spacing: -.02em; margin-top: 20px; }
html[lang="ar"] .legal h1 { line-height: 1.35; letter-spacing: 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); text-decoration: none; }
.back-link .icon { transform: scaleX(-1); }
[dir="rtl"] .back-link .icon { transform: none; }
.back-link:hover { color: var(--ink); }
.legal-block { margin-top: 40px; }
.legal-block h2 { font-size: 1.3rem; margin-bottom: 14px; }
.legal-note {
  margin-top: 36px; padding: 16px 18px;
  background: var(--paper); border-inline-start: 3px solid var(--accent); border-radius: 4px;
}
.covers { list-style: decimal; padding-inline-start: 1.4em; display: grid; gap: 8px; }
.covers li::marker { color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.not-found .btn { margin-top: 24px; }
.not-found-ar { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); font-family: var(--font-ar); }
.not-found-ar h2 { font-size: 1.6rem; }


/* Rafid keeps its own teal wherever it appears on FirModel pages. */
.fm-products .product-live { --accent-on-dark: var(--rafid-teal-on-dark); }
@media (min-width: 1000px) {
  .module { min-height: 240px; }
  .module-live { min-height: 300px; }
  .module-live img { width: 124px; }
}

/* ---------- FirModel home: flowing light behind the hero, a reading-progress line ---------- */
.fm-hero { position: relative; overflow: hidden; isolation: isolate; }
.fm-hero > .wrap { position: relative; z-index: 1; }
.fm-aura { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.fm-aura span {
  position: absolute; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 88, 190, .15), rgba(0, 88, 190, 0));
}
.fm-aura span:nth-child(1) { width: 720px; height: 720px; top: -320px; inset-inline-end: -200px; }
.fm-aura span:nth-child(2) { width: 520px; height: 520px; bottom: -300px; inset-inline-start: -180px; background: radial-gradient(closest-side, rgba(13, 26, 35, .07), rgba(13, 26, 35, 0)); }
.fm-aura span:nth-child(3) { width: 380px; height: 380px; top: 30%; inset-inline-start: 38%; background: radial-gradient(closest-side, rgba(74, 143, 231, .16), rgba(74, 143, 231, 0)); }
.fm-hero .platform { background-color: rgba(242, 244, 246, .72); backdrop-filter: blur(2px); }

.site-header { position: sticky; }
.scroll-progress {
  position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none;
}
[dir="rtl"] .scroll-progress { transform-origin: right; }

/* The footer carries both FirModel logos; the dark theme (fm.css) shows the white one. */
.fm-logo-dark { display: none; }
