/* ============================================================
   APC – Advanced Plans for Engineering Consulting
   Shared stylesheet for Arabic (RTL) and English (LTR) pages
   ============================================================ */

:root {
  --blue-1: #2255C4;
  --blue-2: #1B3FA0;
  --cyan: #29B8CE;
  --navy: #0B1220;
  --navy-soft: #101a30;
  --bg-light: #EDEEF0;
  --text: #3A3A3A;
  --white: #ffffff;
  --grad: linear-gradient(135deg, var(--blue-1), var(--blue-2));
  --shadow: 0 10px 30px rgba(11, 18, 32, .12);
  --radius: 14px;
  --font: 'Montserrat', 'Tajawal', system-ui, sans-serif;
}

html[lang="ar"] { --font: 'Tajawal', system-ui, sans-serif; }
html[lang="en"] { --font: 'Montserrat', system-ui, sans-serif; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--blue-1); text-decoration: none; }
a:hover { color: var(--cyan); }

ul { list-style: none; }

.container {
  width: min(1140px, 92%);
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 18, 32, .94);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--cyan);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .55rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--white);
}
.brand:hover { color: var(--white); }

.brand img {
  height: 48px;
  width: auto;
  background: var(--white);
  border-radius: 8px;
  padding: 3px;
}

.brand .brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand .brand-name strong {
  font-size: 1.15rem;
  letter-spacing: .5px;
}
.brand .brand-name span {
  font-size: .68rem;
  color: #aebadb;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.main-nav a {
  color: #dfe5f2;
  font-weight: 500;
  font-size: .95rem;
  padding-block: .3rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.main-nav a:hover { color: var(--cyan); }

.main-nav a.active,
.main-nav a[aria-current="page"] {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

.header-links {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.lang-switch {
  background: var(--grad);
  color: var(--white) !important;
  padding: .35rem 1rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  transition: opacity .2s;
}
.lang-switch:hover { opacity: .85; }

.root-link {
  color: #8fa3cf;
  font-size: .78rem;
  border: 1px solid #33415f;
  padding: .3rem .7rem;
  border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.root-link:hover { color: var(--cyan); border-color: var(--cyan); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  padding: .35rem .55rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cyan);
  margin-block: 4px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  color: var(--white);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(11, 18, 32, .92) 25%, rgba(27, 63, 160, .55) 70%, rgba(41, 184, 206, .25));
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  height: 90px;
  background: var(--white);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  z-index: -1;
}
[dir="rtl"] .hero::after { clip-path: polygon(0 100%, 100% 100%, 0 0); }

.hero-content {
  padding-block: 7rem 9rem;
  max-width: 640px;
}

.hero-kicker {
  display: inline-block;
  background: rgba(41, 184, 206, .18);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  border-radius: 999px;
  padding: .25rem 1rem;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.08rem;
  color: #d6ddeb;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: .7rem 1.9rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}

.btn-primary {
  background: var(--grad);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(34, 85, 196, .4);
}
.btn-primary:hover { transform: translateY(-2px); color: var(--white); }

.btn-outline {
  border: 2px solid var(--cyan);
  color: var(--cyan);
  margin-inline-start: .8rem;
}
.btn-outline:hover { background: var(--cyan); color: var(--navy); }

/* ---------- Page header (inner pages) ---------- */
.page-header {
  position: relative;
  background-size: cover;
  background-position: center 20%;
  color: var(--white);
  isolation: isolate;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(11, 18, 32, .93) 30%, rgba(27, 63, 160, .6));
  z-index: -1;
}
.page-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline: 0;
  height: 60px;
  background: var(--white);
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
[dir="rtl"] .page-header::after { clip-path: polygon(0 100%, 100% 100%, 0 0); }

.page-header .container {
  padding-block: 5.5rem 6.5rem;
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin-bottom: .5rem;
}
.page-header p {
  color: #c3cde3;
  max-width: 620px;
  font-size: 1.02rem;
}

/* ---------- Sections ---------- */
.section { padding-block: 4.5rem; }
.section-alt { background: var(--bg-light); }

.section-head {
  margin-bottom: 2.6rem;
  max-width: 720px;
}

.section-head .eyebrow {
  color: var(--cyan);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--navy);
  position: relative;
  padding-inline-start: .9rem;
  margin-block: .3rem .6rem;
  line-height: 1.35;
}
.section-head h2::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .35rem;
  bottom: .35rem;
  width: 5px;
  border-radius: 3px;
  background: var(--grad);
}

