/* Pages Ressources — même direction artistique que l'accueil (cf. ceepia.com) */
:root {
  --bg: #faf8f4; --bg-soft: #f1ede6; --surface: #fff; --text: #17140f; --muted: #5c5a56; --muted-2: #8f8a83;
  --border: #e6e0d7; --border-s: #d4cfc7; --accent: #e04c26; --accent-strong: #c63f1c; --accent-hover: #b63a1a;
  --accent-tint: #feebe5; --mistral: #fa520f;
  --shadow: 0 4px 24px rgb(86 35 17 / 8%); --shadow-lg: 0 12px 48px rgb(86 35 17 / 12%);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.04em; line-height: 1.08; text-wrap: balance; }
h3 { font-weight: 600; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; z-index: 100; }

/* Nav / boutons (repris de l'accueil) */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid rgb(214 210 203 / 60%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.04em; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 500; color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 24px; font: 600 15px var(--font); border-radius: 999px; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, box-shadow .3s; }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 7px 18px #56231124; }
.btn-ghost { color: var(--muted); border-color: var(--border-s); background: transparent; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn .wh { filter: brightness(0) invert(1); }

/* Hero */
.hero { padding: 72px 0 40px; background: radial-gradient(55% 70% at 12% 12%, #fff1e8 0%, transparent 62%), radial-gradient(45% 60% at 88% 85%, #f3e3d8 0%, transparent 60%), var(--bg); }
.hero-in { max-width: 860px; }
.crumb { display: inline-block; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 28px; }
.crumb:hover { color: var(--accent-strong); }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 600; color: var(--accent-strong); background: var(--accent-tint); padding: 7px 16px; border-radius: 999px; margin: 0 0 22px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); margin: 22px 0 0; max-width: 680px; }
.lede strong { color: var(--text); }
.chips-logos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.chip-logo { display: grid; place-items: center; width: 48px; height: 48px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 18px #5623110f; }
.chip-logo .lg { width: 24px; height: 24px; }
.callout { margin-top: 32px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--mistral); border-radius: 16px; padding: 18px 22px; box-shadow: var(--shadow); }
.callout-k { display: block; font-size: 13px; font-weight: 700; color: var(--mistral); margin-bottom: 4px; }
.callout p { margin: 0; font-size: 17.5px; line-height: 1.55; }

/* Mise en page */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 24px; padding-bottom: 80px; align-items: start; }
.toc { position: sticky; top: 88px; font-size: 14.5px; }
.toc summary { font-weight: 700; font-size: 13px; color: var(--muted-2); cursor: pointer; list-style: none; margin-bottom: 10px; letter-spacing: .02em; }
.toc summary::-webkit-details-marker { display: none; }
.toc nav { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
.toc a { display: flex; gap: 10px; padding: 7px 12px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); line-height: 1.35; }
.toc a span { font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--text); border-left-color: var(--accent); }
.toc a.on span { color: var(--accent-strong); }

