/* =================================================================
   Claude IA : la méthode complète — site compagnon
   Système de design « tech sobre & moderne »
   Un seul fichier. Toutes les pages s'appuient sur ces classes.
   ================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg:           #ffffff;
  --bg-soft:      #f6f8fb;
  --bg-sunken:    #eef1f6;
  --surface:      #ffffff;
  --border:       #e4e8f0;
  --border-strong:#cfd6e4;

  --ink:          #0d1424;   /* titres */
  --text:         #3a4255;   /* corps */
  --muted:        #6a7384;   /* secondaire */

  --accent:        #2f54eb;
  --accent-strong: #1d39c4;
  --accent-soft:   #eef2ff;
  --on-accent:     #ffffff;

  --code-bg:   #0f172a;
  --code-text: #e7ecf5;
  --code-dim:  #93a0b8;

  --ok:    #157f4a;
  --ok-bg: #e7f6ee;
  --warn:  #9a5b00;
  --warn-bg:#fdf3e3;

  /* couleurs par niveau */
  --n1: #2563eb;  --n2: #0d9488;  --n3: #7c3aed;  --n4: #c026d3;  --n5: #ea580c;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(13,20,36,.06), 0 1px 3px rgba(13,20,36,.05);
  --shadow:    0 4px 16px rgba(13,20,36,.07), 0 1px 3px rgba(13,20,36,.05);
  --shadow-lg: 0 18px 48px rgba(13,20,36,.13);

  --maxw: 1120px;
  --maxw-narrow: 760px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo,
          Consolas, monospace;
}

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.018em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
img, svg { max-width: 100%; height: auto; }
strong { color: var(--ink); font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--maxw-narrow); }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding: 48px 0; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .75rem;
}
.section-title { max-width: 720px; margin-bottom: 2.5rem; }
.section-title.center { margin-left: auto; margin-right: auto; text-align: center; }
.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- 4. Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 16px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 1.02rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark { flex: none; width: 30px; height: 30px; border-radius: 8px; }
.brand__sub { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.nav__spacer { flex: 1 1 auto; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: inline-block; padding: 8px 12px; border-radius: 8px; color: var(--text);
  font-size: .94rem; font-weight: 550;
}
.nav__links a:hover { background: var(--bg-sunken); color: var(--ink); text-decoration: none; }
.nav__links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav__toggle {
  display: none; background: none; border: 1px solid var(--border-strong); border-radius: 8px;
  width: 42px; height: 40px; cursor: pointer; align-items: center; justify-content: center; color: var(--ink);
}
.nav__toggle svg { width: 22px; height: 22px; }

@media (max-width: 920px) {
  .nav__toggle { display: inline-flex; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 66px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 12px 16px 18px;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .18s ease;
  }
  .nav__links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 11px 12px; font-size: 1rem; }
  .nav__links .btn { margin-top: 6px; text-align: center; }
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: .98rem; font-weight: 600; line-height: 1;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-strong); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn--light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.34); }
.btn--light:hover { background: rgba(255,255,255,.26); color: #fff; }
.btn--sm { padding: 9px 15px; font-size: .88rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ---------- 6. Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(820px 420px at 88% -8%, rgba(47,84,235,.12), transparent 60%),
    radial-gradient(680px 360px at 4% 8%, rgba(124,58,237,.08), transparent 55%);
}
.hero__inner { position: relative; z-index: 1; padding: 84px 0 72px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero__lead { font-size: 1.24rem; color: var(--muted); max-width: 36ch; margin-bottom: 1.6rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.1rem; }
.hero__meta { font-size: .9rem; color: var(--muted); }
.hero__aside { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; gap: 36px; padding: 56px 0 48px; }
  .hero__lead { max-width: none; }
}

/* ---------- 7. Grids & cards ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card--link:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--border-strong); }
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.card__icon svg { width: 24px; height: 24px; }
.card__link { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.card__link svg { width: 16px; height: 16px; transition: transform .15s; }
.card--link:hover .card__link svg { transform: translateX(3px); }

/* ---------- 8. Level cards ---------- */
.lvl-card { position: relative; display: flex; flex-direction: column; padding-top: 30px; }
.lvl-card__num {
  position: absolute; top: -18px; left: 24px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem;
  color: #fff; box-shadow: var(--shadow-sm);
}
.lvl-card__tag { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .35rem; }
.n1 .lvl-card__num, .lvl-card--n1 .lvl-card__num { background: var(--n1); } .lvl-card--n1 .lvl-card__tag { color: var(--n1); }
.lvl-card--n2 .lvl-card__num { background: var(--n2); } .lvl-card--n2 .lvl-card__tag { color: var(--n2); }
.lvl-card--n3 .lvl-card__num { background: var(--n3); } .lvl-card--n3 .lvl-card__tag { color: var(--n3); }
.lvl-card--n4 .lvl-card__num { background: var(--n4); } .lvl-card--n4 .lvl-card__tag { color: var(--n4); }
.lvl-card--n5 .lvl-card__num { background: var(--n5); } .lvl-card--n5 .lvl-card__tag { color: var(--n5); }

/* ---------- 9. Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 650;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-sunken); color: var(--text);
  letter-spacing: .01em; white-space: nowrap;
}
.badge--soft { background: var(--accent-soft); color: var(--accent-strong); }
.badge--n1 { background: rgba(37,99,235,.12);  color: #1d4ed8; }
.badge--n2 { background: rgba(13,148,136,.13); color: #0f766e; }
.badge--n3 { background: rgba(124,58,237,.12); color: #6d28d9; }
.badge--n4 { background: rgba(192,38,211,.12); color: #a21caf; }
.badge--n5 { background: rgba(234,88,12,.13);  color: #c2410c; }

/* ---------- 10. Prompt cards (bibliothèque) ---------- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.filterbar .field { margin: 0; min-width: 180px; flex: 1 1 180px; }
.filterbar__count { margin-left: auto; font-size: .9rem; color: var(--muted); align-self: center; }
.search-field { position: relative; flex: 2 1 240px; }
.search-field input { padding-left: 40px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

.prompt {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 20px;
}
.prompt__head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px 12px; flex-wrap: wrap; }
.prompt__title { font-size: 1.08rem; margin: 0; flex: 1 1 auto; }
.prompt__tags { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.prompt__body { position: relative; }
.prompt__code {
  margin: 0; padding: 20px 22px; background: var(--code-bg); color: var(--code-text);
  font-family: var(--mono); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; padding: 7px 12px; font-size: .82rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: rgba(255,255,255,.2); }
.copy-btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.copy-btn svg { width: 15px; height: 15px; }
.is-empty-msg { display: none; text-align: center; padding: 48px 0; color: var(--muted); }

/* ---------- 11. Changelog / timeline ---------- */
.log { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.log__item { position: relative; padding: 0 0 30px 28px; }
.log__item::before {
  content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.log__date { font-size: .82rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.log__item h3 { font-size: 1.08rem; margin: 4px 0 .35rem; }
.log__item p:last-child { margin-bottom: 0; }

/* ---------- 12. Link lists ---------- */
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li + li { border-top: 1px solid var(--border); }
.linklist a { display: flex; align-items: center; gap: 14px; padding: 16px 4px; color: var(--ink); }
.linklist a:hover { text-decoration: none; color: var(--accent); }
.linklist .ll__txt { flex: 1 1 auto; }
.linklist .ll__txt small { display: block; color: var(--muted); font-weight: 400; font-size: .9rem; }
.linklist .ll__ext { color: var(--muted); width: 18px; height: 18px; flex: none; }

/* ---------- 13. Download cards ---------- */
.dl-card { display: flex; flex-direction: column; }
.dl-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dl-card__fmt {
  flex: none; font-size: .72rem; font-weight: 800; letter-spacing: .04em; color: var(--accent-strong);
  background: var(--accent-soft); padding: 6px 9px; border-radius: 7px;
}
.dl-card .btn { margin-top: auto; }

/* ---------- 14. Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 460px; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { background: var(--bg-soft); color: var(--ink); font-weight: 650; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }

/* ---------- 15. Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin-bottom: 0; }
.field label { font-weight: 600; color: var(--ink); font-size: .92rem; }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-hint { font-size: .85rem; color: var(--muted); }
.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: .9rem; color: var(--muted); }
.form-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.form-status { display: none; padding: 13px 16px; border-radius: 10px; font-size: .92rem; font-weight: 550; }
.form-status.is-visible { display: block; }
.form-status--ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- 16. Notes / callouts ---------- */
.note { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm); padding: 16px 18px; background: var(--bg-soft); margin: 1.4rem 0; }
.note p:last-child { margin-bottom: 0; }
.note--tip  { border-left-color: var(--accent); }
.note--warn { border-left-color: var(--warn); background: var(--warn-bg); }
.note__label { display: block; font-weight: 700; color: var(--ink); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }

/* ---------- 17. Steps ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { position: relative; padding-left: 52px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 18. Page header & breadcrumb ---------- */
.page-head { padding: 52px 0 8px; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.page-head .lead { margin-bottom: 0; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; }

/* ---------- 19. FAQ / accordion ---------- */
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 10px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details > p { padding: 14px 0 4px; margin: 0; color: var(--text); }

/* ---------- 20. CTA band ---------- */
.cta-band { background: linear-gradient(135deg, #131b35, #1f2a52); color: #fff; border-radius: var(--radius); padding: 44px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c4ccde; max-width: 52ch; margin-left: auto; margin-right: auto; }

/* ---------- 21. Footer ---------- */
.site-footer { background: #0d1424; color: #c4ccde; padding: 56px 0 28px; margin-top: 80px; }
.site-footer a { color: #c4ccde; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; margin-bottom: 12px; }
.footer-brand .brand__mark { width: 28px; height: 28px; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; font-size: .93rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: #8a93a8; }
.footer-bottom a { color: #8a93a8; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 21b. Figures (schémas du livre) ---------- */
.fig { margin: 1.6rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px; box-shadow: var(--shadow-sm); }
.fig img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.fig figcaption { margin-top: 12px; font-size: .88rem; color: var(--muted); text-align: center; }
.fig--plain { border: 0; box-shadow: none; background: transparent; padding: 0; }

/* badge mis en avant pour le neuf */
.badge--new { background: var(--accent); color: #fff; }

/* en-tête d'agent : ligne méta (type, outils) */
.agent-meta { font-size: .86rem; color: var(--muted); margin: 0 0 2px; }
.agent-meta strong { color: var(--ink); }
.prompt__head .btn { flex: none; }

/* ---------- 22. Utilities ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.stack > * + * { margin-top: 1rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hide { display: none !important; }
