/* Geopex Consulting. Concept: the page reads like a borehole log.
   A depth rail tracks the reader; services are drawn as rock strata. */

:root {
  --aquifer: #12324F;   /* brand navy */
  --deep: #0B2236;      /* deepest layer */
  --wadi: #2A97A6;      /* brand teal, water */
  --wadi-light: #9AD3DA;
  --ochre: #B98236;     /* sandstone accent, used sparingly */
  --limestone: #EDF1F2; /* cool light ground */
  --paper: #FAFBFB;
  --ink: #1C2A35;
  --muted: #546673;
  --line: #CFD9DD;

  --display: "Reem Kufi", "Tajawal", system-ui, sans-serif;
  --text: "Tajawal", system-ui, "Segoe UI", sans-serif;

  /* type scale (1.25) */
  --fs-0: 1rem;
  --fs-1: 1.125rem;
  --fs-2: 1.4rem;
  --fs-3: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
  --fs-4: clamp(2.6rem, 1.4rem + 5vw, 5rem);

  --wrap: 1160px;
  --rail: 46px;
  --radius-s: 4px;
  --radius-m: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: var(--text);
  font-size: var(--fs-1);
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.25; margin: 0 0 .6em; }
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3 { letter-spacing: -0.01em; }
h2 { font-size: var(--fs-3); color: var(--aquifer); }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: min(var(--wrap), 100% - 2 * 24px - var(--rail)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--aquifer); color: #fff; padding: 8px 14px; z-index: 100; border-radius: var(--radius-s); }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--wadi); outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 26px;
  font: 700 var(--fs-0) var(--text);
  text-decoration: none; border-radius: var(--radius-s); border: 2px solid transparent;
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--wadi); color: #fff; }
.btn-primary:hover { background: #217F8C; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-wa { border-color: var(--aquifer); color: var(--aquifer); margin-top: 8px; }
.btn-wa:hover { background: var(--aquifer); color: #fff; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 251, 251, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; min-height: 74px; }
.brand img { width: 96px; height: auto; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav a { text-decoration: none; padding: 8px 12px; font-weight: 500; color: var(--ink); border-radius: var(--radius-s); }
.nav a:hover { color: var(--wadi); }
.nav .nav-cta { background: var(--aquifer); color: #fff; padding-inline: 18px; margin-inline-start: 8px; }
.nav .nav-cta:hover { background: var(--deep); color: #fff; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang {
  font: 700 .9rem var(--text); min-width: 44px; height: 40px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--radius-s); cursor: pointer; color: var(--aquifer);
}
.lang:hover { border-color: var(--wadi); }
.menu-btn { display: none; width: 44px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius-s); cursor: pointer; padding: 10px; flex-direction: column; justify-content: space-between; }
.menu-btn span { display: block; height: 2px; background: var(--aquifer); border-radius: 2px; }

/* ---------- depth rail ---------- */
.rail {
  position: fixed; z-index: 40; top: 74px; bottom: 0; inset-inline-end: 0; width: var(--rail);
  border-inline-start: 1px solid var(--line); background: rgba(250,251,251,.7);
  pointer-events: none;
}
.rail-scale {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(to bottom, var(--muted) 0 1px, transparent 1px 60px) 0 0 / 18px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 12px) 0 0 / 9px 100% no-repeat;
  opacity: .8;
}
html[dir="ltr"] .rail-scale { background-position: 100% 0, 100% 0; }
.rail-water {
  position: absolute; inset-inline: 0; top: 0; height: 0;
  background: linear-gradient(to bottom, rgba(42,151,166,.0), rgba(42,151,166,.35));
  border-bottom: 2px solid var(--wadi);
  transition: height .15s linear;
}
.rail-water span {
  position: absolute; bottom: 10px; inset-inline-start: 50%;
  writing-mode: vertical-rl; transform: translateX(50%) rotate(180deg);
  font: 500 .78rem var(--text); color: var(--aquifer); white-space: nowrap;
}
html[dir="ltr"] .rail-water span { transform: translateX(-50%) rotate(180deg); }

/* ---------- hero ---------- */
main { padding-inline-end: var(--rail); }
.hero { position: relative; color: #fff; background: var(--aquifer); overflow: hidden; min-height: min(88vh, 820px); display: flex; flex-direction: column; justify-content: center; }
.hero-bg {
  position: absolute; inset: 0;
  background: url("../img/hero.jpg") center / cover no-repeat;
}
html[dir="ltr"] .hero-bg { transform: scaleX(-1); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(11,34,54,.92) 20%, rgba(11,34,54,.55) 55%, rgba(11,34,54,.15)); }
html[dir="ltr"] .hero-bg::after { background: linear-gradient(to left, rgba(11,34,54,.92) 20%, rgba(11,34,54,.55) 55%, rgba(11,34,54,.15)); }
.hero-inner { position: relative; padding-block: 96px 150px; }
.hero-title { font-size: var(--fs-4); font-weight: 700; margin-bottom: .35em; max-width: 12ch; }
html[lang="en"] .hero-title { max-width: 16ch; font-size: clamp(2.4rem, 1.3rem + 4.2vw, 4.4rem); }
.hero-sub { font-size: var(--fs-1); color: #DCE8EC; max-width: 52ch; margin-bottom: 2em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.water-table { position: absolute; inset-inline: 0; bottom: 46px; width: 100%; height: 120px; }
.water-table path { fill: none; stroke: var(--wadi-light); stroke-width: 2.5; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 2.6s .4s cubic-bezier(.4,.1,.2,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero-note { position: absolute; bottom: 10px; inset-inline: 0; margin-inline: auto; max-width: none; font-size: .92rem; color: var(--wadi-light); }

/* ---------- about ---------- */
.about { padding-block: 110px 90px; }
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 72px; align-items: start; }
.lead { font-size: var(--fs-2); line-height: 1.65; color: var(--aquifer); }
.vm { margin: 0; border-inline-start: 3px solid var(--ochre); padding-inline-start: 32px; }
.vm div + div { margin-top: 36px; }
.vm dt { font-family: var(--display); font-size: var(--fs-2); color: var(--aquifer); margin-bottom: 6px; }
.vm dd { margin: 0; color: var(--muted); }

/* ---------- stats ---------- */
.stats { background: var(--deep) url("../img/strata-dark.jpg") center / cover; color: #fff; padding-block: 76px; }
.stats-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); }
.stats-list li { padding: 8px 20px; border-inline-start: 1px solid rgba(154,211,218,.3); }
.stats-list li:first-child { border-inline-start: 0; padding-inline-start: 0; }
.stats-list strong { display: block; font: 700 clamp(2.2rem, 1.6rem + 2vw, 3.2rem)/1.1 var(--display); color: var(--wadi-light); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.stats-list li > span { font-size: .95rem; color: #CBD9DF; line-height: 1.55; display: block; }

/* ---------- section heads ---------- */
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 12px 56px; align-items: end; margin-bottom: 44px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }

/* ---------- services as strata ---------- */
.services { padding-block: 100px 0; }
.strata { border-top: 1px solid var(--line); }
.stratum { --fg: var(--ink); --sub: var(--muted); color: var(--fg); border-bottom: 1px solid rgba(0,0,0,.12); }
.stratum summary {
  list-style: none; cursor: pointer; position: relative;
  display: grid; grid-template-columns: minmax(240px, 1fr) 1.4fr auto; align-items: center; gap: 28px;
  padding: 34px max(24px, (100% - var(--wrap)) / 2);
  min-height: 112px;
}
.stratum summary::-webkit-details-marker { display: none; }
.stratum summary::after {
  content: "+"; font: 400 2rem/1 var(--text); width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid currentColor; opacity: .7;
}
.stratum[open] summary::after { content: "−"; }
.st-name { font: 600 var(--fs-2)/1.35 var(--display); }
.st-desc { color: var(--sub); }
.st-body { padding-block: 0 40px; }
.st-body ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 48px; }
.st-body li { break-inside: avoid; padding: 10px 0; border-bottom: 1px dashed rgba(0,0,0,.18); }
.with-img { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.with-img ul { columns: 1; }
.with-img img { border-radius: var(--radius-m); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* each layer gets its lithology pattern */
.s-hydro { background: #E4DAC6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Ccircle cx='5' cy='6' r='1.4' fill='%23a08a62' opacity='.55'/%3E%3Ccircle cx='18' cy='15' r='1.1' fill='%23a08a62' opacity='.5'/%3E%3Ccircle cx='9' cy='21' r='.9' fill='%23a08a62' opacity='.45'/%3E%3C/svg%3E"); }
.s-gis { background: #D5E2E6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 .5H40M.5 0V40' stroke='%236f8f99' stroke-opacity='.25'/%3E%3C/svg%3E"); }
.s-hydrogeo { background: #A9BAC3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='30'%3E%3Cpath d='M0 .5H60M0 15.5H60M30 0V15M0 15V30M60 15V30' stroke='%2341586a' stroke-opacity='.25' fill='none'/%3E%3C/svg%3E"); }
.s-wells { --fg: #fff; --sub: #D7E2E7; background: #4F6878 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='16'%3E%3Cpath d='M2 8H20M28 8H46' stroke='%23ffffff' stroke-opacity='.14' stroke-width='1.5'/%3E%3C/svg%3E"); }
.s-pm { --fg: #fff; --sub: #BFDDE3; background: var(--aquifer) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='24'%3E%3Cpath d='M0 12C10 4 30 4 40 12S70 20 80 12' stroke='%232A97A6' stroke-opacity='.45' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); }
.s-wells .st-body li, .s-pm .st-body li { border-bottom-color: rgba(255,255,255,.22); }

/* ---------- projects ---------- */
.projects { padding-block: 110px 100px; }
.project-list { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--aquifer); }
.project-list li { padding: 22px 0 22px 24px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-1); }
html[dir="ltr"] .project-list li { padding: 22px 24px 22px 0; }
.region { font-size: .9rem; color: var(--ochre); font-weight: 700; }
.ministry { background: var(--limestone); border-radius: var(--radius-m); }
.ministry summary { list-style: none; cursor: pointer; padding: 26px 30px; display: flex; justify-content: space-between; gap: 20px; align-items: center; font: 600 var(--fs-1)/1.5 var(--display); color: var(--aquifer); }
.ministry summary::-webkit-details-marker { display: none; }
.ministry-hint { font: 500 .9rem var(--text); color: var(--wadi); white-space: nowrap; }
.ministry ol { margin: 0; padding: 0 30px 26px; padding-inline-start: 58px; columns: 2; column-gap: 48px; }
.ministry li { break-inside: avoid; padding: 6px 0; color: var(--ink); }
.ministry li::marker { color: var(--wadi); font-weight: 700; }
.field { margin-top: 80px; }
.field h3 { font-size: var(--fs-2); color: var(--aquifer); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 14px; }
.field-grid figure { margin: 0; overflow: hidden; border-radius: var(--radius-m); }
.field-grid img { width: 100%; height: 380px; object-fit: cover; }

/* ---------- clients ---------- */
.clients { background: var(--limestone); padding-block: 80px; }
.client-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.client-list li { padding: 12px 20px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-weight: 500; }

/* ---------- team ---------- */
.team { padding-block: 110px 90px; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.team-list li { display: flex; gap: 18px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); }
.ini { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font: 700 1.4rem var(--display); background: var(--limestone); color: var(--aquifer); }
.lead-member .ini { background: var(--aquifer); color: #fff; }
.team-list b { display: block; font-weight: 700; line-height: 1.45; }
.team-list small { color: var(--muted); font-size: .95rem; }

/* ---------- certificates ---------- */
.certs { background: var(--deep); color: #fff; padding-block: 100px; }
.certs h2 { color: #fff; }
.certs .section-head p { color: #B9CCD4; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cert-list button { all: unset; cursor: zoom-in; display: block; background: #fff; border-radius: var(--radius-s); padding: 8px; transition: transform .2s; }
.cert-list button:hover { transform: translateY(-4px); }
.cert-list button:focus-visible { outline: 3px solid var(--wadi); outline-offset: 3px; }
.cert-list img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 92vw; max-height: 92vh; }
.lightbox::backdrop { background: rgba(5, 18, 30, .85); }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; background: #fff; border-radius: var(--radius-s); }
.lb-close { position: fixed; top: 16px; inset-inline-end: 20px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: var(--aquifer); font-size: 1.8rem; cursor: pointer; }

/* ---------- contact ---------- */
.contact { padding-block: 110px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 72px; align-items: start; }
.contact-lines { list-style: none; margin: 28px 0; padding: 0; }
.contact-lines li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-lines span { color: var(--muted); }
.contact-lines a { font-weight: 700; text-decoration: none; color: var(--aquifer); justify-self: start; }
.contact-lines p { margin: 0; }
.req-form { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--wadi); border-radius: var(--radius-m); padding: 36px; display: grid; gap: 18px; }
.field-row { display: grid; gap: 6px; }
.field-row label { font-weight: 700; font-size: var(--fs-0); }
.field-row input, .field-row textarea {
  font: 400 var(--fs-0) var(--text); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; background: var(--paper);
  transition: border-color .15s, background .15s;
}
html[dir="rtl"] input[dir="ltr"] { text-align: right; }
.field-row textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field-row input:focus, .field-row textarea:focus { outline: none; border-color: var(--wadi); background: #fff; box-shadow: 0 0 0 3px rgba(42,151,166,.18); }
.err { display: none; color: #B23B2E; font-size: .9rem; }
.field-row.invalid input, .field-row.invalid textarea { border-color: #B23B2E; }
.field-row.invalid .err { display: block; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.btn-send { justify-self: start; min-width: 180px; }
.btn-send[disabled] { opacity: .65; cursor: progress; }
.form-status { margin: 0; font-weight: 500; }
.form-status.ok { color: #1F7A4D; }
.form-status.fail { color: #B23B2E; }

/* ---------- footer ---------- */
.site-footer { background: var(--aquifer); color: #C9D8DE; padding-block: 34px; padding-inline-end: var(--rail); }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.footer-row p { margin: 0; }
.f-name { font: 600 var(--fs-1) var(--display); color: #fff; }
.f-legal, .f-copy { font-size: .9rem; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stats-list { grid-template-columns: repeat(3, 1fr); row-gap: 36px; }
  .stats-list li:nth-child(4) { border-inline-start: 0; padding-inline-start: 0; }
  .cert-list { grid-template-columns: repeat(3, 1fr); }
  .project-list, .team-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .menu-btn { display: flex; }
  .nav {
    position: absolute; top: 100%; inset-inline: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 24px 18px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav .nav-cta { margin: 12px 0 0; text-align: center; border-radius: var(--radius-s); }
  .header-tools { margin-inline-start: auto; }
  .about-grid, .contact-grid, .with-img, .section-head { grid-template-columns: 1fr; gap: 32px; }
  .section-head { gap: 8px; }
  .stratum summary { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .st-name { grid-column: 1; }
  .st-desc { grid-column: 1; grid-row: 2; font-size: var(--fs-0); }
  .stratum summary::after { grid-column: 2; grid-row: 1 / 3; }
  .st-body ul, .ministry ol { columns: 1; }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field-grid figure:last-child { grid-column: 1 / -1; }
  .field-grid img { height: 260px; }
  .hero-bg::after, html[dir="ltr"] .hero-bg::after { background: linear-gradient(to top, rgba(11,34,54,.95) 35%, rgba(11,34,54,.5)); }
}
@media (max-width: 600px) {
  .stats-list, .project-list, .team-list { grid-template-columns: 1fr 1fr; }
  .team-list { grid-template-columns: 1fr; }
  .project-list { grid-template-columns: 1fr; }
  .stats-list li:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .stats-list li:nth-child(4) { border-inline-start: 1px solid rgba(154,211,218,.3); padding-inline-start: 20px; }
  .cert-list { grid-template-columns: repeat(2, 1fr); }
  .req-form { padding: 24px 18px; }
  .ministry summary { flex-direction: column; align-items: start; }
  .hero-inner { padding-block: 72px 140px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .water-table path { animation: none; stroke-dashoffset: 0; }
  .rail-water, .cert-list button { transition: none; }
}
