:root {
  --ink: #1c2333;       /* bleu-nuit des Skylines */
  --muted: #333c4f;
  --paper: #fff;
  --mer: #0b5563;       /* le vert-bleu profond du fond peint : boutons */
  --voile: .62;         /* blanc posé sur les fonds peints : plus haut = plus doux */
  --k: 3.4px;           /* pixels par centimètre réel : les toiles sont à l'échelle entre elles */
  --serif: "Young Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}
@media (max-width: 700px) { :root { --k: 2.3px; } }

* { box-sizing: border-box; }
/* Le fond peint de l'ancien site, fixe sous toute la page */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: #bfe3e0 url(img/fond-wix.jpg) center / cover; }
main > *, footer { background: rgba(255, 255, 255, var(--voile)); }
body { margin: 0; color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; }

/* En-tête */
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 20px var(--gutter); position: absolute; inset: 0 0 auto; z-index: 1; }
.top .nom { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; }
.top nav { display: flex; gap: clamp(14px, 2.5vw, 32px); font-size: .95rem; }
.top nav a { text-decoration: none; font-weight: 500; }
.top nav a:hover, .top nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Accueil : le fond peint presque tel quel */
.hero { --voile: .44;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: clamp(24px, 5vw, 80px);
  padding: clamp(112px, 10vw, 140px) var(--gutter) clamp(48px, 6vw, 96px); }
.hero h1 { font-size: clamp(2.9rem, 7vw, 6.2rem); letter-spacing: -.02em; }
.hero p { max-width: 34ch; font-size: 1.15rem; font-weight: 500; margin: 28px 0 32px; }
.hero .toile { justify-self: center; max-height: 78vh; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 13px 22px; border: 2px solid var(--ink); border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: .98rem; background: var(--paper); color: var(--ink); cursor: pointer; font-family: inherit; }
.btn.plein { background: var(--mer); border-color: var(--mer); color: var(--paper); }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Une toile accrochée : ombre portée d'un châssis épais sur le mur */
.toile { box-shadow: 3px 3px 0 rgba(28, 35, 51, .14), 10px 22px 34px -14px rgba(28, 35, 51, .45); }

section { padding: clamp(56px, 8vw, 120px) var(--gutter); }
section > h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 20px; }
.chapo { max-width: 60ch; color: var(--muted); margin: 0 0 48px; }

/* La cimaise : œuvres centrées sur une même ligne, largeur = taille réelle × --k */
.cimaise { display: flex; flex-wrap: wrap; align-items: center; gap: 56px clamp(28px, 4vw, 64px); }
.piece { margin: 0; }
.piece button { all: unset; display: block; cursor: zoom-in; }
.piece button:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.piece img { width: calc(var(--w) * var(--k)); max-width: calc(100vw - 2 * var(--gutter)); }
.piece figcaption { margin-top: 14px; font-size: .9rem; line-height: 1.35; width: max-content; max-width: 13rem; }
.piece figcaption span { display: block; color: var(--muted); }
.piece figcaption .tirage { color: var(--ink); font-weight: 500; }

/* Un fond peint par série, voilé de blanc : carreaux de l'accueil, boutons et murs de la page Œuvres */
.c-animaux, main > #animaux { --fond: url(img/fond-animaux.jpg); --voile: .55; }
.c-pokemon, main > #pokemon { --fond: url(img/fond-pokemon.jpg); --voile: .6; }
.c-princesses, main > #princesses { --fond: url(img/fond-princesses.jpg); --voile: .52; }
.c-pixels, main > #pixels { --fond: url(img/fond-pixels.jpg); --voile: .66; }
.c-circus, main > #circus { --fond: url(img/fond-circus.jpg); --voile: .58; }
.c-skylines, main > #skylines { --fond: url(img/fond-skylines.jpg); --voile: .55; }
.c-dessins, main > #dessins { --fond: url(img/fond-dessins.jpg); --voile: .28; }
.c-hors-series, main > #hors-series { --fond: url(img/fond-hors-series.jpg); --voile: .48; }
[class^="c-"], main > .serie { background: linear-gradient(rgba(255, 255, 255, var(--voile)), rgba(255, 255, 255, var(--voile))), var(--fond) center / cover; }

