:root {
  --bg: #fff;
  --fg: #0a0a0a;
  --muted: #777;
  --line: #d6d6d6;
  --pad: clamp(16px, 2.7vw, 40px);
  --gap: clamp(12px, 1.4vw, 24px);
  --header-h: 104px;
  --font: Arial, Helvetica, sans-serif;
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: -.015em;
}

a { text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: var(--gap);
  padding: 16px var(--pad) 14px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.brand { display: block; width: fit-content; }
.brand:hover { text-decoration: none; }
.brand img { width: auto; height: 72px; }

.nav {
  justify-self: end;
  align-self: start;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(16px, 2.5vw, 42px);
  width: auto;
  padding-top: 5px;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: clamp(12px, 1.25vw, 18px);
}

main { min-height: 70vh; }
.page { display: none; padding: 0 var(--pad); }
.page.is-active { display: block; }

.intro {
  max-width: 1200px;
  padding: clamp(52px, 9vw, 130px) 0 clamp(56px, 7vw, 110px);
  font-size: clamp(36px, 5.3vw, 76px);
  line-height: .94;
  letter-spacing: -.06em;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 400;
}
.section-heading h1 { font-size: inherit; font-weight: 400; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(34px, 5vw, 74px);
}

.card { min-width: 0; }
.card:hover { text-decoration: none; }
.card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eee;
  filter: grayscale(100%);
  transition: filter .18s ease, opacity .18s ease;
}
.card:hover .card__image { filter: grayscale(0%); opacity: .9; }
.card__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding-top: 7px;
  text-transform: uppercase;
}
.card__caption span:first-child { overflow-wrap: anywhere; }
.card__caption span:last-child { color: var(--muted); text-align: right; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 3fr) minmax(0, 9fr);
  gap: var(--gap);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-meta {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  align-self: start;
  padding-right: 18px;
}
.detail-meta h1 { margin-bottom: 20px; font-size: 13px; font-weight: 400; text-transform: uppercase; }
.detail-meta p { margin-bottom: 6px; }
.detail-meta .muted { color: var(--muted); text-transform: uppercase; }
.detail-description { max-width: 36rem; margin: 26px 0 38px; font-size: 15px; line-height: 1.48; }
.detail-back { margin-top: 38px; text-transform: uppercase; }
.detail-media { display: grid; gap: var(--gap); }
.detail-media img { width: 100%; height: auto; filter: none; background: #eee; }

.prose { max-width: 820px; padding: 24px 0 80px; }
.prose p + p { margin-top: 1em; }
.prose--large { font-size: clamp(28px, 4.2vw, 60px); line-height: .98; letter-spacing: -.05em; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 100px var(--pad) 24px;
  color: var(--muted);
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(190px, 4fr) minmax(0, 8fr); }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; }

  .site-header {
    min-height: var(--header-h);
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .brand img { height: 44px; }

  .nav {
    justify-self: end;
    width: auto;
    gap: clamp(14px, 4vw, 22px);
    padding-top: 5px;
    font-size: clamp(11px, 3vw, 14px);
  }

  .intro {
    padding-top: 58px;
    padding-bottom: 48px;
    font-size: clamp(32px, 8.9vw, 46px);
    line-height: .93;
  }

  /* Important : une seule carte par ligne sur smartphone. */
  .cards,
  .cards--projects,
  .cards--news {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 38px;
  }

  .card { width: 100%; }
  .card__image { width: 100%; aspect-ratio: 4 / 3; }

  .detail-layout { grid-template-columns: 1fr; row-gap: 34px; }
  .detail-meta { position: static; padding-right: 0; }
  .detail-description { font-size: 14px; }
  .site-footer { padding-top: 70px; font-size: 11px; }
}

@media (max-width: 380px) {
  .nav { gap: 10px; font-size: 10.5px; }
  .brand img { height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* =========================================================
   GALERIE PLEIN ECRAN
   ========================================================= */

.detail-media__link {
  display: block;
  cursor: zoom-in;
  overflow: hidden;
}

.detail-media__link img {
  transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .25s ease;
}

.detail-media__link:hover img {
  transform: scale(1.006);
  opacity: .96;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: 1fr auto;
  background: rgba(0,0,0,.96);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility 0s linear .28s;
  touch-action: none;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.lightbox__stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(54px, 6vw, 86px) clamp(18px, 6vw, 90px) 18px;
  cursor: zoom-in;
}

.lightbox__image {
  max-width: 100%;
  max-height: calc(100dvh - 118px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  transform: translate3d(0,0,0) scale(1);
  transform-origin: center center;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), opacity .18s ease;
  will-change: transform;
}

.lightbox.is-zoomed .lightbox__stage { cursor: grab; }
.lightbox.is-dragging .lightbox__stage { cursor: grabbing; }
.lightbox.is-zoomed .lightbox__image { transition: none; }
.lightbox.is-changing .lightbox__image { opacity: 0; }

.lightbox__toolbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 10px var(--pad) 14px;
  font-size: 12px;
  text-transform: uppercase;
}

.lightbox__button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: uppercase;
  cursor: pointer;
}

.lightbox__button:hover,
.lightbox__button:focus-visible { text-decoration: underline; }
.lightbox__counter { justify-self: center; }

.lightbox__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 54px;
  height: 74px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  transform: translateY(-50%);
  opacity: .8;
}
.lightbox__arrow:hover { opacity: 1; }
.lightbox__arrow--prev { left: 8px; }
.lightbox__arrow--next { right: 8px; }

body.lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
  .lightbox__stage {
    padding: 58px 0 10px;
  }
  .lightbox__image {
    max-width: 100vw;
    max-height: calc(100dvh - 112px);
  }
  .lightbox__toolbar {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .lightbox__share { display: none; }
  #lightbox-share { display: none; }
  .lightbox__arrow {
    top: auto;
    bottom: 2px;
    width: 44px;
    height: 48px;
    transform: none;
    font-size: 24px;
  }
  .lightbox__arrow--prev { left: 35%; }
  .lightbox__arrow--next { right: 35%; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__image,
  .detail-media__link img { transition: none !important; }
}
