/* le barbery v3 — d'après la planche retenue par kuma le 2026-09-25 (proposition openai, un peu adoucie).
   fond neutre #f8f7f3, encre #1a1a1a, bleu d'acier #0a5ea8 ; laiton seulement dans les engrenages, en transparence.
   la machine d'abord : disques de mots comme des disques de date, sous-cadran, couronne, compteur ; pièces numérotées,
   annotations à la main, légende du mécanisme. commandes au texte, onglets à trait bleu, aucune pilule. */
:root {
  --fond: #f4efe6;            /* le fond de kumado.net (--ivoire) */
  --blanc: #fdfcfa;
  --encre: #1c1c1c;
  --encre2: #444444;
  --gris: #7a7a7a;
  --filet: #d8d4cc;
  --filet2: #b9b5ad;
  --bleu: #0a5ea8;             /* éléments graphiques : index, vis */
  --lien: #3b5873;             /* liens : bleu d'acier */
  --rouge: #b3141c;
  --laiton: #b8914c;
  --serif: "Old Standard TT", "Times New Roman", serif;
  --sans: "Old Standard TT", "Times New Roman", serif;
  --main: "Caveat", "Segoe Print", cursive;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --col: 76rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--sans); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; background: none; border: none; padding: 0; margin: 0; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.espace { flex: 1; }
svg { width: 1.1em; height: 1.1em; flex: none; }
:focus-visible { outline: 1.5px solid var(--bleu); outline-offset: 3px; }
::selection { background: rgba(10, 94, 168, .15); }
.num { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 1px solid var(--encre); background: var(--fond); font-family: var(--serif); font-size: .78rem; line-height: 1; color: var(--encre); flex: none; }

.preprod { background: var(--encre); color: var(--fond); font-size: .78rem; padding: .3rem 16px; display: flex; gap: 1rem; align-items: center; }
.preprod button { color: inherit; opacity: .75; }
.preprod button:hover { opacity: 1; }

/* ---- en-tête ---- */
.haut { max-width: var(--col); margin: 0 auto; padding: 1rem 28px .7rem; display: flex; align-items: center; gap: 1.5rem; border-bottom: 1px solid var(--filet); }
.marque { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-size: 1.9rem; line-height: 1; letter-spacing: -.01em; }
.marque .logo { width: 2.2rem; height: 2.2rem; color: var(--encre); }
.liens { margin-left: auto; display: flex; gap: 1.6rem; font-size: .84rem; color: var(--encre2); }
.liens a, .liens button { transition: color .15s; }
.liens a:hover, .liens button:hover { color: var(--bleu); }
.licence-on::before { content: "◆ "; color: var(--bleu); font-size: .7em; }
.menu { display: none; margin-left: auto; width: 2.4rem; height: 2.4rem; place-items: center; }
.menu svg { width: 1.5rem; height: 1.5rem; }
.feuille-menu { position: fixed; z-index: 40; top: 3.6rem; right: 12px; background: var(--blanc); border: 1px solid var(--filet2); box-shadow: 0 12px 30px -12px rgba(0,0,0,.25); display: flex; flex-direction: column; padding: .4rem 0; min-width: 12rem; }
.feuille-menu a, .feuille-menu button { padding: .6rem 1.1rem; text-align: left; font-size: .95rem; }
.feuille-menu a:hover, .feuille-menu button:hover { color: var(--bleu); }

main { max-width: var(--col); margin: 0 auto; padding: 0 28px 2rem; }

/* ---- onglets : texte, trait bleu sous l'onglet actif ---- */
.onglets { display: flex; flex-wrap: wrap; gap: .1rem 1.35rem; font-size: .84rem; color: var(--encre2); }
.onglets button { position: relative; padding: .5rem 0 .55rem; white-space: nowrap; transition: color .15s; }
.onglets button:hover { color: var(--encre); }
.onglets button.actif { color: var(--bleu); font-weight: 500; }
.onglets button.actif::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--bleu); }
.onglets button:disabled { opacity: .35; cursor: default; }

