:root {
  --ink: #172026;
  --muted: #5d6a72;
  --line: #d9e2e5;
  --paper: #f7f8f4;
  --white: #ffffff;
  --teal: #1f7f87;
  --teal-dark: #174f5a;
  --gold: #b79a45;
  --green: #547f56;
  --shadow: 0 22px 60px rgba(20, 39, 44, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Cairo", "Inter", Arial, sans-serif;
  line-height: 1.8;
}
body[dir="ltr"] { font-family: "Inter", "Cairo", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: rgba(247, 248, 244, .9);
  border-bottom: 1px solid rgba(23, 32, 38, .08);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 285px; }
.brand-logo { width: 78px; height: 66px; object-fit: contain; }
.brand strong, .brand small { display: block; line-height: 1.2; }
.brand small { color: var(--muted); }
.nav-links { display: flex; align-items: center; gap: 17px; color: var(--muted); font-weight: 800; }
.nav-links a:hover, .nav-links a.active { color: var(--teal); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-toggle, .primary-link, .portal-header-link, .button {
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.lang-toggle { padding: 10px 14px; color: var(--teal-dark); background: #e6efec; }
.primary-link, .button-primary { color: var(--white); background: var(--teal); box-shadow: 0 12px 30px rgba(31, 127, 135, .24); }
.primary-link, .portal-header-link { padding: 10px 16px; }
.portal-header-link { color: var(--teal-dark); background: #eef3ef; border: 1px solid rgba(31, 127, 135, .2); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 18px; }
.button-ghost { color: var(--teal-dark); background: rgba(255, 255, 255, .82); border: 1px solid rgba(255,255,255,.6); }

.hero, .page-hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
}
.hero {
  min-height: 88vh;
  display: grid;
  align-items: end;
  padding: 120px clamp(18px, 5vw, 72px) 46px;
}
.page-hero.compact {
  padding: clamp(72px, 11vw, 132px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(23, 79, 90, .98), rgba(31, 127, 135, .84)),
    url("assets/028-image-engineering-objects-workplace-top-view-construction-concept-engineering-tools-vintage-tone-retro-filter-effect-soft-focus-selective-focus-scaled.jpg") center/cover;
}
.page-hero h1, .hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(2.35rem, 6vw, 5.7rem);
  line-height: 1.08;
  letter-spacing: 0;
}
.page-hero p:not(.eyebrow), .hero p:not(.eyebrow) { max-width: 760px; font-size: clamp(1rem, 1.8vw, 1.26rem); color: #e9f1ee; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; animation: heroZoom 18s ease-in-out infinite alternate; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 40, 44, .96), rgba(6, 40, 44, .70) 44%, rgba(6, 40, 44, .20)),
    linear-gradient(0deg, rgba(6, 40, 44, .82), transparent 45%);
}
body[dir="rtl"] .hero::after {
  background:
    linear-gradient(270deg, rgba(6, 40, 44, .96), rgba(6, 40, 44, .70) 44%, rgba(6, 40, 44, .20)),
    linear-gradient(0deg, rgba(6, 40, 44, .82), transparent 45%);
}
.blueprint-grid {
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 16s linear infinite;
}
.floating-line {
  position: absolute;
  width: 260px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(183,154,69,.9), transparent);
  transform: rotate(-18deg);
  animation: lineFloat 7s ease-in-out infinite;
}
.line-one { top: 24%; inset-inline-start: 12%; }
.line-two { bottom: 28%; inset-inline-end: 14%; animation-delay: -2.4s; }
.hero-content { max-width: 780px; animation: riseIn .9s ease both; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: .92rem; font-weight: 800; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 54px;
  max-width: 900px;
}
.hero-panel div {
  min-height: 112px;
  padding: 18px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}
.hero-panel strong { display: block; font-size: 2rem; line-height: 1; }
.hero-panel span { color: #d7e4df; }

.section { padding: clamp(56px, 8vw, 104px) clamp(18px, 5vw, 72px); }
.section-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 28px; }
h2 { margin: 0; max-width: 780px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.18; letter-spacing: 0; }
.muted { background: #edf1ec; }
.section-action { margin-top: 28px; display: flex; justify-content: center; }

.about { display: grid; grid-template-columns: minmax(260px, .85fr) 1.15fr; gap: clamp(28px, 5vw, 70px); background: var(--white); }
.about-full { grid-template-columns: minmax(260px, .75fr) 1fr; }
.about-copy { color: var(--muted); font-size: 1.05rem; }
.about-image { grid-column: 1 / -1; width: 100%; max-height: 460px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }
.philosophy { margin-top: 24px; padding: 22px; background: #eef3ef; border-radius: 8px; }
.philosophy h3 { margin: 0 0 8px; color: var(--ink); }
.philosophy p { margin: 0; }

.service-grid, .why-grid, .project-grid, .portal-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.service-card, .why-card, .project-card {
  background: var(--white);
  border: 1px solid rgba(23, 32, 38, .08);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(20, 39, 44, .07);
}
.service-card { min-height: 340px; overflow: hidden; }
.service-image { width: 100%; height: 142px; object-fit: cover; background: #dbe1de; }
.service-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: -25px 24px 16px;
  color: var(--white);
  background: var(--teal);
  border-radius: 8px;
  font-weight: 800;
}
.service-card h3, .why-card h3 { margin: 0 0 10px; font-size: 1.3rem; }
.service-card h3 { padding: 0 24px; }
.service-card ul { margin: 0; padding: 0 46px 24px 24px; color: var(--muted); }
body[dir="ltr"] .service-card ul { padding: 0 24px 24px 46px; }
.why-card { padding: 22px; min-height: 150px; }
.why-card p { margin: 0; color: var(--muted); }

.project-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 22px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 800;
}
.chip.active { color: var(--white); background: var(--teal); border-color: var(--teal); }
.project-search { width: min(100%, 360px); min-height: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; }
.project-card { overflow: hidden; }
.project-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #dbe1de; }
.project-body { padding: 18px; }
.project-body h3 { margin: 0 0 10px; font-size: 1.12rem; line-height: 1.5; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; color: var(--teal-dark); font-size: .9rem; font-weight: 800; }
.project-body p { margin: 0; color: var(--muted); }

.portal-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(23,79,90,.96), rgba(31,127,135,.88)),
    url("assets/043-6035441-768x768.jpg") center/cover;
}
.portal-cta p:not(.eyebrow) { max-width: 760px; color: #e3eeeb; }

.partners { background: var(--white); overflow: hidden; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
body[dir="rtl"] .marquee-track { animation-direction: reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-logo, .owner-card {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 190px;
  height: 120px;
  padding: 18px;
  background: #f2f5f1;
  border: 1px solid rgba(23, 32, 38, .08);
  border-radius: 8px;
}
.marquee-logo img { max-height: 84px; object-fit: contain; }
.owner-card { min-width: 260px; color: var(--teal-dark); text-align: center; }

.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 5vw, 70px); background: #e8eee8; }
.address-card { margin-top: 26px; padding: 24px; background: var(--white); border-radius: 8px; box-shadow: var(--shadow); }
.address-card p { color: var(--muted); }
.quote-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 24px; background: var(--white); border-radius: 8px; box-shadow: var(--shadow); }
.quote-form label { display: grid; gap: 6px; color: var(--muted); font-weight: 800; }
.quote-form input, .quote-form select, .quote-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fbfcfa;
}
.quote-form textarea { min-height: 130px; resize: vertical; }
.full { grid-column: 1 / -1; }
.form-note { grid-column: 1 / -1; margin: 0; color: var(--teal); font-weight: 800; }

.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 24px clamp(18px, 5vw, 72px); color: #d9e8e5; background: #10262a; }
.site-footer [data-footer-note] { color: #aebfbb; }
.site-footer a { color: #ffffff; font-weight: 800; }

@keyframes heroZoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 96px 48px; } }
@keyframes lineFloat { 0%,100% { transform: translateY(0) rotate(-18deg); opacity: .25; } 50% { transform: translateY(-28px) rotate(-18deg); opacity: .9; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (max-width: 980px) {
  .site-header { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .about, .about-full, .contact { grid-template-columns: 1fr; }
  .service-grid, .why-grid, .project-grid, .portal-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-toolbar { align-items: stretch; flex-direction: column; }
  .project-search { width: 100%; }
  .portal-cta { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { padding: 10px 16px; }
  .brand { min-width: auto; }
  .brand-logo { width: 60px; height: 52px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .hero { min-height: 92vh; padding-top: 96px; }
  .hero-panel, .service-grid, .why-grid, .project-grid, .portal-feature-grid, .quote-form { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .site-footer { flex-direction: column; }
}
