/* ==========================================================================
   ElectroGrid Solutions — design tokens
   Palette:  --navy (E) #0B2D57 | --charcoal (G) #363B42 | --orange (bolt) #F5941F
   Type:     Rajdhani (display, technical/industrial) + Inter (body) + Tajawal (Arabic)
   Signature: the lightning-bolt seam that splits the hero, echoing the E|G mark
   ========================================================================== */

:root{
  --navy: #0B2D57;
  --navy-deep: #071D3A;
  --charcoal: #363B42;
  --orange: #F5941F;
  --orange-deep: #DD7A0A;
  --amber: #FFC15E;
  --bg: #F6F7FA;
  --paper: #FFFFFF;
  --line: #E2E6ED;
  --ink: #1C222B;
  --ink-soft: #5B6472;

  --font-display: "Rajdhani", "Tajawal", sans-serif;
  --font-body: "Inter", "Tajawal", sans-serif;

  --radius: 10px;
  --shadow: 0 12px 30px -14px rgba(11,45,87,0.25);
  --wrap: 1180px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{
  font-family: var(--font-display);
  color: var(--navy-deep);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.12;
  margin: 0 0 .5em;
}
p{ margin: 0 0 1em; color: var(--ink-soft); }
a{ color: inherit; text-decoration: none; }
img{ max-width: 100%; display: block; }
ul{ list-style: none; margin: 0; padding: 0; }

.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

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

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* subtle circuit-grid backdrop behind the whole page */
.grid-overlay{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, transparent 780px);
}

/* ---------- header ---------- */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246,247,250,0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}
.brand-mark{ height: 42px; width: auto; }
.main-nav{
  display: flex;
  gap: 30px;
  margin-left: auto;
  margin-right: 30px;
}
.main-nav a{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--charcoal);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.main-nav a:hover{ color: var(--orange-deep); border-color: var(--orange); }

