/* =============================================================================
   SMART CITIES SYSTEMS — STYLES
   -----------------------------------------------------------------------------
   Section map (search these comments to jump straight to what you need):
   00 TOKENS   01 RESET/BASE   02 LAYOUT HELPERS   03 HEADER/NAV
   04 HERO     05 SECTIONS(shared)  06 ABOUT/TRIAD   07 SERVICES/COMMIT
   08 SOLUTIONS  09 FOCUS CARDS  10 PRODUCTS CHIPS  11 QUALITY/VALUE
   12 PROJECTS  13 PARTNERS  14 CONTACT  15 FOOTER  16 RTL
   17 MOTION ACCENTS (site-wide "tech" animation, echoes the hero scan)
   18 RESPONSIVE
============================================================================= */

/* ---------------------------- 00 TOKENS ---------------------------------- */
:root {
  --navy: #104D5E;
  --navy-2: #166A81;
  --navy-3: #1C86A4;
  --mist: #EEF2F2;
  --paper: #FBFAF8;
  --copper: #B5652D;
  --copper-soft: #E3A876;
  --teal: #2F8F86;
  --teal-soft: #7FC4BC;
  --ink: #10202F;
  --muted: #5C6B76;
  --line: #DDE3E2;
  --line-dark: rgba(255,255,255,0.12);

  --font-display: 'Space Grotesk', 'Tajawal', sans-serif;
  --font-body: 'Inter', 'Tajawal', sans-serif;

  --container: 1180px;
  --radius: 14px;
  --shadow-soft: 0 20px 50px -30px rgba(12,27,46,0.35);
}

body.lang-ar {
  --font-display: 'Tajawal', sans-serif;
  --font-body: 'Tajawal', sans-serif;
}

