/* =========================================================
   FAM Tech — Design System
   Tokens · Motion · Layout · Components
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --navy:        #143146;
  --navy-dark:   #0E2436;
  --navy-deep:   #081a2a;
  --teal:        #4FC3B0;
  --teal-strong: #2FA897;
  --teal-soft:   #DCF1ED;
  --offwhite:    #F7F8FA;
  --paper:       #FFFFFF;
  --ink:         #1F1F1F;
  --muted:       #6B6B6B;
  --hairline:    rgba(20, 49, 70, 0.08);
  --hairline-2:  rgba(20, 49, 70, 0.16);
  --hairline-on-dark: rgba(255,255,255,0.10);
  --hairline-on-dark-2: rgba(255,255,255,0.18);

  /* Type */
  --font-sans:    "Open Sans", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Montserrat", "Open Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-ar:      "IBM Plex Sans Arabic", "Open Sans", system-ui, sans-serif;

  /* Scale (rem) */
  --t-3xs: 0.75rem;
  --t-2xs: 0.875rem;
  --t-xs:  1rem;
  --t-sm:  1.125rem;
  --t-md:  1.5rem;
  --t-lg:  2rem;
  --t-xl:  3rem;
  --t-2xl: 4.5rem;
  --t-3xl: 6rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 240ms;
  --dur-base: 480ms;
  --dur-slow: 720ms;

  /* Surface */
  --shadow-card: 0 24px 48px -24px rgba(20,49,70,0.18);
  --radius: 6px;

  /* Layout */
  --container: 1240px;
  --gutter: clamp(24px, 5vw, 64px);
  --section-y: clamp(80px, 9vw, 140px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto !important; }
}

/* ---------- Theme: light (default) + dark ---------- */
/* Semantic theme tokens — every component reads from these.
   Light mode is the default; .dark-theme on <html> flips them. */
