/* Castor — feuille commune de /castor et /castor/en, au style TeXtured (Latin Modern, en-tête courant à filet
   terminé par des losanges, lettrine Chorus, sections numérotées, légendes « Figure n / », tableaux booktabs).
   Les variables sont celles de la feuille mère /textured/textured.css (--fond, --papier, --encre, --doux,
   --trait, --cadre, --numero, --lien…). Seconde partie : l'arrière-plan en caractères (le chantier du castor),
   dessiné par castor.js dans trois calques fixes, derrière le contenu.
   Aucune ressource d'un autre domaine : chemins absolus sous /castor/ (réécritures Vercel vers site/castor/). */

@font-face { font-family: "C Roman"; font-weight: 400; font-display: swap; src: url("/castor/fonts/lmroman10-regular.woff2") format("woff2"); }
@font-face { font-family: "C Roman"; font-weight: 700; font-display: swap; src: url("/castor/fonts/lmroman10-bold.woff2") format("woff2"); }
@font-face { font-family: "C Slant"; font-weight: 400; font-display: swap; src: url("/castor/fonts/lmromanslant10-regular.woff2") format("woff2"); }
@font-face { font-family: "C Sans"; font-weight: 400; font-display: swap; src: url("/castor/fonts/lmsans10-regular.woff2") format("woff2"); }
@font-face { font-family: "C Sans"; font-weight: 700; font-display: swap; src: url("/castor/fonts/lmsans10-bold.woff2") format("woff2"); }
@font-face { font-family: "C Mono"; font-weight: 400; font-display: swap; src: url("/castor/fonts/lmmono10-regular.woff2") format("woff2"); }
@font-face { font-family: "C Chorus"; font-style: italic; font-display: block; src: url("/castor/fonts/texgyrechorus-c.woff2") format("woff2"); }
@font-face { font-family: "C Repli"; src: local("Georgia"); size-adjust: 90%; }
@font-face { font-family: "C Repli Sans"; src: local("Helvetica Neue"), local("Arial"); size-adjust: 87%; }