/* ---------------------------- 01 RESET/BASE -------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--navy); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------- 02 LAYOUT HELPERS ------------------------------ */
.section-inner { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.section { padding: 108px 0; opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.section.in-view, .hero-content.in-view { opacity: 1; transform: none; }
.section.alt { background: var(--mist); }
.section-eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display);
  font-size: 16px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--copper); font-weight: 600; margin-bottom: 14px;
}
.section-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--copper);
  --pulse-glow: rgba(181,101,45,.5);
  animation: radarPulse 2.4s ease-out infinite;
}
.section h2 {
  position: relative; padding-bottom: 16px;
  font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.01em; max-width: 780px;
}
.section h2::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--copper), var(--teal));
  transition: width .9s cubic-bezier(.16,.84,.44,1);
}
.section.in-view h2::after { width: 64px; }
.section-lead { margin-top: 18px; max-width: 680px; color: var(--muted); font-size: 17px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: #9E5623; }
.btn-ghost { border-color: var(--line-dark); color: #fff; }
.hero .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.text-link { color: var(--copper); font-weight: 600; }

/* ---------------------------- 03 HEADER/NAV ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,250,248,0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 8px 24px -20px rgba(12,27,46,.4); }
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: none; }
.brand-mark img { display: block; height: 68px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy); }
.brand-tag { font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.main-nav { display: flex; gap: 28px; }
.main-nav a { font-size: 14.5px; font-weight: 500; color: var(--ink); position: relative; padding: 4px 0; }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--copper); transition: width .2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.btn-download {
  display: flex; align-items: center; gap: 7px;
  background: var(--copper); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  transition: background .2s ease, transform .2s ease;
}
.btn-download:hover { background: #9E5623; transform: translateY(-1px); }
.btn-download .icon { flex: none; }
.lang-toggle {
  border: 1px solid var(--line); background: #fff; color: var(--navy);
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  transition: border-color .2s ease, color .2s ease;
}
.lang-toggle:hover { border-color: var(--copper); color: var(--copper); }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; padding: 6px; }
.nav-burger span { width: 22px; height: 2px; background: var(--navy); border-radius: 2px; }

/* ---------------------------- 04 HERO ---------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 100% at 80% 0%, var(--navy-3), var(--navy) 55%, var(--navy) 100%);
  color: #fff;
  padding: 96px 28px 120px;
  min-height: 88vh;
  display: flex; align-items: center;
}
.hero-visual {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0.4; pointer-events: none; z-index: 0;
}
.scan-svg { width: min(80vw, 900px); height: min(80vw, 900px); }
.rings .ring { fill: none; stroke: rgba(127,196,188,0.28); stroke-width: 1; }
.rings .ring-faint { stroke: rgba(127,196,188,0.12); }
.nodes .node {
  fill: var(--copper-soft);
  animation: nodePulse 3.6s ease-in-out infinite;
}
@keyframes nodePulse { 0%, 100% { opacity: .3; r: 3; } 50% { opacity: .85; } }
.sweep-group { transform-origin: 300px 300px; animation: sweep 9s linear infinite; }
.sweep-line { stroke: var(--teal-soft); stroke-width: 1.2; opacity: .6; }
@keyframes sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.core { fill: #fff; }

.hero-content { position: relative; max-width: 760px; margin: 0 auto; text-align: center; }
.hero .eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--teal-soft);
  font-weight: 600; margin-bottom: 18px;
}
.hero .eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--teal-soft);
  --pulse-glow: rgba(127,196,188,.55);
  animation: radarPulse 2.4s ease-out infinite;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; color: #fff; }
.hero-sub { margin-top: 22px; font-size: 18px; color: rgba(255,255,255,0.78); max-width: 620px; margin-inline: auto; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 44px 0 0; }
.stat-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; color: #fff;
}
.stat-pill .icon { width: 15px; height: 15px; color: var(--teal-soft); flex: none; }

/* ---------------------------- 06 ABOUT / TRIAD -------------------------------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about-grid h2 { font-size: clamp(28px, 3.2vw, 38px); }
.about-copy p { color: var(--muted); font-size: 16.5px; margin-bottom: 16px; }

.triad { margin-top: 76px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.triad-card {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow-soft);
  transition: transform .25s ease, border-color .25s ease;
}
.triad-card:hover { transform: translateY(-4px); border-color: var(--teal-soft); }
.triad-card::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(47,143,134,0.14), transparent);
  transform: skewX(-20deg); transition: left .8s ease; pointer-events: none;
}
.triad-card:hover::before { left: 130%; }
.triad-icon {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(181,101,45,0.1);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.triad-icon .icon { color: var(--copper); width: 22px; height: 22px; }
.triad-card h3 { font-size: 19px; margin-bottom: 10px; }
.triad-card p { color: var(--muted); font-size: 15px; }

/* ---------------------------- 07 SERVICES / COMMITMENTS ------------------------ */
.commit-grid { margin-top: 52px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.commit-card { border-top: 2px solid var(--copper); padding-top: 18px; transition: transform .25s ease; }
.commit-card:hover { transform: translateY(-4px); }
.commit-index {
  font-family: var(--font-display); font-size: 13px; color: var(--copper); font-weight: 700;
  transition: text-shadow .25s ease;
}
.commit-card:hover .commit-index { text-shadow: 0 0 14px rgba(181,101,45,.6); }
.commit-card h3 { font-size: 17px; margin: 10px 0 8px; }
.commit-card p { color: var(--muted); font-size: 14.5px; }

/* ---------------------------- 08 SOLUTIONS ------------------------------------- */
.solutions-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.solution-tag {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line); transition: border-color .2s ease;
}
.solution-tag:hover { border-color: var(--teal); }
.solution-tag .icon { width: 18px; height: 18px; color: var(--teal); flex: none; margin-top: 2px; transition: transform .25s ease; }
.solution-tag:hover .icon { transform: scale(1.2); }
.solution-tag span:last-child { font-size: 15.5px; }

/* ---------------------------- 09 FOCUS CARDS ------------------------------------ */
.focus-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.focus-card {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 28px;
  transition: transform .25s ease;
}
.focus-card:hover { transform: translateY(-4px); }
.focus-card::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: skewX(-20deg); transition: left .8s ease; pointer-events: none;
}
.focus-card:hover::before { left: 130%; }
.focus-card h3 { color: #fff; font-size: 18px; margin-bottom: 10px; }
.focus-card p { color: rgba(255,255,255,0.72); font-size: 14.5px; }

/* ---------------------------- 10 PRODUCTS CHIPS ---------------------------------- */
.chip-row { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  padding: 11px 20px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 14.5px; font-weight: 500; color: var(--navy);
  transition: transform .2s ease, border-color .2s ease, color .2s ease;
}
.chip:hover { transform: translateY(-2px); border-color: var(--copper); color: var(--copper); }

/* ---------------------------- 11 QUALITY / VALUE ---------------------------------- */
.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; }
.quality-col p { margin-top: 18px; color: var(--muted); font-size: 16px; max-width: 480px; }
.value-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.value-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 15.5px; }
.value-list .icon { width: 18px; height: 18px; color: var(--copper); flex: none; margin-top: 3px; }

