/* Site Mogoya — s'appuie sur les jetons de charte.css */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }

:root {
  --border: rgb(67 34 3 / .12);
  --shadow: 0 10px 30px rgb(67 34 3 / .10);
  --hero-bg: #2a1502;
}
:root[data-theme="dark"] {
  --bg: #1c0e02;
  --surface: #2a1605;
  --text: #fbeedd;
  --text-muted: #d9bf9a;
  --border: rgb(236 183 103 / .18);
  --shadow: 0 10px 30px rgb(0 0 0 / .4);
  --hero-bg: #140a01;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c0e02;
    --surface: #2a1605;
    --text: #fbeedd;
    --text-muted: #d9bf9a;
    --border: rgb(236 183 103 / .18);
    --shadow: 0 10px 30px rgb(0 0 0 / .4);
    --hero-bg: #140a01;
  }
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.section { padding: 96px 0; }
.section--alt { background: var(--surface); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-titre); font-weight: 700; font-size: .78rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid currentColor; }
.title { font-size: clamp(2rem, 4.2vw, 3.2rem); margin: .8rem 0 1rem; }
.title em { font-style: normal; color: var(--accent); }
.lead { color: var(--text-muted); font-size: 1.1rem; max-width: 680px; }
.center { text-align: center; }
.center .lead { margin: 0 auto; }

/* ---------- Barre utilitaire + en-tête ---------- */
.topbar { background: var(--mogoya-brun); color: var(--mogoya-sable-clair); font-size: .85rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 40px; }
.topbar a { color: inherit; text-decoration: none; margin-inline-start: 1.2rem; }
.topbar a:hover { color: var(--mogoya-sable); }
.topbar .alert { border: 1px solid var(--accent); color: var(--mogoya-sable); padding: .2rem .8rem; border-radius: 99px; }

.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header .container { display: flex; align-items: center; gap: 2rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); font-family: var(--font-titre); font-weight: 800; font-size: 1.35rem; letter-spacing: .04em; }
.brand img { width: 52px; }
.nav { display: flex; gap: 1.8rem; margin-inline-start: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: .8rem; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: #fbeedd; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .07;
  background:
    linear-gradient(60deg, transparent 48%, var(--mogoya-sable) 48%, var(--mogoya-sable) 52%, transparent 52%) 0 0 / 80px 140px,
    linear-gradient(-60deg, transparent 48%, var(--mogoya-sable) 48%, var(--mogoya-sable) 52%, transparent 52%) 0 0 / 80px 140px;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; padding-top: 88px; padding-bottom: 96px; }
