/* ═══════════════════════════════════════
   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-family: var(--fb); font-size: 12px; font-weight: 500; line-height: 1.2; color: #0a0a0a; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .03em;
  letter-spacing: .02em;
  padding: 5px 14px; border-radius: 1px;
  border: 1px solid #0a0a0a; 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: calc(var(--th) + 10px); left: 0;
  height: calc((100dvh - var(--th) - 20px) * 2 / 3);
  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/cover no-repeat;
  position: relative;
}

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

/* ── INFOS PROJET ── */
.reel-info {
  position: absolute; top: calc(var(--th) + 20px + (100dvh - var(--th) - 20px) * 2 / 3); bottom: 0;
  left: 0; right: 0; z-index: 3;
  padding: 10px 20px 0; pointer-events: none;
  background: #fff;
}
.reel-desc-main { font-family: var(--fb); font-size: 12px; font-weight: 500; line-height: 1.2; color: #0a0a0a; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .03em; }
.reel-table { display: flex; flex-direction: column; gap: 3px; }
.reel-row { display: flex; gap: 10px; align-items: baseline; }
.reel-label { font-size: 7px; letter-spacing: .16em; text-transform: uppercase; color: rgba(0,0,0,.28); flex: 0 0 80px; padding-top: 1px; }
.reel-value { font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: rgba(0,0,0,.75); font-weight: 500; line-height: 1.4; }
/* compat anciens éléments inutilisés */
.reel-cat, .reel-title, .reel-loc, .reel-date, .reel-status, .reel-tags { display: none; }
.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; overflow: hidden;
}
.pub-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
/* Bandeau "Sponsorisé" style Instagram */
.pub-sponsored {
  position: absolute; top: var(--th); left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, transparent 100%);
}
.pub-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55);
  object-fit: contain; background: #000; flex-shrink: 0;
}
.pub-identity { display: flex; flex-direction: column; gap: 1px; }
.pub-name { font-size: 12px; font-weight: 500; color: #fff; letter-spacing: .01em; }
.pub-label { font-size: 10px; color: rgba(255,255,255,.65); letter-spacing: .03em; }
/* Overlay texte en bas */
.pub-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
  padding: 48px 22px 44px;
  background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 55%, transparent 100%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
}
.pub-title {
  font-family: var(--fd); font-size: 30px; font-weight: 300; font-style: italic;
  color: #fff; line-height: 1.1;
}
.pub-copy {
  font-size: 12px; font-weight: 300;
  color: rgba(255,255,255,.82); line-height: 1.6;
  letter-spacing: .03em;
}
.pub-cta {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: #fff; border: 1.5px solid rgba(255,255,255,.8);
  padding: 10px 26px; border-radius: 1px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(6px);
  transition: background .2s, color .2s, border-color .2s;
  margin-top: 6px;
}
.pub-cta:hover { background: #fff; color: #0a0a0a; border-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: 52px; height: 64px; border-radius: 0;
  border: none; font-size: 36px; line-height: 1;
  align-items: center; justify-content: center;
  cursor: pointer; transition: color .18s;
  user-select: none; background: transparent;
}

/* ── 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.55); border-radius: 1px; color: rgba(0, 0, 0, 0.55); 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; }
.m-legal { margin-top: 14px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.m-legal a { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: rgba(0,0,0,.28); transition: color .2s; }
.m-legal a:hover { color: rgba(0,0,0,.6); }
.m-legal-sep { font-size: 9px; color: rgba(0,0,0,.15); }

/* ── STATUT PROJET ── */
.reel-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 10px;
}
.reel-status::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.reel-status--realise  { color: rgba(0,0,0,.38); }
.reel-status--realise::before  { background: rgba(0,0,0,.3); }
.reel-status--en-cours { color: #9a6e00; }
.reel-status--en-cours::before { background: #c48a00; }
.reel-status--concours { color: #2060a0; }
.reel-status--concours::before { background: #2070bb; }

/* ── ANIMATIONS ── */
.reel-info > * { opacity: 0; transform: translateY(6px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reel.active .reel-desc-main { opacity: 1; transform: none; transition-delay: .00s; }
.reel.active .reel-table     { opacity: 1; transform: none; transition-delay: .10s; }
.pub-sponsored, .pub-overlay { opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reel.active .pub-sponsored { opacity: 1; transform: none; transition-delay: .08s; }
.reel.active .pub-overlay   { opacity: 1; transform: none; transition-delay: .20s; }

/* ── Pas de peek entre 900px et 1079px ── */
@media (min-width: 900px) and (max-width: 1079px) {
  .x-track { overflow: hidden; }
  .photo.peek { opacity: 0; pointer-events: none; }
}

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

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

  /* topbar blanc */
  #topbar { background: #fff; }
  .logo-img { filter: none; }
  .btn-contact { color: #0a0a0a; border-color: #0a0a0a;}
  .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 {
    top: calc(var(--th) + (100dvh - var(--th) - 58vh - 100px) / 2);
    height: 58vh;
    overflow: visible;
    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: blur(3px); opacity: .18; transition: filter .28s, opacity .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; background: none;
  }
  .reel-desc-main { font-size: 16px; margin-bottom: 10px; }
  .reel-table { gap: 4px; }
  .reel-label { font-size: 8px; flex: 0 0 100px; }
  .reel-value { font-size: 10px; }
  /* rétablir toutes les lignes sur desktop */
  .row-desc, .row-maitre, .row-procedure { display: flex; }
  .reel-loc   { color: rgba(0,0,0,.4); }
  .rtag { color: rgba(0,0,0,.35); border-color: rgba(0,0,0,.13); }

  /* barre de progression : fixe sous topbar, visible uniquement sur le reel actif */
  .photo-dots { display: none; }
  .reel.active .photo-dots {
    display: flex;
    position: fixed;
    top: var(--th); left: 0; right: 0;
    padding: 0 24px;
    gap: 3px;
  }
  .pdot { height: 1px; }

  /* pub desktop : plein écran, même style que mobile */
  .pub-inner { background: #000; }
  .pub-overlay { padding-bottom: 60px; }

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

  /* flèches L/R */
  .arr-prev, .arr-next {
    display: flex;
    background: transparent;
    color: rgba(0,0,0,.35);
  }
  .arr-prev { left: 10px; }
  .arr-next { right: 10px; }
  .arr-prev:hover, .arr-next:hover { 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 embed ── */
.photo-pdf { background: #fff; }
.pdf-embed {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* ── Vidéo embed ── */
.photo-video { background: #fff; }
.video-embed {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
@media (min-width: 900px) {
  .video-embed { object-fit: contain; }
}