.section-head p { color: #5c6470; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center h2 { padding-inline-start: 0; }
.section-head.center h2::before { display: none; }

/* ---------- Grids & cards ---------- */
.grid {
  display: grid;
  gap: 1.6rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(11, 18, 32, .18);
}

.card .card-img {
  height: 210px;
  width: 100%;
  object-fit: cover;
  object-position: center top;
}

.card .card-body {
  padding: 1.4rem 1.5rem 1.7rem;
  flex: 1;
}

.card h3 {
  color: var(--navy);
  font-size: 1.15rem;
  margin-bottom: .2rem;
}

.card .strapline {
  display: block;
  color: var(--cyan);
  font-weight: 700;
  font-size: .86rem;
  font-style: normal;
  margin-bottom: .6rem;
}

.card p { font-size: .94rem; color: #55606e; }

/* ---------- Sector tiles ---------- */
.sector-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center top;
  isolation: isolate;
  box-shadow: var(--shadow);
  transition: transform .25s;
}
.sector-tile:hover { transform: translateY(-5px); }
.sector-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0) 30%, rgba(11, 18, 32, .88));
  z-index: -1;
}
.sector-tile h3 {
  color: var(--white);
  padding: 1.1rem 1.2rem;
  font-size: 1.05rem;
}
.sector-tile h3 span {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  color: var(--cyan);
}