/* ---- la ligne de recherche ---- */
.recherche-zone { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "par sep modes" "form form form" "lect lect lect"; align-items: center; column-gap: 1.3rem; border-bottom: 1px solid var(--filet); }
.recherche-zone .par { grid-area: par; }
.recherche-zone .sep-v { grid-area: sep; width: 1px; height: 1.2rem; background: var(--filet2); }
.recherche-zone .modes { grid-area: modes; }
.recherche { position: relative; margin: 1.6rem auto .4rem; width: min(52rem, 100%); display: flex; align-items: flex-end; gap: 1rem; }
.saisie { flex: 1; display: flex; min-width: 0; border-bottom: 1.5px solid var(--encre); padding-bottom: .25rem; }
.mode { display: inline-flex; align-items: baseline; gap: .55rem; font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; white-space: nowrap; flex: none; }
.mode { padding-bottom: .3rem; }
.mode .car { font-size: .45em; position: relative; top: -.25em; color: var(--lien); }
.mode:hover, .mode:hover .car { color: var(--lien); }
#q { flex: 1; width: 0; min-width: 3rem; font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.1; outline: none; caret-color: var(--bleu); }
#q::placeholder { color: var(--filet2); font-style: italic; }
#q::-webkit-search-cancel-button, #q::-webkit-search-decoration { -webkit-appearance: none; }
.go { align-self: center; color: var(--encre); transition: color .15s, transform .15s; }
.go svg { width: 2.1rem; height: 2.1rem; }
.go:hover { color: var(--lien); }
.interrupteur { align-self: center; flex: none; display: inline-flex; border: 1px solid var(--encre); border-radius: 999px; padding: 2px; font-size: .78rem; }
.interrupteur button { padding: .1rem .55rem; border-radius: 999px; color: var(--encre2); }
.interrupteur button.actif { background: var(--encre); color: var(--fond); }
.interrupteur button:disabled { opacity: .35; }
.lecture { grid-area: lect; justify-self: center; margin: 0 0 .9rem; font-family: var(--mono); font-size: .78rem; color: var(--gris); min-height: 1.1rem; }
.pop { position: absolute; z-index: 30; top: calc(100% + .5rem); left: 0; width: min(24rem, calc(100vw - 40px)); background: var(--blanc); border: 1px solid var(--filet2); box-shadow: 0 14px 34px -14px rgba(0,0,0,.28); padding: .35rem 0; }
.pop button { display: flex; justify-content: space-between; gap: 1rem; width: 100%; text-align: left; padding: .45rem 1rem; font-size: .95rem; }
.pop button b { font-family: var(--serif); font-weight: 400; font-size: 1.12rem; }
.pop button span { font-family: var(--serif); font-style: italic; font-size: .9rem; color: var(--gris); }
.pop button:hover b, .pop button.actif b { color: var(--lien); }