.header-actions{ display: flex; align-items: center; gap: 16px; }
.lang-switch{
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--paper);
}
.lang-btn{
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-btn.active, .lang-btn:hover{ background: var(--navy); color: #fff; }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}
.nav-toggle span{ height: 2px; background: var(--navy); border-radius: 2px; }

/* ---------- hero ---------- */
.hero{ position: relative; padding: 72px 0 0; overflow: hidden; }
.hero-inner{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 64px;
}
.eyebrow, .section-eyebrow{
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--orange-deep);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.section-eyebrow.light{ color: var(--amber); }
.hero-text h1{
  font-size: clamp(2.4rem, 4.2vw, 3.6rem);
  margin-bottom: 20px;
}
.hero-text h1 span{ display: inline; }
.hero-text h1 .accent{ color: var(--orange); }
.hero-lead{ max-width: 46ch; font-size: 1.06rem; }
.hero-cta{ display: flex; gap: 14px; margin: 26px 0 34px; flex-wrap: wrap; }

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.92rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary{ background: var(--orange); color: var(--navy-deep); box-shadow: var(--shadow); }
.btn-primary:hover{ transform: translateY(-2px); background: var(--amber); }
.btn-ghost{ border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover{ background: var(--navy); color: #fff; }
.btn.full{ width: 100%; margin-top: 6px; }

.hero-stats{ display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats li{ display: flex; flex-direction: column; }
.hero-stats strong{
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--navy-deep);
}
.hero-stats span{ font-size: 0.82rem; color: var(--ink-soft); }

.hero-visual{ display: flex; justify-content: center; }
.bolt-frame{
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.bolt-frame::before{
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed var(--line);
  border-radius: 20px;
}
.bolt-logo{ width: 78%; }

.hero-divider{ line-height: 0; }
.hero-divider svg{ width: 100%; height: 46px; display: block; }
.hero-divider polyline{ fill: none; stroke: var(--orange); stroke-width: 3; }

/* ---------- services ---------- */
.services{ padding: 84px 0; }
.services h2, .projects h2, .about h2, .contact h2{
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 34px;
}
.service-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.service-card{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.service-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }
.service-card h3{ font-size: 1.08rem; margin-bottom: 8px; }
.service-card p{ font-size: 0.92rem; margin-bottom: 0; }

/* ===== STYLES DES ICÔNES SERVICES (AMÉLIORÉES) ===== */
.service-icon{
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f9;
  border-radius: 16px;
  padding: 10px;
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.service-card:hover .service-icon {
  transform: scale(1.06);
  background: #e6edf5;
  box-shadow: 0 4px 14px rgba(11,45,87,0.12);
}

.service-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- projects ---------- */
.projects{ padding: 84px 0; background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-lead{ max-width: 60ch; margin-bottom: 40px; }
.project-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.project-card{
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: transform .18s ease, box-shadow .18s ease;
}
.project-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow); }
.project-media{
  height: 190px;
  position: relative;
  overflow: hidden;
  background: var(--navy);
}
.project-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-tag{
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.22);
  padding: 5px 12px;
  border-radius: 999px;
}
.project-body{ padding: 20px; }
.project-body h3{ font-size: 1rem; margin-bottom: 8px; }
.project-body p{ font-size: 0.9rem; margin-bottom: 0; }

/* ---------- about ---------- */
.about{ padding: 84px 0; }
.about-inner{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}
.about-list li{
  position: relative;
  padding-inline-start: 26px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--ink);
}
.about-list li::before{
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 8px;
  width: 10px; height: 10px;
  background: var(--orange);
  clip-path: polygon(58% 0%, 20% 55%, 46% 55%, 34% 100%, 82% 42%, 54% 42%);
}
.about-visual{
  display: flex; justify-content: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
}
.about-logo{ width: 70%; }

/* ---------- contact ---------- */
.contact{ background: var(--navy-deep); padding: 84px 0; color: #fff; }
.contact h2{ color: #fff; }
.contact-lead{ color: #C9D3E2; max-width: 46ch; }
.contact-inner{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}
.contact-info{ margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.contact-info li{ display: flex; flex-direction: column; gap: 2px; }
.contact-label{
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}
.contact-info a{ font-size: 1.05rem; font-weight: 600; }
.contact-info a:hover{ color: var(--orange); }

.contact-form{
  background: var(--paper);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.form-row{ margin-bottom: 16px; }
.form-row label{
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy-deep);
  margin-bottom: 6px;
}
.form-row input, .form-row textarea{
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus{ border-color: var(--orange); }
.form-note{ font-size: 0.78rem; color: var(--ink-soft); margin: 10px 0 0; }

/* ---------- footer ---------- */
.site-footer{ background: var(--charcoal); color: #D6D9DD; padding: 34px 0; }
.footer-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand{ display: flex; align-items: center; gap: 14px; }
.footer-mark{ height: 30px; opacity: 0.95; }
.footer-brand p{ margin: 0; font-family: var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.85rem; color: #D6D9DD; }
.footer-copy{ margin: 0; font-size: 0.85rem; color: #A8ADB4; }

/* ---------- responsive ---------- */
@media (max-width: 960px){
  .hero-inner, .about-inner, .contact-inner{ grid-template-columns: 1fr; }
  .hero-visual{ order: -1; }
  .service-grid{ grid-template-columns: repeat(2, 1fr); }
  .project-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 760px){
  .main-nav{
    position: absolute;
    top: 78px; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 18px;
    display: none;
  }
  .main-nav.open{ display: flex; }
  .main-nav a{ padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle{ display: flex; }
  .service-grid{ grid-template-columns: 1fr; }
  .hero-stats{ gap: 22px; }
}

/* ---------- RTL (Arabic) ---------- */
html[dir="rtl"] body{ font-family: var(--font-body); }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] .eyebrow, html[dir="rtl"] .section-eyebrow,
html[dir="rtl"] .main-nav a, html[dir="rtl"] .btn,
html[dir="rtl"] .contact-label, html[dir="rtl"] .form-row label,
html[dir="rtl"] .footer-brand p{
  font-family: "Tajawal", sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
html[dir="rtl"] .main-nav{ margin-left: 0; margin-right: auto; }
html[dir="rtl"] .header-actions{ order: -1; }