:root {
  /* Surfaces */
  --bg:           #FFFFFF;            /* page background */
  --bg-soft:      #F4F6F9;            /* alt section background */
  --surface:      #FFFFFF;            /* cards */
  --surface-2:    #F7F8FA;            /* nested cards / fills */
  --nav-bg:       rgba(255,255,255,0.85);
  --nav-bg-solid: #FFFFFF;
  --footer-bg:    #0E2436;            /* footer always navy for brand anchor */
  --hero-bg:      linear-gradient(180deg,#0E2436 0%, #143146 100%);

  /* Ink */
  --text:         #0E2436;            /* primary text */
  --text-muted:   #6B6B6B;
  --text-soft:    #8A95A1;

  /* Lines / borders */
  --border:       rgba(20,49,70,0.10);
  --border-2:     rgba(20,49,70,0.18);

  /* Accents */
  --accent:       #4FC3B0;
  --accent-strong:#2FA897;
  --accent-soft:  #DCF1ED;
  --brand-blue:   #1E5AC8;
  --brand-blue-dark:#1A4FB3;

  /* Form */
  --input-bg:     #FFFFFF;
  --input-border: rgba(20,49,70,0.20);

  /* Shadow */
  --shadow-card:  0 24px 48px -24px rgba(20,49,70,0.18);

  /* Legacy aliases — kept so existing rules keep working */
  --paper: var(--bg);
  --offwhite: var(--bg-soft);
  --ink: var(--text);
  --muted: var(--text-muted);
  --hairline: var(--border);
  --hairline-2: var(--border-2);
  --surface-card: var(--surface);
  --teal: var(--accent);
  --teal-strong: var(--accent-strong);
  --teal-soft: var(--accent-soft);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

html.dark-theme { /* dark theme disabled — kept as no-op so any stale class does nothing */ }

/* Smooth color transitions when toggling */
html, body, .site-header, .site-footer, .card-frame, .doc-card, .info-card,
.stats, .filter-chip, .project-card, .sector-card, .brand-chip, .pill,
.btn, .specs, input, textarea, select {
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}

/* Apply tokens broadly to common surfaces */
body { background: var(--bg); color: var(--text); }
.section--alt, .stats { background: var(--bg-soft); }
.card-frame, .doc-card, .info-card, .specs {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.filter-chip { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.filter-chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Header */
.site-header:not(.on-dark) { background: var(--nav-bg); border-bottom-color: var(--border); backdrop-filter: blur(14px); }
.site-header:not(.on-dark) .logo-name,
.site-header:not(.on-dark) nav.primary a,
.site-header:not(.on-dark) .icon-btn,
.site-header:not(.on-dark) .lang-switch { color: var(--text); }
.site-header:not(.on-dark) .icon-btn,
.site-header:not(.on-dark) .lang-switch { border-color: var(--border-2); }

/* Headings inherit */
h1, h2, h3, h4, h5, h6, .display { color: var(--text); }
.muted, .specs .k, .stats .label, .who, .year, .doc-card .meta .sub { color: var(--text-muted); }

/* Form inputs */
.field input, .field textarea, .field select,
input[type="text"], input[type="email"], input[type="tel"], textarea {
  background: var(--input-bg); color: var(--text); border-color: var(--input-border);
}
.field label { color: var(--text-muted); }

/* Project card body content */
.project-card { background: var(--surface); border: 1px solid var(--border); }
.project-card h3 { color: var(--text); }

/* CTA / hero / principle bands stay branded navy in BOTH modes — anchor */
.principle-band, .cta-band, .hero { background: var(--hero-bg); color: #fff; }
.principle-band h2, .cta-band h2, .hero h1 { color: #fff; }

/* Footer always brand-dark */
.site-footer { background: var(--footer-bg); }

/* Selection */
::selection { background: var(--accent); color: #0E2436; }

/* Brand chip dark vs light */
.brand-chip { background: var(--surface); color: var(--text); border-color: var(--border-2); }

/* Sector card overlay legibility */
html.dark-theme .sector-card .label { color: #fff; }

/* Logo image styling */
.logo-img { display:inline-flex; align-items:center; justify-content:center; width:56px; height:56px; vertical-align:middle; }
.logo-img img { width:100%; height:100%; object-fit:contain; border-radius:10px; display:block; }
.site-header .logo { display:inline-flex; align-items:center; height:100%; }
.site-header .logo .logo-img { width:60px; height:60px; }
.site-header.on-dark .logo-img img,
html.dark-theme .site-header .logo-img img { background: transparent; }

/* Softer, modern aesthetic — gentle radius across components */
.card-frame, .doc-card, .info-card, .filter-chip, .pill, .btn,
.project-card, .sector-card, .brand-chip, .specs, .stats { border-radius: var(--radius); }
.btn { border-radius: 999px; padding: 14px 26px; font-weight: 600; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; border: 0; }
/* Prevent any 1px top-edge artifact above hero on dark pages */
body::before { content: none; }
html {
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "ss01", "cv11";
}
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[lang="ar"], [lang="ar"] body { font-family: var(--font-ar); }

/* Heading + subheading typography — Montserrat */
h1, h2, h3, h4, h5, h6,
.display, .display-xs, .display-sm, .display-lg, .display-xl,
.section-heading h2, .section-heading h3,
.hero h1, .hero h2,
.cta-band h2, .cta-band h3,
.principle h3, .step h3, .sector-card .label .name,
.project-card h3, .doc-card .meta .ttl,
.foot-col h4 {
  font-family: var(--font-display);
  font-weight: 700; /* Subheadings — Montserrat Bold */
  letter-spacing: -0.01em;
}
.hero h1, .display, .display-xl, .display-lg,
.section-heading h2 {
  font-weight: 800; /* Headings — Montserrat ExtraBold */
  letter-spacing: -0.02em;
}
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4,
[lang="ar"] .display, [lang="ar"] .hero h1 {
  font-family: var(--font-ar);
  letter-spacing: 0;
}
[dir="rtl"] { direction: rtl; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: var(--teal); color: var(--navy-dark); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow .num { color: var(--teal-strong); opacity: 0.7; }
.eyebrow.on-dark { color: var(--teal); }
.mono { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.display {
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  padding-bottom: 0.08em;
}
h1.display, .h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 600; }
h2.display, .h2 { font-size: clamp(1.875rem, 3.6vw, 3rem); font-weight: 500; }
h3.display, .h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 500; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 65ch; line-height: 1.6; }
.body { max-width: 65ch; line-height: 1.7; color: var(--ink); }
.body p + p { margin-top: 1em; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(56px, 6vw, 96px); }
.grid { display: grid; gap: 24px; }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: var(--stack, 16px); }
.divider {
  height: 1px; background: var(--hairline); border: 0; margin: 0;
}

/* Section heading component */
.section-heading { display: grid; gap: 18px; max-width: 80ch; }
.section-heading .rule {
  width: 40px; height: 1px; background: var(--teal); display: block;
}
.section-heading .lead { margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn .arrow { transition: transform var(--dur-fast) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .btn:hover .arrow { transform: translateX(-3px); }
.btn-primary { background: var(--teal); color: var(--navy-dark); }
.btn-primary:hover { background: var(--teal-soft); color: var(--navy-dark); }
.btn-outline { border-color: rgba(255,255,255,0.4); color: white; }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-outline-dark { border-color: var(--hairline-2); color: var(--ink); }
.btn-outline-dark:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { color: var(--navy); }
.btn-ghost:hover { color: var(--teal-strong); }
.btn-sm { padding: 10px 16px; font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.0);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), backdrop-filter var(--dur-fast) var(--ease);
}
.site-header.is-scrolled {
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--hairline);
}
.site-header.on-dark { color: white; }
.site-header.on-dark.is-scrolled {
  background: rgba(8, 26, 42, 0.72);
  border-bottom-color: var(--hairline-on-dark);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.site-header .logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.06em;
  font-size: 0.85rem;
}
.site-header .logo-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  position: relative;
}
.site-header .logo-mark svg { width: 22px; height: 22px; }
.site-header .logo-name {
  font-family: var(--font-sans); font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em;
}
.site-header nav.primary {
  display: flex; gap: 30px; align-items: center;
}
.site-header nav.primary a {
  position: relative; font-size: 0.92rem; padding: 8px 0;
  display: inline-flex; gap: 8px; align-items: baseline;
  transition: color var(--dur-fast) var(--ease);
}
.site-header nav.primary a .idx {
  font-family: var(--font-mono); font-size: 0.7rem; opacity: 0.5;
}
.site-header nav.primary a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--teal);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-fast) var(--ease);
}
[dir="rtl"] .site-header nav.primary a::after { transform-origin: right center; }
.site-header nav.primary a:hover::after,
.site-header nav.primary a.is-active::after { transform: scaleX(1); }
.site-header nav.primary a.is-active { color: var(--teal); }
.site-header .actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--hairline-2); border-radius: 4px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.on-dark .icon-btn { border-color: var(--hairline-on-dark-2); }
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn svg { width: 16px; height: 16px; }
.lang-switch {
  font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.12em; padding: 9px 12px;
  border: 1px solid var(--hairline-2); border-radius: 4px;
}
.on-dark .lang-switch { border-color: var(--hairline-on-dark-2); }
.lang-switch:hover { border-color: var(--teal); color: var(--teal); }

.hamburger { display: none; }
@media (max-width: 1024px) {
  .site-header nav.primary { display: none; }
  .hamburger { display: grid; }
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 80;
  display: none;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer .scrim {
  position: absolute; inset: 0;
  background: rgba(8,26,42,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mobile-drawer .panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 86vw);
  background: var(--navy-dark); color: white;
  padding: 28px 28px 40px;
  display: flex; flex-direction: column; gap: 18px;
}
[dir="rtl"] .mobile-drawer .panel { right: auto; left: 0; }
.mobile-drawer nav a {
  font-size: 1.4rem; font-weight: 500; letter-spacing: -0.01em;
  padding: 10px 0;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--hairline-on-dark);
}
.mobile-drawer nav a .idx { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.6; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: white; background: linear-gradient(180deg, var(--navy-dark), var(--navy));
  padding-block: clamp(110px, 14vw, 200px);
  margin-top: -77px; padding-top: calc(clamp(110px, 14vw, 200px) + 77px);
}
.hero::before {
  content: ""; position: absolute; inset: 1px 0 0 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 50%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.06; mix-blend-mode: overlay;
}
.hero .container { position: relative; z-index: 2; }
.hero-grid { display: grid; gap: 56px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1024px) { .hero-grid.has-art { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 80px; } }

.breadcrumb {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.7; display: inline-flex; gap: 10px; align-items: center;
  margin-bottom: 28px;
}
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { opacity: 0.5; }

.hero h1 { margin: 18px 0 22px; }
.hero p.lead { color: rgba(255,255,255,0.7); }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* Hero meta-row at bottom of hero */
.hero-meta {
  margin-top: clamp(48px, 7vw, 96px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; padding-top: 24px;
  border-top: 1px solid var(--hairline-on-dark);
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.7);
}
.hero-meta strong { display: block; color: white; font-weight: 500; font-size: 0.8rem; margin-top: 4px; }
@media (max-width: 720px) { .hero-meta { grid-template-columns: repeat(2, 1fr); } }

/* Preview banner */
.preview-banner {
  background: var(--teal-soft); color: var(--navy-dark);
  padding: 10px 16px; text-align: center;
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(20,49,70,0.06);
}
.preview-banner strong { color: var(--teal-strong); margin-right: 10px; }

/* ---------- Stats bar ---------- */
.stats {
  background: var(--offwhite);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stats-grid > div {
  padding: 40px 28px;
  border-right: 1px solid var(--hairline);
  display: grid; gap: 4px;
}
[dir="rtl"] .stats-grid > div { border-right: 0; border-left: 1px solid var(--hairline); }
.stats-grid > div:last-child { border-right: 0; }
[dir="rtl"] .stats-grid > div:last-child { border-left: 0; }
.stats .num {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 600; letter-spacing: -0.02em; color: var(--navy-dark); line-height: 1;
}
.stats .num .suffix { color: var(--teal); }
.stats .label {
  font-family: var(--font-mono); font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 8px;
}
@media (max-width: 720px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid > div { border-right: 0; border-bottom: 1px solid var(--hairline); }
  .stats-grid > div:nth-child(odd) { border-right: 1px solid var(--hairline); }
}

/* ---------- Cards ---------- */
.card-frame {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  display: grid; gap: 16px;
}
.card-frame .idx {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em;
  color: var(--muted);
}
[dir="rtl"] .card-frame .idx { right: auto; left: 22px; }
.card-frame .glyph {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  background: var(--offwhite);
  color: var(--navy);
}
.card-frame .glyph svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card-frame h3 {
  font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; margin: 4px 0 0; color: var(--navy-dark);
}
.card-frame p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.card-frame .more {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 0.85rem; color: var(--navy);
  margin-top: 8px;
  position: relative; padding-bottom: 2px;
}
.card-frame .more::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: var(--teal); transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
[dir="rtl"] .card-frame .more::after { transform-origin: right; }
@media (hover: hover) {
  .card-frame:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card);
    border-color: var(--hairline-2);
  }
  .card-frame:hover .more::after { transform: scaleX(1); }
}

