/* ==========================================================================
   RealChem: realchem.sy
   Corporate light theme built on the brand navy (#122C52) and blue (#3674B5).
   Logical properties throughout, so one stylesheet serves EN (LTR) and AR (RTL).
   ========================================================================== */

:root {
  color-scheme: light;
  --navy: #122c52;
  --navy-900: #0c1f3b;
  --navy-700: #1b3a66;
  --blue: #3674b5;
  --blue-600: #2c6099;
  --blue-50: #eef4fb;
  --ink: #142033;
  --text: #3d4858;
  --muted: #677385;
  --line: #e1e6ed;
  --line-strong: #cfd7e2;
  --soft: #f4f6f9;
  --white: #ffffff;
  --radius: 4px;
  --max: 1200px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Segoe UI", "Noto Sans Arabic", Tahoma, "Geeza Pro", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--white); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
html[lang="ar"] body { font-family: var(--font-ar); font-size: 16.5px; line-height: 1.85; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; font-weight: 700; }
p { margin: 0; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.container { width: min(var(--max), 100% - 48px); margin-inline: auto; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { inset-inline-start: 12px; }

/* ---------- Top bar + header ---------- */
.topbar { background: var(--navy-900); color: #b8c4d6; font-size: 13px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 38px; }
.topbar-links { display: flex; gap: 22px; }
.topbar a:hover { color: #fff; }

.header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.header.scrolled { box-shadow: 0 4px 18px rgba(18, 44, 82, .08); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 24px; }
.brand img { height: 46px; width: auto; }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 8px 14px; font-size: 15px; font-weight: 500; color: var(--ink); border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.menu a:hover { color: var(--blue); }
.menu a.active { color: var(--blue); border-bottom-color: var(--blue); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang { font-size: 14px; font-weight: 600; color: var(--navy); padding: 6px 2px; border-bottom: 1px solid transparent; }
.lang:hover { border-bottom-color: var(--navy); }
.burger { display: none; width: 42px; height: 42px; border: 1px solid var(--line-strong); background: var(--white); color: var(--navy); cursor: pointer; align-items: center; justify-content: center; border-radius: var(--radius); }
.burger svg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 26px; border-radius: var(--radius); font: inherit; font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; }
html[dir="rtl"] .btn svg.arrow { transform: scaleX(-1); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--blue-50); }
.btn-outline-light { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .06); }
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--navy); color: #d5deea; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, var(--navy-900) 0%, rgba(12, 31, 59, .4) 55%, rgba(12, 31, 59, 0) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='146' viewBox='0 0 84 146'%3E%3Cpath d='M42 1l41 24v48L42 97 1 73V25zM42 97v48' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'/%3E%3C/svg%3E");
}
html[dir="rtl"] .hero::before {
  background:
    linear-gradient(-90deg, var(--navy-900) 0%, rgba(12, 31, 59, .4) 55%, rgba(12, 31, 59, 0) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='146' viewBox='0 0 84 146'%3E%3Cpath d='M42 1l41 24v48L42 97 1 73V25zM42 97v48' fill='none' stroke='%23ffffff' stroke-opacity='.05' stroke-width='1'/%3E%3C/svg%3E");
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 64px; align-items: center; padding-block: 88px 96px; }
.label { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8fb4de; }
.label::before { content: ""; width: 28px; height: 2px; background: var(--blue); }
html[lang="ar"] .label { letter-spacing: 0; text-transform: none; font-size: 14.5px; }
.hero h1 { color: #fff; font-size: clamp(32px, 4vw, 50px); line-height: 1.15; margin: 20px 0 22px; font-weight: 600; }
html[lang="ar"] .hero h1 { line-height: 1.4; font-size: clamp(30px, 3.6vw, 46px); }
.lead { font-size: 18px; color: #c3cfde; max-width: 600px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.portfolio { background: var(--white); border-radius: var(--radius); box-shadow: 0 24px 60px rgba(4, 14, 30, .35); overflow: hidden; }
.portfolio-head { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.portfolio-head h2 { font-size: 17px; }
.portfolio-head span { font-size: 13px; color: var(--muted); }
.portfolio ul { list-style: none; margin: 0; padding: 0; }
.portfolio li + li { border-top: 1px solid var(--line); }
.portfolio a { display: flex; align-items: center; gap: 16px; padding: 15px 26px; transition: background .15s; }
.portfolio a:hover { background: var(--soft); }
.portfolio .pico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); border-radius: var(--radius); }
.portfolio .pico svg { width: 21px; height: 21px; }
.portfolio b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.portfolio small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.portfolio .go { margin-inline-start: auto; width: 16px; height: 16px; color: var(--line-strong); flex: none; transition: color .15s, transform .15s; }
html[dir="rtl"] .portfolio .go { transform: scaleX(-1); }
.portfolio a:hover .go { color: var(--blue); }
.tag-excl { display: inline-block; margin-inline-start: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); border: 1px solid currentColor; padding: 1px 6px; border-radius: 2px; vertical-align: 2px; }
html[lang="ar"] .tag-excl { letter-spacing: 0; font-size: 11.5px; }

/* ---------- Facts ---------- */
.facts { border-bottom: 1px solid var(--line); }
.facts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fact { padding: 34px 28px; border-inline-start: 1px solid var(--line); }
.fact:first-child { border-inline-start: 0; padding-inline-start: 0; }
.fact b { display: block; font-size: 34px; line-height: 1.1; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.fact span { display: block; margin-top: 8px; font-size: 14.5px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-block: 104px; }
.section-soft { background: var(--soft); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
html[lang="ar"] .kicker { letter-spacing: 0; text-transform: none; font-size: 15px; }
.h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.2; margin: 14px 0 18px; }
html[lang="ar"] .h2 { line-height: 1.45; }
.intro { font-size: 17.5px; color: var(--text); max-width: 640px; }
.section-head { margin-bottom: 52px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.section-head .h2 { margin-bottom: 0; }
.section-head.single { grid-template-columns: minmax(0, 1fr); max-width: 720px; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 80px; align-items: start; }
.about-body { display: grid; gap: 18px; font-size: 17px; }
.about-body strong { color: var(--ink); font-weight: 600; }
.values { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.values li { display: flex; gap: 18px; padding-block: 24px; border-bottom: 1px solid var(--line); }
.values .vico { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--navy); border-radius: var(--radius); }
.values .vico svg { width: 22px; height: 22px; }
.values h3 { font-size: 17px; margin-bottom: 4px; }
.values p { font-size: 15px; color: var(--muted); }

/* Products */
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.product { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: var(--radius); padding: 32px 30px; display: flex; flex-direction: column; transition: box-shadow .2s, border-color .2s; }
.product:hover { box-shadow: 0 14px 34px rgba(18, 44, 82, .09); }
.product.featured { grid-column: span 2; border-top-color: var(--blue); }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.product .pico { width: 52px; height: 52px; display: grid; place-items: center; background: var(--blue-50); color: var(--navy); border-radius: var(--radius); }
.product .pico svg { width: 28px; height: 28px; }
.badge { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--blue); padding: 5px 10px; border-radius: 2px; }
html[lang="ar"] .badge { letter-spacing: 0; font-size: 12.5px; }
.product h3 { font-size: 20px; margin-bottom: 10px; }
.product > p { font-size: 15.5px; color: var(--muted); margin-bottom: 22px; }
.speclist { list-style: none; margin: auto 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.product:not(.featured) .speclist { grid-template-columns: minmax(0, 1fr); }
.speclist li { position: relative; padding-inline-start: 16px; font-size: 14.5px; color: var(--text); }
.speclist li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 6px; height: 6px; background: var(--blue); }

.products.two, .products.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product.wide .speclist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-note { display: flex; gap: 8px; align-items: center; margin: -8px 0 20px; padding: 9px 12px; background: var(--blue-50); border-inline-start: 3px solid var(--blue); font-size: 13.5px; font-weight: 600; color: var(--navy); }
.product-note svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.callout { margin-top: 32px; background: var(--navy); color: #c3cfde; border-radius: var(--radius); padding: 36px 40px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: 48px; align-items: center; }
.callout .kicker { color: #8fb4de; }
.callout h3 { color: #fff; font-size: 22px; margin: 10px 0 10px; }
.callout p { font-size: 15.5px; max-width: 620px; }
.callout .btn { margin-top: 22px; }
.terr-table { width: 100%; border-collapse: collapse; font-size: 15px; border: 1px solid rgba(255, 255, 255, .14); }
.terr-table th, .terr-table td { text-align: start; padding: 13px 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.terr-table tr:last-child th, .terr-table tr:last-child td { border-bottom: 0; }
.terr-table th { color: #9fb0c6; font-weight: 500; }
.terr-table td { color: #fff; font-weight: 600; }

/* Richful band */
.band { background: var(--navy); color: #c3cfde; }
.band .kicker { color: #8fb4de; }
.band .h2 { color: #fff; }
.band-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 72px; align-items: center; }
.band .intro { color: #c3cfde; max-width: none; }
.checks { list-style: none; margin: 30px 0 36px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: #e3eaf3; }
.checks svg { width: 18px; height: 18px; color: #8fb4de; flex: none; margin-top: 3px; }
.terr { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); }
.terr h3 { color: #fff; font-size: 15px; padding: 18px 24px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.terr table { width: 100%; border-collapse: collapse; font-size: 15px; }
.terr th, .terr td { text-align: start; padding: 15px 24px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.terr tr:last-child th, .terr tr:last-child td { border-bottom: 0; }
.terr th { color: #9fb0c6; font-weight: 500; width: 45%; }
.terr td { color: #fff; font-weight: 600; }

/* Industries */
.industries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.ind { padding: 30px 26px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); background: var(--white); }
.ind svg { width: 30px; height: 30px; color: var(--blue); margin-bottom: 18px; }
.ind h3 { font-size: 16.5px; margin-bottom: 6px; }
.ind p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }

/* Process */
.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; list-style: none; margin: 0; padding: 0; }
.step { border-top: 2px solid var(--line-strong); padding-top: 24px; }
.step-n { font-size: 14px; font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.step h3 { font-size: 18px; margin: 8px 0 8px; }
.step p { font-size: 15px; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; }
.details { list-style: none; margin: 34px 0 0; padding: 0; border-top: 1px solid var(--line); }
.details li { display: flex; gap: 18px; align-items: flex-start; padding-block: 20px; border-bottom: 1px solid var(--line); }
.details .vico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: var(--blue-50); color: var(--navy); border-radius: var(--radius); }
.details .vico svg { width: 20px; height: 20px; }
.details small { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .details small { letter-spacing: 0; text-transform: none; font-size: 13.5px; }
.details span, .details a { font-size: 16px; color: var(--ink); font-weight: 500; }
.details a:hover { color: var(--blue); }
.details .addr-co { display: block; }
.details .addr { display: block; font-weight: 400; font-size: 15px; color: var(--text); margin-top: 2px; }
.details .addr span { font-weight: inherit; font-size: inherit; color: inherit; }
.note { margin-top: 14px; font-size: 13px; color: var(--muted); }

.form { border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; background: var(--white); box-shadow: 0 10px 30px rgba(18, 44, 82, .06); }
.form h3 { font-size: 21px; margin-bottom: 6px; }
.form > p { font-size: 15px; color: var(--muted); margin-bottom: 26px; }
.f-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--white); color: var(--ink); font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 120px; resize: vertical; }
.field select { appearance: none; -webkit-appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23677385' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
html[dir="rtl"] .field select { background-position: left 14px center; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(54, 116, 181, .15); }
.form .btn { width: 100%; }
.form-note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.demo-msg { margin-top: 14px; padding: 12px 14px; border-inline-start: 3px solid var(--blue); background: var(--blue-50); color: var(--ink); font-size: 14px; }

/* Footer */
.footer { background: var(--navy-900); color: #9fb0c6; padding-block: 64px 30px; font-size: 14.5px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 48px; }
.footer .brand img { height: 52px; margin-bottom: 18px; }
.footer p { max-width: 340px; }
.footer h4 { color: #fff; font-size: 14px; font-weight: 600; margin: 6px 0 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a:hover { color: #fff; }
.foot-bottom { margin-top: 52px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13.5px; color: #7f91a9; }

/* 404 */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; background: var(--soft); }
.notfound .code { font-size: clamp(72px, 14vw, 132px); font-weight: 700; color: var(--navy); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid, .about-grid, .band-grid, .contact-grid, .callout { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .portfolio { max-width: 560px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product.featured { grid-column: span 2; }
  .industries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 900px) {
  .menu { position: absolute; inset: 100% 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(18, 44, 82, .08); display: none; }
  .menu.open { display: flex; }
  .menu a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
  .menu a.active { border-bottom-color: var(--line); }
  .burger { display: inline-flex; }
  .nav-actions .btn-sm { display: none; }
  .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-note { display: none; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .section { padding-block: 72px; }
  .hero-grid { padding-block: 56px 64px; }
  .nav { height: 68px; }
  .brand img { height: 38px; }
  .products, .industries, .process, .f-row, .checks, .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .product.featured { grid-column: span 1; }
  .speclist, .product.wide .speclist { grid-template-columns: minmax(0, 1fr); }
  .products.two, .products.four { grid-template-columns: minmax(0, 1fr); }
  .callout { padding: 26px 20px; }
  .fact { padding: 24px 16px; }
  .fact b { font-size: 28px; }
  .form { padding: 26px 20px; }
  .portfolio a { padding: 14px 18px; }
  .topbar-links { gap: 14px; font-size: 12.5px; }
}
