/* Styles des pages générées par build.py : /ressources/ et /r/<slug>/ */
:root {
  --bg: #ffffff;
  --ink: #0d0d0d;
  --muted: #5f5f5f;
  --dot: #cfcfcf;
  --line: #e2e2e2;
  --accent: #e5121b;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  color: var(--ink);
  font-family: "Inter Tight", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.pixel { font-family: "Pixelify Sans", ui-monospace, monospace; font-weight: 700; letter-spacing: .04em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 48px); }

/* ── En-tête ── */
.top { display: flex; justify-content: space-between; align-items: center; padding: 20px clamp(20px, 4vw, 48px); }
.mark { font-size: 24px; color: var(--accent); }
.top nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; }
.top nav a:not(.cta) { padding: 6px 10px; margin: -6px -10px; border-radius: 8px; transition: color .15s; }
.top nav a:not(.cta):hover { color: var(--accent); }
.top nav a.here { background: #f1f1f1; }
.cta { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; transition: background .15s; }
.cta:hover { background: var(--accent); }

/* ── Boutons, étiquettes ── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--ink); transform: translateY(-1px); }
.btn.soft { background: #efefef; color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.btn.soft:hover { background: #e4e4e4; }
.btn.white { background: #fff; color: var(--ink); }
.btn b { font-family: var(--mono); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  background: #f1f1f1; color: var(--muted);
}
.chip.red { background: #fde9ea; color: var(--accent); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8d8d8d; }

/* ── Page ressource : en-tête ── */
.res { padding-block: clamp(20px, 4vw, 44px) clamp(40px, 6vw, 72px); }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; }
.crumb a.mono:hover { color: var(--accent); }
.res h1 { font-weight: 500; font-size: clamp(34px, 5vw, 56px); line-height: 1.03; letter-spacing: -0.025em; max-width: 18ch; }
.res .summary { margin-top: 20px; max-width: 58ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: #3d3d3d; }
.byline { margin-top: 20px; font-family: var(--mono); font-size: 12px; color: #8d8d8d; }
.byline b { color: var(--ink); font-weight: 500; }
.works { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 18px; }
.works .tool { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; }
.works .tool::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cover { margin-top: clamp(28px, 4vw, 44px); max-width: 860px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.cover img { display: block; width: 100%; height: auto; }

/* ── Page ressource : contenu ── */
.prose { max-width: 760px; margin-top: clamp(28px, 4vw, 44px); font-size: 17px; line-height: 1.65; color: #2b2b2b; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin-top: clamp(40px, 5vw, 60px); font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.prose h3 { margin-top: 34px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.prose a:hover { color: var(--accent); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose :not(pre) > code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: #f1f1f1; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--accent); font-family: var(--mono); font-size: .85em; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.step { padding: 18px 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.step .n { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.step .t { margin-top: 10px; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.step .d { margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--muted); }

.code { border-radius: 12px; overflow: hidden; background: #111; color: #f3f3f3; }
.code-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid #2a2a2a; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9a9a9a; }
.code .copy { border: 1px solid #3a3a3a; background: #1e1e1e; color: #f3f3f3; border-radius: 7px; padding: 6px 11px; font-family: var(--mono); font-size: 11px; cursor: pointer; transition: background .15s, border-color .15s; }
.code .copy:hover { background: var(--accent); border-color: var(--accent); }
.code .copy.done { background: #0a7d3c; border-color: #0a7d3c; }
.code pre { margin: 0; padding: 16px; overflow-x: auto; }
.code code { font-family: var(--mono); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; padding: 12px 16px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #8d8d8d; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-family: var(--mono); font-size: 13px; color: var(--ink); white-space: nowrap; }

.callout { padding: 16px 18px; border-radius: 12px; border: 1px solid #f6c9cc; background: #fff5f5; font-size: 16px; }
.callout::before { content: "Note"; display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ── Carte newsletter ── */
.nl { margin-top: clamp(48px, 7vw, 88px); padding: clamp(26px, 4vw, 48px); background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.nl h2 { font-weight: 500; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -0.02em; }
.nl p.sub { margin-top: 12px; max-width: 46ch; font-size: 17px; line-height: 1.5; color: var(--muted); }
.nl form { display: flex; gap: 8px; max-width: 460px; margin-top: 24px; }
.nl input[type="email"] { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; outline: 0; padding: 14px 16px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.nl input[type="email"]:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.nl .btn { border-radius: 12px; padding: 14px 20px; font-size: 16px; white-space: nowrap; }
.nl .note { margin-top: 12px; min-height: 1.4em; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.nl .note.ok { color: #0a7d3c; }
.nl .note.err { color: #c62a12; }
.hp { position: absolute; left: -9999px; }

/* ── Cartes ressource (bibliothèque, « autres ressources ») ── */
.more { padding-block: clamp(48px, 7vw, 88px); }
.more-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; }
.more h2, .lib h1 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.more h2 { font-size: clamp(26px, 3.2vw, 38px); }
.more-head a { font-size: 15px; font-weight: 500; white-space: nowrap; }
.more-head a b { font-family: var(--mono); color: var(--accent); }
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rcard {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s;
}
.rcard:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 6px 0 var(--ink); }
.rcard .thumb { aspect-ratio: 16 / 9; background: #f4f4f4; border-bottom: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.rcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcard .thumb span { font-family: "Pixelify Sans", monospace; font-weight: 700; font-size: 34px; letter-spacing: .04em; color: #dcdcdc; }
.rcard .body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.rcard .meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rcard h3 { margin-top: 14px; font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.rcard p { margin: 8px 0 18px; font-size: 15px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .go { margin-top: auto; font-size: 15px; font-weight: 500; }
.rcard .go b { font-family: var(--mono); color: var(--accent); display: inline-block; transition: transform .2s; }
.rcard:hover .go b { transform: translateX(4px); }

/* ── Bibliothèque ── */
.lib { padding-block: clamp(20px, 4vw, 44px) clamp(48px, 7vw, 88px); flex: 1; }
.lib .mono { color: var(--accent); }
.lib h1 { margin-top: 14px; font-size: clamp(36px, 5.4vw, 64px); max-width: 16ch; }
.lib h1 .pixel { color: var(--accent); letter-spacing: .02em; }
.lib .summary { margin-top: 18px; max-width: 52ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: clamp(28px, 4vw, 44px) 0 20px; }
.tools input { flex: 1 1 240px; max-width: 360px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff; padding: 11px 14px; font: inherit; font-size: 16px; }
.tools input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.filters button:hover { border-color: var(--ink); }
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
#empty { padding: 40px 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ── Pied de page ── */
footer { background: #fff; border-top: 1px solid var(--line); margin-top: auto; }
.foot { padding-block: clamp(48px, 7vw, 88px) clamp(32px, 5vw, 56px); }
.foot h2 { max-width: 17ch; font-weight: 500; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.02em; }
.pixel { color: var(--accent); letter-spacing: .03em; }
.foot-links { margin-top: clamp(28px, 4vw, 44px); display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 15px; font-weight: 500; }
.foot-links a { transition: color .15s; }
.foot-links a:hover { color: var(--accent); }
.legal { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 18px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.legal i { display: inline-block; width: 6px; height: 6px; margin-left: 5px; background: var(--accent); }
.legal i:nth-child(2) { opacity: .55; }
.legal i:nth-child(3) { opacity: .25; }

.lang { margin-left: auto; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 5px 10px; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, color .15s; }
.lang:hover { border-color: var(--accent); color: var(--accent); }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.arrow { font-family: var(--mono); color: var(--accent); display: inline-block; transition: transform .2s; }
a:hover > .arrow, .rcard:hover .go .arrow { transform: translateX(4px); }
.chip { background: #fde9ea; color: var(--accent); }
.rempty { grid-column: 1 / -1; padding: clamp(28px, 4vw, 44px) 24px; text-align: center; background: #fff; border: 1px dashed #cfcfcf; border-radius: 18px; }
.rempty b { display: block; font-size: 18px; font-weight: 600; }
.rempty span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.works .tool { color: var(--ink); }

@media (max-width: 820px) {
  .top nav a:not(.cta) { display: none; }
  .top nav a.keep { display: block; }
  .rgrid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr 1fr; }
  .nl form { flex-direction: column; }
  td:first-child { white-space: normal; }
}