/* Service category label inside card */
.cat {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--teal-strong);
}

/* ---------- Sector card (image-led) ---------- */
.sector-card {
  position: relative; display: block;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden; background: var(--navy-dark);
  aspect-ratio: 4/5;
  transition: transform var(--dur-fast) var(--ease);
}
.sector-card .cover { position: absolute; inset: 0; }
.sector-card .cover svg { width: 100%; height: 100%; display: block; }
.sector-card .label {
  position: absolute; left: 24px; right: 24px; bottom: 22px;
  display: flex; align-items: end; justify-content: space-between;
  color: white;
}
.sector-card .label .name { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.01em; }
.sector-card .label .meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; opacity: 0.8; text-transform: uppercase; }
.sector-card .hairline {
  position: absolute; left: 24px; right: 24px; bottom: 14px;
  height: 1px; background: var(--teal);
  transition: height var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  .sector-card:hover .cover { transform: scale(1.04); }
  .sector-card:hover .hairline { height: 2px; }
  .sector-card .cover { transition: transform 720ms var(--ease); }
}

/* ---------- Project card (generative cover) ---------- */
.project-card {
  display: grid; gap: 14px; color: var(--ink);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.project-card:hover { box-shadow: 0 24px 48px -24px rgba(20,49,70,0.18); border-color: var(--accent); }
.project-card .cover {
  position: relative; aspect-ratio: 4/3;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--navy-dark);
}
.project-card .cover .gradient { position: absolute; inset: 0; }
.project-card .cover .grain {
  position: absolute; inset: 0; opacity: 0.10; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.project-card .cover .initial {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: clamp(5rem, 12vw, 9rem);
  color: rgba(255,255,255,0.30);
  font-weight: 500;
  letter-spacing: -0.05em;
  pointer-events: none;
}
.project-card .cover .frame {
  position: absolute; inset: 14px;
  border: 1px solid rgba(79,195,176,0.4);
  border-radius: 2px;
  pointer-events: none;
}
.project-card .cover .corner {
  position: absolute; width: 8px; height: 8px;
  border: 1px solid var(--teal);
}
.project-card .cover .corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.project-card .cover .corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.project-card .cover .corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.project-card .cover .corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.project-card .meta-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 10px;
  background: var(--navy-dark); color: white;
  border: 1px solid var(--teal);
  border-radius: 999px;
}
.pill.light { background: var(--teal-soft); color: var(--navy-dark); border-color: rgba(20,49,70,0.2); }
.year { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.project-card h3 { margin: 0; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; color: var(--navy-dark); }
.project-card .who { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }

@media (hover: hover) {
  .project-card:hover { transform: translateY(-6px); }
  .project-card:hover h3 { color: var(--teal-strong); }
}

/* ---------- Brand chip ---------- */
.brand-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
  border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden;
}
.brand-chip {
  padding: 28px 18px;
  display: grid; place-items: center;
  background: var(--paper);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--navy-dark);
  filter: grayscale(1); opacity: 0.85;
  transition: filter var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  text-align: center; min-height: 96px;
}
.brand-chip:hover { filter: none; opacity: 1; background: var(--offwhite); color: var(--teal-strong); }
.brand-grid > .brand-chip:nth-child(6n) { border-right: 0; }
.brand-grid > .brand-chip:nth-last-child(-n+6) { border-bottom: 0; }
@media (max-width: 900px) {
  .brand-grid { grid-template-columns: repeat(3, 1fr); }
  .brand-grid > .brand-chip:nth-child(6n) { border-right: 1px solid var(--hairline); }
  .brand-grid > .brand-chip:nth-child(3n) { border-right: 0; }
  .brand-grid > .brand-chip:nth-last-child(-n+6) { border-bottom: 1px solid var(--hairline); }
  .brand-grid > .brand-chip:nth-last-child(-n+3) { border-bottom: 0; }
}