/* ---- l'atelier : la machine ---- */
.atelier { position: relative; margin: 1.1rem 0 0; padding: 2.6rem 0 1rem; min-height: 22rem; }
.mecanisme { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mecanisme .trace { stroke: var(--filet2); stroke-width: .6; stroke-dasharray: 3 4; fill: none; }
.mecanisme .roue-l { fill: rgba(214, 186, 128, .3); stroke: var(--laiton); stroke-width: 1.1; }
.mecanisme .pont { fill: rgba(226, 224, 218, .8); stroke: #8f8c84; stroke-width: 1; }
.mecanisme .rot-a { transform-box: fill-box; transform-origin: center; }
.atelier.tourne .mecanisme .rot-a { animation: tour 1.6s linear infinite; }
.atelier.tourne .mecanisme .rot-b { animation: tour 2.2s linear infinite reverse; }
.mecanisme .rot-b { transform-box: fill-box; transform-origin: center; }
@keyframes tour { to { transform: rotate(360deg); } }
.annot { position: absolute; margin: 0; font-family: var(--main); font-size: 1.25rem; line-height: 1.05; color: var(--encre2); pointer-events: none; z-index: 3; }
.an-disques { left: 1%; top: .2rem; transform: rotate(-7deg); }
.an-mecanique { left: 34%; top: -.3rem; transform: rotate(-4deg); }
.an-engrenage { right: 1%; top: .4rem; transform: rotate(-5deg); text-align: right; }
.titre-machine { position: relative; z-index: 3; display: flex; align-items: baseline; justify-content: center; gap: .6rem; margin: 0 0 .4rem; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--encre2); }
.titre-machine .num { font-style: normal; align-self: center; }
.titre-machine .son { font-family: var(--mono); font-style: normal; font-size: .76rem; color: var(--gris); }

.roues { position: relative; z-index: 2; display: flex; justify-content: center; align-items: center; overflow-x: auto; scrollbar-width: none; padding: .3rem 0 .4rem; }
.roues::-webkit-scrollbar { display: none; }
.disque { position: relative; flex: none; touch-action: none; cursor: grab; outline: none; }
.disque:active { cursor: grabbing; }
.disque + .disque { margin-left: calc(var(--d) * -0.12); }
.disque svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 5px rgba(40, 36, 28, .18)); }
.disque:focus-visible svg { filter: drop-shadow(0 0 0 var(--bleu)) drop-shadow(0 0 3px var(--bleu)); }
.disque .bord { fill: url(#perle); stroke: var(--encre); stroke-width: 1.3; }
.disque .bande-mots { fill: none; stroke: var(--blanc); stroke-width: 21; }
.disque .couronne-int { fill: none; stroke: var(--encre); stroke-width: .8; }
.disque .fond-int { fill: rgba(253, 252, 249, .22); stroke: var(--encre); stroke-width: .9; }
.disque .denture { fill: none; stroke: var(--laiton); stroke-width: 1; opacity: .7; }
.disque .graduation { stroke: var(--encre); stroke-width: .7; opacity: .55; }
.disque .rim { font-family: var(--serif); font-style: italic; fill: var(--encre2); }
.disque .rim.haut { fill: var(--bleu); font-style: normal; }
.disque .rim.clos { fill: var(--lien); font-family: var(--sans); font-style: normal; font-size: 9px; }
.disque .cart { fill: var(--blanc); stroke: var(--encre); stroke-width: 1.3; }
.disque .cart2 { fill: none; stroke: var(--encre); stroke-width: .6; }
.disque .mot { font-family: var(--serif); fill: var(--encre); font-weight: 500; }
.disque .index { fill: var(--bleu); }
.disque.flou .rims { filter: blur(1.2px); }
.disque .son-d { font-family: var(--mono); font-size: 9px; fill: var(--gris); }
.vide-machine { position: relative; z-index: 3; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--encre2); margin: 3rem 0; }

.organes { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-end; gap: clamp(1.5rem, 6vw, 5rem); margin-top: .4rem; }
.organe { position: relative; display: flex; flex-direction: column; align-items: center; }
.organe > .num { position: absolute; left: -.4rem; top: -.2rem; z-index: 2; }
.cadran { width: 8.2rem; height: 8.2rem; overflow: visible; filter: drop-shadow(0 3px 4px rgba(40,36,28,.18)); }
.cadran .face-c { fill: #fff; stroke: var(--encre); stroke-width: 1.6; }
.cadran .anneau { fill: none; stroke: var(--encre); stroke-width: .6; }
.cadran .tick { stroke: var(--encre); stroke-width: .8; }
.cadran .chiffre { font-family: var(--serif); font-size: 17px; fill: var(--encre); cursor: pointer; }
.cadran .chiffre:hover { fill: var(--bleu); }
.cadran .chiffre.actif { font-weight: 600; }
.cadran .aiguille { stroke: var(--bleu); stroke-width: 3.4; stroke-linecap: round; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 60px 64px; }
.cadran .axe { fill: var(--bleu); }
.cadran .leg-c { font-family: var(--sans); font-size: 8.5px; fill: var(--encre2); }
.plaque { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 9.5rem; padding: .55rem 1.3rem .6rem; background: var(--blanc); border: 1.3px solid var(--encre); outline: 1px solid var(--encre); outline-offset: -5px; box-shadow: 0 3px 5px rgba(40,36,28,.15); }
.plaque b { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.plaque span { font-size: .8rem; color: var(--encre2); }
.plaque small { font-size: .7rem; color: var(--gris); }
.plaque small:empty { display: none; }
.vis-c { position: absolute; width: .42rem; height: .42rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8fc0ec, var(--bleu) 45%, #05325c); }
.c1 { top: -.62rem; left: -.62rem; } .c2 { top: -.62rem; right: -.62rem; } .c3 { bottom: -.62rem; left: -.62rem; } .c4 { bottom: -.62rem; right: -.62rem; }
.couronne { display: block; width: 9.6rem; height: 6.6rem; transition: transform .1s; }
.couronne svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 4px rgba(40,36,28,.2)); }
.couronne:active { transform: translateX(-3px); }
.couronne .fleche-c { fill: none; stroke: var(--bleu); stroke-width: 2.4; stroke-linecap: round; transition: transform .6s; transform-origin: 70px 48px; }
.couronne:hover .fleche-c { transform: rotate(8deg); }
.couronne .molette line { stroke: var(--encre); stroke-width: 1.2; opacity: .55; }
.atelier.tourne .couronne .molette { animation: molette .25s linear infinite; }
@keyframes molette { to { transform: translateY(-9px); } }
.couronne text { font-family: var(--serif); font-size: 17px; fill: var(--encre); }
.an-cadran { position: static; margin-top: .2rem; text-align: center; font-size: 1.1rem; }
.an-couronne { position: static; margin-top: .1rem; text-align: center; font-size: 1.1rem; }

/* ---- résultats, outils, plis ---- */
.bas { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .8fr) minmax(0, 1fr); gap: 2.4rem; margin-top: 1.4rem; padding-top: .2rem; }
.rubrique { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin: 0 0 .3rem; padding-bottom: .45rem; border-bottom: 1px solid var(--filet2); font-family: var(--sans); font-weight: 400; font-size: 1rem; color: var(--encre2); }
.etat { font-size: .8rem; color: var(--gris); display: inline-flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.etat b { color: var(--encre); font-weight: 500; }
.richesse { display: inline-flex; align-items: baseline; gap: .35rem; font-family: var(--mono); font-size: .78rem; color: var(--encre); }
.richesse button { font-family: var(--sans); font-size: 1rem; color: var(--bleu); width: 1.2rem; }
.richesse button:disabled { opacity: .3; cursor: default; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); column-gap: 1.6rem; }
.liste li { border-bottom: 1px solid rgba(0,0,0,.05); }
.ligne { display: flex; align-items: baseline; gap: .8rem; width: 100%; text-align: left; padding: .38rem 0; }
.ligne .n { font-family: var(--serif); font-size: .82rem; color: var(--gris); min-width: 1.3rem; font-variant-numeric: tabular-nums; }
.ligne .w { font-family: var(--serif); font-size: 1.22rem; color: var(--encre); }
.ligne .dec { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--gris); }
.ligne .dec svg { width: .95rem; height: .95rem; color: var(--lien); }
.ligne .p { font-family: var(--mono); font-size: .7rem; color: var(--gris); }
.ligne .s { font-size: .72rem; color: var(--gris); }
.ligne:hover .w { color: var(--lien); }
.ligne.choisi .w { color: var(--lien); }
.ligne.choisi .n { color: var(--lien); }
.liste h4 { grid-column: 1 / -1; margin: .9rem 0 .1rem; font-weight: 400; font-size: .76rem; color: var(--gris); }
.suite:empty, .note-licence:empty { display: none; }
.suite button { font-size: .84rem; color: var(--bleu); margin-top: .6rem; }
.note-licence { margin: .9rem 0 0; font-size: .78rem; color: var(--gris); }
.note-licence button { color: var(--bleu); }
.dharma { max-height: 26rem; overflow: auto; margin-top: .3rem; }
.dharma table { border-collapse: collapse; }
.dharma td { font-family: var(--serif); font-size: 1.12rem; padding: .28rem 1.4rem .28rem 0; white-space: nowrap; border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: top; }
.dharma .plus { font-size: .8rem; color: var(--gris); }

