:root {
  --bg: #ffffff;
  --ink: #141414;
  --mute: #6a6a6a;
  --dim: #8a8a8a;
  --ph: #f3f2ee;
  --pad: 32px;
  --title: 30px;
  --ease: cubic-bezier(.2, .75, .2, 1);
}
@media (max-width: 699.98px) {
  :root { --pad: 16px; --title: 24px; }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--pad); top: -60px; z-index: 2000000;
  background: var(--bg); padding: 8px 12px; text-decoration: underline;
}
.skip:focus { top: 8px; }

/* ---------- en-tête ---------- */
.top {
  height: 56px;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1000001;
  background: var(--bg);
}
.top nav { display: flex; gap: 22px; }
@media (max-width: 699.98px) { .top nav { gap: 11px; } }
@media (max-width: 359.98px) { .top nav { gap: 8px; } .top { font-size: 14px; } }
.nv {
  padding: 12px 0;
  color: var(--ink);
  text-decoration: none;
  text-underline-offset: 4px;
  white-space: nowrap;
}
.nv:hover, .top nav .nv[aria-current="page"] { text-decoration: underline; }
.nv.name:hover { text-decoration: none; }

/* ---------- puzzle ---------- */
.puzzle {
  position: relative;
  overflow: clip;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: height .75s var(--ease);
}
#sentinel { height: 1px; }

.ctrls {
  position: sticky;
  top: calc(100vh - 56px);
  top: calc(100svh - 56px);
  z-index: 1000000;
  height: 44px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
@media (max-width: 699.98px) {
  .ctrls { top: calc(100vh - 50px); top: calc(100svh - 50px); padding: 0 6px; }
}
.ctrl {
  pointer-events: auto;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0;
  background: var(--bg);
  cursor: pointer;
}
.ctrl .ic-vrac { display: none; }
.ctrl[aria-pressed="true"] .ic-grid { display: none; }
.ctrl[aria-pressed="true"] .ic-vrac { display: block; }

.ph {
  position: absolute;
  opacity: 0;
  transform: scale(.96);
}
.ph-btn {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  padding: 0; margin: 0; border: 0;
  background: #e9e8e4;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}
.ph-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; box-shadow: inset 0 0 0 2px var(--bg); }
.ph.is-dragging .ph-btn { cursor: grabbing; }
.ph-btn img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.rz {
  position: absolute;
  width: 36px; height: 36px;
  touch-action: none;
}
.rz-nw { left: -18px; top: -18px; }
.rz-ne { right: -18px; top: -18px; }
.rz-sw { left: -18px; bottom: -18px; }
.rz-se { right: -18px; bottom: -18px; }
.rz-nw, .rz-se { cursor: url(assets/rz-nwse.svg) 16 16, nwse-resize; }
.rz-ne, .rz-sw { cursor: url(assets/rz-nesw.svg) 16 16, nesw-resize; }

/* liste des zines au centre du puzzle */
@keyframes xgfade { from { opacity: 0; } to { opacity: 1; } }
.list {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 900000;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  animation: xgfade .5s ease .35s both;
}
.list-nav {
  position: relative;
  pointer-events: auto;
  padding: 24px;
}
.list-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.list-nav a {
  display: block;
  padding: 2px 0;
  font-size: var(--title);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  text-align: center;
  color: var(--ink);
  transition: color .2s ease;
}
.list-nav.has-hover a { color: var(--dim); }
.list-nav.has-hover a.is-hover { color: var(--ink); }

/* ---------- pages ---------- */
.page { padding: 96px var(--pad) 140px; min-height: calc(80vh - 56px); }
@media (max-width: 699.98px) { .page { padding-top: 48px; } }
h1 {
  margin: 0;
  font-size: var(--title);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 400;
}
h1:focus { outline: none; }

.page.zine { padding-top: 40px; }
.zine-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-bottom: 64px;
}
.zine-title {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.back { color: var(--mute); text-decoration: none; text-underline-offset: 3px; }
.back:hover { text-decoration: underline; }
@media (max-width: 699.98px) {
  .page.zine { padding-top: 24px; }
  .zine-title { font-size: 18px; }
  .zine-head { margin-bottom: 28px; }
}
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
@media (max-width: 699.98px) {
  .shots { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
.shot {
  display: block;
  width: 100%;
  padding: 0; margin: 0; border: 0;
  background: var(--ph);
  overflow: hidden;
  cursor: zoom-in;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }

.page.contact { padding-top: 40px; }
@media (max-width: 699.98px) { .page.contact { padding-top: 24px; } }
.links { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.links a { text-decoration: none; }
.links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- visionneuse ---------- */
.lb {
  position: fixed; inset: 0;
  z-index: 3000000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  outline: none;
  touch-action: pinch-zoom;
}
.lb img {
  display: block;
  max-width: calc(100% - 200px);
  max-height: calc(100% - 130px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 699.98px) {
  .lb img { max-width: calc(100% - 24px); max-height: calc(100% - 150px); }
}
.lb.is-full img { max-width: 100%; max-height: 100%; }
.lb-zone {
  position: absolute; top: 64px; bottom: 64px;
  width: 28%;
  border: 0; background: none;
  display: flex; align-items: center;
}
.lb-prev { left: 0; padding: 0 0 0 12px; justify-content: flex-start; cursor: w-resize; }
.lb-next { right: 0; padding: 0 12px 0 0; justify-content: flex-end; cursor: e-resize; }
.lb-tools { position: absolute; top: 8px; right: 8px; display: flex; }
.lb-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 0; background: none; cursor: pointer;
}
.lb-btn .ic-exit { display: none; }
.lb.is-full .lb-btn .ic-full { display: none; }
.lb.is-full .lb-btn .ic-exit { display: block; }
.lb-count {
  position: absolute; bottom: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}
.lb.is-full .lb-count { display: none; }
body.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .puzzle, .ph, .list, .list-nav a { transition: none !important; animation: none !important; }
}