:root {
  color-scheme: light dark;
  --fond: light-dark(#f9fafb, #292929);
  --papier: light-dark(#fff, #303030);
  --encre: light-dark(#1b1616, #dbdbdb);
  --doux: light-dark(#595959, #a6a6a6);
  --trait: light-dark(#bfbfbf, #5c5c5c);
  --cadre: light-dark(#8c8c8c, #7a7a7a);
  --grille: light-dark(#ececec, #464646);
  --numero: light-dark(#e0e0e0, #3d3d3d);
  --lien: light-dark(#2f6db5, #8db4ea);
  --accent: light-dark(#b5452f, #f0a494);
  --url-cadre: light-dark(#ed9c8b, #b8705f);
  --url-fond: light-dark(#ffece8, #43302b);
  --ref-cadre: light-dark(#b3b3b3, #6b6b6b);
  --ref-fond: light-dark(#f7f7f7, #333);
  --code-fond: light-dark(#eaeef2, #3a3838);
  --retenir-bord: light-dark(#4fb3c8, #4f99a8);
  --retenir-fond: light-dark(#effbfd, #2a3436);
  --bleu: light-dark(#2563a8, #6aa5e8);
  --rouge: light-dark(#c0392b, #ef7d6e);
  --vert: light-dark(#2e7d4f, #6cc28f);
  --orange: light-dark(#b8660f, #f0a65a);
  --violet: light-dark(#7b4fa3, #b996dd);
  --cyan: light-dark(#157684, #5cc4d2);
  /* une couleur par famille d'outils : le losange de la carte et son survol */
  --f-pdf: var(--violet); --f-image: var(--cyan); --f-video: var(--bleu); --f-audio: var(--vert); --f-create: var(--orange); --f-files: var(--rouge);
  --texte: "C Roman", "Latin Modern Roman", "C Repli", Georgia, serif;
  --penche: "C Slant", "C Roman", "Latin Modern Roman", "C Repli", Georgia, serif;
  --sans: "C Sans", "Latin Modern Sans", "C Repli Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "C Mono", "Latin Modern Mono", ui-monospace, Menlo, Consolas, monospace;
  --chorus: "C Chorus", "TeX Gyre Chorus", "Apple Chancery", cursive;
  --corps: 1rem;
  --col: 42rem;
  --large: 58rem;
  --marge: 1.25rem;
  --h-tete: 2.4rem;
}
@supports not (color: light-dark(#000, #fff)) {
  :root {
    color-scheme: light;
    --fond: #f9fafb; --papier: #fff; --encre: #1b1616; --doux: #595959; --trait: #bfbfbf; --cadre: #8c8c8c; --grille: #ececec; --numero: #e0e0e0;
    --lien: #2f6db5; --accent: #b5452f; --url-cadre: #ed9c8b; --url-fond: #ffece8; --ref-cadre: #b3b3b3; --ref-fond: #f7f7f7; --code-fond: #eaeef2;
    --retenir-bord: #4fb3c8; --retenir-fond: #effbfd; --bleu: #2563a8; --rouge: #c0392b; --vert: #2e7d4f; --orange: #b8660f; --violet: #7b4fa3; --cyan: #157684;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--h-tete) + 1.2rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 var(--corps)/1.55 var(--texte); font-kerning: normal;
  font-variant-ligatures: common-ligatures; overflow-wrap: break-word; }
::selection { background: rgb(255 127 100 / .25); }
:focus-visible { outline: 2px solid var(--lien); outline-offset: 2px; border-radius: 2px; }
img, svg, video { max-width: 100%; }
img, video { height: auto; }
a { color: var(--lien); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
em, i { font-family: var(--penche); font-style: normal; }
b, strong { font-weight: 700; }
p { margin: .7em 0; }
main :is(p, li), figcaption { hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
@media (min-width: 40em) { main p.j { text-align: justify; } }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; line-height: 1.22; hyphens: manual; text-wrap: balance; }
code, pre, kbd { font-family: var(--mono); }
code { font-size: .95em; }
kbd { padding: .05em .35em; border: 1px solid var(--trait); border-bottom-width: 2px; border-radius: 3px; background: var(--papier);
  font: 400 .82em var(--sans); white-space: nowrap; }

.page { max-width: calc(var(--col) + 2 * var(--marge)); margin: 0 auto; padding: 0 var(--marge); }
/* blocs plus larges (figures, catalogue) : ils débordent symétriquement de la colonne */
.large { margin-inline: calc((min(100vw - 2 * var(--marge), var(--large)) - 100%) / -2); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .plus { display: none; }
.evite { position: absolute; left: -9999px; top: 0; z-index: 50; padding: .6rem 1rem; background: var(--encre); color: var(--fond); font-family: var(--sans); }
.evite:focus { left: 0; }

/* ---------- en-tête courant : nu sur la première page, puis « header » ; le filet finit en losanges ---------- */
.tete { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: .9rem;
  height: var(--h-tete); padding: .35rem 2px 0; background: var(--fond); font: 400 .875rem/1.2 var(--sans); color: var(--doux);
  box-shadow: 0 0 0 100vmax var(--fond); clip-path: inset(0 -100vmax -6px); }   /* fond pleine largeur : le catalogue (.large) passe dessous, pas à côté */
.tete .courant { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: opacity .15s ease-out; }
.tete .filet { position: absolute; left: 0; right: 0; bottom: 0; height: 1.2px; background: var(--trait); }
.tete .filet::before, .tete .filet::after { content: ""; position: absolute; top: -3px; width: 7px; height: 7px; background: var(--fond);
  border: 1.2px solid var(--trait); rotate: 45deg; }
.tete .filet::before { left: -7px; }
.tete .filet::after { right: -7px; }
.tete.premiere .courant { opacity: 0; }
.tete.premiere .filet { left: 55%; background: linear-gradient(to right, transparent, var(--trait)); }
.tete.premiere .filet::before { display: none; }
/* à droite, seulement les réglages du site (langue, animation, thème) : atelier.js les range dans cette rangée, comme sur
   les pages TeXtured (.tete .outils l'emporte sur .outils, la grille du catalogue) ; le dépôt GitHub est lié sous les boutons
   de téléchargement */
.tete .outils { flex: none; display: flex; gap: .15rem; margin-left: auto; }
.tete .outils button { display: inline-grid; place-items: center; min-width: 1.75rem; min-height: 1.75rem; padding: 0 .4rem;
  border: 1px solid transparent; border-radius: 4px; background: none; color: inherit; font: inherit; cursor: pointer; }
.tete .outils button:hover { border-color: var(--trait); color: var(--encre); }
.tete .outils button svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- titre, comme \chapter* : lettrine Chorus pâle derrière, devise, marque (le losange croqué) ---------- */
.titre { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0 2rem; align-items: start; margin: 2.4rem 0 1.2rem; }
.titre .texte { position: relative; min-width: 0; }
.titre h1 { position: relative; margin: 0; font-size: clamp(2.6rem, 8vw, 3.4rem); line-height: 1.1; letter-spacing: -.005em; }
.titre .lettrine { position: absolute; left: -.05em; top: -.45em; font: italic 400 clamp(6rem, 17vw, 7.6rem)/1 var(--chorus);
  color: var(--numero); user-select: none; pointer-events: none; }
.titre .devise { position: relative; margin: .7rem 0 0; font: 400 clamp(1.15rem, 3.2vw, 1.4rem)/1.3 var(--sans); color: var(--encre); hyphens: manual; }
.titre .devise span { color: var(--doux); white-space: nowrap; }
.titre .marque { width: 7.5rem; height: 7.5rem; margin-top: .2rem; color: var(--encre); }
.titre .marque .c { fill: var(--fond); }
@media (max-width: 600px) {
  .titre { grid-template-columns: 1fr; }
  .titre .marque { position: absolute; right: 0; top: -.4rem; width: 3.4rem; height: 3.4rem; }
}

.sommaire { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin: 1rem 0 0; font: 400 .9rem/1.2 var(--sans); }
.sommaire a { display: inline-block; padding: .55rem 0; }

/* ---------- boutons de téléchargement ---------- */
.telecharger { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0 .6rem; }
.bouton { display: inline-flex; flex-direction: column; justify-content: center; min-height: 3.1rem; padding: .45rem 1rem .5rem;
  border: 1px solid var(--encre); border-radius: 3px; background: var(--encre); color: var(--fond); font: 700 1rem/1.15 var(--sans);
  text-decoration: none; transition: background-color .14s ease-out, color .14s ease-out; }
.archs { flex-basis: 100%; margin: .1rem 0 0; font-size: .9rem; color: var(--doux); }
.bouton small { font-weight: 400; font-size: .78rem; opacity: .85; }
.bouton:hover { background: var(--fond); color: var(--encre); text-decoration: none; }
.mention { margin: .35rem 0 0; font: 400 .9rem/1.4 var(--sans); color: var(--doux); }

/* liens du texte : renvoi interne en gris, lien externe en corail, comme dans la feuille mère */
main :is(p, li, .note-t, .mention) a[href]:not(.bouton) { color: inherit; text-decoration: none; padding: 0 .15em; border-radius: .15em;
  background: var(--ref-fond); box-shadow: inset 0 0 0 1.1px var(--ref-cadre); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
main :is(p, li, .note-t, .mention) a[href^="http"]:not(.bouton) { background: var(--url-fond); box-shadow: inset 0 0 0 1.1px var(--url-cadre); }
main :is(p, li, .note-t, .mention) a[href]:not(.bouton):hover { box-shadow: inset 0 0 0 1.7px var(--cadre); }
main .sommaire a[href] { background: none; box-shadow: none; padding: .55rem 0; color: var(--lien); text-decoration: underline; }

/* ---------- sections : filet à losange, numéro, chapeau ---------- */
section { position: relative; margin-top: 4rem; }
section::before { content: ""; display: block; height: 1.2px; margin: 0 8% 2.2rem; background: linear-gradient(to right, transparent, var(--trait) 18%, var(--trait) 82%, transparent); }
section::after { content: ""; position: absolute; left: 50%; top: -.21rem; width: .42rem; height: .42rem; border: 1.2px solid var(--trait); background: var(--fond);
  translate: -50% 0; rotate: 45deg; }
h2 { margin: 0 0 .6rem; font-size: 1.5rem; line-height: 1.2; }
h3 { margin: 1.7rem 0 .4rem; font-size: 1.15rem; line-height: 1.25; }
.num { margin-right: .65em; font-variant-numeric: tabular-nums; }
.chapeau { color: var(--doux); }

/* ---------- figures ---------- */
figure { margin: 1.4rem 0 1.6rem; }
figure img, figure video { display: block; width: 100%; border: 1px solid var(--trait); border-radius: 3px; background: var(--papier); }
figcaption { margin-top: .55rem; font-size: .9rem; line-height: 1.38; color: var(--doux); text-wrap: balance; }
figcaption b { font-family: var(--sans); color: var(--encre); margin-right: .15em; }
.paire { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .paire { grid-template-columns: 1fr; } }
.cote { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.6rem; align-items: start; }
.cote figure { margin-top: .4rem; }
@media (max-width: 680px) { .cote { grid-template-columns: 1fr; } .cote figure { max-width: 17rem; } }

/* ---------- points (calme, rapide, local) : filets fins, sans pastilles ---------- */
.points { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 2rem; margin: 1rem 0; padding: 0; list-style: none; }
.points li { padding: .7rem 0 .6rem; border-top: 1px solid var(--trait); }
.points b { display: block; font-family: var(--sans); }
@media (max-width: 640px) { .points { grid-template-columns: 1fr; } }

/* ---------- catalogue ---------- */
.barre { position: sticky; top: var(--h-tete); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  margin: 1.1rem 0 .2rem; padding: .7rem 0 .5rem; background: var(--fond); font-family: var(--sans); }
@media (max-width: 760px), (max-height: 640px) { .barre { position: static; } }
.barre label.recherche { flex: 1 1 15rem; display: flex; }
.barre input { flex: 1; min-width: 0; min-height: 2.4rem; padding: .3rem .6rem; border: 1px solid var(--cadre); border-radius: 3px;
  background: var(--papier); color: var(--encre); font: 400 1rem var(--sans); }
.barre input::placeholder { color: var(--doux); opacity: 1; }
.compte { margin: 0; font: 400 .9rem var(--sans); color: var(--doux); }
.chips { display: flex; flex-wrap: wrap; gap: .25rem .2rem; flex-basis: 100%; }
.chip { min-height: 2.2rem; padding: .2rem .65rem; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--encre);
  font: 400 .92rem var(--sans); cursor: pointer; }
.chip span { color: var(--doux); font-size: .82em; margin-left: .3em; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--trait); }
.chip[aria-pressed="true"] { background: var(--encre); color: var(--fond); font-weight: 700; }
.chip[aria-pressed="true"] span { color: inherit; opacity: .8; }
html:not(.js) .barre { display: none; }

.famille { margin-top: 1.4rem; }
.famille h3 { display: flex; align-items: baseline; gap: .1rem; margin: 0 0 .45rem; font-size: 1.15rem; }
.famille h3 .n { margin-left: .5rem; font-weight: 400; font-size: .85rem; color: var(--doux); }
.outils { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
@media (max-width: 900px) { .outils { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .outils { grid-template-columns: 1fr; } }
.outils li { position: relative; margin: 0; padding: .55rem .7rem .6rem 1.9rem; border: .8px solid var(--cadre); border-radius: 4px; background: var(--papier);
  background: color-mix(in srgb, var(--papier) 80%, transparent);
  transition: background-color .14s ease-out; }
.outils li:hover { background: color-mix(in srgb, var(--sw, var(--cadre)) 12%, var(--papier)); }
.outils li::before { content: ""; position: absolute; left: .78rem; top: .92rem; width: 7px; height: 7px; border: 1.5px solid var(--sw, var(--encre)); rotate: 45deg; }
.outils b { display: block; font: 700 .97rem/1.25 var(--sans); }
.outils span { display: block; margin-top: .15rem; font-size: .9rem; line-height: 1.3; color: var(--doux); }
.outils .neuf { display: inline; margin: 0 0 0 .35rem; font: 400 .72rem var(--sans); color: var(--doux); letter-spacing: .04em; }
.f-pdf { --sw: var(--f-pdf); }
.f-image { --sw: var(--f-image); }
.f-video { --sw: var(--f-video); }
.f-audio { --sw: var(--f-audio); }
.f-create { --sw: var(--f-create); }
.f-files { --sw: var(--f-files); }
.plus { margin: .45rem 0 0; min-height: 2.2rem; padding: .2rem .7rem; border: 1px solid var(--trait); border-radius: 3px; background: var(--papier);
  color: var(--encre); font: 400 .88rem var(--sans); cursor: pointer; }
.plus:hover { border-color: var(--encre); }
.cache { display: none !important; }
.rien { margin: 1rem 0; font-family: var(--penche); color: var(--doux); }

/* ---------- code ---------- */
pre { margin: .8rem 0 1rem; padding: .7rem .9rem; overflow-x: auto; border-left: 1.2px solid var(--cadre); border-radius: 0 3px 3px 0; background: var(--code-fond);
  font-size: .86rem; line-height: 1.5; tab-size: 2; }
pre code { font-size: 1em; }
pre .co { color: var(--doux); }
pre .pr { color: var(--doux); user-select: none; }
.legende-code { margin: 1rem 0 -.4rem; font: 400 .85rem var(--sans); color: var(--doux); }

/* ---------- tableaux booktabs : filets horizontaux seulement, épais en haut et en bas ---------- */
.tscroll { overflow-x: auto; }
.legende-t { margin: 1.3rem 0 .45rem; font-size: 1rem; line-height: 1.3; }
.legende-t b { font-family: var(--sans); }
table { width: 100%; border-collapse: collapse; border-top: 1.5px solid var(--encre); border-bottom: 1.5px solid var(--encre); font-size: .95rem; line-height: 1.35; }
thead th { padding: .55rem .6rem .35rem; border-bottom: .9px solid var(--encre); font: 700 .92rem/1.2 var(--sans); text-align: left; vertical-align: bottom; }
tbody th, tbody td { padding: .4rem .6rem; text-align: left; vertical-align: top; hyphens: manual; }
tbody th { font-weight: 400; font-family: var(--sans); font-size: .9rem; color: var(--doux); white-space: nowrap; }
tbody tr:first-child > * { padding-top: .6rem; }
tbody tr:last-child > * { padding-bottom: .6rem; }
td.nous, th.nous { background: var(--retenir-fond); }
.oui { color: var(--vert); font-family: var(--sans); font-weight: 700; margin-right: .2em; }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.note-t { margin: .55rem 0 0; font-size: .88rem; line-height: 1.4; color: var(--doux); }
@media (max-width: 560px) {
  table { font-size: .9rem; }
  tbody th { white-space: normal; width: 5.6rem; }
  tbody th, tbody td, thead th { padding-inline: .35rem; }
}

/* ---------- téléchargement ---------- */
.prix { margin: .3rem 0 0; font: 700 clamp(2.6rem, 9vw, 3.4rem)/1.05 var(--sans); }
.prix + p { margin-top: .3rem; color: var(--doux); font-family: var(--sans); }
.notes { margin: 1rem 0 0; padding: 0; list-style: none; }
.notes li { margin: 0; padding: .55rem 0; border-top: 1px solid var(--trait); }
.notes li:last-child { border-bottom: 1px solid var(--trait); }
.notes b { font-family: var(--sans); }

/* ---------- pied de page ---------- */
footer.pied { margin-top: 3.5rem; padding: 1.4rem 0 3rem; border-top: 1.2px solid var(--trait); font-size: .92rem; color: var(--doux); }
footer.pied .blague { margin: 0 0 1rem; font-family: var(--penche); color: var(--encre); font-size: 1rem; }
footer.pied .blague::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 .7rem .12rem 2px; border: 1.2px solid var(--cadre); rotate: 45deg; }
footer.pied ul { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin: 0 0 .6rem; padding: 0; list-style: none; font-family: var(--sans); }
footer.pied li { margin: 0; }
footer.pied li a { display: inline-block; padding: .5rem 0; }
footer.pied h2 { margin: 1.2rem 0 .2rem; font-size: .95rem; color: var(--encre); }
footer.pied p { margin: .2rem 0; }

@media (max-width: 760px) {
  body { font-size: .98rem; }
  .page { padding: 0 1rem; }
  .large { margin-inline: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .outils li::before, .tete .filet::before, .tete .filet::after, section::after { forced-color-adjust: none; }
  main :is(p, li) a[href] { text-decoration: underline; }
}
@media print {
  .tete, .barre, .plus, .telecharger { display: none !important; }
  .cache { display: block !important; }
  :root { color-scheme: light; }
}

/* Vidéo de présentation (Figure 1) : 16:9 à toute largeur. */
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--encre); }

/* Tirage : catalogue d'outillage, encre brune (voir /textured/atelier.css), aux dosages de TeXtured (data-tirage) :
   lettrine pastel, numéros de section, losanges des filets, sélection, surlignage (.at-surligne). */
:root { --tirage: #925f52; }
::selection { background: color-mix(in srgb, var(--tirage) 28%, transparent); }
.titre .lettrine { color: color-mix(in srgb, var(--tirage) 34%, var(--papier)); }
h2 .num, h3 .num { color: color-mix(in srgb, var(--tirage) 62%, var(--encre)); }
.tete .filet::before, .tete .filet::after, section::after { border-color: color-mix(in srgb, var(--tirage) 55%, var(--trait)); }
.devise span { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tirage) 62%, var(--encre)); text-decoration-thickness: 2px; text-underline-offset: .22em; }