/* Séries (accueil) : une mosaïque, bord à bord */
.bloc-series { padding-left: 0; padding-right: 0; padding-bottom: 0; }
.bloc-series > h2 { padding: 0 var(--gutter); margin-bottom: 40px; }
.series { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.series a { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; height: 100%;
  padding: 28px clamp(16px, 2vw, 32px); text-decoration: none; overflow: hidden; }
.series h3 { font-size: clamp(1.4rem, 2.2vw, 2rem); }
.series small { display: block; font-size: .9rem; margin-top: 6px; }
.series .vignettes { display: flex; align-items: center; justify-content: center; height: 190px; }
.series .vignettes img { max-height: 150px; max-width: 62%; width: auto; rotate: -4deg; transition: rotate .25s ease;
  box-shadow: 4px 8px 16px -6px rgba(28, 35, 51, .5); }
.series .vignettes img + img { rotate: 5deg; margin-left: -14%; }
.series a:hover img, .series a:focus-visible img { rotate: 0deg; }
.series a:focus-visible { outline-offset: -6px; }
.series a:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }

.apropos { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.texte-wix p { max-width: 62ch; margin: 0 0 1em; }
.texte-wix p:first-child { font-family: var(--serif); font-size: 1.45rem; line-height: 1.35; }
.signature { margin-top: 1.5em; color: var(--muted); }

/* Tirages */
.tirages-intro { margin: 0 0 48px; }
.tirages-intro p { max-width: 62ch; margin: 0 0 16px; }
.supports { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.supports li { padding: 8px 18px; border-radius: 999px; background: rgba(255, 255, 255, .72); font-weight: 500; }
.suite { margin-top: 56px; }

/* Contact : le fond peint revient */
.contact { --voile: .46; }
.contact p { max-width: 50ch; }

/* Pied de page */
footer { --voile: .5; padding: 24px var(--gutter); font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Page œuvres */
.intro-page { --voile: .44; padding-top: clamp(112px, 10vw, 150px); padding-bottom: clamp(48px, 5vw, 80px); }
.intro-page h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.sommaire { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.sommaire a { padding: 8px 18px; border-radius: 999px; color: var(--ink); font-weight: 500; text-decoration: none; }
.sommaire a:hover { background: var(--ink); color: var(--paper); }
.serie .texte { max-width: 62ch; margin: 0 0 48px; }
.serie .texte p { margin: 0 0 1em; }
.serie .texte small { font-size: .85rem; }

/* Détail d'une œuvre : le tableau lui-même, flou et très clair, sert de fond */
dialog.detail { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0;
  background: #fff; color: var(--ink); overflow: hidden; isolation: isolate; }
/* agrandi pour ne garder que le cœur de la toile, sans sa bordure noire */
dialog.detail::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--img) center / cover; transform: scale(1.8);
  filter: blur(36px); opacity: .3; }
dialog.detail::backdrop { background: rgba(28, 35, 51, .5); }
.detail .cadre { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 5vw, 72px); align-items: center;
  height: 100%; padding: clamp(56px, 6vw, 80px) var(--gutter) var(--gutter); }
.detail .toile { max-height: calc(100dvh - 160px); width: auto; justify-self: center; }
.detail h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 16px; }
.detail .serie-nom { margin: 0 0 16px; color: var(--muted); }
.detail .legende { list-style: none; margin: 0 0 28px; padding: 0; font-size: .95rem; }
.detail .actions { flex-direction: column; align-items: flex-start; }
.detail .note { font-size: .9rem; color: var(--muted); margin-top: 16px; }
.detail .fermer { position: absolute; top: 16px; right: var(--gutter); }
@media (prefers-reduced-motion: no-preference) {
  dialog.detail[open] .toile { animation: accroche .5s cubic-bezier(.2, .7, .2, 1); }
  @keyframes accroche { from { opacity: 0; transform: translateY(-14px); } }
}

@media (max-width: 860px) {
  .hero, .apropos, .detail .cadre { grid-template-columns: 1fr; }
  .hero .toile { max-height: 60vh; }
  .detail .cadre { align-content: start; overflow-y: auto; padding-top: 76px; }
  .detail .toile { max-height: 55dvh; }
  .series { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series .vignettes { height: 130px; }
  .series .vignettes img { max-height: 104px; }
  .hero, .intro-page, .mentions { padding-top: 148px; }
}
@media (prefers-reduced-motion: reduce) { .series .vignettes img { transition: none; } }

/* Mentions légales */
.mentions { padding-top: clamp(148px, 10vw, 160px); }
.mentions h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.mentions > h2 { font-size: 1.4rem; margin: 40px 0 10px; }
.mentions p { max-width: 62ch; margin: 0 0 1em; }