/* ---------- Filter chip row ---------- */
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.filter-chip {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--hairline-2); border-radius: 999px;
  background: white; color: var(--navy-dark);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--teal); color: var(--teal-strong); }
.filter-chip[aria-pressed="true"] { background: var(--navy-dark); color: white; border-color: var(--navy-dark); }
.filter-row .label-leading {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-right: 8px;
}

/* ---------- Service grid ---------- */
.service-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 1024px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .service-grid { grid-template-columns: 1fr; } }

.sector-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .sector-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .sector-grid { grid-template-columns: 1fr; } }

.proj-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1024px) { .proj-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .proj-grid-4 { grid-template-columns: 1fr; } }

/* ---------- Bento (projects overview) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 280px;
  gap: 18px;
}
.bento .project-card .cover { aspect-ratio: auto; height: 100%; }
.bento .project-card { display: grid; grid-template-rows: 1fr auto; gap: 14px; }
.bento .span-2 { grid-column: span 2; }
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .bento .span-2 { grid-column: span 2; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .bento .span-2 { grid-column: span 1; }
}

/* ---------- Why FAM Tech (dark cards) ---------- */
.principle-band {
  background: linear-gradient(180deg, var(--navy-dark), var(--navy-deep));
  color: white;
  position: relative; overflow: hidden;
}
.principle-band::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 30%, transparent 100%);
  pointer-events: none;
}
.principle-band .container { position: relative; z-index: 2; }
.principle-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 56px; }
.principle {
  padding: 32px 28px;
  border: 1px solid var(--hairline-on-dark);
  margin-left: -1px; margin-bottom: -1px;
  display: grid; gap: 14px;
}
.principle .num { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.18em; color: var(--teal); }
.principle h3 { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.principle p { color: rgba(255,255,255,0.7); margin: 0; font-size: 0.95rem; }
@media (max-width: 900px) { .principle-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .principle-grid { grid-template-columns: 1fr; } }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(180deg, var(--navy-dark), var(--navy));
  color: white; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 40%, transparent 100%);
}
.cta-band .container {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding-block: clamp(56px, 7vw, 100px);
  flex-wrap: wrap;
}
.cta-band h2 { margin: 0; max-width: 22ch; }
.cta-band .lead { color: rgba(255,255,255,0.7); margin-top: 14px; }

