/* Mise en page « Mosaïque » — blocs collés de tailles variées, mode sombre ou clair */

/* Couleurs : sombre par défaut, claire si le visiteur la choisit ou si son appareil est en mode clair */
:root, :root[data-theme="dark"] {
  --bg: #0d0d0c; --ink: #efeee9; --ink-2: #d3d1c7; --muted: #8f8e88; --line: #2c2c2a; --surface: #1a1a19;
  --accent: #5dcaa5; --field-line: #444441; --placeholder: #6b6a64; --header-bg: rgba(13, 13, 12, .86); --tag-line: #5f5e5a;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f5f4ef; --ink: #141413; --ink-2: #3d3d3a; --muted: #67665f; --line: #dcdad2; --surface: #e6e4dc;
    --accent: #0f6e56; --field-line: #b4b2a9; --placeholder: #8f8e88; --header-bg: rgba(245, 244, 239, .88); --tag-line: #b4b2a9;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f4ef; --ink: #141413; --ink-2: #3d3d3a; --muted: #67665f; --line: #dcdad2; --surface: #e6e4dc;
  --accent: #0f6e56; --field-line: #b4b2a9; --placeholder: #8f8e88; --header-bg: rgba(245, 244, 239, .88); --tag-line: #b4b2a9;
  color-scheme: light;
}
:root { --cols: 6; --gut: clamp(16px, 3vw, 40px); }

body.t-d { background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; transition: background-color .25s, color .25s; }
.t-d a { color: inherit; }
.t-d ::selection { background: var(--ink); color: var(--bg); }