/* ---------------------------- 12 PROJECTS (card slider) ---------------------------- */
.projects-slider { margin-top: 48px; }
.projects-track {
  display: flex; gap: 20px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  direction: ltr; /* keeps scroll math consistent in both languages; text direction is restored per-card below */
  scrollbar-width: none; -ms-overflow-style: none;
}
.projects-track::-webkit-scrollbar { display: none; }
.project-card {
  position: relative; overflow: hidden; scroll-snap-align: start;
  flex: 0 0 clamp(230px, 27vw, 296px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .25s ease, border-color .25s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--copper); }
.project-card::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(181,101,45,0.12), transparent);
  transform: skewX(-20deg); transition: left .8s ease; pointer-events: none;
}
.project-card:hover::before { left: 130%; }
.project-index { font-family: var(--font-display); color: var(--copper); font-weight: 700; font-size: 14px; }
.project-name { margin-top: 16px; font-size: 15.5px; line-height: 1.55; }

.slider-controls { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.slider-arrow {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--navy);
  transition: border-color .2s ease, color .2s ease, transform .2s ease;
}
.slider-arrow:hover { border-color: var(--copper); color: var(--copper); transform: translateY(-2px); }

/* ---------------------------- 13 PARTNERS ------------------------------------------- */
.partners-grid { margin-top: 44px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.partner-chip {
  display: flex; align-items: center; justify-content: center;
  width: 150px; height: 72px; padding: 12px 20px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--mist);
  transition: transform .2s ease, border-color .2s ease;
}
.partner-chip:hover { transform: translateY(-2px); border-color: var(--teal-soft); }
.partner-chip img {
  max-width: 110px; max-height: 40px; width: auto; height: auto; object-fit: contain;
  filter: grayscale(1) opacity(.7); transition: filter .2s ease;
}
.partner-chip:hover img { filter: grayscale(0) opacity(1); }
.partner-chip.partner-chip-text {
  width: 150px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--navy-2);
  height: auto; padding: 12px 18px;
}

