@font-face {
  font-family: "Montserrat";
  src: url("assets/fonts/montserrat-var-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #4a4a49;        /* anthracite des logos */
  --ink-deep: #383837;
  --ink-soft: #626260;
  --leaf: #abd29f;       /* vert clair « IT » (charte : FREE-IT - Logo - HD.ai) */
  --leaf-dark: #49835e;  /* vert foncé, fin des dégradés (charte) */
  --leaf-text: #3e6f50;  /* vert foncé assombri : lisible en petit sur fond clair (5,4:1) */
  --bg: #ffffff;
  --bg-soft: #f4f8f2;
  --line: #dfe8da;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf-text); }
:focus-visible { outline: 3px solid var(--leaf-dark); outline-offset: 2px; border-radius: 4px; }

/* Bascule de thème (theme.js) : éléments propres à la version pixel masqués ici ; bouton affiché par le script */
.only-pixel { display: none !important; }
.theme-toggle { font: inherit; font-size: .88rem; border: 0; cursor: pointer; }
.theme-toggle[hidden] { display: none; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 30; background: #fff; padding: .5em 1em; }

.wrap { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
section { padding: 88px 0; }
section.wrap { padding-top: 88px; padding-bottom: 88px; }

h1, h2, h3 { line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h2.big { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; max-width: 22em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { text-wrap: pretty; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; color: var(--leaf-text); margin: 0 0 1em; }
.lead { font-size: 1.12rem; color: var(--ink-soft); margin-top: 0; }
.narrow { max-width: 660px; }

/* Boutons */
.btn {
  display: inline-block; padding: .8em 1.4em; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 600;
  transition: background .2s;
}
.btn:hover { background: var(--leaf-text); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: .5em 1.05em; font-size: .88rem; white-space: nowrap; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* Bouton « Make Magic » : bordure en dégradé qui défile, halo qui pulse, reflet qui traverse, étoile qui scintille */
.btn.theme-toggle {
  position: relative; overflow: hidden; isolation: isolate;
  border: 2px solid transparent; box-shadow: none; color: var(--ink-deep);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(90deg, var(--leaf-dark), var(--leaf), #e3b75f, var(--leaf), var(--leaf-dark)) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: magic-border 4s linear infinite, magic-glow 2.4s ease-in-out infinite;
}
.btn.theme-toggle::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(172, 210, 159, .95) 45%, rgba(227, 183, 95, .55) 55%, transparent 70%);
  transform: translateX(-120%);
  animation: magic-sheen 3.2s ease-in-out infinite;
}
.btn.theme-toggle .only-normal::after {
  content: "✦"; display: inline-block; margin-left: .4em; color: #c98a14; font-size: 1.15em; line-height: 1;
  animation: magic-twinkle 1.6s ease-in-out infinite;
}
.btn.theme-toggle:hover {
  color: #fff;
  background:
    linear-gradient(90deg, var(--leaf-text), var(--leaf-dark)) padding-box,
    linear-gradient(90deg, var(--leaf-dark), var(--leaf), #e3b75f, var(--leaf), var(--leaf-dark)) border-box;
  background-size: 100% 100%, 300% 100%;
}
.btn.theme-toggle:hover .only-normal::after { color: #ffd77a; }
@keyframes magic-border { to { background-position: 0 0, 300% 0; } }
@keyframes magic-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78, 138, 95, 0); }
  50% { box-shadow: 0 0 14px 3px rgba(78, 138, 95, .45); }
}
@keyframes magic-sheen {
  0%, 50% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}
@keyframes magic-twinkle {
  0%, 100% { transform: scale(.7) rotate(0deg); opacity: .55; }
  50% { transform: scale(1.25) rotate(90deg); opacity: 1; }
}

/* En-tête */
.top { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 66px; }
.brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); font-weight: 700; white-space: nowrap; }
.brand span { margin-left: 6px; }
.brand b { color: var(--leaf-text); }
nav { display: flex; align-items: center; gap: 20px; }
nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .9rem; white-space: nowrap; }
nav a:not(.btn):hover { color: var(--leaf-text); }
nav a.btn { color: #fff; }

/* Hero */
.hero { background: var(--bg-soft) url(assets/lagon-sobre.svg?v=7dc8a871e6) no-repeat center bottom / max(100%, 1100px) auto; padding: 80px 0 max(240px, 17.5vw); }
.hero-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero-logos { display: grid; gap: 4px; mix-blend-mode: multiply; }
.hero-logos img { justify-self: end; width: 100%; max-width: 500px; height: auto; }

.band { background: var(--bg-soft); }

/* Qui sommes-nous */
.qui { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; max-width: 980px; }
.qui .approche { grid-column: 1 / -1; }

/* Que faisons-nous */
.services { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.services li { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--leaf-dark); border-radius: var(--radius); padding: 22px 22px 18px; display: flex; flex-direction: column; counter-increment: s; }
.services h3 { font-size: 1.2rem; }
.services h3::before { content: counter(s, decimal-leading-zero) " "; color: var(--leaf-text); font-weight: 800; }
.services p { margin: 0 0 .8em; font-size: .95rem; }
.services .ex { margin: auto 0 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--ink-soft); font-size: .88rem; font-style: italic; }
.aussi { margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.aussi div { padding: 14px 0 0; border-top: 2px solid var(--leaf); }
.aussi dt { font-weight: 700; margin-bottom: .3em; }
.aussi dd { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* Qu'utilisons-nous : exemple */
.exemple { margin-top: 36px; padding: 22px 26px; background: var(--bg-soft); border-left: 4px solid var(--leaf-dark); border-radius: 0 var(--radius) var(--radius) 0; max-width: 860px; }
.exemple h3 { font-size: 1.05rem; }
.exemple p { margin: 0; color: var(--ink-soft); }

/* Technologies */
.stack { margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
.stack div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.stack dt { font-weight: 700; font-size: .95rem; }
.stack dd { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Qui sommes-nous : secteurs */
.sectors { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.sectors-title { margin: 0 0 12px; font-weight: 700; font-size: .95rem; }
.sectors ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.sectors li { padding: .45em 1em; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }

/* Compétences : partenaires */
.partners { margin-top: 44px; padding-top: 28px; border-top: 2px solid var(--ink); display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; align-items: start; }
.partners h3 { font-size: 1.15rem; }
.partners p { margin: 0; color: var(--ink-soft); max-width: 46em; }
.partners dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.partners dl div { padding: 14px 0 0; border-top: 2px solid var(--leaf); }
.partners dt { font-weight: 700; margin-bottom: .3em; }
.partners dd { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* Contact */
.contact-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.contact-in .lead { margin-bottom: 0; }
.contact { list-style: none; margin: 0; padding: 8px 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.contact li { padding: 16px 0; display: grid; grid-template-columns: 7em 1fr; gap: 12px; align-items: baseline; font-size: 1.05rem; }
.contact li + li { border-top: 1px solid var(--line); }
.contact span { color: var(--leaf-text); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; }
.contact a { font-weight: 700; text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* Pied de page */
.foot { background: var(--ink-deep); color: #ddd; padding: 32px 0; font-size: .9rem; }
.foot a { color: var(--leaf); }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot p { margin: 0 0 .5em; }
.foot summary { cursor: pointer; color: var(--leaf); }
.foot-legal:has(details[open]) { flex-basis: 100%; }
.foot-legal > p { margin: .5em 0 0; }

@media (max-width: 980px) {
  nav a:not(.btn) { display: none; }
}

@media (max-width: 900px) {
  section, section.wrap { padding-top: 56px; padding-bottom: 56px; }
  .hero { padding: 48px 0 195px; }
  .hero-logos img { justify-self: start; }
  .hero-in { grid-template-columns: 1fr; gap: 28px; }
  .hero-logos { max-width: 440px; }
  .contact-in, .partners, .partners dl { grid-template-columns: 1fr; gap: 28px; }
  .services, .aussi, .stack { grid-template-columns: 1fr 1fr; }
  .qui { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand span { display: none; }
  .contact { padding: 4px 20px; }
  .contact li { grid-template-columns: 1fr; gap: 2px; }
  .services, .aussi, .stack { grid-template-columns: 1fr; }
  .stack div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn.theme-toggle, .btn.theme-toggle::before, .btn.theme-toggle .only-normal::after { animation: none; }
  .btn.theme-toggle::before { display: none; }
  .hero { background-image: url(assets/lagon-sobre-fixe.svg?v=10c4de2dae); }
}

/* Page 404 */
.legal { max-width: 46em; padding-top: 48px; padding-bottom: 64px; }
.legal h2 { font-size: 1.3rem; margin-top: 1.8em; }
.legal-home img { display: block; }
.notfound { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding-top: 48px; padding-bottom: 48px; }
.notfound img { margin-bottom: 24px; }
