/*
 * MG IT Solutions : socle commun du site public.
 * Couleurs du logo (bleu nuit, orange, crème), Schibsted Grotesk pour le texte,
 * IBM Plex Mono pour les informations techniques (comme « IT SOLUTIONS » du logo).
 * Feuilles complémentaires : home.css, work.css, pages.css, forms.css, legacy.css.
 */

:root {
    --night: #121a25;
    --navy: #1e2b3c;
    --ink: #18212e;
    --ink-2: #3a4555;
    --muted: #5c6575;
    --line: #e1d9ce;
    --line-dark: #2c3a4d;
    --paper: #f6f0eb;
    --paper-2: #eee6dc;
    --white: #ffffff;
    --brand: #f28c1b;
    --brand-dark: #de7a0c;
    --brand-text: #9f5408;
    --on-dark: #e9ecf1;
    --on-dark-muted: #a5afbd;
    --radius: 6px;
    --header-h: 68px;
    --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--brand); color: var(--night); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
.icon { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--brand); color: var(--night); font-weight: 600; border-radius: var(--radius); }
.skip-link:focus { top: 12px; }

/* ---------- Mise en page ---------- */
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .wrap { padding: 0 40px; } }
.section { padding: 72px 0; }
@media (min-width: 1024px) { .section { padding: 112px 0; } }
.bg-paper { background: var(--paper); }
.bg-night { background: var(--night); color: var(--on-dark); }
.muted { color: var(--muted); }
.bg-night .muted { color: var(--on-dark-muted); }

/* ---------- Typographie ---------- */
.label {
    display: inline-block;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: lowercase;
    color: var(--brand-text);
}
.label::after { content: "_"; color: var(--brand); }
.bg-night .label { color: var(--on-dark-muted); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
.display {
    font-size: clamp(38px, 6.4vw, 78px);
    line-height: .98;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.h2 {
    font-size: clamp(30px, 4.2vw, 52px);
    line-height: 1.04;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.lead { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; color: var(--ink-2); }
.bg-night .lead { color: var(--on-dark-muted); }
.accent { color: var(--brand); }

.head { display: grid; gap: 16px 48px; margin-bottom: 48px; }
.head .label { margin-bottom: 14px; }
@media (min-width: 900px) { .head--split { grid-template-columns: 1.3fr 1fr; align-items: end; } }

/* ---------- Boutons et liens ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn .icon { transition: transform .2s var(--ease); }
.btn:hover .icon-arrow { transform: translateX(3px); }
.btn-primary { background: var(--brand); color: var(--night); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--night); }
.btn-ghost { border-color: #cbbfb0; color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost-light { border-color: var(--line-dark); color: var(--on-dark); background: transparent; }
.btn-ghost-light:hover { border-color: var(--on-dark-muted); color: var(--white); }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 479px) { .actions .btn { flex: 1 1 100%; } }

.link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
.link .icon { width: 1em; height: 1em; transition: transform .2s var(--ease); }
.link:hover { color: var(--brand-text); }
.link:hover .icon-arrow { transform: translateX(3px); }
.bg-night .link:hover { color: var(--brand); }

/* ---------- En-tête ---------- */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--header-h);
    background: var(--night);
    color: var(--on-dark);
    border-bottom: 1px solid var(--line-dark);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 6px; }
.brand span { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.site-nav { display: none; align-items: center; gap: 2px; }
.site-nav .nav-item {
    position: relative;
    padding: 8px 12px;
    font-size: 15px;
    color: var(--on-dark-muted);
    border-radius: 4px;
    transition: color .15s;
}
.site-nav .nav-item:hover, .site-nav .nav-item.is-active { color: var(--white); }
.site-nav .nav-item.is-active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 0;
    height: 2px;
    background: var(--brand);
}
.site-nav .btn { margin-left: 14px; min-height: 40px; padding: 9px 16px; font-size: 14px; }
.menu-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px; height: 46px;
    padding: 0 12px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
}
.menu-btn span { display: block; height: 2px; background: var(--on-dark); transition: transform .2s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-panel {
    position: fixed;
    top: var(--header-h); left: 0; right: 0; bottom: 0;
    display: none;
    flex-direction: column;
    padding: 12px 20px 28px;
    overflow-y: auto;
    background: var(--night);
}
.mobile-panel.is-open { display: flex; }
.mobile-panel .nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 2px;
    font-size: 22px;
    font-weight: 600;
    color: var(--on-dark);
    border-bottom: 1px solid var(--line-dark);
}
.mobile-panel .nav-item .icon { color: var(--on-dark-muted); }
.mobile-panel .nav-item.is-active { color: var(--brand); }
.mobile-panel .btn { margin-top: 24px; }
.mobile-panel .mobile-contact { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; color: var(--on-dark-muted); font-size: 15px; }
@media (min-width: 1000px) {
    .site-nav { display: flex; }
    .menu-btn, .mobile-panel { display: none !important; }
}

