/* FirModel — the dark theme for FirModel's own pages (home, legal, 404).
   Loaded only where html[data-brand="firmodel"]; Rafid's page never loads it.
   Colours come from the FirModel logo: ink and the blue of its M, brightened for a black ground. */

html[data-brand="firmodel"] {
  color-scheme: dark;
  --surface: #050608;
  --paper: #0a0d12;
  --text: #e6ebf1;
  --muted: #9aa7b4;
  --line: rgba(255, 255, 255, .09);
  --field-border: rgba(255, 255, 255, .32);
  --ink: #f4f7fa;                 /* headings */
  --accent: #1f6feb;              /* fills with white text: 4.6:1 */
  --accent-strong: #6aa5ff;       /* blue text on black: 8:1 */
  --accent-soft: rgba(31, 111, 235, .16);
  --accent-on-dark: #6aa5ff;
  --on-dark: #e6ebf1;
  --on-dark-muted: #9aa7b4;
  --m-blue: #3b86ff;              /* the M, lit */
  --m-glow: rgba(59, 134, 255, .6);
  --shadow-paper: 0 30px 60px -30px rgba(0, 0, 0, .8);
}
html[data-brand="firmodel"] body { background: var(--surface); }
html[data-brand="firmodel"] ::selection { background: rgba(59, 134, 255, .45); color: #fff; }

/* ---------- Shared parts on black ---------- */

html[data-brand="firmodel"] .site-header { background: rgba(5, 6, 8, .55); }
html[data-brand="firmodel"] .site-header::before {
  /* The blur lives on a pseudo-element, so the fixed phone menu is not trapped inside the header. */
  content: ""; position: absolute; inset: 0; z-index: -1;
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
html[data-brand="firmodel"] .site-header.is-scrolled { border-bottom-color: var(--line); }
@media (max-width: 759px) { html[data-brand="firmodel"] .site-nav { background: var(--surface); } }
html[data-brand="firmodel"] .lang-switch:hover,
html[data-brand="firmodel"] .menu-toggle:hover,
html[data-brand="firmodel"] .btn-quiet:hover,
html[data-brand="firmodel"] .site-nav-short .nav-links a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
html[data-brand="firmodel"] .site-nav-short .nav-links a { color: var(--muted); }
html[data-brand="firmodel"] .skip-link { background: var(--accent); }

.fm-wordmark .fm-logo-svg { display: block; height: 26px; width: auto; overflow: visible; }
.logo-m { fill: var(--m-blue); filter: drop-shadow(0 0 7px var(--m-glow)); }
@media (prefers-reduced-motion: no-preference) {
  .logo-m { animation: m-breathe 4.5s ease-in-out infinite; }
}
@keyframes m-breathe {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(59, 134, 255, .45)); }
  50% { filter: drop-shadow(0 0 12px rgba(59, 134, 255, .9)); }
}
.fm-logo-dark { display: none; }
html[data-brand="firmodel"] .fm-logo-light { display: none; }
html[data-brand="firmodel"] .fm-logo-dark { display: block; }