/* ---------- Process steps ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 48px; }
.step {
  padding: 28px; border: 1px solid var(--hairline);
  margin-left: -1px; margin-bottom: -1px;
  background: var(--paper);
  display: grid; gap: 8px;
  position: relative;
}
.step .step-num { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.18em; color: var(--teal-strong); }
.step h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.01em; margin: 6px 0 0; color: var(--navy-dark); }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }
@media (max-width: 900px) { .process { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: white; padding-block: 80px 30px;
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}
.site-footer .container { position: relative; z-index: 2; }
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px;
  border-bottom: 1px solid var(--hairline-on-dark);
  padding-bottom: 48px;
}
@media (max-width: 1000px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-col h4 {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--teal); margin: 0 0 18px;
}
.foot-col a { display: block; padding: 4px 0; color: rgba(255,255,255,0.78); transition: color var(--dur-fast) var(--ease); font-size: 0.92rem; }
.foot-col a:hover { color: var(--teal); }
.foot-brand .name { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.foot-brand .desc { color: rgba(255,255,255,0.6); font-size: 0.9rem; max-width: 32ch; }
.foot-bottom {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 24px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(255,255,255,0.55);
}
.vision-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 12px; border: 1px solid var(--hairline-on-dark-2); border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: white;
}
.vision-badge .dot { width: 8px; height: 8px; background: var(--teal); border-radius: 999px; }

/* ---------- WhatsApp FAB ---------- */
:root {
  --brand-blue: #1E5AC8;
  --brand-blue-dark: #1A4FB3;
}

.wa-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  width: 56px; height: 56px; border-radius: 999px;
  background: var(--brand-blue);
  border: 1px solid var(--brand-blue-dark);
  color: white;
  display: grid; place-items: center;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  box-shadow: 0 12px 32px rgba(30,90,200,0.42);
}
[dir="rtl"] .wa-fab { right: auto; left: 24px; }
.wa-fab:hover { transform: scale(1.06); background: var(--brand-blue-dark); box-shadow: 0 16px 38px rgba(30,90,200,0.55); }
.wa-fab svg { width: 26px; height: 26px; }

/* Toast */
/* Footer logo — same treatment as header logo */
.site-footer .footer-logo { display: inline-flex; align-items: center; height: auto; margin-bottom: 20px; }
.site-footer .footer-logo .logo-img { width: 96px; height: auto; }
.site-footer .footer-logo .logo-img img { width: 100%; height: auto; object-fit: contain; border-radius: 0; background: transparent; display: block; }