/* ---------- En-tête des pages intérieures ---------- */
.page-head { padding: calc(var(--header-h) + 56px) 0 56px; background: var(--night); color: var(--on-dark); }
@media (min-width: 1024px) { .page-head { padding: calc(var(--header-h) + 88px) 0 80px; } }
.page-head .label { margin-bottom: 18px; color: var(--on-dark-muted); }
.page-head .display { max-width: 15ch; color: var(--white); }
.page-head .lead { margin-top: 22px; max-width: 620px; color: var(--on-dark-muted); }
.page-head .head-meta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--on-dark-muted); }

/* ---------- Appel final ---------- */
.cta-final { padding: 80px 0; background: var(--navy); color: var(--on-dark); }
.cta-final .wrap { display: grid; gap: 32px; align-items: end; }
@media (min-width: 960px) { .cta-final .wrap { grid-template-columns: 1.3fr 1fr; } }
.cta-final h2 { color: var(--white); }
.cta-final p { margin-top: 16px; max-width: 520px; color: var(--on-dark-muted); font-size: 17px; }
.cta-final .contact-lines { margin-top: 18px; display: grid; gap: 6px; font-family: var(--mono); font-size: 14px; color: var(--on-dark-muted); }
.cta-final .contact-lines a { color: var(--on-dark); }
.cta-final .contact-lines a:hover { color: var(--brand); }
@media (min-width: 960px) { .cta-final .actions { justify-content: flex-end; } .cta-final .contact-lines { justify-items: end; } }

/* ---------- Pied de page ---------- */
.site-footer { padding: 64px 0 28px; background: var(--night); color: var(--on-dark-muted); font-size: 15px; border-top: 1px solid var(--line-dark); }
.footer-grid { display: grid; gap: 40px; }
.footer-grid > * { min-width: 0; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.6fr; gap: 48px; } }
.site-footer .brand { color: var(--white); }
.site-footer h2 { margin-bottom: 14px; font-family: var(--mono); font-size: 13px; font-weight: 500; text-transform: lowercase; color: var(--on-dark); }
.site-footer ul li + li { margin-top: 2px; }
.site-footer ul a, .footer-contact a, .cta-final .contact-lines a { display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--white); }
.footer-about { margin-top: 16px; max-width: 34ch; line-height: 1.6; }
.footer-contact { margin-top: 18px; display: grid; gap: 0; font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.footer-contact a { color: var(--on-dark); }
.footer-social { display: flex; gap: 8px; margin-top: 20px; }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    color: var(--on-dark);
}
.footer-social a:hover { border-color: var(--on-dark-muted); }
.footer-news p { margin-bottom: 14px; line-height: 1.6; }
.footer-news .field-row { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-news input[type="email"] {
    flex: 1 1 180px;
    min-width: 0;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line-dark);
    border-radius: var(--radius);
    background: #0d141d;
    color: var(--white);
}
.footer-news input[type="email"]::placeholder { color: #8893a3; }
.footer-news input[type="email"]:focus { outline: none; border-color: var(--brand); }
.footer-news .btn { flex: 0 0 auto; }
.form-status { font-size: 14px; }
.form-status:empty { display: none; }
.site-footer .form-status { margin-bottom: 10px; }
.form-status--ok { color: #8fe0a8; }
.form-status--err { color: #ffb4a8; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 56px;
    padding-top: 22px;
    border-top: 1px solid var(--line-dark);
    font-size: 13px;
    color: #9aa4b2;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-bottom a { padding: 4px 0; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