.outils { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: .9rem 1.2rem; padding-top: 2.1rem; }
.outils button { display: inline-flex; align-items: center; gap: .6rem; font-size: .82rem; color: var(--encre2); text-align: left; transition: color .15s; }
.outils button svg { width: 1.3rem; height: 1.3rem; color: var(--encre); }
.outils button:hover, .outils button:hover svg { color: var(--lien); }
.outils button[aria-pressed="true"], .outils button[aria-pressed="true"] svg { color: var(--lien); }

.plis { border-left: 1px solid var(--filet); padding-left: 1.6rem; padding-top: 1.6rem; }
.pli-tete { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .75rem 0; border-bottom: 1px solid var(--filet2); font-size: .98rem; color: var(--encre); text-align: left; }
.pli-tete svg { transition: transform .2s; }
.pli-tete[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--bleu); }
.pli-tete .badge { margin-left: auto; font-size: .74rem; color: var(--bleu); }
.pli-corps { padding: .8rem 0 1rem; border-bottom: 1px solid var(--filet); }
.rang { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .9rem; margin: .45rem 0; }
.lib { min-width: 4.6rem; font-size: .76rem; color: var(--gris); }
.opts { display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-size: .84rem; color: var(--encre2); }
.opts button { position: relative; padding: .1rem 0 .2rem; }
.opts button:hover { color: var(--encre); }
.opts button.actif { color: var(--bleu); }
.opts button.actif::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--bleu); }
.rang input[type=text], .rang select { font-size: .86rem; color: var(--encre); border-bottom: 1px solid var(--filet2); padding: .1rem 0; min-width: 0; -webkit-appearance: none; appearance: none; border-radius: 0; background: transparent; }
.rang input[type=text] { width: 11rem; }
.rang input:focus, .rang select:focus { outline: none; border-color: var(--bleu); }
.rang input::placeholder { color: var(--gris); }
.plage { display: inline-flex; gap: .8rem; }
.texte { font-size: .82rem; color: var(--bleu); }
.clavier { display: flex; flex-wrap: wrap; gap: .15rem .35rem; }
.clavier button { display: flex; flex-direction: column; align-items: center; min-width: 2.2rem; padding: .15rem .2rem; line-height: 1.1; }
.clavier button:hover b { color: var(--bleu); }
.clavier b { font-family: var(--mono); font-weight: 500; font-size: .95rem; }
.clavier i { font-family: var(--serif); font-size: .7rem; color: var(--gris); }
.clavier .sep { width: 100%; height: .2rem; }