/* Ensure white text on dark brand sections */
.principle-band, .principle-band h2, .principle-band h3, .principle-band p, .principle-band .display,
.cta-band, .cta-band h2, .cta-band h3, .cta-band p, .cta-band .display, .cta-band .lead,
.hero, .hero h1, .hero h2, .hero p, .hero .display, .hero .lead,
.site-footer, .site-footer h4, .site-footer a, .site-footer p, .site-footer span {
  color: #fff;
}
.principle-band p, .cta-band p, .hero p, .hero .lead, .cta-band .lead { color: rgba(255,255,255,0.78); }
.site-footer .desc { color: rgba(255,255,255,0.72); }
.site-footer h4 { color: var(--accent); }
.site-footer a { opacity: 0.82; }
.site-footer a:hover { opacity: 1; color: var(--accent); }
.principle .num { color: var(--accent); }
.principle h3 { color: #fff; }
.principle p { color: rgba(255,255,255,0.78); }
.principle-band .step h3, .cta-band .step h3, .hero .step h3 { color: #fff; }
.principle-band .step p, .cta-band .step p, .hero .step p { color: rgba(255,255,255,0.78); }
/* Belt-and-braces: enforce white text on every dark band, regardless of inline styles */
.principle-band, .principle-band *, .cta-band, .cta-band *, .hero, .hero * { color: #fff; }
.principle-band .eyebrow, .cta-band .eyebrow, .hero .eyebrow { color: var(--accent); }
.principle-band .num, .cta-band .num, .hero .num { color: var(--accent); }
.principle-band p, .cta-band p, .hero p, .hero .lead, .cta-band .lead { color: rgba(255,255,255,0.78); }
/* Any explicitly dark-coded surface keeps text light */
[style*="background:rgba(8,26,42"], [style*="background:#0E2436"], [style*="background:#143146"],
[style*="background:var(--navy"], .on-dark, .on-dark * { color: #fff; }
[style*="background:rgba(8,26,42"] a, [style*="background:#0E2436"] a, [style*="background:#143146"] a { color: #fff; }
.principle h3, .principle .num { color: #fff; }
.principle-band .step h3, .cta-band .step h3, .hero .step h3 { color: #fff; }
.cta-band .btn-primary, .principle-band .btn-primary { color: var(--navy-dark); }
.principle-band a:not(.btn), .cta-band a:not(.btn), .hero a:not(.btn) { color: var(--accent); }
.btn-primary, .btn-primary * { color: var(--navy-dark); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(100px);
  background: var(--navy-dark); color: white; padding: 12px 18px;
  border: 1px solid var(--teal); border-radius: 4px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em;
  z-index: 100; opacity: 0;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
  max-width: 90vw;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---------- Form ---------- */
.field { position: relative; padding-top: 18px; }
.field input, .field textarea {
  width: 100%; padding: 14px 0 12px;
  background: transparent; border: 0; border-bottom: 1px solid var(--hairline-2);
  font: inherit; color: var(--ink); outline: none;
  border-radius: 0;
  transition: border-color var(--dur-fast) var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field label {
  position: absolute; left: 0; top: 30px;
  font-size: 1rem; color: var(--muted);
  pointer-events: none;
  transition: transform var(--dur-fast) var(--ease), font-size var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  transform-origin: left center;
}
[dir="rtl"] .field label { left: auto; right: 0; transform-origin: right center; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--teal); }
.field input:focus + label,
.field textarea:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-22px) scale(0.78);
  color: var(--teal-strong);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.is-visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.is-visible > *:nth-child(8) { transition-delay: 560ms; }
.reveal-stagger.is-visible > *:nth-child(n+9) { transition-delay: 640ms; }

/* Hero text reveal */
.hero h1 { line-height: 1.14; padding-bottom: 0.12em; }
.hero h1 .word { display: inline-block; overflow: hidden; padding-bottom: 0.18em; margin-bottom: -0.18em; vertical-align: top; }
.hero h1 .word > span {
  display: inline-block; transform: translateY(120%); opacity: 0;
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
}
.hero.is-revealed h1 .word > span { transform: translateY(0); opacity: 1; }
.hero h1 .word > span { transition-delay: var(--d, 0ms); }
/* Arabic: words have no inner spans; animate .word itself, no clipping */
[dir="rtl"] .hero h1 { line-height: 1.4; padding-bottom: 0; }
[dir="rtl"] .hero h1 .word {
  overflow: visible; padding-bottom: 0; margin-bottom: 0;
  transform: translateY(20%); opacity: 0;
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
  transition-delay: var(--d, 0ms);
}
[dir="rtl"] .hero.is-revealed h1 .word { transform: translateY(0); opacity: 1; }
.hero .sub-reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease) 200ms, transform 600ms var(--ease) 200ms; }
.hero.is-revealed .sub-reveal { opacity: 1; transform: translateY(0); }
.hero .cta-row.sub-reveal { transition-delay: 320ms; }

/* ---------- Specs table ---------- */
.specs {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.specs .row {
  display: grid; grid-template-columns: 200px 1fr; gap: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 14px 18px;
  align-items: baseline;
}
.specs .row:last-child { border-bottom: 0; }
.specs .k {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.specs .v { color: var(--ink); }

/* ---------- Sidebar info card ---------- */
.info-card {
  background: var(--offwhite);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
}
.info-card h4 {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--teal-strong); margin: 0 0 14px;
}
.info-card dl { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; }
.info-card dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.info-card dd { margin: 0 0 8px; color: var(--navy-dark); font-weight: 500; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8,26,42,0.92);
  display: none; align-items: center; justify-content: center;
  padding: 60px;
}
.lightbox.is-open { display: flex; }
.lightbox .frame {
  position: relative; max-width: min(1100px, 95vw); max-height: 85vh;
  width: 100%; height: 100%;
  border: 1px solid var(--hairline-on-dark-2);
  background: var(--navy-dark);
  border-radius: 4px;
  overflow: hidden;
}
.lightbox .frame > * { width: 100%; height: 100%; }
.lightbox .close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 4px;
  border: 1px solid var(--hairline-on-dark-2);
  color: white; display: grid; place-items: center;
}
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  border-radius: 999px; border: 1px solid var(--teal); color: white; display: grid; place-items: center; background: rgba(20,49,70,0.5); }
.lightbox .nav.prev { left: 12px; }
.lightbox .nav.next { right: 12px; }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery .tile {
  aspect-ratio: 1/1; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--hairline); cursor: zoom-in;
  position: relative; background: var(--navy-dark);
  clip-path: inset(0 0 100% 0);
  animation: clipReveal 800ms var(--ease) forwards;
}
.gallery .tile.is-revealed { clip-path: inset(0); }
.gallery .tile:nth-child(2n+1) { aspect-ratio: 4/3; }
.gallery .tile:nth-child(5) { grid-column: span 2; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery .tile:nth-child(5) { grid-column: span 1; }
}

/* ---------- Section number marker ---------- */
.section-num {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); display: inline-flex; gap: 12px; align-items: center;
}
.section-num::before { content: ""; width: 26px; height: 1px; background: var(--teal); }

/* ---------- Theme toggle (visual) ---------- */
.theme-toggle path { transition: d var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease); }

/* ---------- Misc ---------- */
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-row .tag {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em;
  padding: 5px 10px; border: 1px solid var(--hairline-2); border-radius: 999px;
  text-transform: uppercase; color: var(--navy-dark);
}

/* Two-column body layout */
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 56px; align-items: start; }
@media (max-width: 1024px) { .two-col { grid-template-columns: 1fr; gap: 32px; } }
.two-col aside.sticky { position: sticky; top: 100px; }

/* Document download card */
.doc-card {
  background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 28px; display: flex; gap: 24px; align-items: center;
  transition: box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.doc-card:hover { box-shadow: var(--shadow-card); border-color: var(--hairline-2); }
.doc-card .icon {
  width: 56px; height: 70px;
  border: 1px solid var(--hairline-2); border-radius: 4px;
  display: grid; place-items: center; color: var(--navy);
  flex-shrink: 0;
}
.doc-card .meta { flex: 1; min-width: 0; }
.doc-card .meta .ttl { font-size: 1.1rem; font-weight: 500; color: var(--navy-dark); margin: 0; }
.doc-card .meta .sub { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.12em; color: var(--muted); margin-top: 4px; }

/* duotone treatment used on placeholders */
.duotone {
  background:
    linear-gradient(135deg, rgba(20,49,70,0.92), rgba(79,195,176,0.6)),
    linear-gradient(45deg, var(--navy-dark), var(--navy));
  background-blend-mode: multiply, normal;
  position: relative; overflow: hidden;
}
.duotone::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.5' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  mix-blend-mode: overlay; opacity: 0.25;
}