/* Article */
.prose { max-width: 780px; min-width: 0; }
.sec { padding: 44px 0 8px; border-top: 1px solid var(--border); }
.sec:first-child { border-top: 0; padding-top: 24px; }
.sec-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.sec-n { font-size: 15px; font-weight: 700; color: var(--accent-strong); background: var(--accent-tint); border-radius: 999px; padding: 4px 12px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); flex: 1 1 320px; }
.sec-logos { display: flex; gap: 6px; }
.sec-logos .lg { width: 26px; height: 26px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; object-fit: contain; }
.prose h3 { font-size: 1.3rem; margin: 34px 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--accent-strong); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose a { color: var(--accent-strong); text-underline-offset: 3px; }
.cite { font-size: .72em; line-height: 0; margin-left: 1px; }
.cite a { display: inline-block; min-width: 1.5em; padding: 1px 4px; text-align: center; text-decoration: none; font-weight: 700; background: var(--accent-tint); border-radius: 6px; margin: 0 1px; }
.cite a:hover { background: var(--accent-strong); color: #fff; }

/* Tableaux */
.table-scroll { overflow-x: auto; margin: 22px 0 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 6px 18px #5623110a; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
th { text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--bg-soft); padding: 12px 16px; white-space: nowrap; }
td { padding: 13px 16px; border-top: 1px solid var(--border); vertical-align: top; }
td:first-child { font-weight: 600; }
tr:hover td { background: #fffaf6; }
.cell-logo { display: inline-flex; align-items: center; gap: 10px; }
.cell-logo .lg { width: 22px; height: 22px; flex: none; }
.brand-row.is-mistral td { background: #fff3ec; }
.brand-row.is-mistral td:first-child { box-shadow: inset 3px 0 0 var(--mistral); }
td.num { white-space: nowrap; text-align: right; }
td.num b { display: inline-block; min-width: 2ch; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 110px; height: 8px; background: var(--bg-soft); border-radius: 99px; vertical-align: middle; margin-right: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #b8b2a8; border-radius: 99px; }
.is-mistral .bar i { background: var(--mistral); }
th[style*="right"], td[style*="right"] { text-align: right; }

/* Code / prompt */
pre { margin: 0; overflow-x: auto; }
.formula { background: #17140f; color: #f3ead9; border-radius: 16px; padding: 20px 24px; margin: 20px 0 24px; font: 500 15px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prompt { margin: 22px 0 14px; border-radius: 18px; overflow: hidden; background: #17140f; box-shadow: var(--shadow-lg); }
.prompt-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 20px; background: #221d18; color: #cfc6b8; font-size: 13px; font-weight: 600; }
.copy { font: 600 13px var(--font); color: #fff; background: var(--accent-strong); border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.copy:hover { background: var(--accent-hover); }
.prompt pre { padding: 20px 24px; color: #f3ead9; font: 400 14.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

/* Sources */
.prose .sources { list-style: none; padding: 0; display: grid; gap: 12px; margin-top: 20px; }
.prose .src { display: flex; gap: 16px; padding: 18px; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; scroll-margin-top: 90px; }
.src:target { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.src-logo { display: grid; place-items: center; flex: none; width: 44px; height: 44px; background: var(--bg-soft); border-radius: 12px; }
.src-logo .lg { width: 24px; height: 24px; }
.src b { font-weight: 700; }
.src p { margin: 4px 0 10px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.src-links { display: flex; flex-wrap: wrap; gap: 8px; }
.src-link { font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 14px; border: 1px solid var(--border-s); border-radius: 999px; color: var(--text) !important; }
.src-link:hover { border-color: var(--accent); color: var(--accent-strong) !important; }

.reflex { margin: 44px 0 24px; padding: 34px 32px; border-radius: 28px; border: 1px solid var(--border); background: radial-gradient(60% 80% at 50% 115%, rgb(224 76 38 / 22%), transparent 70%), radial-gradient(45% 60% at 10% 0%, #fff1e8, transparent 60%), var(--bg); }
.reflex p { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.25; }
.follow { display: flex; flex-wrap: wrap; gap: 12px; }
.follow .lg { width: 18px; height: 18px; }

footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 30px 0; font-size: 14px; color: var(--muted-2); }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a { text-decoration: none; color: var(--muted); }
footer a:hover { color: var(--text); }

/* Index des ressources */
.index-hero { padding: 72px 0 24px; background: radial-gradient(55% 70% at 12% 12%, #fff1e8 0%, transparent 62%), var(--bg); }
.index-hero h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding: 24px 0 90px; }
.res-card { display: flex; flex-direction: column; gap: 14px; padding: 26px; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 6px 18px #5623110a; transition: transform .4s var(--ease), box-shadow .4s, border-color .3s; }
.res-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #c63f1c73; }
.res-logos { display: flex; gap: 8px; }
.res-logos .lg { width: 38px; height: 38px; padding: 8px; background: var(--bg-soft); border-radius: 12px; }
.res-card h2 { font-size: 1.6rem; }
.res-card p { color: var(--muted); font-size: 16px; margin: 0; }
.res-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 600; color: var(--muted-2); }
.res-go { color: var(--accent-strong); }
.res-soon { border-style: dashed; background: transparent; box-shadow: none; }
.res-soon:hover { transform: none; box-shadow: none; border-color: var(--border-s); }
.res-soon h2 { color: var(--muted-2); }
.how { margin: 8px 0 0; padding: 24px 28px; border-radius: 20px; background: var(--bg-soft); border: 1px solid var(--border); font-size: 16px; color: var(--muted); }
.how b { color: var(--text); }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 12px; }
  .toc { position: static; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
  .toc summary { margin: 0; }
  .toc details[open] summary { margin-bottom: 10px; }
}
@media (max-width: 700px) {
  body { font-size: 16.5px; }
  .nav-links { display: none; }
  .hero { padding: 40px 0 24px; }
  .container { padding: 0 16px; }
  .reflex { padding: 26px 22px; }
  .bar { width: 64px; }
  th, td { padding: 11px 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } #progress { display: none; } }

/* Citations (modèles de lettre, mots-clés) et sous-titres */
.prose blockquote { margin: 18px 0; padding: 14px 20px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; }
.prose blockquote p { margin: 0 0 10px; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose h4 { font-size: 18px; margin: 22px 0 8px; }

/* Photos */
.res-photo { margin: 28px 0; }
.res-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 22px; box-shadow: 0 10px 30px #5623111a; background: var(--bg-soft); }
.res-photo figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.res-photo figcaption a { color: inherit; }
.res-photo-me { max-width: 780px; margin: 8px auto 28px; padding: 0 20px; box-sizing: content-box; }
.res-photo-me img { aspect-ratio: 16 / 9; }
.res-cover { display: block; max-width: none; height: auto; width: calc(100% + 52px); margin: -26px -26px 4px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 22px 22px 0 0; }