/* ---- légende du mécanisme ---- */
.legende { display: grid; grid-template-columns: 8rem repeat(4, minmax(0, 1fr)); gap: 1.4rem; align-items: start; margin-top: 2.6rem; padding: 1.2rem 0 0; border-top: 1px solid var(--filet2); }
.legende-titre { margin: 0; font-family: var(--sans); font-weight: 400; font-size: .84rem; color: var(--encre2); }
.leg { display: grid; grid-template-columns: auto 3.4rem 1fr; gap: .6rem; align-items: start; }
.leg-ico { width: 3.4rem; height: 3.4rem; }
.leg p { margin: 0; font-size: .76rem; line-height: 1.45; color: var(--encre2); }
.leg b { display: block; font-weight: 500; color: var(--encre); font-size: .8rem; }

/* ---- pied ---- */
.pied { max-width: var(--col); margin: 1.4rem auto 0; padding: 1rem 28px 2rem; border-top: 1px solid var(--filet); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .76rem; color: var(--gris); }
.pied a:hover { color: var(--bleu); }

/* ---- la fenêtre de licence ---- */
dialog.feuille { position: relative; border: 1.3px solid var(--encre); outline: 1px solid var(--encre); outline-offset: -7px; border-radius: 0; padding: 2rem 2.2rem 1.6rem; width: min(31rem, calc(100vw - 28px)); max-height: 90vh; background: var(--blanc); color: var(--encre); box-shadow: 0 30px 70px -20px rgba(0,0,0,.35); }
dialog.feuille::backdrop { background: rgba(26, 26, 26, .35); }
dialog.feuille h2 { font-family: var(--serif); font-weight: 400; font-size: 2.1rem; margin: 0 0 .9rem; padding-bottom: .6rem; border-bottom: 1px solid var(--encre); width: 70%; }
.feuille-roue { position: absolute; top: 2.3rem; right: 3.6rem; width: 3rem; height: 3rem; color: var(--encre2); }
.fermer { position: absolute; top: .9rem; right: .9rem; font-size: 1.6rem; line-height: 1; color: var(--encre); width: 2rem; height: 2rem; }
dialog.feuille p { margin: .4rem 0; font-family: var(--serif); font-size: 1.08rem; line-height: 1.45; color: var(--encre); }
dialog.feuille .avantages { list-style: none; margin: 1rem 0 .4rem; padding: 0; border-top: 1px solid var(--filet2); }
dialog.feuille .avantages li { padding: .5rem 0 .5rem 1.4rem; border-bottom: 1px solid var(--filet2); font-family: var(--serif); font-size: 1.02rem; }
dialog.feuille .prix { text-align: center; font-family: var(--serif); font-size: 2.6rem; line-height: 1.1; margin: 1rem 0 .1rem; position: relative; }
.prix::before, .prix::after { content: ""; position: absolute; top: 50%; width: 22%; height: 1px; background: var(--filet2); }
.prix::before { left: 8%; } .prix::after { right: 8%; }
dialog.feuille .prix-note { text-align: center; font-family: var(--sans); font-size: .78rem; color: var(--gris); margin: 0 0 .6rem; }
.a-savoir { list-style: none; margin: .4rem 0 0; padding: 0; }
.a-savoir li { padding: .35rem 0; font-size: .8rem; line-height: 1.45; color: var(--encre2); border-top: 1px solid rgba(0,0,0,.06); }
.a-savoir b { font-weight: 500; color: var(--encre); }
.feuille h3 { font-family: var(--sans); font-weight: 400; font-size: .78rem; color: var(--gris); margin: 1.1rem 0 .3rem; }
.feuille .cle input { width: 100%; font-family: var(--mono); font-size: .82rem; padding: .4rem 0; border-bottom: 1px solid var(--filet2); }
.feuille .cle input:focus { outline: none; border-color: var(--bleu); }
.pied-feuille { display: flex; align-items: center; justify-content: center; gap: 1.4rem; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--filet2); }
.pied-feuille .sep-v { width: 1px; height: 1.6rem; background: var(--filet2); }
.pied-feuille button, .pied-feuille a { font-family: var(--serif); font-size: 1.12rem; color: var(--encre2); display: inline-flex; align-items: center; gap: .45rem; }
.pied-feuille .principal { color: var(--bleu); font-size: 1.3rem; }
.pied-feuille .principal svg { width: 1.3rem; height: 1.3rem; }
.feuille .petit { font-size: .8rem; color: var(--bleu); }
.feuille a.lienp { color: var(--bleu); font-size: .8rem; }