/* === HERO V2 (scroll-driven) === */
.hero-stage { position: relative; height: 200vh; }
.hero-stage > .hero {
  position: sticky; top: 0; height: 100vh;
  padding-block: 0;
  margin-top: -77px; padding-top: 77px;
  overflow: hidden; isolation: isolate;
}
.hero-stage > .hero::before,
.hero-stage > .hero::after { display: none; }
.hero-bg-layer { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hero-bg-layer .hero-bg {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 600ms var(--ease);
  will-change: opacity, transform;
}
.hero-bg-layer .hero-bg[data-stage="0"] { opacity: 1; }
.hero-bg-layer .hero-bg img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transform: scale(1);
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px) 32px 32px / 64px 64px,
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px) 32px 32px / 64px 64px,
    linear-gradient(180deg, rgba(14,36,54,.88) 0%, rgba(14,36,54,.65) 40%, rgba(14,36,54,.55) 100%);
}
.hero-content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(180px, 20vw, 260px);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.hero-content .hero-grid { align-items: center; }
.hero-content .hero-grid > div:last-child { will-change: transform; }
.hero-stage h1.display { will-change: transform, opacity; }
.hero-stage .hero-meta { margin-top: clamp(32px, 5vw, 64px); }

/* hero-next lifts over pinned hero */
.hero-next {
  position: relative; z-index: 3;
  border-top-left-radius: 24px; border-top-right-radius: 24px;
  box-shadow: 0 -24px 48px -24px rgba(0,0,0,0.35);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 80px);
          mask-image: linear-gradient(to bottom, transparent 0, #000 80px);
}

/* Mobile / reduced-motion: no pin, static hero photo */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
  .hero-stage { height: auto; }
  .hero-stage > .hero {
    position: relative; height: auto; top: auto;
    padding-block: clamp(110px, 14vw, 200px);
  }
  .hero-bg-layer .hero-bg { transition: none; }
  .hero-bg-layer .hero-bg:not([data-stage="0"]) { display: none; }
  .hero-bg-layer .hero-bg img { transform: none !important; }
  .hero-content .hero-grid > div:last-child { transform: none !important; }
  .hero-stage h1.display { transform: none !important; opacity: 1 !important; }
  .hero-next { -webkit-mask-image: none; mask-image: none; box-shadow: none; border-radius: 0; }
}

/* =========================================================
   FAM Tech — Updated supplier portfolio components
   Brand strip · Product grid · Major projects · Partners · Downloads · Lead modal
   ========================================================= */

/* Brand strip: row of partner logos on service detail pages */
.brand-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  align-items: center;
  margin-top: 28px;
}
.brand-strip .brand-tile {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  height: 92px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}
.brand-strip .brand-tile:hover { border-color: var(--teal); transform: translateY(-2px); }
.brand-strip .brand-tile img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: grayscale(15%);
}
.brand-strip .brand-tile .made-in {
  position: absolute; bottom: 6px; right: 8px;
  font-family: var(--font-mono);
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.brand-strip .brand-tile { position: relative; }

/* Product grid: image tiles for valves, labels, etc. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.product-tile {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 240ms var(--ease), transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.product-tile:hover { border-color: var(--teal); transform: translateY(-3px); box-shadow: 0 14px 32px rgba(14,36,54,0.08); }
.product-tile .ph {
  aspect-ratio: 4 / 3;
  background: var(--offwhite);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-tile .ph img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.product-tile .meta { padding: 16px 18px 18px; }
.product-tile .meta .cat { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.product-tile .meta h4 { margin: 6px 0 0; font-size: 1rem; line-height: 1.35; color: var(--navy-dark); }
.product-tile .meta p { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }

/* Insulation sub-sections layout */
.insulation-sub {
  border-top: 1px solid var(--hairline);
  padding-top: 36px;
  margin-top: 36px;
}
.insulation-sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.insulation-sub .sub-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  align-items: center;
}
.insulation-sub .sub-logo {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.insulation-sub .sub-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.insulation-sub h3 { font-size: 1.45rem; margin: 0 0 8px; color: var(--navy-dark); }
.insulation-sub .brand-line { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-strong); margin: 0 0 12px; }
@media (max-width: 720px) {
  .insulation-sub .sub-grid { grid-template-columns: 1fr; }
  .insulation-sub .sub-logo { height: 110px; max-width: 220px; }
}

/* Major projects gallery */
.major-projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
  margin-top: 40px;
}
.major-projects .mp-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--navy-dark);
  min-height: 280px;
  display: block;
  text-decoration: none;
  isolation: isolate;
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
  grid-column: span 6;
}
.major-projects .mp-card.span-12 { grid-column: span 12; min-height: 420px; }
.major-projects .mp-card.span-8 { grid-column: span 8; min-height: 360px; }
.major-projects .mp-card.span-4 { grid-column: span 4; }
.major-projects .mp-card:hover { transform: translateY(-4px); box-shadow: 0 22px 60px rgba(14,36,54,0.22); }
.major-projects .mp-card img.cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 600ms var(--ease);
}
.major-projects .mp-card:hover img.cover-img { transform: scale(1.04); }
.major-projects .mp-card .mp-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(14,36,54,0) 0%, rgba(14,36,54,0.05) 45%, rgba(14,36,54,0.92) 100%);
}
.major-projects .mp-card .mp-meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 22px 24px;
  color: white;
}
.major-projects .mp-card .mp-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal);
  background: rgba(79,195,176,0.12);
  border: 1px solid rgba(79,195,176,0.34);
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 12px;
}
.major-projects .mp-card h3 {
  color: white;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}