/* En-tête */
.d-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--gut); background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.d-header__right { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.d-brand { display: block; color: var(--ink); }
.d-brand__logo { width: 92px; height: auto; }
.d-nav { display: flex; gap: clamp(14px, 3vw, 34px); font-size: 14px; }
.d-nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.d-nav a:hover, .d-nav a[aria-current] { color: var(--ink); }
.d-burger { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.d-burger i { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--ink); transition: transform .25s; }
.d-burger i:first-of-type { top: 15px; } .d-burger i:last-of-type { top: 23px; }
.d-burger[aria-expanded="true"] i:first-of-type { transform: translateY(4px) rotate(45deg); }
.d-burger[aria-expanded="true"] i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

/* Intro */
.d-intro { padding: clamp(28px, 6vw, 80px) var(--gut) clamp(24px, 4vw, 48px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 40px; }
.d-intro__title { margin: 0; display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.d-intro__name { font-size: clamp(48px, 10vw, 150px); line-height: .88; letter-spacing: -.045em; }
.d-intro__jobs { font-size: clamp(14px, 1.4vw, 17px); color: var(--muted); letter-spacing: 0; }
.d-intro__statement { margin: 0; max-width: 22ch; font-size: clamp(18px, 2vw, 26px); line-height: 1.2; letter-spacing: -.02em; text-align: right; }
.d-intro--small .d-intro__name { font-size: clamp(44px, 8vw, 110px); }
.d-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.d-filters a { text-decoration: none; font-size: 13px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); transition: all .2s; }
.d-filters a:hover { color: var(--ink); border-color: var(--muted); }
.d-filters a.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.d-empty { padding: 0 var(--gut) 80px; color: var(--muted); }

/* Le mur : blocs collés sans espace */
.t-d main { container-type: inline-size; }
.wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: calc(100vw / var(--cols)); grid-auto-rows: calc(100cqw / var(--cols)); grid-auto-flow: dense; gap: 0; }
.tile { position: relative; overflow: hidden; background: var(--surface); grid-column: span 1; grid-row: span 1; }
.tile[hidden] { display: none; }
.tile--m { grid-column: span 2; }
.tile--l { grid-column: span 2; grid-row: span 2; }
.tile--xl { grid-column: span 3; grid-row: span 2; }
.tile--tall { grid-column: span 2; grid-row: span 4; }
.tile--full { grid-column: 1 / -1; grid-row: span 3; }
.tile > a, .tile picture { display: block; width: 100%; height: 100%; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: filter .45s ease, transform .8s cubic-bezier(.2, .7, .2, 1), opacity .45s; }
.tile .lite-video { height: 100%; aspect-ratio: auto; }

/* Texte au survol : voile sombre derrière le texte pour qu'il reste lisible quelle que soit l'image */
.tile > a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .72) 100%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.tile__info { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: clamp(14px, 2vw, 28px); text-align: center; pointer-events: none; opacity: 0; transition: opacity .3s; color: #fff; }
.tile__title { margin: 0; font-size: clamp(20px, 2.2vw, 34px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; color: #fff; }
.tile--s .tile__title { font-size: clamp(15px, 1.4vw, 20px); }
.tile__desc { max-width: 38ch; font-size: clamp(13px, 1vw, 15px); line-height: 1.45; color: #f2f1ec; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile--s .tile__desc { display: none; }

@media (hover: hover) {
  .wall:hover .tile img, .wall:hover .tile video, .wall:focus-within .tile img { filter: grayscale(1) brightness(.5); }
  .wall .tile:hover img, .wall .tile:hover video, .wall .tile:focus-within img { filter: none; transform: scale(1.03); }
  .tile:hover > a::after, .tile:focus-within > a::after { opacity: 1; }
  .tile:hover .tile__info, .tile:focus-within .tile__info { opacity: 1; }
}
@media (hover: none) {
  .tile__info { opacity: 1; inset: auto 0 0 0; align-items: flex-start; text-align: left; padding: 48px 12px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); justify-content: flex-end; gap: 4px; }
  .tile__title { font-size: 17px; }
  .tile__desc { font-size: 12px; -webkit-line-clamp: 2; }
}
.tile a:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.wall--gallery .tile > a { cursor: zoom-in; }
.wall--gallery .tile > a::after { display: none; }

/* À propos sur l'accueil */
.d-about { padding: clamp(56px, 9vw, 130px) var(--gut); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 20px 40px; border-bottom: 1px solid var(--line); }
.d-about > p { grid-column: 2; margin: 0; }
.d-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); text-transform: none; }
.d-about__text { font-size: clamp(20px, 2.6vw, 36px); line-height: 1.22; letter-spacing: -.02em; }
.d-about__text p { margin: 0 0 .5em; }
.d-about__text strong { font-weight: 500; color: var(--accent); }
.d-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.d-link .icon { width: 1em; height: 1em; }

/* Page projet : textes posés sur des photos, toujours en blanc */
.d-hero { position: relative; min-height: min(78vh, 62vw); display: flex; align-items: flex-end; background: #1a1a19; overflow: hidden; color: #fff; }
.d-hero__img, .d-hero__img picture { position: absolute; inset: 0; }
.d-hero__img img { width: 100%; height: 100%; object-fit: cover; }
.d-hero__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .1) 40%, rgba(0, 0, 0, .7)); }
.d-hero__text { position: relative; padding: var(--gut); width: 100%; }
.d-hero__title { margin: 10px 0 0; font-size: clamp(46px, 10vw, 160px); line-height: .88; letter-spacing: -.045em; font-weight: 500; max-width: 14ch; color: #fff; }
.d-crumbs { font-size: 13px; color: #e6e4dc; }
.d-crumbs a { text-decoration: none; color: inherit; }
.d-crumbs a:hover { text-decoration: underline; }
.d-info { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px clamp(32px, 6vw, 96px); padding: clamp(36px, 6vw, 80px) var(--gut); }
.d-info__desc { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.d-info__desc p:first-child { margin-top: 0; }
.d-info__desc strong { color: var(--ink); font-weight: 500; }
.d-draft { display: inline-block; font-size: 13px; background: #faeeda; color: #633806; padding: 4px 10px; border-radius: 4px; }
.d-info__facts { margin: 0; font-size: 14px; }
.d-info__facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.d-info__facts dt { color: var(--muted); }
.d-info__facts dd { margin: 0; text-align: right; }
.d-tags dd { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; text-align: left; }
.d-tag { font-size: 12px; text-decoration: none; padding: 3px 10px; border: 1px solid var(--tag-line); border-radius: 99px; color: var(--ink-2); }
.d-tag:hover { border-color: var(--ink); color: var(--ink); }
.d-next { position: relative; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: clamp(40px, 8vw, 110px) var(--gut); text-decoration: none; overflow: hidden; background: #185fa5; isolation: isolate; color: #fff; }
.t-d a.d-next { color: #fff; }
.d-next__img { position: absolute; inset: 0; z-index: -1; }
.d-next__img picture, .d-next__img img { width: 100%; height: 100%; object-fit: cover; }
.d-next__img::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .55); transition: background .4s; }
.d-next:hover .d-next__img::after { background: rgba(0, 0, 0, .3); }
.d-next__label { font-size: 14px; color: #e6e4dc; }
.d-next__title { display: inline-flex; align-items: center; gap: 14px; font-size: clamp(32px, 6vw, 88px); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.d-next__title .icon { width: .7em; height: .7em; transition: transform .3s; }
.d-next:hover .d-next__title .icon { transform: translateX(8px); }
/* « Parlons-en » placé entre la galerie et le projet suivant */
.d-project .d-footer__cta { border-top: 1px solid var(--line); }

/* Pages de texte */
.d-page { padding: clamp(40px, 7vw, 100px) var(--gut) clamp(60px, 8vw, 120px); max-width: 860px; }
.d-page--wide { max-width: 1200px; }
.d-page__head h1 { margin: 0; font-size: clamp(42px, 8vw, 104px); line-height: .9; letter-spacing: -.045em; font-weight: 500; }
.d-page__kicker { color: var(--muted); margin: 14px 0 0; }
.d-page .prose { margin-top: clamp(28px, 5vw, 56px); color: var(--ink-2); }
.d-page .prose h2, .d-page .prose h3, .d-page .prose strong { color: var(--ink); font-weight: 500; }

/* Formulaire */
.t-d .field label { font-size: 13px; color: var(--muted); }
.t-d .field input, .t-d .field select, .t-d .field textarea { background: transparent; border: 0; border-bottom: 1px solid var(--field-line); padding: 10px 0; color: var(--ink); border-radius: 0; font-size: 18px; }
.t-d .field select { background: var(--bg); }
.t-d .field input:focus, .t-d .field textarea:focus, .t-d .field select:focus { outline: none; border-bottom-color: var(--ink); }
.t-d .has-error input, .t-d .has-error textarea { border-bottom-color: #e24b4a; }
.t-d ::placeholder { color: var(--placeholder); }
.t-d .btn, .t-d .contact-form button { align-self: flex-start; background: var(--ink); color: var(--bg); border: 0; padding: 13px 28px; border-radius: 99px; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; transition: transform .2s; }
.t-d .btn:hover { transform: translateY(-2px); }
.t-d .contact-direct { margin-top: 30px; color: var(--muted); }

/* Pied de page */
.d-footer { border-top: 1px solid var(--line); }
.d-footer__cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 30px; padding: clamp(48px, 8vw, 110px) var(--gut); text-decoration: none; border-bottom: 1px solid var(--line); }
.d-footer__cta span { color: var(--muted); font-size: 15px; }
.d-footer__cta strong { display: inline-flex; align-items: center; gap: 14px; font-size: clamp(40px, 8vw, 120px); font-weight: 500; letter-spacing: -.045em; line-height: .9; }
.d-footer__cta .icon { width: .6em; height: .6em; transition: transform .3s; }
.d-footer__cta:hover .icon { transform: translateX(10px); }
.d-footer__row { display: flex; flex-direction: column; gap: 16px; padding: 24px var(--gut) 32px; color: var(--muted); }
.d-social { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.d-social a { color: var(--muted); display: block; transition: color .2s; }
.d-social a:hover { color: var(--ink); }
.d-social .icon { width: 20px; height: 20px; }

@media (max-width: 1100px) {
  :root { --cols: 4; }
  .tile--xl { grid-column: span 4; }
}
@media (max-width: 700px) {
  :root { --cols: 2; }
  .tile--l, .tile--xl { grid-column: span 2; grid-row: span 2; }
  .tile--tall { grid-column: span 2; grid-row: span 4; }
  .tile--full { grid-row: span 1; aspect-ratio: auto; }
  .d-header__right { gap: 8px; }
  .d-burger { display: block; }
  .d-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); padding: 8px var(--gut) 20px; border-bottom: 1px solid var(--line); display: none; }
  .d-nav.is-open { display: flex; }
  .d-nav a { padding: 12px 0; font-size: 22px; color: var(--ink); }
  .d-intro__statement { text-align: left; }
  .d-about { grid-template-columns: 1fr; }
  .d-about > p { grid-column: 1; }
  .d-info { grid-template-columns: 1fr; }
  .d-hero { min-height: 70vh; }
}