.bulle { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--encre); color: var(--fond); padding: .45rem 1rem; font-size: .86rem; z-index: 60; }

/* ---- pages de texte (mode d'emploi, licence) ---- */
.page { max-width: 42rem; margin: 0 auto; padding: 1rem 28px 3rem; }
.page h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 7vw, 3.4rem); line-height: 1.05; margin: 1.8rem 0 .4rem; }
.page .chapeau { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--encre2); margin: 0 0 1.8rem; }
.page nav.sommaire { border-top: 1px solid var(--filet2); border-bottom: 1px solid var(--filet2); padding: .8rem 0; margin-bottom: 1.6rem; }
.page nav.sommaire ol { margin: 0; padding-left: 1.2rem; columns: 2 12rem; font-size: .88rem; line-height: 1.9; color: var(--gris); }
.page nav.sommaire a { color: var(--encre2); }
.page nav.sommaire a:hover { color: var(--bleu); }
.page section { padding: 1.5rem 0; border-top: 1px solid var(--filet); scroll-margin-top: 1rem; }
.page h2 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 0 0 .7rem; }
.page h3 { font-family: var(--sans); font-weight: 500; font-size: .8rem; color: var(--gris); margin: 1.4rem 0 .35rem; }
.page p, .page li { font-family: var(--serif); font-size: 1.12rem; line-height: 1.55; color: var(--encre2); }
.page p { margin: .5rem 0; }
.page b { color: var(--encre); font-weight: 500; }
.page ul { padding-left: 1.1rem; }
.page li { margin: .3rem 0; }
.page a { color: var(--bleu); }
.page .ex { font-style: italic; color: var(--encre); }
.page .touche { font-family: var(--sans); font-size: .8rem; color: var(--encre); border: 1px solid var(--filet2); padding: 0 .35rem; white-space: nowrap; }
.page .ph { font-family: var(--mono); font-size: .86rem; }
.page table { border-collapse: collapse; width: 100%; margin: .6rem 0; }
.page th { text-align: left; font-family: var(--sans); font-weight: 500; font-size: .76rem; color: var(--gris); padding: .3rem .8rem .3rem 0; }
.page td { padding: .5rem .8rem .5rem 0; border-top: 1px solid var(--filet); vertical-align: top; font-family: var(--serif); font-size: 1.04rem; line-height: 1.45; color: var(--encre2); }
.page td:first-child { color: var(--encre); white-space: nowrap; }
.page .codes-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .15rem .8rem; font-family: var(--serif); font-size: 1rem; color: var(--encre2); }
.page .codes-page b { font-family: var(--mono); font-weight: 500; color: var(--encre); display: inline-block; width: 1.4rem; }
.haut .retour { margin-left: auto; font-size: .86rem; color: var(--bleu); }

