/* ==========================================================================
   MetaFact — metafact.sa
   Bilingual (AR/EN) single-page site
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink:        #1b2127;
  --ink-2:      #2a333b;
  --ink-3:      #3d4750;
  --steel:      #6b757e;
  --steel-2:    #98a1a9;
  --line:       #dfe3e6;
  --line-2:     #eceef0;
  --paper:      #ffffff;
  --paper-2:    #f5f6f7;
  --paper-3:    #eef0f1;

  --green:      #195845;
  --green-2:    #1f6d55;
  --green-3:    #2a8a6b;
  --green-soft: #e9f1ee;

  --shadow-sm: 0 1px 2px rgba(27, 33, 39, .06), 0 2px 8px rgba(27, 33, 39, .05);
  --shadow-md: 0 4px 12px rgba(27, 33, 39, .07), 0 12px 32px rgba(27, 33, 39, .08);
  --shadow-lg: 0 8px 24px rgba(27, 33, 39, .10), 0 24px 64px rgba(27, 33, 39, .12);

  --wrap: 1220px;
  --gut: clamp(20px, 5vw, 56px);
  --sect: clamp(72px, 9vw, 128px);
  --r: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --hdr: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 12px); }
body {
  margin: 0;
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green-3); outline-offset: 3px; border-radius: 2px; }

/* English typography tightening — Tajawal's Latin runs wide */
html[lang="en"] body { letter-spacing: -.002em; }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { letter-spacing: -.02em; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: var(--sect); position: relative; }
.section--alt { background: var(--paper-2); }
.section--dark { background: var(--ink); color: #c3cad0; }
.section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

.grid { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }

/* ---------- Section heading ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--green-2); margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; inline-size: 26px; block-size: 2px;
  background: var(--green-2); flex: none;
}
.section--dark .eyebrow { color: var(--green-3); }
.section--dark .eyebrow::before { background: var(--green-3); }

.h-sect { font-size: clamp(28px, 3.6vw, 46px); }
.h-sub {
  font-size: clamp(17px, 1.5vw, 20px); font-weight: 500;
  color: var(--steel); margin-top: 14px; max-width: 62ch;
}
.section--dark .h-sub { color: #96a1aa; }
.sect-head { margin-bottom: clamp(38px, 5vw, 64px); }
.sect-head--split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 64px); align-items: end; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border: 1px solid transparent; border-radius: var(--r);
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 4px 14px rgba(25, 88, 69, .25); }
.btn--primary:hover { background: var(--green-2); box-shadow: 0 8px 22px rgba(25, 88, 69, .32); }
.btn--ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink-2); background: var(--ink); color: #fff; }
.btn--onDark { border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn--onDark:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn--sm { padding: 10px 20px; font-size: 14px; }
.btn .ar-flip { transition: transform .25s var(--ease); }
html[dir="rtl"] .btn .ar-flip { transform: scaleX(-1); }
.btn:hover .ar-flip { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .ar-flip { transform: scaleX(-1) translateX(3px); }

/* ==========================================================================
   Header
   ========================================================================== */
.hdr {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100;
  block-size: var(--hdr);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-block-end: 1px solid transparent;
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.hdr.is-stuck { border-block-end-color: var(--line); box-shadow: 0 1px 20px rgba(27, 33, 39, .06); }
.hdr__in { display: flex; align-items: center; gap: 22px; block-size: 100%; }
.hdr__logo { flex: none; }
.hdr__logo img { block-size: 34px; inline-size: auto; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a {
  position: relative; padding: 8px 12px; font-size: 14.5px; font-weight: 500;
  color: var(--ink-3); border-radius: var(--r); transition: color .2s var(--ease);
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; inset-block-end: 2px; inset-inline: 12px;
  block-size: 2px; background: var(--green); transform: scaleX(0); transform-origin: center;
  transition: transform .28s var(--ease);
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }

.hdr__act { display: flex; align-items: center; gap: 10px; flex: none; }

/* Language toggle */
.lang {
  display: inline-flex; align-items: center; position: relative;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper-2);
}
.lang__pill {
  position: absolute; inset-block: 3px; inline-size: calc(50% - 3px);
  background: var(--ink); border-radius: 999px; transition: transform .32s var(--ease);
  inset-inline-start: 3px;
}
html[lang="en"] .lang__pill { transform: translateX(0); }
html[lang="ar"] .lang__pill { transform: translateX(100%); }
html[dir="rtl"][lang="ar"] .lang__pill { transform: translateX(-100%); }
html[dir="rtl"][lang="en"] .lang__pill { transform: translateX(0); }
.lang button {
  position: relative; z-index: 1; background: none; border: 0; cursor: pointer;
  padding: 5px 0; inline-size: 46px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--steel);
  border-radius: 999px; transition: color .28s var(--ease);
}
.lang button.is-on { color: #fff; }

/* Burger */
.burger {
  display: none; inline-size: 42px; block-size: 42px; border: 1px solid var(--line);
  background: var(--paper); border-radius: var(--r); cursor: pointer;
  align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.burger span { display: block; inline-size: 18px; block-size: 2px; background: var(--ink); transition: transform .3s var(--ease), opacity .2s; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile drawer */
.drawer {
  position: fixed; inset-block-start: var(--hdr); inset-inline: 0; inset-block-end: 0;
  background: #fff; z-index: 99; padding: 28px var(--gut) 40px;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
  overflow-y: auto;
}
.drawer.is-open { opacity: 1; visibility: visible; transform: none; }
.drawer a:not(.btn) {
  display: block; padding: 16px 0; font-size: 19px; font-weight: 700;
  color: var(--ink); border-block-end: 1px solid var(--line-2);
}
.drawer .btn { display: flex; inline-size: 100%; margin-block-start: 28px; font-size: 16px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; padding-block: calc(var(--hdr) + clamp(56px, 8vw, 104px)) 0;
  background: var(--ink); color: #cfd6db; overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { inline-size: 100%; block-size: 100%; object-fit: cover; opacity: .3; filter: grayscale(.5) contrast(1.05); }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(27,33,39,.94) 0%, rgba(27,33,39,.82) 45%, rgba(27,33,39,.96) 100%),
    radial-gradient(120% 90% at 15% 0%, rgba(25,88,69,.35) 0%, transparent 60%);
}
html[dir="ltr"] .hero__bg::after { background:
    linear-gradient(to bottom, rgba(27,33,39,.94) 0%, rgba(27,33,39,.82) 45%, rgba(27,33,39,.96) 100%),
    radial-gradient(120% 90% at 85% 0%, rgba(25,88,69,.35) 0%, transparent 60%); }
.hero__in { position: relative; z-index: 1; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em; color: #b9c3ca;
  background: rgba(255, 255, 255, .04); margin-bottom: 26px;
}
.hero__eyebrow i { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--green-3); flex: none; box-shadow: 0 0 0 4px rgba(42, 138, 107, .18); }
.hero h1 {
  color: #fff; font-size: clamp(34px, 5.6vw, 68px); line-height: 1.15;
  max-width: 20ch; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--green-3); }
.hero__lead { margin-block-start: 24px; font-size: clamp(16.5px, 1.5vw, 19px); color: #a9b4bc; max-width: 60ch; line-height: 1.85; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-block-start: 38px; }

.hero__stats {
  margin-block-start: clamp(56px, 7vw, 88px);
  border-block-start: 1px solid rgba(255, 255, 255, .12);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.hero__stat { padding: 26px 0 34px; padding-inline-end: 24px; position: relative; }
.hero__stat + .hero__stat { padding-inline-start: 24px; }
.hero__stat + .hero__stat::before {
  content: ""; position: absolute; inset-block: 26px 34px; inset-inline-start: 0;
  inline-size: 1px; background: rgba(255, 255, 255, .12);
}
.hero__stat dt { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #7d8992; font-weight: 600; }
.hero__stat dd { margin: 8px 0 0; font-size: clamp(15px, 1.4vw, 17.5px); font-weight: 700; color: #fff; line-height: 1.5; }
.hero__stat dd small { display: block; font-size: 13px; font-weight: 500; color: #96a1aa; margin-block-start: 3px; }

/* ---------- Motto band ---------- */
.motto { background: var(--green); color: #fff; padding-block: clamp(28px, 4vw, 44px); }
.motto__in { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.motto p { font-size: clamp(20px, 2.6vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.motto span { font-size: 14.5px; color: #b7d5ca; max-width: 46ch; }

/* ==========================================================================
   About
   ========================================================================== */
.about__body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.about__body p + p { margin-block-start: 16px; }
.about__body p { color: var(--steel); font-size: 16.5px; }
.about__body strong { color: var(--ink); font-weight: 700; }

.figure { position: relative; }
.figure img { inline-size: 100%; border-radius: var(--r); box-shadow: var(--shadow-md); }
.figure figcaption {
  margin-block-start: 14px; font-size: 13.5px; color: var(--steel-2);
  padding-inline-start: 14px; border-inline-start: 2px solid var(--green);
  line-height: 1.6;
}
.figure figcaption b { display: block; color: var(--ink-2); font-weight: 700; font-size: 14px; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); margin-block-start: clamp(40px, 5vw, 64px); border: 1px solid var(--line); }
.pillar { background: var(--paper); padding: clamp(24px, 3vw, 36px); transition: background .3s var(--ease); }
.pillar:hover { background: var(--paper-2); }
.pillar__n { font-size: 12px; font-weight: 800; color: var(--green); letter-spacing: .1em; }
.pillar h3 { font-size: 19px; margin-block: 10px 8px; }
.pillar p { font-size: 15px; color: var(--steel); line-height: 1.7; }
.section--alt .pillar { background: var(--paper); }

/* ==========================================================================
   Vision / Mission / Values
   ========================================================================== */
.vm { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 3vw, 40px); }
.vm__card {
  border: 1px solid rgba(255, 255, 255, .12); padding: clamp(28px, 3.4vw, 42px);
  border-radius: var(--r); background: rgba(255, 255, 255, .025); position: relative; overflow: hidden;
}
.vm__card::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0;
  inline-size: 3px; block-size: 54px; background: var(--green-3);
}
.vm__card h3 { font-size: 21px; margin-bottom: 12px; }
.vm__card p { color: #9aa5ad; font-size: 16px; line-height: 1.85; }

.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255, 255, 255, .1); margin-block-start: clamp(32px, 4vw, 48px); border: 1px solid rgba(255, 255, 255, .1); }
.value { background: var(--ink); padding: clamp(22px, 2.6vw, 32px); transition: background .3s var(--ease); }
.value:hover { background: #212932; }
.value__n {
  inline-size: 30px; block-size: 30px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%;
  font-size: 12.5px; font-weight: 800; color: var(--green-3); margin-bottom: 16px;
}
.value h4 { font-size: 17px; margin-bottom: 8px; }
.value p { font-size: 14.5px; color: #8d98a1; line-height: 1.7; }

/* ==========================================================================
   Capabilities
   ========================================================================== */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap {
  background: var(--paper); padding: clamp(26px, 3vw, 38px);
  position: relative; transition: background .3s var(--ease);
}
.cap:hover { background: var(--paper-2); }
.cap__ico { color: var(--green); margin-bottom: 18px; }
.cap__ico svg { inline-size: 30px; block-size: 30px; stroke-width: 1.4; }
.cap h3 { font-size: 18.5px; margin-bottom: 8px; }
.cap p { font-size: 15px; color: var(--steel); line-height: 1.7; }
.cap__n {
  position: absolute; inset-block-start: clamp(22px, 2.6vw, 32px); inset-inline-end: clamp(22px, 2.6vw, 32px);
  font-size: 13px; font-weight: 800; color: var(--line); letter-spacing: .05em;
}

.duo { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(24px, 3vw, 40px); margin-block-start: clamp(32px, 4vw, 48px); }
.panel { border: 1px solid var(--line); border-radius: var(--r); padding: clamp(26px, 3vw, 36px); background: var(--paper); }
.panel h3 { font-size: 18px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.panel h3 svg { inline-size: 19px; block-size: 19px; color: var(--green); flex: none; }
.tick { display: flex; gap: 12px; padding-block: 10px; font-size: 15.2px; color: var(--ink-3); line-height: 1.65; align-items: flex-start; }
.tick + .tick { border-block-start: 1px solid var(--line-2); }
.tick::before {
  content: ""; flex: none; inline-size: 7px; block-size: 7px; margin-block-start: 10px;
  background: var(--green); transform: rotate(45deg);
}
.section--dark .tick { color: #a9b4bc; }
.section--dark .tick + .tick { border-block-start-color: rgba(255,255,255,.09); }

.callout {
  margin-block-start: clamp(28px, 3.6vw, 44px); background: var(--ink); color: #b6c0c8;
  padding: clamp(26px, 3.4vw, 40px); border-radius: var(--r);
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 44px); align-items: center;
}
.callout h3 { color: #fff; font-size: clamp(20px, 2.2vw, 26px); }
.callout p { font-size: 15.5px; line-height: 1.85; }
.callout--green { background: var(--green-soft); color: var(--ink-3); border: 1px solid #cfe1da; }
.callout--green h3 { color: var(--green); }

/* ==========================================================================
   CNC
   ========================================================================== */
.feat4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 2.4vw, 28px); }
.feat {
  border-block-start: 2px solid var(--ink); padding-block-start: 22px;
  transition: border-color .3s var(--ease);
}
.feat:hover { border-block-start-color: var(--green); }
.feat h3 { font-size: 17.5px; margin-bottom: 8px; }
.feat p { font-size: 14.8px; color: var(--steel); line-height: 1.7; }
.section--dark .feat { border-block-start-color: rgba(255,255,255,.28); }
.section--dark .feat:hover { border-block-start-color: var(--green-3); }
.section--dark .feat p { color: #949fa8; }

/* Steps rail */
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-block-start: clamp(40px, 5vw, 64px); position: relative; }
.steps::before { content: ""; position: absolute; inset-block-start: 17px; inset-inline: 8%; block-size: 1px; background: var(--line); }
.section--dark .steps::before { background: rgba(255,255,255,.14); }
.step { position: relative; padding-inline-end: 18px; }
.step__dot {
  inline-size: 34px; block-size: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink);
  font-size: 13px; font-weight: 800; position: relative; z-index: 1; margin-bottom: 18px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.step:hover .step__dot { background: var(--green); border-color: var(--green); color: #fff; }
.section--alt .step__dot { background: var(--paper-2); }
.section--dark .step__dot { background: var(--ink); border-color: rgba(255,255,255,.2); color: #fff; }
.step h4 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--steel); line-height: 1.65; }
.section--dark .step p { color: #8d98a1; }

.note {
  margin-block-start: clamp(28px, 3.4vw, 40px); display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 22px; background: var(--paper-2); border-inline-start: 3px solid var(--green);
  font-size: 14.8px; color: var(--ink-3); line-height: 1.75; border-radius: 0 var(--r) var(--r) 0;
}
html[dir="rtl"] .note { border-radius: var(--r) 0 0 var(--r); }
.note svg { inline-size: 19px; block-size: 19px; color: var(--green); flex: none; margin-block-start: 4px; }
.section--dark .note { background: rgba(255,255,255,.04); color: #a9b4bc; }

/* ==========================================================================
   Products
   ========================================================================== */
.prods { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.4vw, 30px); }
.prod {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: var(--paper); display: flex; flex-direction: column;
  transition: border-color .3s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}
.prod:hover { border-color: var(--steel-2); box-shadow: var(--shadow-md); transform: translateY(-4px); }
.prod:focus-within { border-color: var(--green); box-shadow: var(--shadow-md); }
.prod__img { position: relative; aspect-ratio: 4 / 3; background: var(--paper-3); overflow: hidden; }
.prod__img img { inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.prod:hover .prod__img img { transform: scale(1.045); }
.prod__body { padding: 22px clamp(20px, 2.2vw, 26px) clamp(22px, 2.4vw, 28px); flex: 1; display: flex; flex-direction: column; }
.prod h3 { font-size: 18.5px; margin-bottom: 8px; }
.prod p { font-size: 14.8px; color: var(--steel); line-height: 1.7; flex: 1; }
.prod__more {
  margin-block-start: 18px; font-size: 13.5px; font-weight: 700; color: var(--green);
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
}
/* the "details" button carries the whole card's hit area */
.prod__more::after { content: ""; position: absolute; inset: 0; }
.prod__more:focus-visible { outline: none; }
.prod__more svg { inline-size: 15px; block-size: 15px; transition: transform .25s var(--ease); }
html[dir="rtl"] .prod__more svg { transform: scaleX(-1); }
.prod:hover .prod__more svg { transform: translateX(4px); }
html[dir="rtl"] .prod:hover .prod__more svg { transform: scaleX(-1) translateX(4px); }

.notes4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-block-start: clamp(32px, 4vw, 48px); }
.note4 { background: var(--paper); padding: clamp(22px, 2.6vw, 30px); }
.note4 h4 { font-size: 16.5px; margin-bottom: 8px; }
.note4 p { font-size: 14.5px; color: var(--steel); line-height: 1.7; }

/* ---------- Product modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: clamp(14px, 3vw, 40px);
  opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__back { position: absolute; inset: 0; background: rgba(15, 20, 24, .72); backdrop-filter: blur(4px); }
.modal__box {
  position: relative; background: #fff; border-radius: var(--r); inline-size: min(980px, 100%);
  max-block-size: min(88vh, 860px); overflow: hidden; box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  transform: translateY(14px) scale(.985); transition: transform .34s var(--ease);
}
.modal.is-open .modal__box { transform: none; }
.modal__media { background: var(--paper-3); position: relative; min-block-size: 260px; }
.modal__media img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.modal__content { padding: clamp(26px, 3.2vw, 42px); overflow-y: auto; }
.modal__eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--green-2); }
.modal__content h3 { font-size: clamp(22px, 2.4vw, 28px); margin-block: 10px 14px; }
.modal__content > p { font-size: 15.5px; color: var(--steel); line-height: 1.8; }
.modal__sub { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-block: 26px 10px; }
.modal__close {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 2;
  inline-size: 38px; block-size: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .92); color: var(--ink); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: background .2s var(--ease), transform .2s var(--ease);
}
.modal__close:hover { background: #fff; transform: rotate(90deg); }
.modal__close svg { inline-size: 17px; block-size: 17px; }

/* ==========================================================================
   Finishes
   ========================================================================== */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.4vw, 30px); }
.stage { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.stage__tex { block-size: 108px; background-size: cover; background-position: center; position: relative; }
.stage__tex::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(27,33,39,.18), transparent 60%); }
.stage__body { padding: clamp(22px, 2.6vw, 30px); }
.stage__n { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--green); }
.stage h3 { font-size: 19px; margin-block: 8px 10px; }
.stage p { font-size: 15px; color: var(--steel); line-height: 1.75; }

.tbl-wrap { margin-block-start: clamp(32px, 4vw, 48px); overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
table.tbl { inline-size: 100%; border-collapse: collapse; min-inline-size: 640px; }
table.tbl th, table.tbl td { padding: 16px 20px; text-align: start; font-size: 15px; vertical-align: top; }
table.tbl thead th {
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
table.tbl tbody tr + tr { border-block-start: 1px solid var(--line); }
table.tbl tbody tr:hover { background: var(--paper-2); }
table.tbl td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
table.tbl td { color: var(--steel); }

/* ==========================================================================
   Quality
   ========================================================================== */
.qc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); }
.qc__i { background: var(--ink); padding: clamp(24px, 2.8vw, 34px); transition: background .3s var(--ease); }
.qc__i:hover { background: #212932; }
.qc__i .step__dot { margin-bottom: 16px; }
.qc__i h4 { font-size: 16.5px; margin-bottom: 8px; }
.qc__i p { font-size: 14.5px; color: #8d98a1; line-height: 1.7; }

.panel--dark { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.03); }
.panel--dark h3 { color: #fff; }
.panel--dark h3 svg { color: var(--green-3); }

/* ==========================================================================
   Sectors
   ========================================================================== */
.sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.sector { background: var(--paper); padding: clamp(26px, 3vw, 36px); position: relative; transition: background .3s var(--ease); }
.sector:hover { background: var(--paper-2); }
.sector__ico { color: var(--green); margin-bottom: 16px; }
.sector__ico svg { inline-size: 28px; block-size: 28px; stroke-width: 1.4; }
.sector h3 { font-size: 17.5px; margin-bottom: 8px; }
.sector p { font-size: 14.8px; color: var(--steel); line-height: 1.7; }

.compliance { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px); margin-block-start: clamp(32px, 4vw, 44px); }
.comp {
  display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--paper);
  font-size: 15px; color: var(--ink-3); line-height: 1.65;
}
.comp svg { inline-size: 20px; block-size: 20px; color: var(--green); flex: none; margin-block-start: 3px; }

/* ==========================================================================
   Why
   ========================================================================== */
.why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.why__i { background: var(--paper); padding: clamp(26px, 3vw, 38px); transition: background .3s var(--ease); }
.why__i:hover { background: var(--paper-2); }
.why__n {
  font-size: 34px; font-weight: 800; color: var(--paper-3); line-height: 1;
  margin-bottom: 14px; letter-spacing: -.03em;
}
.why__i:hover .why__n { color: var(--green-soft); }
.why__i h3 { font-size: 18px; margin-bottom: 8px; }
.why__i p { font-size: 14.8px; color: var(--steel); line-height: 1.7; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.form { display: grid; gap: 16px; }
.form__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; color: #c3cad0; letter-spacing: .02em; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 15px; padding: 13px 16px; border-radius: var(--r);
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05);
  color: #fff; transition: border-color .25s var(--ease), background .25s var(--ease);
  inline-size: 100%;
}
.field textarea { resize: vertical; min-block-size: 118px; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: #6f7b84; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-3); background: rgba(255, 255, 255, .08);
}
.field select { appearance: none; cursor: pointer; padding-inline-end: 40px; }
.field select option { background: var(--ink); color: #fff; }
.field--sel { position: relative; }
/* Physical borders on purpose: the chevron must point down in both directions,
   and logical borders would mirror it in RTL. */
.field--sel::after {
  content: ""; position: absolute; inset-inline-end: 16px; inset-block-end: 20px;
  inline-size: 7px; block-size: 7px;
  border-right: 2px solid #8d98a1; border-bottom: 2px solid #8d98a1;
  transform: rotate(45deg); pointer-events: none;
}
.form__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-block-start: 6px; }
.form__msg { font-size: 14.5px; font-weight: 600; display: none; line-height: 1.65; }
.form__msg.is-ok { display: block; color: #58c39c; }
.form__msg.is-err { display: block; color: #e8846f; }
#mailFallback[hidden] { display: none; }

.cinfo { border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r); overflow: hidden; }
.cinfo__row { display: flex; gap: 16px; padding: 20px clamp(20px, 2.4vw, 28px); align-items: flex-start; }
.cinfo__row + .cinfo__row { border-block-start: 1px solid rgba(255, 255, 255, .1); }
.cinfo__ico { inline-size: 20px; block-size: 20px; color: var(--green-3); flex: none; margin-block-start: 4px; }
.cinfo dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #7d8992; font-weight: 600; }
.cinfo dd { margin: 5px 0 0; font-size: 16px; font-weight: 700; color: #fff; line-height: 1.55; word-break: break-word; }
.cinfo dd a:hover { color: var(--green-3); }
.cinfo dd small { display: block; font-size: 14px; font-weight: 500; color: #96a1aa; margin-block-start: 2px; }
.cinfo__note { padding: 20px clamp(20px, 2.4vw, 28px); background: rgba(255,255,255,.035); border-block-start: 1px solid rgba(255,255,255,.1); font-size: 14.5px; color: #96a1aa; line-height: 1.75; }

/* ==========================================================================
   Footer
   ========================================================================== */
.ftr { background: #12171b; color: #7d8992; padding-block: clamp(40px, 5vw, 56px); border-block-start: 1px solid rgba(255,255,255,.07); }
.ftr__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ftr img { block-size: 28px; inline-size: auto; opacity: .85; }
.ftr p { font-size: 13.5px; }
.ftr a:hover { color: #fff; }
.ftr__links { display: flex; gap: 20px; font-size: 13.5px; flex-wrap: wrap; }

/* ==========================================================================
   Reveal animation
   ========================================================================== */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .07s; } .rv-d2 { transition-delay: .14s; }
.rv-d3 { transition-delay: .21s; } .rv-d4 { transition-delay: .28s; }
.rv-d5 { transition-delay: .35s; } .rv-d6 { transition-delay: .42s; }

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

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .nav { display: none; }
  .burger { display: flex; }
  .hide-sm { display: none; }
  .caps, .sectors, .why { grid-template-columns: repeat(2, 1fr); }
  .prods { grid-template-columns: repeat(2, 1fr); }
  .values, .qc, .notes4 { grid-template-columns: repeat(2, 1fr); }
  .feat4 { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .steps { grid-template-columns: repeat(3, 1fr); row-gap: 34px; }
  .steps::before { display: none; }
  .compliance { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --hdr: 66px; }
  .hdr__logo img { block-size: 29px; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); row-gap: 0; }
  .hero__stat { padding-inline: 0 20px; }
  .hero__stat:nth-child(2n) { padding-inline-start: 20px; }
  .hero__stat:nth-child(2n+1)::before { display: none; }
  .hero__stat:nth-child(n+3) { border-block-start: 1px solid rgba(255,255,255,.12); }
  .about__body, .contact, .duo, .vm, .callout, .sect-head--split { grid-template-columns: 1fr; }
  .pillars, .stages { grid-template-columns: 1fr; }
  .modal__box { grid-template-columns: 1fr; max-block-size: 92vh; }
  .modal__media { block-size: 200px; min-block-size: 0; }
  .form__row { grid-template-columns: 1fr; }
  .ftr__in { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .caps, .sectors, .why, .prods, .values, .qc, .notes4, .feat4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; row-gap: 26px; }
  .step { padding-inline-end: 0; }
  .hero__cta .btn { inline-size: 100%; }
  .motto__in { flex-direction: column; align-items: flex-start; gap: 12px; }
}
