:root{color-scheme:light;--ink:#172641;--accent:#bb344b;--paper:#f8f3eb;--line:#dfd3cb}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:1rem/1.55 system-ui,sans-serif}header,footer{padding:1rem max(5vw,1.5rem);display:flex;justify-content:space-between;background:#fff9f3;border-bottom:1px solid var(--line)}header a{color:inherit;font-weight:700;text-decoration:none}main{max-width:1220px;margin:auto;padding:0 5vw 4rem}.intro{padding:clamp(2rem,7vw,5rem) 0 2rem;border-bottom:1px solid var(--line)}.intro p:first-child{color:var(--accent);font-weight:750}.intro h1,h2{font-family:Georgia,serif}.intro h1{font-size:clamp(3rem,8vw,6.2rem);line-height:1;margin:.25em 0;letter-spacing:-.05em}.toolbar{margin:1rem 0;display:flex;flex-wrap:wrap;gap:1rem;align-items:center}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr));gap:1.25rem}.card{background:#fffcf8;border:1px solid var(--line);border-radius:1rem;overflow:hidden}.card h2{margin:.25rem 0}.card section{padding:1rem}.cover{width:100%;height:220px;border:0;border-radius:0;background:#eaded4;display:block;padding:1rem}.cover img{width:100%;height:100%;object-fit:contain}.card p{margin:.3rem 0 .8rem}.editor .grid{grid-template-columns:1fr}.page{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;padding:.7rem 0;border-top:1px solid var(--line)}.page img{width:62px;height:78px;object-fit:contain}.page span{overflow-wrap:anywhere}.fields{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin:.5rem 0}button,input,select{font:inherit;padding:.45rem .65rem;border:1px solid #aa9d96;border-radius:.45rem;background:white;color:inherit;max-width:100%}button{cursor:pointer}button:disabled{opacity:.45;cursor:default}button:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}dialog{width:min(920px,95vw);max-height:92vh;border:none;border-radius:1rem;padding:1rem;background:var(--paper);color:inherit}dialog::backdrop{background:#172641b8}dialog form{float:right}dialog nav{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.sheet{margin-top:1rem;overflow:auto;background:#e9dfd4;text-align:center}.sheet img{display:block;width:100%;max-height:65vh;object-fit:contain}.sheet.zoom img{width:180%;max-height:none;max-width:none}footer{margin-top:2rem;color:var(--accent)}

/* Larger scan previews */
.page > button:first-child {
  flex: 0 0 auto;
  padding: .3rem;
}
.page img {
  display: block;
  width: clamp(150px, 23vw, 300px);
  height: clamp(180px, 27vw, 360px);
}
dialog {
  width: min(1400px, 98vw);
  max-height: 96vh;
}
.sheet img {
  max-height: 78vh;
}

/* Center rotated scans and swap the available axes for quarter turns. */
img[data-rotation="90"] { rotate: 90deg; }
img[data-rotation="180"] { rotate: 180deg; }
img[data-rotation="270"] { rotate: 270deg; }
.page > button:first-child {
  display: grid;
  place-items: center;
}
.page img:is([data-rotation="90"], [data-rotation="270"]) {
  width: clamp(150px, 23vw, 300px);
  height: clamp(150px, 23vw, 300px);
}
.sheet:has(img:is([data-rotation="90"], [data-rotation="270"])) {
  container-type: inline-size;
  display: grid;
  place-items: center;
  height: min(74vh, 85vw);
}
.sheet img:is([data-rotation="90"], [data-rotation="270"]) {
  width: min(74vh, 85vw);
  height: 100cqw;
  max-height: none;
  grid-area: 1 / 1;
  place-self: center;
  position: absolute;
}
.sheet.zoom:has(img:is([data-rotation="90"], [data-rotation="270"])) {
  display: block;
}
.sheet.zoom:has(img:is([data-rotation="90"], [data-rotation="270"]))::before {
  content: "";
  display: block;
  width: 160cqw;
  height: 130cqw;
}
.sheet.zoom img:is([data-rotation="90"], [data-rotation="270"]) {
  left: 80cqw;
  top: 65cqw;
  translate: -50% -50%;
  width: 130cqw;
  height: 160cqw;
}
.sheet { position: relative; }

body:not(.editor) .intro {
  padding: clamp(1.5rem, 3vw, 2.75rem) 0 1.15rem;
}
body:not(.editor) .intro h1 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
}
body:not(.editor) .toolbar { margin: 0; }
#notice:empty { display: none; }
body:not(.editor) .grid {
  margin-top: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
  gap: .85rem;
}
body:not(.editor) .grid > p { grid-column: 1 / -1; }
.contact-tile {
  display: grid;
  grid-template-columns: minmax(0, clamp(105px, 30vw, 290px)) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: .5rem;
  background: #fffcf8;
  border-color: var(--line);
  text-align: left;
}
.contact-photo {
  aspect-ratio: 1;
  background: #e9dfd4;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.contact-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.contact-caption {
  display: grid;
  gap: .1rem;
  padding: 0 .25rem .25rem;
  overflow-wrap: anywhere;
}
.contact-caption small { color: #574e4a; }

.accueil-animé [hidden] { display: none; }
.accueil-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin: 1.15rem 0;
}
.liste-link {
  display: inline-block;
  padding: .5rem .85rem;
  border-radius: .45rem;
  background: var(--ink);
  color: white;
  font-weight: 650;
  text-decoration: none;
}
.images-flottantes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 70% 15%, #344460, #172641 75%);
}
.lettre-flottante {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  padding: .25rem;
  border-radius: .3rem;
  background: #fffaf3;
  box-shadow: 0 6px 16px #08112266;
  aspect-ratio: 1;
  overflow: hidden;
}
.lettre-flottante img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.lettre-flottante:hover, .lettre-flottante:focus-visible {
  z-index: 1;
  outline: 2px solid #fffaf3;
  outline-offset: -2px;
}

/* Keep the home controls readable over the viewport-wide movement. */
body.accueil-animé {
  background: #172641;
  color: #fffaf3;
  overflow: hidden;
}
.accueil-animé header {
  position: relative;
  z-index: 1;
  background: #172641e8;
  border-color: #ffffff21;
}
body.accueil-animé main {
  pointer-events: none;
  padding-bottom: 0;
}
body.accueil-animé .intro {
  position: relative;
  z-index: 1;
  border: 0;
  padding: clamp(.85rem, 3vh, 1.8rem) 0 0;
  text-shadow: 0 2px 6px #081122, 0 0 18px #081122;
}
body.accueil-animé .intro p:first-child { color: #ffd1d5; }
body.accueil-animé .intro h1 { font-size: clamp(2rem, 5vw, 4rem); }
.accueil-animé .images-flottantes { pointer-events: auto; }
.accueil-animé .accueil-actions {
  position: fixed;
  z-index: 2;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: .5rem;
  max-width: calc(100vw - 1rem);
  border-radius: .65rem;
  background: #172641ed;
  box-shadow: 0 4px 18px #08112299;
  pointer-events: auto;
}
.accueil-animé .liste-link { background: #fffaf3; color: var(--ink); }
.accueil-animé #pause { color: var(--ink); }
.accueil-animé :is(#accueil-vide, #notice) { position: relative; z-index: 1; }
.accueil-animé footer { display: none; }
