:root {
    --blue: #1b3f95;
    --blue-dark: #12296a;
    --red: #e2322d;
    --line: #d5d9e4;
    --focus: #2f6bff;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }
body {
    min-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: #fff;
    background: var(--blue);
}
[lang="ar"] body, [lang="ar"] a { font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; }

.wrap { width: min(1000px, 100% - 2rem); margin-inline: auto; }

/* Barre de contact */
.topbar { background: var(--blue-dark); font-size: .875rem; }
.topbar-inner { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; padding: .55rem 0; }
.topbar a { color: #dbe3f7; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

/* En-tête */
.site-header { background: #fff; border-bottom: 4px solid var(--red); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; }
.logo { display: block; height: 54px; width: auto; max-width: 100%; }

.lang-switch { display: flex; gap: .25rem; }
.lang-switch a {
    padding: .35rem .75rem; border: 1.5px solid var(--line); border-radius: 99px;
    color: var(--blue); font-weight: 600; font-size: .9rem; text-decoration: none;
}
.lang-switch a:hover { border-color: var(--blue); }
.lang-switch a.active { background: var(--blue); border-color: var(--blue); color: #fff; }

a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.topbar a:focus-visible, .cta:focus-visible { outline-color: #fff; }

/* Message */
.stage { flex: 1; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.message { padding: 3.5rem 0 2rem; }
.badge {
    display: inline-block; margin: 0 0 1rem; padding: .3rem .9rem;
    font-size: .9rem; font-weight: 600;
    border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 99px;
}
h1 {
    margin: 0 0 .9rem;
    font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
    font-weight: 700; font-size: clamp(2.4rem, 8vw, 4.5rem); line-height: 1.05;
}
[lang="ar"] h1 { font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; line-height: 1.3; }
.lead { margin: 0 0 1.75rem; max-width: 52ch; font-size: 1.15rem; color: #dbe3f7; }
.cta {
    display: inline-block; padding: .85rem 1.8rem;
    font-weight: 600; font-size: 1.05rem; color: #fff; text-decoration: none;
    background: var(--red); border-radius: 6px; transition: background-color .15s;
}
.cta:hover { background: #c92822; }

/* Scène : le tracteur roule de gauche à droite, quelle que soit la langue */
.scene { position: relative; direction: ltr; height: clamp(150px, 24vw, 220px); }
.tractor {
    position: absolute; left: 0; bottom: 22px;
    width: clamp(190px, 28vw, 300px);
    animation: drive 16s linear infinite;
}
.tractor svg { display: block; width: 100%; height: auto; overflow: visible; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: #0c1630; }
.road::before {
    content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 3px;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .7) 0 28px, transparent 28px 56px);
}

@keyframes drive {
    from { transform: translateX(-110%); }
    to   { transform: translateX(100vw); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump {
    from { transform: translateY(0); }
    to   { transform: translateY(-1.6px); }
}
@keyframes puff {
    0%   { transform: translate(0, 0) scale(.5); opacity: .8; }
    100% { transform: translate(-34px, -34px) scale(1.9); opacity: 0; }
}

.wheel { animation: spin 1.4s linear infinite; }
.wheel-rear  { transform-origin: 80px 100px; }
.wheel-front { transform-origin: 212px 116px; animation-duration: .9s; }
.body { animation: bump .32s ease-in-out infinite alternate; }

.puff { fill: #fff; opacity: 0; transform-box: fill-box; transform-origin: center; animation: puff 1.5s ease-out infinite; }
.p2 { animation-delay: .5s; }
.p3 { animation-delay: 1s; }

/* Mouvement réduit : le tracteur reste à l'arrêt, au centre */
@media (prefers-reduced-motion: reduce) {
    .tractor { animation: none; left: 50%; transform: translateX(-50%); }
    .wheel, .body, .puff { animation: none; }
    .puff { display: none; }
}

.site-footer { background: var(--blue-dark); padding: 1rem 0; font-size: .875rem; color: #dbe3f7; text-align: center; }

.lang-switch a[lang="fr"], .lang-switch a[lang="en"] { font-family: "Barlow", system-ui, sans-serif; }