.badge { display: inline-flex; align-items: center; gap: .6rem; border: 1px solid rgb(236 183 103 / .4); padding: .4rem 1rem; border-radius: 99px; font-size: .85rem; color: var(--mogoya-sable); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgb(228 124 35 / .25); }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); margin: 1.4rem 0; }
.hero h1 em { font-style: normal; color: var(--mogoya-orange); }
.hero p { color: #e8d3b4; font-size: 1.15rem; max-width: 600px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.hero .btn--outline { color: #fbeedd; box-shadow: inset 0 0 0 2px var(--mogoya-sable); }
.hero .btn--outline:hover { background: var(--mogoya-sable); color: var(--mogoya-brun); }
.hero-visual { position: relative; display: grid; place-items: center; }
.hero-visual .halo { position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgb(228 124 35 / .35), transparent 65%); }
.hero-visual img { position: relative; width: min(440px, 100%); filter: drop-shadow(0 20px 40px rgb(0 0 0 / .5)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }

/* Bandeau d'offres défilant */
.offers { background: var(--surface); border-bottom: 1px solid var(--border); }
.offers .container { display: flex; gap: 1rem; overflow-x: auto; padding-top: 1.2rem; padding-bottom: 1.2rem; scrollbar-width: thin; }
.offer { flex: 0 0 280px; padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s; }
.offer:hover { border-color: var(--accent); transform: translateY(-2px); }
.offer strong { display: block; font-family: var(--font-titre); margin-bottom: .3rem; }
.offer span { color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---------- Pourquoi Mogoya ---------- */
.why { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.why .big { font-family: var(--font-titre); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.35; }
.why .big em { font-style: normal; color: var(--accent); }
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pillar { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.6rem; position: relative; overflow: hidden; }
.pillar::after { content: ""; position: absolute; inset-inline-end: -18px; top: -18px; border-left: 36px solid transparent; border-right: 36px solid transparent; border-top: 60px solid var(--mogoya-sable); opacity: .35; }
.pillar b { display: block; font-family: var(--font-titre); font-size: 2.2rem; color: var(--accent); }
.pillar h3 { font-size: 1.05rem; margin: .3rem 0 .5rem; }
.pillar p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Expertises (onglets) ---------- */
.tabs { display: flex; justify-content: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 3rem 0 2.5rem; }
.tab { background: none; border: 0; color: var(--text-muted); font: 600 .98rem var(--font-texte); padding: 1rem 1.3rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: .5rem; }
.tab svg { width: 18px; height: 18px; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.panel { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; }
.panel[hidden] { display: none; }
.panel h3 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: .6rem 0 1rem; }
.panel p { color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.4rem 0 1.8rem; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: .35rem .85rem; border-radius: 99px; font-size: .88rem; }
.panel-art { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--mogoya-brun); position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(3, 1fr); align-content: end; gap: 1px; }
.panel-art .tri { position: absolute; width: 0; height: 0; border-left: 70px solid transparent; border-right: 70px solid transparent; }
.panel-art .stat { position: relative; background: rgb(0 0 0 / .35); color: #fbeedd; padding: 1.1rem; }
.panel-art .stat b { display: block; font-family: var(--font-titre); font-size: 1.5rem; color: var(--mogoya-sable); }
.panel-art .stat span { font-size: .82rem; }

/* ---------- Engagements ---------- */
.commit-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 220px 220px; gap: 1.1rem; margin-top: 3rem; }
.commit { border-radius: 12px; padding: 1.6rem; display: flex; flex-direction: column; justify-content: flex-end; color: #fbeedd; position: relative; overflow: hidden; background: var(--mogoya-brun); }
.commit:nth-child(1) { grid-row: span 2; background: linear-gradient(160deg, var(--mogoya-brun-clair), var(--mogoya-brun)); }
.commit:nth-child(2) { background: var(--mogoya-orange); }
.commit:nth-child(5) { background: var(--mogoya-sable); color: var(--mogoya-brun); }
.commit::before { content: ""; position: absolute; top: 18px; inset-inline-end: 18px; border-left: 26px solid transparent; border-right: 26px solid transparent; border-top: 44px solid currentColor; opacity: .18; }
.commit b { font-family: var(--font-titre); font-size: 3rem; line-height: 1; }
.commit:nth-child(1) b { font-size: 5rem; }
.commit span { text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; margin-top: .6rem; font-weight: 600; }
.commit p { margin-top: .6rem; max-width: 420px; opacity: .9; }

/* ---------- Réponse à incident ---------- */
.incident { background: var(--hero-bg); color: #fbeedd; }
.incident .lead { color: #e8d3b4; }
.cycle { display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; margin: 2.6rem 0; counter-reset: step; }
.cycle li { list-style: none; border: 1px solid rgb(236 183 103 / .3); border-radius: 10px; padding: 1.2rem; font-family: var(--font-titre); font-weight: 700; }
.cycle li::before { counter-increment: step; content: "0" counter(step); display: block; color: var(--mogoya-orange); font-size: .85rem; margin-bottom: .4rem; }
.cycle { padding: 0; }
.incident-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.incident-card { background: rgb(255 255 255 / .04); border: 1px solid rgb(236 183 103 / .2); border-radius: 12px; padding: 1.6rem; }
.incident-card h3 { font-size: 1.15rem; margin-bottom: .6rem; }
.incident-card p { color: #e8d3b4; font-size: .95rem; margin-bottom: 1rem; }
.incident-card a { color: var(--mogoya-sable); font-weight: 600; text-decoration: none; }

/* ---------- Secteurs ---------- */
.sectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-top: 3rem; }
.sector { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.6rem; border-top: 4px solid var(--accent); }
.sector:nth-child(even) { border-top-color: var(--mogoya-sable); }
.sector small { color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }
.sector h3 { font-size: 1.15rem; margin: .5rem 0; }
.sector p { color: var(--text-muted); font-size: .94rem; }

/* ---------- Méthode ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; margin-top: 3rem; }
.step { position: relative; padding-top: 1.4rem; border-top: 2px solid var(--border); }
.step b { position: absolute; top: -1.05rem; inset-inline-start: 0; background: var(--accent); color: #fff; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-titre); }
.step h3 { font-size: 1.1rem; margin: .6rem 0 .4rem; }
.step p { color: var(--text-muted); font-size: .95rem; }

/* ---------- Technologies ---------- */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); margin-top: 2.4rem; }
.marquee-track { direction: ltr; display: flex; gap: 1rem; width: max-content; animation: scroll 40s linear infinite; }
.marquee-track span { border: 1px solid var(--border); background: var(--surface); padding: .7rem 1.4rem; border-radius: 99px; font-weight: 600; white-space: nowrap; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Solutions (cartes) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 3rem; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card small { color: var(--accent); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.card h3 { font-size: 1.1rem; }
.card p { color: var(--text-muted); font-size: .95rem; flex: 1; }
.card a { font-weight: 700; text-decoration: none; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; background: var(--mogoya-sable); color: var(--mogoya-brun); border-radius: 18px; padding: 3.2rem; position: relative; overflow: hidden; }
.contact .title em { color: var(--mogoya-brun); text-decoration: underline; text-decoration-color: var(--mogoya-orange); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.contact p { color: var(--mogoya-brun-clair); }
.form { background: #fff; border-radius: 12px; padding: 1.8rem; display: grid; gap: .9rem; box-shadow: 0 10px 30px rgb(67 34 3 / .15); }
.form label { font-weight: 600; font-size: .9rem; display: grid; gap: .35rem; }
.form input, .form textarea, .form select { font: inherit; padding: .75rem .9rem; border: 1px solid #e3d2bb; border-radius: var(--radius); background: #fffdf9; color: var(--mogoya-brun); }
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form .consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .82rem; color: var(--mogoya-brun-clair); }
.form button { border: 0; cursor: pointer; font-size: 1rem; }
.form-msg { font-weight: 600; color: var(--mogoya-orange-fonce); }

/* ---------- Pied de page ---------- */
.footer { background: var(--mogoya-brun); color: #e8d3b4; padding: 64px 0 24px; margin-top: 96px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: var(--mogoya-sable); font-family: var(--font-titre); margin: 0 0 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer a { color: #e8d3b4; text-decoration: none; }
.footer a:hover { color: var(--mogoya-orange); }
.footer .brand { color: #fff; margin-bottom: 1rem; }
.footer-bottom { border-top: 1px solid rgb(236 183 103 / .2); margin-top: 3rem; padding-top: 1.4rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; }
.footer .motif { margin-top: 0; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .marquee-track, .hero-visual img { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container, .why, .panel, .contact { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual img { width: 240px; }
  .commit-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .commit { min-height: 180px; }
  .commit:nth-child(1) { grid-column: span 2; grid-row: auto; }
  .cycle { grid-template-columns: repeat(2, 1fr); }
  .incident-cards, .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 1rem 16px 1.4rem; border-bottom: 1px solid var(--border); gap: 1rem; }
  .nav.open { display: flex; }
  .menu-btn { display: grid; }
  .header-actions .btn { display: none; }
  .header .container { justify-content: space-between; }
}
@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .topbar .hide-sm { display: none; }
  .pillars, .incident-cards, .steps, .footer-grid, .commit-grid { grid-template-columns: 1fr; }
  .commit:nth-child(1) { grid-column: auto; }
  .contact { padding: 1.6rem; }
  .tab { padding: .8rem; font-size: .9rem; }
}

.sr-only:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-only:focus { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: var(--radius); }

/* ---------- Ancrage régional ---------- */
.region { display: grid; grid-template-columns: 1fr 1.1fr; gap: 4rem; align-items: center; }
.axes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.axe { background: var(--bg); border: 1px solid var(--border); border-inline-start: 4px solid var(--accent); border-radius: 10px; padding: 1.3rem; }
.axe:nth-child(2n) { border-inline-start-color: var(--mogoya-sable); }
.axe h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.axe p { color: var(--text-muted); font-size: .94rem; }
.countries { margin-top: 1.2rem; color: var(--text-muted); font-size: .95rem; }
@media (max-width: 980px) { .region { grid-template-columns: 1fr; gap: 2rem; } }
@media (max-width: 600px) { .axes { grid-template-columns: 1fr; } }

/* ---------- Sélecteur de langue ---------- */
.topbar .lang { display: inline-flex; gap: .2rem; margin-inline-start: 1.2rem; }
.topbar .lang a { margin: 0; padding: .1rem .45rem; border-radius: 4px; font-weight: 600; }
.topbar .lang a[aria-current="page"] { background: var(--accent); color: #fff; }

/* ---------- Arabe (droite à gauche) ---------- */
[dir="rtl"] {
  --font-titre: 'Cairo', 'Montserrat', system-ui, sans-serif;
  --font-texte: 'Noto Kufi Arabic', 'Open Sans', system-ui, sans-serif;
}
/* L'espacement des lettres casse la liaison des caractères arabes */
[dir="rtl"] .eyebrow, [dir="rtl"] .commit span, [dir="rtl"] .sector small, [dir="rtl"] .card small, [dir="rtl"] .brand { letter-spacing: 0; text-transform: none; }
[dir="rtl"] body { line-height: 1.8; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.45; }
[dir="rtl"] bdi { white-space: nowrap; }

/* ---------- Pages légales ---------- */
.legal { max-width: 780px; margin: 0 auto; padding: 64px 16px 0; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: .8rem 0 .6rem; }
.legal .updated { color: var(--text-muted); font-size: .9rem; }
.legal h2 { font-size: 1.3rem; margin: 2.6rem 0 .8rem; }
.legal p, .legal li { color: var(--text-muted); }
.legal p + p { margin-top: .8rem; }
.legal ul { padding-inline-start: 1.2rem; margin: .6rem 0 0; }
.legal li + li { margin-top: .4rem; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.4rem; margin: 0; }
.legal dt { font-weight: 600; }
.legal dd { margin: 0; color: var(--text-muted); }
.todo { background: var(--mogoya-sable-clair); color: var(--mogoya-brun); padding: 0 .35em; border-radius: 3px; font-style: italic; }
@media (max-width: 600px) { .legal dl { grid-template-columns: 1fr; gap: .1rem; } .legal dd { margin-bottom: .6rem; } }
.legal p + dl, .legal ul + p { margin-top: .9rem; }
