/* ═══════════════════════════════════════
   MAIRE ARCHITECTE
   Mobile : noir plein écran
   Desktop : blanc, image centrée
═══════════════════════════════════════ */

:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --th: 52px; /* topbar height */
  --fd: 'Cormorant Garamond', Georgia, serif;
  --fb: 'Karla', Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { font-family: var(--fb); font-weight: 300; -webkit-font-smoothing: antialiased; overscroll-behavior: none; background: #fff; color: #0a0a0a; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--fb); cursor: pointer; border: none; background: none; color: inherit; }

/* ── TOPBAR ── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--th);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(255,255,255,.95);
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.logo { display: flex; align-items: center; }
.logo-img { height: 28px; width: auto; display: block; }
.btn-contact {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 14px; border-radius: 1px;
  border: 1px solid rgba(0,0,0,.2); color: #0a0a0a;
  transition: background .2s, color .2s;
}
.btn-contact:hover { background: #0a0a0a; color: #fff; }

/* ── VIEWPORT ── */
#viewport { position: fixed; inset: 0; overflow: hidden; }

/* ── Y-TRACK (projets) ── */
#y-track {
  position: absolute; top: 0; left: 0; width: 100%;
  will-change: transform;
  transition: transform .45s var(--ease);
}
.reel {
  position: absolute; left: 0; width: 100%; height: 100dvh; overflow: hidden;
}

/* ── X-TRACK (photos) ── */
.x-track {
  position: absolute; top: var(--th); left: 0;
  height: calc(100dvh - var(--th) - 130px);
  display: flex;
  will-change: transform;
  transition: transform .3s var(--ease);
  overflow: hidden;
  scrollbar-width: none;
}
.x-track::-webkit-scrollbar { display: none; }
.photo {
  flex: 0 0 100vw; width: 100vw; height: 100%;
  background: #fff center/contain no-repeat;
  position: relative;
}

/* ── OVERLAY — désactivé ── */
.reel-overlay { display: none; }