@media (max-width: 820px) {
  .major-projects .mp-card,
  .major-projects .mp-card.span-12,
  .major-projects .mp-card.span-8,
  .major-projects .mp-card.span-4 { grid-column: span 12; min-height: 240px; }
}

/* Partners logo wall */
.partners-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.partners-wall .partner-tile {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  height: 92px;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}
.partners-wall .partner-tile:hover { border-color: var(--teal); transform: translateY(-2px); }
.partners-wall .partner-tile img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.78);
  transition: filter 240ms var(--ease);
}
.partners-wall .partner-tile:hover img { filter: grayscale(0%) opacity(1); }

/* Downloads center */
.downloads-section { margin-top: 40px; }
.downloads-section + .downloads-section { margin-top: 56px; }
.downloads-section .ds-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 14px;
}
.downloads-section .ds-head h3 {
  font-size: 1.25rem; margin: 0; color: var(--navy-dark);
}
.downloads-section .ds-head .ds-cat {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal-strong);
}
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.download-card {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 22px 22px 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color 240ms var(--ease), transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.download-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(14,36,54,0.06); }
.download-card .dc-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-strong);
}
.download-card .dc-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.download-card .dc-title { font-weight: 600; color: var(--navy-dark); line-height: 1.3; margin: 0; font-size: 1rem; }
.download-card .dc-sub { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.download-card .dc-actions { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.download-card.is-coming-soon { opacity: 0.78; }
.download-card.is-coming-soon .dc-icon { color: var(--muted); }
.download-card .dc-pill {
  font-family: var(--font-mono); font-size: .64rem;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(79,195,176,0.12); color: var(--teal-strong);
  border: 1px solid rgba(79,195,176,0.28);
}
.download-card.is-coming-soon .dc-pill {
  background: rgba(14,36,54,0.06); color: var(--muted); border-color: var(--hairline);
}

/* Lead-capture modal */
.lead-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.lead-modal.is-open { display: flex; }
.lead-modal-scrim {
  position: absolute; inset: 0;
  background: rgba(14,36,54,0.62);
  backdrop-filter: blur(4px);
  animation: famtech-fade 200ms ease-out;
}
@keyframes famtech-fade { from { opacity: 0; } to { opacity: 1; } }
.lead-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(14,36,54,0.35);
  animation: famtech-pop 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes famtech-pop { from { transform: translateY(20px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.lead-modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: white;
  color: var(--navy-dark);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 200ms, color 200ms;
}
.lead-modal-close:hover { border-color: var(--teal); color: var(--teal-strong); }
.lead-modal-body { padding: 30px 32px 28px; }
.lead-modal-body header { margin-bottom: 22px; }
.lead-modal-body header h3 { font-size: 1.45rem; margin: 8px 0 6px; color: var(--navy-dark); }
.lead-modal-intro { color: var(--muted); font-size: .92rem; margin: 0 0 14px; line-height: 1.5; }
.lead-modal-doc {
  background: var(--offwhite);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.lead-modal-doc .k { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lead-modal-doc .v { font-size: .95rem; color: var(--navy-dark); font-weight: 500; }
.lead-form .grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 540px) { .lead-form .grid-2 { grid-template-columns: 1fr; } }
.lead-form label {
  display: flex; flex-direction: column; gap: 6px;
}
.lead-form label.full { margin-top: 14px; }
.lead-form label > span {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.lead-form input, .lead-form select, .lead-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: white;
  color: var(--navy-dark);
  font: inherit; font-size: .94rem;
  transition: border-color 180ms, box-shadow 180ms;
}
.lead-form input:focus, .lead-form select:focus, .lead-form textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(79,195,176,0.18);
}
.lead-form textarea { resize: vertical; min-height: 84px; font-family: inherit; }
.lead-privacy {
  font-size: .78rem; color: var(--muted);
  margin: 16px 0 0; line-height: 1.5;
}
.lead-modal-actions { margin-top: 18px; }
.lead-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(220, 50, 50, 0.08);
  border: 1px solid rgba(220, 50, 50, 0.32);
  border-radius: 10px;
  color: #a02323;
  font-size: .88rem;
}
.lead-success { padding: 12px 0; text-align: center; }
.lead-success .success-glyph {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(79,195,176,0.16);
  border: 1px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-strong);
}
.lead-success h4 { font-size: 1.2rem; margin: 0 0 6px; color: var(--navy-dark); }
.lead-success p { color: var(--muted); margin: 0 0 18px; }

[dir="rtl"] .lead-modal-close { right: auto; left: 16px; }

/* ===================================================================
   Mobile responsiveness hardening
   Inline grid-template-columns on pages override the media queries
   above; these !important rules beat them so grids collapse on phones.
   =================================================================== */
@media (max-width: 1024px) {
  .service-grid, .proj-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .icon-btn, .hamburger { width: 44px; height: 44px; }
}
@media (max-width: 768px) {
  /* bare .grid used inline (service-detail 3-col, contact 2-col, about 2-col) */
  .grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
  .service-grid, .proj-grid-4, .sector-grid, .principle-grid,
  .process, .foot-grid { grid-template-columns: 1fr !important; }
  .brand-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .specs .row { grid-template-columns: 1fr !important; gap: 4px; }
}
@media (hover: none) {
  .lang-switch, .filter-chip, .btn-sm {
    min-height: 44px; display: inline-flex; align-items: center;
  }
}
/* safety net — real fix is the collapsing grids above */
html, body { overflow-x: hidden; }
