:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef0f4; --text: #1b2330; --muted: #566174;
  --border: #dde1e8; --brand: #4338ca; --brand-hover: #3730a3; --brand-soft: #eef0ff; --on-brand: #ffffff;
  --code-bg: #0b1020; --code-text: #e6edf7; --warn-bg: #fff3cd; --warn-text: #5c4300;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 28px rgba(16, 24, 40, .08);
  --hero-glow: radial-gradient(60rem 28rem at 85% -10%, rgba(99, 82, 235, .16), transparent 70%), radial-gradient(40rem 22rem at -5% 10%, rgba(67, 56, 202, .10), transparent 70%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --surface: #161b22; --surface-2: #1d242d; --text: #e6edf3; --muted: #9aa7b6;
    --border: #2b3441; --brand: #8b93ff; --brand-hover: #a5abff; --brand-soft: #1c2140; --on-brand: #0d1117;
    --code-bg: #070a12; --code-text: #e6edf7; --warn-bg: #3a2f08; --warn-text: #f5d675; --shadow: none;
    --hero-glow: radial-gradient(60rem 28rem at 85% -10%, rgba(139, 147, 255, .16), transparent 70%), radial-gradient(40rem 22rem at -5% 10%, rgba(99, 82, 235, .12), transparent 70%);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6rem; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); letter-spacing: -.025em; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: .1em .38em; border-radius: 6px; }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: .6rem 1rem; border-radius: 8px; z-index: 50; }
.skip:focus { left: 12px; }

/* ---- en-tête */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
@supports (backdrop-filter: blur(8px)) { .top { background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px); } }
.bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.logo { flex: none; }
.menu { display: flex; gap: .15rem; flex-wrap: wrap; margin-left: .4rem; }
.menu a { padding: .45rem .7rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.menu a:hover { background: var(--brand-soft); color: var(--brand); }
.tools { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.lang, .app { padding: .4rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.lang:hover, .app:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 860px) {
  .bar { min-height: 56px; padding-top: .4rem; padding-bottom: .4rem; }
  .menu { order: 3; width: 100%; margin: 0; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .35rem; scrollbar-width: thin; }
  .menu a { white-space: nowrap; }
}
@media (max-width: 520px) { .app { display: none; } }

/* ---- boutons, pastilles */
.btn { display: inline-flex; align-items: center; min-height: 46px; padding: .6rem 1.2rem; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-weight: 650; text-decoration: none; border: 2px solid var(--brand); }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.2rem 0 0; }
.chips li { padding: .28rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .88rem; font-weight: 550; color: var(--muted); }
.chips.big li { font-size: 1rem; padding: .4rem .95rem; color: var(--text); }
.todo { background: var(--warn-bg); color: var(--warn-text); padding: .05em .45em; border-radius: 6px; font-weight: 600; }

/* ---- héros */
.hero { background: var(--hero-glow); }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 2.6rem; align-items: center; padding-top: 56px; padding-bottom: 44px; }
.eyebrow { font-size: .9rem; font-weight: 650; color: var(--brand); letter-spacing: .02em; margin-bottom: .8rem; }
.hero h1 span { color: var(--brand); display: block; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.cta { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0 0; }
.hero-visual { display: grid; gap: 1.1rem; min-width: 0; }
.terminal { margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 14px; overflow: hidden; border: 1px solid #1f2937; }
.terminal figcaption { padding: .55rem 1rem; font-size: .8rem; color: #9aa7b6; border-bottom: 1px solid #1f2937; }
.terminal pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font: .88rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.terminal code { background: none; padding: 0; font-size: inherit; color: inherit; }
.shot { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hero-shot img { height: auto; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; padding-top: 36px; } }

/* ---- chiffres */
.stats { border-block: 1px solid var(--border); background: var(--surface); }
.stats ul { list-style: none; margin: 0; padding: 1.4rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stats li { text-align: center; }
.stats strong { display: block; font-size: 2.3rem; line-height: 1.1; color: var(--brand); letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .92rem; }
@media (max-width: 720px) { .stats ul { grid-template-columns: repeat(2, 1fr); } }

/* ---- sections */
.sect { padding: 72px 0; }
.sect.alt { background: var(--surface); border-block: 1px solid var(--border); }
.sect > .wrap > h2 { margin-bottom: .5rem; }
.sect > .wrap > .lead { margin-bottom: 2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.3rem 1.4rem; }
.alt .card { background: var(--bg); }
.card.accent { border-color: var(--brand); background: var(--brand-soft); }
.card h3 { margin-bottom: .45rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card ul { margin: 0; padding-left: 1.15rem; }
.card li { margin-bottom: .3rem; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .cols3 { grid-template-columns: 1fr; } }
.note { color: var(--muted); max-width: 52rem; margin-top: 1.4rem; }

/* ---- schéma en étapes */
.flow { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.flow li { counter-increment: step; position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1rem 1rem; }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; margin-bottom: .7rem; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -.95rem; top: 1.45rem; width: .9rem; text-align: center; color: var(--brand); font-weight: 700; z-index: 1; }
.flow h3 { font-size: 1.02rem; }
.flow p { font-size: .92rem; color: var(--muted); margin: 0; }
@media (max-width: 960px) {
  .flow { grid-template-columns: 1fr; gap: .8rem; }
  .flow li { padding-left: 4rem; }
  .flow li::before { position: absolute; left: 1rem; top: 1rem; margin: 0; }
  .flow li::after { display: none; }
}

/* ---- fonctions */
.feature { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.4rem; align-items: center; margin-bottom: 3.2rem; }
.feature.rev .feature-text { order: 2; }
.feature .shot img { height: auto; max-height: 440px; }
.feature-text p { color: var(--muted); }
.more { margin-top: .5rem; }
.two { columns: 2; column-gap: 2rem; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; gap: 1.2rem; } .feature.rev .feature-text { order: 0; } .two { columns: 1; } }

/* ---- leçons, technologies */
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.lesson p { font-size: .96rem; }
.lesson b { color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.plain { padding-left: 1.1rem; margin: 0; }
.plain li { margin-bottom: .5rem; color: var(--muted); }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }
details { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1.1rem; margin-bottom: .7rem; }
details[open] { border-color: var(--brand); }
summary { cursor: pointer; font-weight: 650; }
details p { margin: .6rem 0 0; color: var(--muted); }

/* ---- pied de page, pages légales */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 2.2rem 0; font-size: .95rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: .4rem; }
.brand-line { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.doc { max-width: 800px; padding-top: 48px; padding-bottom: 64px; }
.doc h2 { margin-top: 2rem; font-size: 1.3rem; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th, .doc td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { width: 14rem; color: var(--muted); font-weight: 600; }
.notfound hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
@media print { .top, .cta, .foot a[href="#contenu"] { display: none; } body { background: #fff; color: #000; } .sect { padding: 24px 0; } }