/* ── INFOS PROJET ── */
.reel-info {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  padding: 0 24px 28px; pointer-events: none;
  background: none;
}
.reel-cat { font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: rgba(0,0,0,.4); margin-bottom: 7px; }
.reel-title { font-family: var(--fd); font-size: 40px; font-weight: 300; font-style: italic; line-height: 1; color: #0a0a0a; margin-bottom: 5px; }
.reel-loc { font-size: 11px; color: rgba(0,0,0,.45); letter-spacing: .07em; margin-bottom: 14px; }
.reel-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.rtag { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: rgba(0,0,0,.4); border: 1px solid rgba(0,0,0,.14); padding: 3px 9px; border-radius: 1px; }

/* ── INDICATEURS PHOTOS ── */
.photo-dots {
  position: absolute; z-index: 3; pointer-events: none;
  top: var(--th); left: 0; right: 0;
  display: flex; gap: 2px; padding: 8px 24px 0;
}
.pdot { height: 1px; flex: 1; background: rgba(0,0,0,.15); transition: background .2s; }
.pdot.on { background: #0a0a0a; }

/* ── PUB ── */
.reel.pub .reel-overlay { display: none; }
.reel.pub .x-track { display: none; }
.pub-inner {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: #fff;
  padding: 28px 28px 40px; gap: 18px;
}
/* image carrée centrée */
.pub-img {
  width: min(68vw, 320px);
  height: min(68vw, 320px);
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}
.pub-text {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.pub-title {
  font-family: var(--fd); font-size: 26px; font-weight: 400; font-style: italic;
  color: #0a0a0a; line-height: 1.1;
}
.pub-copy {
  font-size: 11px; font-weight: 300;
  color: rgba(0,0,0,.45); line-height: 1.65;
  max-width: 250px; letter-spacing: .04em;
}
.pub-cta {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: #0a0a0a; border: 1px solid rgba(0,0,0,.25);
  padding: 10px 28px; border-radius: 1px;
  transition: background .2s, color .2s; margin-top: 6px;
}
.pub-cta:hover { background: #0a0a0a; color: #fff; }

/* ── DOTS PROJETS ── */
#proj-dots {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 7px; z-index: 90;
}
.ydot { width: 3px; height: 3px; border-radius: 50%; background: rgba(0,0,0,.18); cursor: pointer; border: none; padding: 0; transition: background .2s, height .2s; }
.ydot.on { background: #0a0a0a; height: 14px; border-radius: 2px; }

/* ── FLÈCHES (desktop seulement) ── */
.arr-prev, .arr-next {
  display: none;
  position: fixed; top: 50%; transform: translateY(-50%);
  z-index: 90; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid; font-size: 20px; line-height: 1;
  align-items: center; justify-content: center;
  cursor: pointer; transition: background .18s, color .18s;
  user-select: none;
}

/* ── MODAL ── */
#modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: transparent; display: flex; align-items: flex-end;
  pointer-events: none; transition: background .3s;
}
#modal-overlay.open { background: rgba(0,0,0,.65); pointer-events: auto; }
#modal-sheet {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: #fffffff6; border: 1px solid rgba(244,244,242,.1); border-bottom: none;
  border-radius: 12px 12px 0 0; padding: 18px 22px 44px;
  transform: translateY(100%); transition: transform .4s var(--ease);
}
#modal-overlay.open #modal-sheet { transform: translateY(0); }
.m-handle { width: 32px; height: 3px; background: rgba(0,0,0,.12); border-radius: 2px; margin: 0 auto 24px; }
.m-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid rgba(244,244,242,.07); margin-bottom: 20px; }
.m-logo { width: 44px; height: 44px; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 2px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.m-logo img { height: 24px; width: auto; filter: invert(1); }
.m-name { font-family: var(--fd); font-size: 17px; font-weight: 400; color: #000000; margin-bottom: 2px; }
.m-city { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: rgba(0, 0, 0, 0.4); }
.m-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(244,244,242,.05); }
.m-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: rgba(0, 0, 0, 0.35); flex-shrink: 0; margin-top: 1px; }
.m-lbl { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: rgba(0, 0, 0, 0.25); margin-bottom: 3px; }
.m-val { font-size: 13px; color: #000000; line-height: 1.5; transition: color .2s; }
a.m-val:hover { color: rgba(0, 0, 0, 0.55); }
.m-close { margin-top: 20px; width: 100%; padding: 12px; background: transparent; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 1px; color: rgba(0, 0, 0, 0.35); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; transition: background .2s, color .2s; }
.m-close:hover { background: rgba(244,244,242,.06); color: #000000; }

/* ── ANIMATIONS ── */
.reel-info > * { opacity: 0; transform: translateY(6px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reel.active .reel-cat   { opacity: 1; transform: none; transition-delay: .04s; }
.reel.active .reel-title { opacity: 1; transform: none; transition-delay: .10s; }
.reel.active .reel-loc   { opacity: 1; transform: none; transition-delay: .16s; }
.reel.active .reel-tags  { opacity: 1; transform: none; transition-delay: .22s; }
.pub-img, .pub-text { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reel.active .pub-img  { opacity: 1; transform: none; transition-delay: .06s; }
.reel.active .pub-text { opacity: 1; transform: none; transition-delay: .18s; }

/* ════════════════════════════════════════
   DESKTOP ≥ 900px
   Fond blanc, image centrée, peek 50px
════════════════════════════════════════ */
@media (min-width: 900px) {

  body { background: #fff; color: #0a0a0a; }

  /* topbar blanc */
  #topbar { background: #fff; border-bottom: 1px solid rgba(0,0,0,.07); }
  .logo-img { filter: none; }
  .btn-contact { color: #0a0a0a; border-color: rgba(0,0,0,.2); }
  .btn-contact:hover { background: #0a0a0a; color: #fff; }

  /* reel blanc, overflow visible pour peek */
  .reel { background: #fff; overflow: visible; }

  /* x-track : transform géré par JS, overflow visible */
  .x-track {
    /* centrage vertical : milieu dispo entre topbar et bas */
    top: calc(var(--th) + (100dvh - var(--th) - 58vh - 100px) / 2);
    height: 58vh;
    overflow: visible;
    /* transition rapide */
    transition: transform .28s var(--ease);
  }

  /* photo desktop : contain centré, fond blanc */
  .photo {
    flex: 0 0 calc(100vw - 132px);
    width: calc(100vw - 132px);
    height: 100%;
    background-color: #fff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 2px;
    cursor: pointer;
  }
  .photo::after { display: none; }
  .x-track { gap: 16px; }
  .photo.peek { filter: brightness(.07); transition: filter .28s; }

  /* overlay désactivé */
  .reel-overlay { display: none; }

  /* infos sous l'image — alignement géré par JS */
  .reel-info {
    top: calc(var(--th) + (100dvh - var(--th) - 58vh - 100px) / 2 + 58vh + 14px);
    bottom: auto; left: 0 !important; right: 66px !important; padding: 0;
  }
  .reel-cat   { color: rgba(0,0,0,.38); }
  .reel-title { color: #0a0a0a; font-size: 34px; }
  .reel-loc   { color: rgba(0,0,0,.4); }
  .rtag { color: rgba(0,0,0,.35); border-color: rgba(0,0,0,.13); }

  /* dots photo : cachés sur desktop (navigation par flèches) */
  .photo-dots { display: none; }

  /* pub desktop : fond blanc, textes noirs */
  .pub-inner { background: #fff; }
  .pub-title { color: #0a0a0a; }
  .pub-copy  { color: rgba(0,0,0,.45); }
  .pub-cta   { color: #0a0a0a; border-color: rgba(0,0,0,.28); }
  .pub-cta:hover { background: #0a0a0a; color: #fff; }

  /* dots projets */
  .ydot { background: rgba(0,0,0,.15); }
  .ydot.on { background: #0a0a0a; }

  /* flèches L/R */
  .arr-prev, .arr-next {
    display: flex;
    background: rgba(255,255,255,.88);
    border-color: rgba(0,0,0,.14);
    color: rgba(0,0,0,.5);
    backdrop-filter: blur(6px);
  }
  .arr-prev { left: 10px; }
  .arr-next { right: 10px; }
  .arr-prev:hover, .arr-next:hover { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }

  /* modal blanc */
  #modal-overlay.open { background: rgba(0,0,0,.28); }
  #modal-sheet { background: #fafafa; border-color: rgba(0,0,0,.09); }
  .m-handle { background: rgba(0,0,0,.13); }
  .m-head { border-bottom-color: rgba(0,0,0,.07); }
  .m-logo { border-color: rgba(0,0,0,.14); }
  .m-logo img { filter: none; }
  .m-name { color: #0a0a0a; }
  .m-city { color: rgba(0,0,0,.38); }
  .m-row { border-bottom-color: rgba(0,0,0,.04); }
  .m-icon { color: rgba(0,0,0,.3); }
  .m-lbl { color: rgba(0,0,0,.28); }
  .m-val { color: #0a0a0a; }
  a.m-val:hover { color: rgba(0,0,0,.45); }
  .m-close { border-color: rgba(0,0,0,.1); color: rgba(0,0,0,.35); }
  .m-close:hover { background: rgba(0,0,0,.04); color: #0a0a0a; }
}

/* ── PDF canvas ── */
.photo-pdf {
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.pdf-canvas {
  max-width: 100%; max-height: 100%;
  width: auto !important; height: auto !important;
  display: block; box-shadow: 0 2px 20px rgba(0,0,0,.08);
}
/* cacher le label numéro sur les PDF */
.photo-pdf .photo-num { display: none; }