/* ---------- Split rows (image + text) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.6rem;
  align-items: center;
}

.split .split-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.split .split-img::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 46%;
  height: 8px;
  background: var(--grad);
}
.split .split-img img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center top;
}

.split h3 {
  color: var(--navy);
  font-size: 1.45rem;
  margin-bottom: .25rem;
}

.split .strapline {
  color: var(--cyan);
  font-weight: 700;
  font-size: .95rem;
  display: block;
  margin-bottom: .9rem;
}

.split p { color: #55606e; margin-bottom: .8rem; }

/* ---------- Values (dark section) ---------- */
.values-section {
  position: relative;
  background-size: cover;
  background-position: center;
  color: var(--white);
  isolation: isolate;
}
.values-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 18, 32, .93), rgba(27, 63, 160, .82));
  z-index: -1;
}
.values-section .section-head h2 { color: var(--white); }
.values-section .section-head p { color: #c3cde3; }

.value-card {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(41, 184, 206, .35);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  backdrop-filter: blur(4px);
  transition: background .25s, transform .25s;
}
.value-card:hover {
  background: rgba(41, 184, 206, .14);
  transform: translateY(-4px);
}
.value-card .value-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--grad);
  color: var(--white);
  font-weight: 800;
  margin-bottom: .8rem;
}
.value-card h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.value-card p { color: #c9d3e6; font-size: .9rem; }

/* ---------- Vision / Mission ---------- */
.vm-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.8rem;
  border-top: 6px solid var(--cyan);
}
.vm-card:nth-child(2) { border-top-color: var(--blue-1); }
.vm-card h3 {
  color: var(--navy);
  font-size: 1.3rem;
  margin-bottom: .7rem;
}
.vm-card p { color: #55606e; }

/* ---------- Clients ---------- */
.clients-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.client-pill {
  background: var(--white);
  border: 2px solid #dfe3ea;
  border-inline-start: 5px solid var(--cyan);
  border-radius: 12px;
  padding: .8rem 1.5rem;
  font-weight: 700;
  color: var(--navy);
  box-shadow: 0 4px 14px rgba(11, 18, 32, .07);
  transition: transform .2s, border-color .2s;
}
.client-pill:hover { transform: translateY(-3px); border-color: var(--cyan); }
.client-pill span {
  display: block;
  font-size: .78rem;
  font-weight: 400;
  color: #75808f;
}

/* ---------- Feature project (highlights) ---------- */
.feature-project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}
.feature-project img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  object-position: center top;
}
.feature-project .feature-body {
  padding: 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.feature-project .feature-body .eyebrow {
  color: var(--cyan);
  font-weight: 700;
  font-size: .85rem;
}
.feature-project .feature-body h3 {
  color: var(--navy);
  font-size: 1.4rem;
  margin-block: .25rem .8rem;
}
.feature-project .feature-body p { color: #55606e; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  background: var(--grad);
  color: var(--white);
  text-align: center;
  padding-block: 4.5rem;
  isolation: isolate;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset-inline-end: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  background: rgba(41, 184, 206, .25);
  transform: rotate(45deg);
  z-index: -1;
}
.cta-band h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: .6rem;
}
.cta-band p {
  color: #d9e2f5;
  margin-bottom: 1.8rem;
}
.cta-band .btn-outline {
  border-color: var(--white);
  color: var(--white);
  margin-inline-start: 0;
}
.cta-band .btn-outline:hover { background: var(--white); color: var(--blue-2); }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 1.6rem;
  text-align: center;
  border-bottom: 5px solid var(--cyan);
}
.contact-card .icon {
  width: 58px;
  height: 58px;
  margin-inline: auto;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-card .icon svg { width: 26px; height: 26px; fill: var(--white); }
.contact-card h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: .4rem; }
.contact-card p, .contact-card a { color: #55606e; font-size: 1rem; direction: ltr; unicode-bidi: embed; }
.contact-card a:hover { color: var(--cyan); }
.contact-card .note { font-size: .8rem; color: #98a1ae; direction: inherit; margin-top: .4rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #aeb8cc;
  margin-top: 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 2.4rem;
  padding-block: 3.5rem 2.5rem;
}
.site-footer h4 {
  color: var(--white);
  font-size: 1.02rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: .5rem;
}
.site-footer h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 38px;
  height: 3px;
  border-radius: 2px;
  background: var(--cyan);
}
.site-footer p { font-size: .9rem; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.footer-brand img {
  height: 44px;
  background: var(--white);
  border-radius: 8px;
  padding: 3px;
}
.footer-brand strong { color: var(--white); font-size: 1.1rem; }
.site-footer ul li { margin-bottom: .5rem; }
.site-footer ul a { color: #aeb8cc; font-size: .92rem; }
.site-footer ul a:hover { color: var(--cyan); }
.footer-contact li {
  font-size: .92rem;
  margin-bottom: .55rem;
}
.footer-contact li span.ltr { direction: ltr; unicode-bidi: embed; }
.footer-bottom {
  border-top: 1px solid #1d2a45;
  padding-block: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
}
.footer-bottom a { color: var(--cyan); font-weight: 700; }

/* ---------- Utilities ---------- */
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.text-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse .split-img { order: -1; }
  .feature-project { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--navy);
    border-bottom: 3px solid var(--cyan);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem 1.4rem 1.4rem;
  }
  .main-nav a {
    display: block;
    padding: .75rem .2rem;
    border-bottom: 1px solid #1d2a45;
    font-size: 1.02rem;
  }
  .main-nav a.active,
  .main-nav a[aria-current="page"] { border-bottom-color: var(--cyan); }

  .root-link { display: none; }

  .hero-content { padding-block: 5rem 7rem; }
  .btn-outline { margin-inline-start: 0; margin-top: .8rem; }
}

@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; }
  .brand .brand-name span { display: none; }
  .lang-switch { padding: .3rem .8rem; font-size: .8rem; }
  .card .card-img { height: 180px; }
}