html[data-brand="firmodel"] .btn-primary:hover { background: #1a5fd1; color: #fff; }
html[data-brand="firmodel"] .btn-ghost { border-color: rgba(255, 255, 255, .38); color: #fff; }
html[data-brand="firmodel"] .btn-ghost:hover { background: #fff; color: #050608; border-color: #fff; }
.btn-teal { background: #047c94; color: #fff; }
.btn-teal:hover { background: #03687c; color: #fff; }

html[data-brand="firmodel"] .contact {
  background: radial-gradient(70% 60% at 50% 0%, rgba(31, 111, 235, .14), transparent 70%);
  border-top: 1px solid var(--line);
}
html[data-brand="firmodel"] .contact-form { background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
html[data-brand="firmodel"] .field input,
html[data-brand="firmodel"] .field select,
html[data-brand="firmodel"] .field textarea { background: #07090c; color: var(--text); }
html[data-brand="firmodel"] .site-footer { background: #030405; }

/* ---------- Hero: flowing field, the M in three dimensions ---------- */

.fmx-hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 980px);
  display: flex; flex-direction: column; justify-content: center;
  margin-top: calc(-1 * var(--header-h));
  padding-block: calc(var(--header-h) + 32px) 110px;
}
.fmx-flow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.fmx-hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 58% at 74% 46%, rgba(31, 111, 235, .22), transparent 70%),
    linear-gradient(180deg, rgba(5, 6, 8, .2) 0%, transparent 30%, transparent 70%, var(--surface) 100%);
}
[dir="rtl"] .fmx-hero-shade {
  background:
    radial-gradient(48% 58% at 26% 46%, rgba(31, 111, 235, .22), transparent 70%),
    linear-gradient(180deg, rgba(5, 6, 8, .2) 0%, transparent 30%, transparent 70%, var(--surface) 100%);
}
.fmx-hero-grid { display: grid; gap: 24px; align-items: center; }
@media (min-width: 980px) { .fmx-hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 32px; } }

.fmx-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04);
  color: var(--text); font-size: .9rem; font-weight: 500;
}
.fmx-pill .status-dot, .fmx-pill .status-dot::after { background: var(--m-blue); }
.fmx-pill-teal { border-color: rgba(28, 152, 174, .45); background: rgba(28, 152, 174, .1); }
.fmx-pill-teal .status-dot, .fmx-pill-teal .status-dot::after { background: #1c98ae; }

.fmx-title {
  margin-top: 26px;
  font-size: clamp(2.7rem, 1.1rem + 5.6vw, 5.9rem);
  line-height: 1.0; letter-spacing: -.04em; font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #ffffff 35%, #a9bfdc 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[lang="ar"] .fmx-title { line-height: 1.28; letter-spacing: 0; font-size: clamp(2.4rem, 1.1rem + 4.6vw, 5rem); }
.fmx-lead { margin-top: 26px; max-width: 34rem; color: var(--muted); font-size: clamp(1.1rem, 1rem + .35vw, 1.3rem); }
.fmx-hero .cta-row { margin-top: 36px; }
.fmx-btn-glow { box-shadow: 0 14px 44px -12px rgba(31, 111, 235, .85), inset 0 1px 0 rgba(255, 255, 255, .18); }

.fmx-scroll {
  position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 44px; color: var(--muted); font-size: .8rem; text-decoration: none;
}
[dir="rtl"] .fmx-scroll { transform: translateX(50%); }
.fmx-scroll:hover { color: #fff; }
.fmx-scroll-line {
  position: relative; width: 1px; height: 46px; overflow: hidden;
  background: rgba(255, 255, 255, .14);
}
.fmx-scroll-line::after {
  content: ""; position: absolute; inset-inline: 0; top: -40%; height: 40%;
  background: linear-gradient(transparent, var(--m-blue));
}
@media (prefers-reduced-motion: no-preference) {
  .fmx-scroll-line::after { animation: scroll-drop 2.2s cubic-bezier(.6, 0, .3, 1) infinite; }
  .fmx-hero-copy > * { animation: fmx-rise 1s var(--ease) both; }
  .fmx-hero-copy > :nth-child(1) { animation-delay: .1s; }
  .fmx-hero-copy > :nth-child(2) { animation-delay: .22s; }
  .fmx-hero-copy > :nth-child(3) { animation-delay: .38s; }
  .fmx-hero-copy > :nth-child(4) { animation-delay: .52s; }
  .fmx-hero-visual { animation: fmx-arrive 1.6s var(--ease) .2s both; }
}
@keyframes scroll-drop { to { top: 110%; } }
@keyframes fmx-rise { from { opacity: 0; transform: translateY(28px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes fmx-arrive { from { opacity: 0; transform: scale(.86); filter: blur(14px); } to { opacity: 1; transform: none; filter: none; } }

/* The M: 24 thin layers stacked in depth make a real extrusion under CSS perspective. */
.m3d {
  position: relative; width: min(100%, 540px); aspect-ratio: 1 / 1; margin-inline: auto;
  display: grid; place-items: center; perspective: 1100px;
}
@media (max-width: 979px) { .m3d { width: min(84%, 420px); } }
.m3d-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.m3d-glow {
  position: absolute; inset: 6%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 124, 246, .6), rgba(46, 124, 246, .16) 55%, transparent);
  filter: blur(34px); opacity: var(--glow, .85);
}
.m3d-floor {
  position: absolute; bottom: 7%; width: 58%; height: 12%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(46, 124, 246, .38), transparent);
  filter: blur(14px);
}
.m3d-body {
  position: relative; width: 80%; aspect-ratio: 475.7 / 343.2;
  transform-style: preserve-3d; will-change: transform;
  transform: rotateX(14deg) rotateY(-26deg);
}
[dir="rtl"] .m3d-body { transform: rotateX(14deg) rotateY(26deg); }
.m3d-layer { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.m3d-layer:last-child { filter: drop-shadow(0 0 22px rgba(59, 134, 255, .55)); }
/* depth: generated, back (dark) to front (lit) */
.m3d-layer:nth-child(1) { transform: translateZ(-50.6px); fill: rgb(2, 16, 38); }
.m3d-layer:nth-child(2) { transform: translateZ(-48.4px); fill: rgb(2, 18, 42); }
.m3d-layer:nth-child(3) { transform: translateZ(-46.2px); fill: rgb(2, 20, 47); }
.m3d-layer:nth-child(4) { transform: translateZ(-44.0px); fill: rgb(2, 22, 51); }
.m3d-layer:nth-child(5) { transform: translateZ(-41.8px); fill: rgb(2, 23, 56); }
.m3d-layer:nth-child(6) { transform: translateZ(-39.6px); fill: rgb(2, 25, 60); }
.m3d-layer:nth-child(7) { transform: translateZ(-37.4px); fill: rgb(1, 27, 65); }
.m3d-layer:nth-child(8) { transform: translateZ(-35.2px); fill: rgb(1, 29, 69); }
.m3d-layer:nth-child(9) { transform: translateZ(-33.0px); fill: rgb(1, 31, 74); }
.m3d-layer:nth-child(10) { transform: translateZ(-30.8px); fill: rgb(1, 33, 78); }
.m3d-layer:nth-child(11) { transform: translateZ(-28.6px); fill: rgb(1, 35, 83); }
.m3d-layer:nth-child(12) { transform: translateZ(-26.4px); fill: rgb(1, 36, 87); }
.m3d-layer:nth-child(13) { transform: translateZ(-24.2px); fill: rgb(1, 38, 91); }
.m3d-layer:nth-child(14) { transform: translateZ(-22.0px); fill: rgb(1, 40, 96); }
.m3d-layer:nth-child(15) { transform: translateZ(-19.8px); fill: rgb(1, 42, 100); }
.m3d-layer:nth-child(16) { transform: translateZ(-17.6px); fill: rgb(1, 44, 105); }
.m3d-layer:nth-child(17) { transform: translateZ(-15.4px); fill: rgb(1, 46, 109); }
.m3d-layer:nth-child(18) { transform: translateZ(-13.2px); fill: rgb(0, 47, 114); }
.m3d-layer:nth-child(19) { transform: translateZ(-11.0px); fill: rgb(0, 49, 118); }
.m3d-layer:nth-child(20) { transform: translateZ(-8.8px); fill: rgb(0, 51, 122); }
.m3d-layer:nth-child(21) { transform: translateZ(-6.6px); fill: rgb(0, 53, 127); }
.m3d-layer:nth-child(22) { transform: translateZ(-4.4px); fill: rgb(0, 55, 131); }
.m3d-layer:nth-child(23) { transform: translateZ(-2.2px); fill: rgb(0, 56, 136); }
.m3d-layer:nth-child(24) { transform: translateZ(0px); fill: url(#fm-m-face); }

/* ---------- The moving band ---------- */

.fmx-band {
  position: relative; overflow: hidden; padding-block: 26px;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface), #071224 50%, var(--surface));
}
.fmx-band-track { display: flex; width: max-content; }
.fmx-band-list { display: flex; align-items: center; }
.fmx-band-list li {
  display: flex; align-items: center; gap: 44px; padding-inline-end: 44px;
  white-space: nowrap; font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 1rem + 3.2vw, 3.6rem); line-height: 1.2;
}
.fmx-band-list li span { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .42); }
.fmx-band-list li:nth-child(even) span { color: #fff; -webkit-text-stroke: 0; }
html[lang="ar"] .fmx-band-list li { letter-spacing: 0; }
html[lang="ar"] .fmx-band-list li span { -webkit-text-stroke: 0; color: rgba(255, 255, 255, .34); }
html[lang="ar"] .fmx-band-list li:nth-child(even) span { color: #fff; }
.fmx-band-m { width: clamp(30px, 3vw, 48px); height: auto; fill: var(--m-blue); filter: drop-shadow(0 0 10px var(--m-glow)); }
@media (prefers-reduced-motion: no-preference) {
  .fmx-band-track { animation: fmx-marquee 42s linear infinite; }
  [dir="rtl"] .fmx-band-track { animation-name: fmx-marquee-rtl; }
  .fmx-band:hover .fmx-band-track { animation-play-state: paused; }
}
@keyframes fmx-marquee { to { transform: translateX(-50%); } }
@keyframes fmx-marquee-rtl { to { transform: translateX(50%); } }

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

.fmx-section { position: relative; padding-block: clamp(84px, 11vw, 150px); }
.fmx-head { max-width: 48rem; margin-bottom: clamp(40px, 6vw, 72px); }
.fmx-h2 {
  font-size: clamp(2.3rem, 1.2rem + 3.6vw, 4.2rem); line-height: 1.04; letter-spacing: -.035em;
  color: #fff; font-weight: 600;
}
html[lang="ar"] .fmx-h2 { line-height: 1.3; letter-spacing: 0; }
.fmx-h2-wide { max-width: 20ch; margin-bottom: clamp(40px, 6vw, 72px); }
.fmx-sub { margin-top: 18px; color: var(--muted); font-size: clamp(1.1rem, 1rem + .3vw, 1.25rem); max-width: 40rem; }

/* Glass cards with a light that follows the pointer (adapted from the spotlight-card pattern on 21st.dev). */
.fmx-cards { display: grid; gap: 16px; }
@media (min-width: 900px) { .fmx-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fmx-card, .fmx-who-item, .fmx-rafid {
  position: relative; overflow: hidden; isolation: isolate;
  transition: border-color .35s ease, translate .35s var(--ease);
}
.fmx-card, .fmx-who-item {
  padding: clamp(26px, 3vw, 40px); border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
  border: 1px solid var(--line);
}
[data-spot]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(460px circle at var(--mx, 50%) var(--my, -20%), rgba(46, 124, 246, .2), transparent 45%);
  opacity: 0; transition: opacity .35s ease;
}
[data-spot]:hover::before { opacity: 1; }
.fmx-card:hover, .fmx-who-item:hover { border-color: rgba(106, 165, 255, .38); translate: 0 -4px; }
.fmx-card-icon {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px;
  background: rgba(31, 111, 235, .14); border: 1px solid rgba(106, 165, 255, .28);
  color: #8fbaff; box-shadow: 0 0 34px -8px rgba(46, 124, 246, .7);
}
.fmx-card-icon .icon { width: 26px; height: 26px; }
.fmx-card h3, .fmx-who-item h3 { margin-top: 24px; font-size: 1.32rem; color: #fff; }
.fmx-card p, .fmx-who-item p { margin-top: 10px; color: var(--muted); }

/* Products */
.fmx-products { background: radial-gradient(60% 50% at 0% 40%, rgba(28, 152, 174, .1), transparent 70%); }
.fmx-product-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .fmx-product-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .fmx-rafid { grid-row: span 2; }
}
.fmx-rafid {
  display: flex; flex-direction: column; gap: 22px;
  padding: clamp(28px, 3.4vw, 48px); border-radius: 26px;
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(28, 152, 174, .3), transparent 60%),
    linear-gradient(180deg, #0d1a23, #061015);
  border: 1px solid rgba(28, 152, 174, .38);
}
[dir="rtl"] .fmx-rafid {
  background:
    radial-gradient(110% 80% at 0% 0%, rgba(28, 152, 174, .3), transparent 60%),
    linear-gradient(180deg, #0d1a23, #061015);
}
.fmx-rafid[data-spot]::before { background: radial-gradient(460px circle at var(--mx, 50%) var(--my, -20%), rgba(28, 152, 174, .24), transparent 45%); }
.fmx-rafid:hover { border-color: rgba(28, 152, 174, .7); }
.fmx-rafid-top { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.fmx-rafid-logo img { width: clamp(140px, 14vw, 180px); height: auto; }
.fmx-rafid-text { color: #c8d5de; font-size: 1.1rem; max-width: 34rem; }
.fmx-rafid .checks .icon { color: #1c98ae; }
.fmx-rafid .checks li { color: #dbe5ec; }
.fmx-rafid .product-actions { margin-top: auto; }

.fmx-soon {
  position: relative; overflow: hidden;
  padding: clamp(26px, 3vw, 38px); border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .02);
}
.fmx-soon h3 { margin-top: 14px; font-size: 1.6rem; color: #fff; }
.fmx-soon p:last-child { margin-top: 10px; color: var(--muted); }
.fmx-soon-state {
  display: inline-flex; padding: 4px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18); color: #c3cdd8; font-size: .85rem; font-weight: 500;
}
.fmx-soon::after {
  content: ""; position: absolute; inset-block: 0; width: 40%; inset-inline-start: -40%;
  background: linear-gradient(90deg, transparent, rgba(106, 165, 255, .07), transparent);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .fmx-soon::after { animation: soon-scan 5s ease-in-out infinite; }
  .fmx-soon + .fmx-soon::after { animation-delay: 2.5s; }
}
@keyframes soon-scan { 0% { inset-inline-start: -40%; } 60%, 100% { inset-inline-start: 110%; } }

/* Who */
.fmx-who-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .fmx-who-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fmx-who-item h3 { font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); }
.fmx-who-item p { font-size: 1.08rem; }

/* How we build */
.fmx-approach { border-top: 1px solid var(--line); }
.fmx-split { display: grid; gap: 40px 72px; }
@media (min-width: 900px) {
  .fmx-split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .fmx-sticky { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; margin-bottom: 0; }
}
.fmx-principles li {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px;
  padding-block: 28px; border-top: 1px solid var(--line);
  transition: border-color .3s ease;
}
.fmx-principles li:last-child { border-bottom: 1px solid var(--line); }
.fmx-principles li:hover { border-top-color: rgba(106, 165, 255, .55); }
.fmx-principles .icon { width: 28px; height: 28px; color: #8fbaff; margin-top: .15em; }
.fmx-principles h3 { font-size: 1.25rem; color: #fff; }
.fmx-principles p { margin-top: 6px; color: var(--muted); }