/* ---- écrans moyens et petits ---- */
@media (max-width: 1100px) {
  .bas { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .plis { grid-column: 1 / -1; border-left: none; padding-left: 0; padding-top: 0; }
  .legende { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legende-titre { grid-column: 1 / -1; }
  .legende-titre br { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .haut { padding: .8rem 16px .6rem; }
  .marque { font-size: 1.65rem; }
  .marque .logo { width: 1.9rem; height: 1.9rem; }
  .liens { display: none; }
  .menu { display: grid; }
  main { padding: 0 16px 1.5rem; }
  .recherche-zone { grid-template-columns: minmax(0, 1fr); grid-template-areas: "par" "form" "lect" "modes"; border-bottom: none; }
  .recherche-zone .par { justify-content: center; border-bottom: 1px solid var(--filet); }
  .recherche-zone .sep-v { display: none; }
  .recherche { margin: 1rem 0 .2rem; gap: .7rem; }
  .mode, #q { font-size: 1.75rem; }
  .go svg { width: 1.7rem; height: 1.7rem; }
  .lecture { margin-bottom: .2rem; }
  .modes { gap: 0 1.1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--filet); }
  .modes button { font-size: .8rem; padding: .35rem 0; }
  .atelier { padding-top: 1.4rem; min-height: 0; }
  .annot.an-disques, .annot.an-mecanique, .annot.an-engrenage { display: none; }
  .organes { gap: .9rem; }
  .cadran { width: 5.4rem; height: 5.4rem; }
  .plaque { min-width: 7rem; padding: .45rem .7rem; }
  .plaque b { font-size: 1.6rem; }
  .couronne { width: 5.8rem; height: 4rem; }
  .an-cadran, .an-couronne { font-size: .95rem; }
  .bas { grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; margin-top: 1rem; }
  .outils { grid-template-columns: 1fr; padding-top: 2.3rem; gap: .7rem; }
  .outils button span { font-size: .76rem; }
  .liste { grid-template-columns: 1fr; }
  .legende { grid-template-columns: 1fr; gap: .9rem; }
  .pied { padding: 1rem 16px 2rem; }
  .pied .espace { display: none; }
  dialog.feuille { padding: 1.6rem 1.3rem 1.3rem; }
  dialog.feuille h2 { font-size: 1.8rem; }
  .feuille-roue { right: 3rem; top: 1.9rem; }
  .page table, .page tbody, .page tr, .page td { display: block; width: 100%; }
  .page thead { display: none; }
  .page tr { border-top: 1px solid var(--filet); padding: .5rem 0; }
  .page td { border: none; padding: .1rem 0; }
  .page td:first-child { white-space: normal; }
  .page td[data-l]::before { content: attr(data-l) " — "; font-family: var(--sans); font-size: .76rem; color: var(--gris); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- rectifications du 26/09 ---- */
.recherche-zone { display: block; border-bottom: none; }
.devise { margin-left: auto; font-style: italic; font-size: .92rem; color: var(--encre2); }
.cherche-plis, .recherche-zone .plis { max-width: 52rem; margin: .4rem auto 0; border: none; padding: 0; display: grid; grid-template-columns: 1fr; }
.recherche-zone .pli-tete { padding: .45rem 0; font-size: .92rem; border-bottom: 1px solid var(--filet); }
.recherche-zone #btnClavier { font-size: .74rem; color: var(--encre2); padding: .3rem 0; }
.pli-tete .badge, .texte, .note-licence button, .suite button, .feuille a.lienp, .feuille .petit { color: var(--lien); }
.pied a:hover { color: var(--lien); }
.jauges { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 .4rem; }
.jauge { display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .78rem; font-style: italic; color: var(--encre2); }
.jauges .titre-machine { margin: 0; }
.disque.petit svg { filter: drop-shadow(0 2px 3px rgba(30,30,30,.18)); }
.organes { margin-top: .6rem; }
.poussoir { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.bouton-rouge { width: 4.2rem; height: 4.2rem; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #e8534f 0%, var(--rouge) 45%, #6e0a0f 100%);
  box-shadow: 0 0 0 5px #d9d7d2, 0 0 0 6px var(--encre), 0 5px 0 5px #a9a6a0, 0 6px 0 6px var(--encre), 0 10px 14px 4px rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s; }
.poussoir:hover .bouton-rouge { filter: brightness(1.06); }
.poussoir:active .bouton-rouge { transform: translateY(4px); box-shadow: 0 0 0 5px #d9d7d2, 0 0 0 6px var(--encre), 0 1px 0 5px #a9a6a0, 0 2px 0 6px var(--encre), 0 4px 8px 4px rgba(0,0,0,.2); }
.lib-p { font-size: .9rem; margin-top: .55rem; }
.atelier { padding-top: 1rem; }
.bas { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
@media (max-width: 760px) {
  .devise { font-size: .78rem; }
  .recherche { flex-wrap: wrap; gap: .5rem .7rem; }
  .mode { width: 100%; }
  .interrupteur { margin-left: auto; }
  .bouton-rouge { width: 3.6rem; height: 3.6rem; }
  .bas { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---- rectifications du 26/09 (2) ---- */
body { background-color: var(--fond); background-image: linear-gradient(rgba(244,239,230,.8), rgba(244,239,230,.8)), url("img/fond.webp"); background-size: auto, 520px 520px; }
.marque { font-size: 2rem; }
.mode, .mode #modeNom { color: var(--lien); }
.mode .car { width: .72em; height: .72em; top: 0; align-self: center; color: var(--lien); }
.pli-tete svg { width: .85rem; height: .85rem; color: var(--lien); transform: rotate(-90deg); }
.pli-tete[aria-expanded="true"] svg { transform: none; }
.go { align-self: center; }
.go .bouton-rouge { display: block; width: 2.6rem; height: 2.6rem; box-shadow: 0 0 0 3px #d9d7d2, 0 0 0 4px var(--encre), 0 3px 0 3px #a9a6a0, 0 4px 0 4px var(--encre), 0 6px 10px 2px rgba(0,0,0,.2); }
.go:active .bouton-rouge { transform: translateY(3px); box-shadow: 0 0 0 3px #d9d7d2, 0 0 0 4px var(--encre), 0 0 0 3px #a9a6a0, 0 1px 0 4px var(--encre); }
.go:hover { transform: none; }
.jauges { justify-content: center; gap: clamp(2rem, 10vw, 7rem); margin: 1rem 0 0; }
.titre-machine { position: relative; z-index: 3; }

/* ---- typographie ludique (26/09, 3) : machine à écrire pour les mots, fell pour les titres ---- */
:root { --frappe: "EB Garamond", Garamond, serif; --fell: "IM Fell English", "Old Standard TT", serif; }
.marque { font-family: var(--fell); font-style: italic; font-size: 2.3rem; }
.devise { font-family: var(--fell); font-style: italic; font-size: 1rem; }
.mode, .mode #modeNom { font-family: var(--fell); font-style: italic; }
#q { font-family: var(--frappe); letter-spacing: .02em; }
.disque .mot { font-family: var(--frappe); font-weight: 400; }
.disque .rim { font-family: var(--fell); }
.ligne .w { font-family: var(--frappe); font-size: 1.12rem; }
.titre-machine { font-family: var(--fell); }
.rubrique { font-family: var(--fell); font-style: italic; font-size: 1.2rem; }
.etat b { font-family: var(--frappe); font-weight: 400; }
.pli-tete span { font-weight: 700; letter-spacing: .02em; }
.jauge span { font-family: var(--fell); }
dialog.feuille h2, .page h1, .page h2 { font-family: var(--fell); font-style: italic; }
.go svg.rouge { width: 3rem; height: 3rem; display: block; }
.go .calotte { transition: transform .08s; transform-origin: 50px 50px; }
.go:active .calotte { transform: scale(.94); }
.go:hover .calotte { filter: brightness(1.07); }

/* ---- 26/09 (4) : outils à gauche des résultats ---- */
.bas { grid-template-columns: minmax(9rem, auto) minmax(0, 1fr); }
.outils { order: -1; grid-template-columns: 1fr; padding-top: 2.4rem; }
#q, .ligne .w, .disque .mot, .etat b { font-weight: 400; }
@media (max-width: 760px) { .bas { grid-template-columns: auto minmax(0, 1fr); } .outils { padding-top: 2.6rem; } }
/* garamond pour les mots (27/09) : un peu plus grand, sans espacement de machine à écrire */
#q { letter-spacing: 0; font-size: clamp(2.1rem, 4.4vw, 3.1rem); }
.ligne .w { font-size: 1.3rem; }
.disque .mot { font-weight: 500; }

/* ---- 27/09 : fond à moitié de sa couleur, motif gardé ; transparences ---- */
body { background: #faf7f2; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("img/fond.webp") 0 0 / 520px 520px; opacity: .2; pointer-events: none; }
.disque:not(.petit) .bord { fill-opacity: .5; }
.mecanisme .rot-a, .mecanisme .rot-b { opacity: .8; }
.mecanisme .ressort { fill: none; stroke: var(--laiton); stroke-width: .9; }
.mecanisme .vis-pont { opacity: .7; }

/* ---- 27/09 (4) : le petit personnage du bouton rouge, et le cinabre ---- */
#q { color: #b8391f; caret-color: #b8391f; }
.go svg.rouge { width: 3.8rem; height: 3.8rem; }
.go .oeil { transform-box: fill-box; transform-origin: center; transition: transform .09s; }
.go .oeil.ferme { transform: scaleY(.08); }
.go .bouche { transition: d .35s ease; }
.go:hover .oeil ellipse { ry: 8.5; }
.go:active .oeil { transform: scaleY(.35); }
.go .pupille { transition: transform .12s ease-out; }
.go.etourdi .pupille { animation: tournis .5s linear infinite; }
@keyframes tournis { 0% { transform: translate(2.5px,0) } 25% { transform: translate(0,2.5px) } 50% { transform: translate(-2.5px,0) } 75% { transform: translate(0,-2.5px) } 100% { transform: translate(2.5px,0) } }
.go.triste .larme { opacity: 1; animation: larme 1.6s ease-in infinite; }
@keyframes larme { from { transform: translateY(0); opacity: 1 } to { transform: translateY(9px); opacity: 0 } }
.go.content svg.rouge { animation: saute .5s cubic-bezier(.3,1.6,.5,1) 2; }
@keyframes saute { 50% { transform: translateY(-5px) } }

.bouton-the { display: inline-block; margin-top: .6rem; padding: .55rem 1.2rem; border-radius: 999px; background: #b8391f; color: #fff !important; text-decoration: none; font-family: var(--fell); font-style: italic; font-size: 1.15rem; box-shadow: 0 3px 0 #7a2311; }
.bouton-the:hover { filter: brightness(1.08); }