/* ---------------------------- 14 CONTACT --------------------------------------------- */
.contact { position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.contact::before {
  content: ""; position: absolute; inset: -20%; pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(127,196,188,0.06) 0px, rgba(127,196,188,0.06) 1px, transparent 1px, transparent 64px);
  animation: gridDrift 22s linear infinite;
}
.contact .section-inner { position: relative; z-index: 1; }
.contact h2 { color: #fff; }
.contact .section-eyebrow { color: var(--teal-soft); }
.contact .section-eyebrow::before { background: var(--teal-soft); --pulse-glow: rgba(127,196,188,.55); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; margin-top: 20px; }
.contact-lead { margin-top: 16px; color: rgba(255,255,255,0.72); font-size: 16px; max-width: 440px; }
.contact-list { margin-top: 32px; display: flex; flex-direction: column; gap: 22px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-icon { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; flex: none; }
.contact-icon .icon { width: 18px; height: 18px; color: var(--teal-soft); }
.contact-text { font-size: 15px; color: rgba(255,255,255,0.85); line-height: 1.5; }

.contact-form { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.contact-form label { font-size: 13px; color: rgba(255,255,255,0.7); }
.contact-form input, .contact-form textarea {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16); border-radius: 10px;
  padding: 12px 14px; color: #fff; font-size: 15px; resize: vertical;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: rgba(255,255,255,0.4); }
.contact-form .btn { margin-top: 6px; }

/* ---------------------------- 15 FOOTER ------------------------------------------------ */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.7); border-top: 1px solid var(--line-dark); padding: 44px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-brand .brand-name { color: #fff; font-family: var(--font-display); font-weight: 700; }
.footer-brand p { font-size: 13.5px; margin-top: 4px; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { font-size: 13.5px; }
.footer-nav a:hover { color: #fff; }
.footer-copy { font-size: 12.5px; width: 100%; text-align: center; margin-top: 18px; opacity: .6; }

/* ---------------------------- 16 RTL -------------------------------------------------- */
[dir="rtl"] .main-nav { direction: rtl; }
[dir="rtl"] .main-nav a::after { left: auto; right: 0; }
[dir="rtl"] .hero-cta,
[dir="rtl"] .hero-stats,
[dir="rtl"] .partners-grid,
[dir="rtl"] .chip-row { direction: rtl; }
/* NOTE: no flex-direction: row-reverse here — a flex row already mirrors
   automatically once `direction: rtl` is inherited from <html dir="rtl">,
   so adding row-reverse on top double-flips the icon to the wrong end. */
[dir="rtl"] .solution-tag,
[dir="rtl"] .value-list li,
[dir="rtl"] .contact-list li,
[dir="rtl"] .stat-pill { text-align: right; }
[dir="rtl"] .project-card { direction: rtl; text-align: right; }
[dir="rtl"] .commit-card { border-left: none; border-right: 2px solid var(--copper); padding-right: 18px; padding-top: 0; }
[dir="rtl"] .about-copy, [dir="rtl"] .quality-col, [dir="rtl"] .contact-lead { text-align: right; }
[dir="rtl"] .section h2, [dir="rtl"] .hero h1, [dir="rtl"] .hero-sub { text-align: center; }
[dir="rtl"] .about-grid h2 { text-align: right; }
[dir="rtl"] .text-link { display: inline-block; }
[dir="rtl"] .section h2::after { left: 50%; right: auto; transform: translateX(-50%); }
[dir="rtl"] .about-grid h2::after { left: auto; right: 0; transform: none; }

/* ---------------------------- 17 MOTION ACCENTS ---------------------------------------
   Shared keyframes for the site-wide "tech" motion (radar-pulse eyebrows, card scan
   sweeps, drifting circuit grid) that echoes the hero's scan visual. Individual rules
   that use these keyframes live next to the elements they animate, above.
----------------------------------------------------------------------------------------- */
@keyframes radarPulse {
  0%   { box-shadow: 0 0 0 0 var(--pulse-glow); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 400px 0; }
}

/* ---------------------------- 18 RESPONSIVE -------------------------------------------- */
@media (max-width: 980px) {
  .about-grid, .two-col, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .triad, .commit-grid, .focus-grid { grid-template-columns: repeat(2, 1fr); }
  .solutions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .main-nav { position: fixed; inset: 64px 0 auto 0; background: var(--paper); flex-direction: column; padding: 18px 28px; gap: 6px; border-bottom: 1px solid var(--line); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
  .main-nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .main-nav a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-burger { display: flex; }
  .brand-tag { display: none; }
  .triad, .commit-grid, .focus-grid { grid-template-columns: 1fr; }
  .section { padding: 76px 0; }
  .hero { padding: 84px 20px 96px; }
}
