/* =========================================================
   ALEN ELECTRICO — Site vitrine
   Concept : "blueprint electrique" — l'identite visuelle emprunte
   au schema technique (plan de cablage) plutot qu'a un style generique.
   Palette : encre bleu-nuit, bleu de marque, cuivre (fil electrique).
   Type : IBM Plex Sans Condensed (display) / IBM Plex Sans (texte) / IBM Plex Mono (donnees)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Condensed:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&family=Noto+Sans+Arabic:wght@500;600;700&display=swap');

:root{
  --ink: #10282A;
  --paper: #F3F6FA;
  --paper-raised: #FFFFFF;
  --blue: #4FA8AC;
  --blue-deep: #1E4B4D;
  --blue-darker: #0C2426;
  --blue-highlight: #3E7E80;
  --copper: #C8792F;
  --copper-light: #E4A25C;
  --brand-red: #A32F35;
  --line: #DCE3EC;
  --muted: #5B6B80;
  --radius: 4px;
  --shadow: 0 24px 48px -20px rgba(12,36,38,0.22);
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; max-width:100%; overflow-x:hidden; }
body{
  margin:0; background:var(--paper); color:var(--ink);
  font-family:'IBM Plex Sans', sans-serif; font-size:16px; line-height:1.6;
  -webkit-font-smoothing:antialiased; max-width:100%; overflow-x:hidden;
}
h1,h2,h3,h4{ font-family:'IBM Plex Sans Condensed', sans-serif; font-weight:700; line-height:1.12; margin:0 0 .5em; letter-spacing:-.01em; color:var(--ink); }
.mono{ font-family:'IBM Plex Mono', monospace; }
a{ color:var(--blue); text-decoration:none; }
img{ max-width:100%; display:block; }
::selection{ background:var(--copper); color:#fff; }
button{ font-family:inherit; }

/* ---------- Arabic (RTL) typography ---------- */
html[dir="rtl"] body{ font-family:'Noto Sans Arabic', 'IBM Plex Sans', sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4{ font-family:'Noto Sans Arabic', 'IBM Plex Sans Condensed', sans-serif; }
html[dir="rtl"] .eyebrow::before{ margin-left:0; }
html[dir="rtl"] .eyebrow{ flex-direction:row-reverse; }
html[dir="rtl"] .more{ flex-direction:row-reverse; }
html[dir="rtl"] .service-icon, html[dir="rtl"] .contact-info-item .ic{ margin-left:0; }
html[dir="rtl"] .contact-info-item{ flex-direction:row-reverse; text-align:right; }
html[dir="rtl"] .footer-brand{ flex-direction:row-reverse; }
html[dir="rtl"] .cta-banner{ text-align:right; }
html[dir="rtl"] .stats-grid > div{ text-align:center; }
html[dir="rtl"] .apropos-stats-rtl{ text-align:right; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; }
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible{
  outline:2px solid var(--copper); outline-offset:2px;
}

.wrap{ max-width:1180px; margin:0 auto; padding:0 24px; }
.section{ padding:88px 0; }
.section-alt{ background:var(--paper-raised); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.eyebrow{ font-family:'IBM Plex Mono', monospace; font-size:12.5px; letter-spacing:.09em; text-transform:uppercase; color:var(--copper); font-weight:600; margin-bottom:14px; display:flex; align-items:center; gap:10px; }
.eyebrow::before{ content:''; width:22px; height:2px; background:var(--copper); flex-shrink:0; }
.section-head{ max-width:640px; margin-bottom:52px; }
.section-head p{ color:var(--muted); font-size:17px; margin-top:14px; }
h2.h2-size{ font-size:clamp(28px,4vw,40px); }

/* ---------- Blueprint grid texture (used as subtle background) ---------- */
.blueprint-bg{
  background-image:
    linear-gradient(rgba(30,95,168,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,95,168,0.06) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; gap:9px; padding:14px 26px;
  border-radius:var(--radius); font-weight:600; font-size:14.5px; letter-spacing:.01em;
  border:1.5px solid transparent; cursor:pointer; transition:.18s ease; white-space:nowrap;
}
.btn-copper{ background:var(--copper); color:#fff; box-shadow:0 6px 16px -6px rgba(200,121,47,0.55); }
.btn-copper:hover{ background:#B36A25; transform:translateY(-2px); box-shadow:0 10px 22px -8px rgba(200,121,47,0.6); }
.btn-outline-light{ border-color:rgba(255,255,255,0.4); color:#fff; }
.btn-outline-light:hover{ border-color:#fff; background:rgba(255,255,255,0.08); }
.btn-outline-dark{ border-color:var(--line); color:var(--ink); }
.btn-outline-dark:hover{ border-color:var(--blue); color:var(--blue); }
.btn-block{ width:100%; justify-content:center; }

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:50; background:rgba(243,246,250,0.92); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.site-header .wrap{ display:flex; align-items:center; justify-content:space-between; height:78px; gap:18px; }
.brand{ display:flex; align-items:center; flex-shrink:0; }
.brand-logo{ height:42px; width:auto; }
.main-nav{ display:flex; align-items:center; gap:34px; }
.main-nav a{ color:var(--ink); font-size:14.5px; font-weight:500; }
.main-nav a:hover{ color:var(--blue); }
.header-actions{ display:flex; align-items:center; gap:16px; }
.header-phone{ display:flex; align-items:center; gap:8px; font-family:'IBM Plex Mono'; font-size:14px; font-weight:600; color:var(--ink); }
.menu-toggle{ display:none; background:none; border:none; font-size:26px; color:var(--ink); cursor:pointer; }

/* ---------- Language switcher ---------- */
.lang-switch{ position:relative; }
.lang-current{
  display:flex; align-items:center; gap:6px; background:#fff; border:1.5px solid var(--line);
  border-radius:var(--radius); padding:9px 12px; font-family:'IBM Plex Mono'; font-size:12.5px;
  font-weight:600; color:var(--ink); cursor:pointer; letter-spacing:.03em;
}
.lang-current:hover{ border-color:var(--blue); }
.lang-dropdown{
  display:none; position:absolute; top:calc(100% + 8px); right:0; background:#fff;
  border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow);
  min-width:150px; overflow:hidden; z-index:60;
}
html[dir="rtl"] .lang-dropdown{ right:auto; left:0; }
.lang-dropdown.open{ display:block; }
.lang-dropdown a{ display:block; padding:11px 16px; font-size:14px; color:var(--ink); }
.lang-dropdown a:hover{ background:var(--paper); }
.lang-dropdown a.active{ color:var(--blue); font-weight:600; background:var(--paper); }
.mobile-lang-row{ display:flex; gap:8px; padding:14px 0 4px; flex-wrap:wrap; }
.mobile-lang-pill{
  border:1.5px solid var(--line); border-radius:20px; padding:6px 14px !important; font-family:'IBM Plex Mono';
  font-size:12px; font-weight:600; color:var(--ink) !important; border-bottom:1.5px solid var(--line) !important;
}
.mobile-lang-pill.active{ background:var(--blue); border-color:var(--blue); color:#fff !important; }

/* ---------- Hero ---------- */
.hero{
  background: radial-gradient(ellipse at 50% 0%, var(--blue-highlight), transparent 60%), linear-gradient(160deg, var(--blue-deep), var(--blue-darker));
  color:#fff; position:relative; overflow:hidden; padding:100px 0 80px;
}
.hero::after{
  content:''; position:absolute; top:0; right:0; width:70px; height:130px; background:var(--brand-red);
  opacity:.85; z-index:1; pointer-events:none;
}
.hero-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:50px; align-items:center; position:relative; z-index:2; }
.hero .eyebrow{ color:var(--copper-light); }
.hero .eyebrow::before{ background:var(--copper-light); }
.hero h1{ color:#fff; font-size:clamp(34px,5vw,54px); }
.hero h1 .accent{ color:var(--copper-light); }
.hero p.lead{ color:rgba(255,255,255,0.78); font-size:18px; max-width:480px; margin:18px 0 30px; }
.hero-cta-row{ display:flex; gap:14px; flex-wrap:wrap; }
.hero-trust{ display:flex; gap:34px; margin-top:46px; flex-wrap:wrap; }
.hero-trust .num{ font-family:'IBM Plex Mono'; font-size:26px; font-weight:600; color:#fff; }
.hero-trust .lbl{ font-size:12.5px; color:rgba(255,255,255,0.6); margin-top:2px; }

/* ---------- Hero 3D schematic (mouse parallax) ---------- */
.hero-schematic-wrap{ perspective:900px; }
.hero-schematic{
  position:relative; transform-style:preserve-3d; transition:transform .25s ease-out;
  will-change:transform;
}
.hero-schematic svg{ width:100%; height:auto; }
.schematic-line{ stroke-dasharray:400; stroke-dashoffset:400; animation:draw 2.6s ease forwards; }
.schematic-line.d1{ animation-delay:.1s; } .schematic-line.d2{ animation-delay:.5s; }
.schematic-line.d3{ animation-delay:.9s; } .schematic-line.d4{ animation-delay:1.3s; }
@keyframes draw{ to{ stroke-dashoffset:0; } }
.schematic-node{ opacity:0; animation:nodeIn .5s ease forwards; }
.schematic-node.n1{ animation-delay:1.6s; } .schematic-node.n2{ animation-delay:1.8s; }
.schematic-node.n3{ animation-delay:2s; } .schematic-node.n4{ animation-delay:2.2s; }
@keyframes nodeIn{ from{ opacity:0; transform:scale(0);} to{ opacity:1; transform:scale(1);} }
.schematic-pulse{ animation:pulse 2.4s ease-in-out infinite; }
@keyframes pulse{ 0%,100%{ opacity:.5; r:4; } 50%{ opacity:1; r:6.5; } }

/* ---------- Service cards (3D tilt on hover, JS-driven) ---------- */
.services-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:26px; perspective:1200px; }
.service-card{
  background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius);
  padding:32px 28px; transition:transform .15s ease-out, box-shadow .3s ease, border-color .3s ease;
  transform-style:preserve-3d; will-change:transform;
}
.service-card:hover{ box-shadow:var(--shadow); border-color:var(--blue); }
.service-icon{
  width:52px; height:52px; border-radius:8px; background:linear-gradient(145deg,var(--blue),var(--blue-deep));
  display:flex; align-items:center; justify-content:center; color:#fff; margin-bottom:20px;
  transform:translateZ(18px);
}
.service-card h3{ font-size:19px; margin-bottom:10px; transform:translateZ(10px); }
.service-card p{ color:var(--muted); font-size:14.5px; margin:0 0 16px; }
.service-card .more{ font-size:13.5px; font-weight:600; color:var(--blue); display:inline-flex; align-items:center; gap:6px; }

/* ---------- Domaines cles (real photos grid) ---------- */
.domaines-grid{
  display:grid; grid-template-columns:repeat(3,1fr); grid-auto-rows:220px; gap:18px; perspective:1200px;
}
.domaine-wide{ grid-column:span 2; }
.domaine-card{
  position:relative; border-radius:6px; overflow:hidden; background:var(--ink);
  transform-style:preserve-3d; will-change:transform; box-shadow:0 10px 24px -14px rgba(12,36,38,0.4);
}
.domaine-card img{
  width:100%; height:100%; object-fit:cover; transition:transform .5s ease, filter .5s ease;
  filter:saturate(1.02);
}
.domaine-card:hover img{ transform:scale(1.07); }
.domaine-card::before{
  content:''; position:absolute; inset:0; background:linear-gradient(0deg, rgba(12,36,38,0.88) 0%, rgba(12,36,38,0.15) 45%, transparent 70%);
  z-index:1;
}
.domaine-cap{
  position:absolute; left:0; right:0; bottom:0; padding:18px 20px; color:#fff; font-family:'IBM Plex Sans Condensed';
  font-weight:700; font-size:18px; z-index:2; letter-spacing:.01em;
}
.domaine-cap::before{ content:''; display:block; width:26px; height:2px; background:var(--copper-light); margin-bottom:8px; }

@media (max-width:760px){
  .domaines-grid{ grid-template-columns:1fr 1fr; grid-auto-rows:170px; }
  .domaine-wide{ grid-column:span 2; }
}
@media (max-width:480px){
  .domaines-grid{ grid-template-columns:1fr; grid-auto-rows:190px; }
  .domaine-wide{ grid-column:span 1; }
}

/* ---------- Stats band ---------- */
.stats-band{
  background: radial-gradient(ellipse at 50% 0%, var(--blue-highlight) 0%, transparent 55%), var(--ink);
  color:#fff; padding:56px 0; position:relative; overflow:hidden;
}
.stats-band::after{
  content:''; position:absolute; top:0; right:0; width:46px; height:80px; background:var(--brand-red); opacity:.8;
}
.stats-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:30px; text-align:center; }
.stats-grid .num{ font-family:'IBM Plex Mono'; font-size:38px; font-weight:600; color:var(--copper-light); }
.stats-grid .lbl{ font-size:13px; color:rgba(255,255,255,0.65); margin-top:6px; }

/* ---------- Gallery (3D flip reveal) ---------- */
.gallery-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; perspective:1000px; }
.gallery-item{ position:relative; border-radius:var(--radius); overflow:hidden; aspect-ratio:4/3; background:var(--line); }
.gallery-item img{ width:100%; height:100%; object-fit:cover; transition:transform .4s ease; }
.gallery-item:hover img{ transform:scale(1.06); }
.gallery-item .cap{
  position:absolute; left:0; right:0; bottom:0; padding:14px 16px;
  background:linear-gradient(0deg, rgba(15,27,45,0.85), transparent);
  color:#fff; font-size:13.5px; font-weight:500;
}
.flip-3d{ transform-style:preserve-3d; }
.flip-3d.reveal{ transform:rotateY(-18deg) translateX(-16px); opacity:0; }
.flip-3d.reveal.in{ transform:rotateY(0) translateX(0); opacity:1; transition:transform .8s cubic-bezier(.2,.8,.2,1), opacity .8s ease; }

/* ---------- Testimonials ---------- */
.testimonial-card{ background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius); padding:30px; }
.testimonial-card .stars{ color:var(--copper); font-size:15px; margin-bottom:14px; }
.testimonial-card p.quote{ font-size:16px; color:var(--ink); margin-bottom:18px; }
.testimonial-card .who{ font-size:13.5px; font-weight:600; }
.testimonial-card .who span{ color:var(--muted); font-weight:400; }

/* ---------- CTA banner ---------- */
.cta-banner{
  background: radial-gradient(ellipse at 30% 0%, var(--blue-highlight) 0%, transparent 60%), linear-gradient(120deg, var(--blue-deep), var(--blue-darker));
  color:#fff; border-radius:6px; padding:56px 48px; display:flex; align-items:center; justify-content:space-between; gap:30px; flex-wrap:wrap;
  position:relative; overflow:hidden;
}
.cta-banner::after{
  content:''; position:absolute; top:0; right:0; width:38px; height:64px; background:var(--brand-red); opacity:.75; z-index:1;
}
.cta-banner::before{
  content:''; position:absolute; inset:0; opacity:.5; pointer-events:none;
  background-image:linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size:28px 28px; transform:perspective(500px) rotateX(35deg) scale(1.4); transform-origin:bottom;
}
.cta-banner > *{ position:relative; z-index:1; }
.cta-banner h2{ color:#fff; font-size:28px; margin-bottom:8px; }
.cta-banner p{ color:rgba(255,255,255,0.75); margin:0; }

/* ---------- Contact ---------- */
.contact-grid{ display:grid; grid-template-columns:1fr 1fr; gap:50px; }
.contact-info-item{ display:flex; gap:14px; margin-bottom:24px; }
.contact-info-item .ic{ width:42px; height:42px; border-radius:8px; background:var(--paper); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--blue); flex-shrink:0; }
.contact-info-item .lbl{ font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:3px; }
.contact-info-item .val{ font-weight:600; }
label{ display:block; font-size:13px; font-weight:600; color:var(--ink); margin-bottom:7px; }
input, textarea, select{
  width:100%; border:1.5px solid var(--line); border-radius:var(--radius); padding:12px 14px;
  font-family:inherit; font-size:15px; background:#fff; color:var(--ink); transition:border-color .15s;
}
input:focus, textarea:focus, select:focus{ border-color:var(--blue); }
.field{ margin-bottom:18px; }
.form-card{ background:var(--paper-raised); border:1px solid var(--line); border-radius:var(--radius); padding:32px; }
.success-msg{ background:#E7F4EC; border:1px solid #B7DFC3; color:#1E7A3C; padding:14px 18px; border-radius:var(--radius); margin-bottom:20px; font-size:14.5px; }

/* ---------- Footer ---------- */
.site-footer{ background:var(--ink); color:rgba(255,255,255,0.7); padding:60px 0 26px; }
.footer-grid{ display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:40px; margin-bottom:40px; }
.footer-grid h4{ color:#fff; font-size:14px; text-transform:uppercase; letter-spacing:.05em; margin-bottom:18px; }
.footer-grid a{ color:rgba(255,255,255,0.65); display:block; margin-bottom:10px; font-size:14.5px; }
.footer-grid a:hover{ color:var(--copper-light); }
.footer-brand{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.footer-logo{ height:34px; width:auto; padding:6px 10px; background:rgba(255,255,255,0.92); border-radius:6px; }
.footer-legal{ border-top:1px solid rgba(255,255,255,0.12); padding-top:22px; font-size:12.5px; color:rgba(255,255,255,0.45); line-height:1.8; }

/* ---------- Scroll reveal ---------- */
.reveal{ opacity:0; transform:translateY(24px); transition:opacity .7s ease, transform .7s ease; }
.reveal.in{ opacity:1; transform:translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width:960px){
  .hero-grid{ grid-template-columns:1fr; }
  .contact-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; gap:26px; }
}
@media (max-width:760px){
  .main-nav, .header-phone{ display:none; }
  .menu-toggle{ display:block; }
  .lang-dropdown{ right:0; left:auto; }
  html[dir="rtl"] .lang-dropdown{ right:0; left:auto; }
  .section{ padding:56px 0; }
  .cta-banner{ flex-direction:column; text-align:center; padding:40px 26px; }
  .cta-banner.reveal, .cta-banner{ text-align:center; }
}
@media (max-width:420px){
  .site-header .wrap{ gap:10px; }
  .brand-logo{ height:34px; }
  .lang-current{ padding:8px 9px; font-size:11.5px; }
}
.mobile-nav{ display:none; flex-direction:column; gap:2px; background:var(--paper-raised); border-top:1px solid var(--line); padding:10px 24px 18px; }
.mobile-nav.open{ display:flex; }
.mobile-nav a{ padding:12px 0; color:var(--ink); font-weight:500; border-bottom:1px solid var(--line); }

@media print{ .site-header, .site-footer{ display:none; } }
