/* =========================================================
   MIA Building — feuille de style
   Palette tirée du logo : orange #F58230 / gris #939598
   ========================================================= */

:root {
  --bg: #f6f4f0;
  --bg-alt: #eeebe5;
  --ink: #1d1e20;
  --ink-soft: #5b5c60;
  --grey: #939598;
  --line: #d9d5ce;
  --accent: #f58230;
  --dark: #17181a;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  --gutter: clamp(20px, 5vw, 80px);
  --section: clamp(72px, 8vw, 120px);
  --max: 1360px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; image-rendering: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: 0; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Typo commune ---------- */
.eyebrow {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--grey);
  margin: 0 0 32px;
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }

.section { padding: var(--section) var(--gutter); max-width: var(--max); margin: 0 auto; }
.section__head { margin-bottom: clamp(44px, 5vw, 72px); }
.section__head--split { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap; }
.section__title, .statement {
  font-weight: 200;
  letter-spacing: -.03em;
  line-height: 1.04;
  margin: 0;
}
.section__title { font-size: clamp(40px, 6vw, 84px); }
.statement { font-size: clamp(30px, 4.2vw, 58px); line-height: 1.15; max-width: 22ch; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 30px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 400; letter-spacing: .02em;
  transition: background .4s var(--ease), transform .4s var(--ease);
}
@media (hover: hover) { .btn:hover { background: var(--accent); transform: translateY(-2px); } }
.btn--small { height: 40px; padding: 0 20px; font-size: 13px; }
.btn--outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); gap: 12px; }
@media (hover: hover) { .btn--outline:hover { background: var(--ink); color: var(--bg); } }
.btn__arrow { color: var(--accent); transition: transform .4s var(--ease), color .4s; }
@media (hover: hover) { .btn--outline:hover .btn__arrow { transform: translateX(4px); } }

.link-arrow { display: inline-flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 400; }
.link-arrow span { transition: transform .4s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); color: var(--accent); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(246, 244, 240, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500; }
.nav__brand img { height: 18px; width: auto; }
.nav__links { display: flex; gap: 40px; font-size: 14px; }
.nav__links a { position: relative; color: var(--ink-soft); transition: color .3s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__burger { display: none; width: 32px; height: 32px; position: relative; }
.nav__burger span { position: absolute; left: 4px; right: 4px; height: 1px; background: var(--ink); transition: transform .4s var(--ease); }
.nav__burger span:first-child { top: 12px; }
.nav__burger span:last-child { top: 20px; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 0 var(--gutter);
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease);
}
.mobile-menu a { font-size: 40px; font-weight: 200; letter-spacing: -.02em; }
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  max-width: var(--max); margin: 0 auto;
  padding: 140px var(--gutter) 80px;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: center;
}
.hero__title {
  font-size: clamp(48px, 7.4vw, 112px);
  font-weight: 200; letter-spacing: -.045em; line-height: .98;
  margin: 0 0 40px;
}
.hero__lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-soft); margin: 0 0 48px; max-width: 34ch; }
.hero__cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.hero__visual { position: relative; width: 100%; max-width: 640px; justify-self: end; padding: 0 0 18% 14%; }
.hero__img { margin: 0; overflow: hidden; background: var(--bg-alt); }
.hero__img img { width: 100%; height: 100%; object-fit: cover; }
.hero__img--main { position: relative; aspect-ratio: 3 / 2; }
.hero__img--small { position: absolute; left: 0; bottom: 0; width: 50%; aspect-ratio: 16 / 9; border: 10px solid var(--bg); box-sizing: content-box; }
.hero__caption { display: block; text-align: right; margin-top: 14px; font-size: 12px; color: var(--grey); letter-spacing: .04em; }

/* ---------- Bandeau références ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 26px 0; }
.marquee__track { display: flex; align-items: center; gap: 48px; width: max-content; animation: marquee 50s linear infinite; }
.marquee__track span { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.marquee__track i { width: 6px; height: 6px; background: var(--accent); transform: rotate(45deg); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- La société ---------- */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin: clamp(40px, 5vw, 64px) 0 0 auto; max-width: 820px; }
.about__text { margin: 0; color: var(--ink-soft); }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(56px, 6vw, 88px); border-top: 1px solid var(--line); }
.figure { padding: 40px 32px 0 0; display: flex; flex-direction: column; gap: 12px; }
.figure + .figure { padding-left: 32px; border-left: 1px solid var(--line); }
.figure__num { font-size: clamp(64px, 8vw, 120px); font-weight: 200; letter-spacing: -.05em; line-height: 1; }
.figure__label { font-size: 14px; color: var(--grey); max-width: 22ch; }

/* ---------- Prestations ---------- */
.expertises { max-width: none; background: var(--bg-alt); }
.expertises > * { max-width: calc(var(--max) - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.exp { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.exp__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.exp__item { border-bottom: 1px solid var(--line); }
.exp__btn {
  width: 100%; text-align: left;
  display: grid; grid-template-columns: 56px 1fr 24px; align-items: center;
  padding: 28px 0;
  font-size: clamp(20px, 2vw, 28px); font-weight: 200; letter-spacing: -.015em; line-height: 1.2;
  color: var(--grey);
  transition: color .4s var(--ease), padding .4s var(--ease);
}
.exp__btn small { font-size: 12px; letter-spacing: .1em; font-weight: 400; color: var(--grey); }
.exp__btn::after { content: "→"; font-size: 18px; opacity: 0; transform: translateX(-8px); transition: all .4s var(--ease); color: var(--accent); }
.exp__btn:hover, .exp__item.is-active .exp__btn { color: var(--ink); }
.exp__item.is-active .exp__btn { padding-left: 12px; }
.exp__item.is-active .exp__btn::after { opacity: 1; transform: none; }
.exp__item.is-active small { color: var(--accent); }
.exp__mobile { display: none; }

.exp__panel { position: sticky; top: 120px; max-width: 600px; justify-self: end; width: 100%; }
.exp__img { margin: 0 0 40px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.exp__img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .5s var(--ease); }
.exp__img img.is-swapping { opacity: 0; }
.exp__body { max-width: 46ch; transition: opacity .5s var(--ease); }
.exp__body.is-swapping { opacity: 0; }
.exp__num { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.exp__title { font-size: clamp(26px, 2.6vw, 36px); font-weight: 300; letter-spacing: -.02em; line-height: 1.15; margin: 8px 0 20px; }
.exp__desc { margin: 0; color: var(--ink-soft); }

/* ---------- Projets ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  height: 38px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); transition: all .3s var(--ease);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(44px, 4.5vw, 64px) clamp(24px, 3vw, 44px); }
.card { text-align: left; display: flex; flex-direction: column; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.card.is-hidden { display: none; }
.card:nth-child(3n+2) { margin-top: clamp(0px, 5vw, 72px); }
.card__img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); margin-bottom: 24px; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .8s var(--ease); filter: saturate(.9); }
.card__img::after {
  content: "Voir le projet"; position: absolute; left: 20px; bottom: 20px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #fff;
  background: rgba(23, 24, 26, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 10px 16px; border-radius: 999px;
  opacity: 0; transform: translateY(8px); transition: all .5s var(--ease);
}
.card:hover .card__img img, .card:focus-visible .card__img img { transform: scale(1.02); filter: saturate(1.05); }
.card:hover .card__img::after, .card:focus-visible .card__img::after { opacity: 1; transform: none; }
.card__meta { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: 10px; }
.card__meta b { font-weight: 400; color: var(--accent); }
.card__title { font-size: clamp(20px, 1.7vw, 24px); font-weight: 300; letter-spacing: -.015em; line-height: 1.25; margin: 0; }

/* ---------- Vision ---------- */
.vision .statement { max-width: 26ch; }
.goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 5vw, 72px); margin-top: clamp(56px, 6vw, 88px); }
.goal { border-top: 1px solid var(--ink); padding-top: 28px; }
.goal__num { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.goal h3 { font-size: 26px; font-weight: 300; letter-spacing: -.02em; margin: 14px 0 14px; }
.goal p { margin: 0; color: var(--ink-soft); font-size: 16px; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(56px, 8vw, 140px); border-top: 1px solid var(--line); }
.contact__info { list-style: none; padding: 0; margin: 64px 0 0; display: grid; gap: 22px; }
.contact__info li { display: grid; grid-template-columns: 110px 1fr; font-size: 16px; }
.contact__info span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); padding-top: 3px; }
.contact__info a:hover { color: var(--accent); }
.contact__info address { font-style: normal; }

.form { display: grid; gap: 10px; align-content: start; padding-top: 12px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font: inherit; font-size: 18px; color: var(--ink); padding: 30px 0 12px; resize: vertical; border-radius: 0;
  transition: border-color .3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field label { position: absolute; left: 0; top: 30px; color: var(--grey); pointer-events: none; transition: all .3s var(--ease); font-size: 18px; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { top: 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.form .btn { justify-self: start; margin-top: 36px; }
.form__note { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); min-height: 1.5em; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #b9b7b2; padding: clamp(64px, 8vw, 100px) var(--gutter) 40px; text-align: center; }
.footer__logo { width: min(260px, 60vw); margin: 0 auto 28px; }
.footer__tag { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin: 0 0 28px; }
.footer__contact { font-size: 14px; line-height: 1.9; margin: 0 0 clamp(48px, 6vw, 80px); }
.footer__contact a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid #2c2d30; padding-top: 28px; font-size: 13px; max-width: var(--max); margin: 0 auto; }
.footer__bottom a:hover { color: var(--accent); }

/* ---------- Fiche projet (modale) ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(23, 24, 26, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .4s var(--ease); }
.modal__sheet {
  position: relative; width: min(1240px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--bg); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  animation: rise .6s var(--ease);
}
.modal__close { position: absolute; top: 18px; right: 18px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 14px; transition: all .3s; }
.modal__close:hover { background: var(--ink); color: var(--bg); }
.modal__gallery { min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 14px; background: var(--bg-alt); }
.modal__main { margin: 0; width: 100%; min-width: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; }
.modal__main img { width: auto; height: auto; max-width: 100%; max-height: 100%; min-width: 0; object-fit: contain; animation: fade .5s var(--ease); cursor: pointer; }
.modal__thumbs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.modal__thumbs button { flex: none; width: 76px; height: 60px; overflow: hidden; opacity: .45; outline: 1px solid transparent; outline-offset: 2px; transition: all .3s; }
.modal__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.modal__thumbs button:hover { opacity: .8; }
.modal__thumbs button.is-active { opacity: 1; outline-color: var(--accent); }
.modal__info { padding: clamp(36px, 4vw, 60px); display: flex; flex-direction: column; }
.modal__count { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent); }
.modal__title { font-size: clamp(28px, 2.8vw, 40px); font-weight: 200; letter-spacing: -.025em; line-height: 1.1; margin: 10px 0 36px; }
.modal__meta { display: grid; gap: 14px; margin: 0 0 32px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.modal__meta div { display: grid; grid-template-columns: 90px 1fr; }
.modal__meta dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--grey); padding-top: 3px; }
.modal__meta dd { margin: 0; }
.modal__desc { margin: 0 0 28px; color: var(--ink-soft); }
.modal__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.modal__tags span { font-size: 12px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.modal__nav { margin-top: auto; display: flex; justify-content: space-between; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

/* ---------- Apparition au scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card:nth-child(3n+2) { margin-top: 0; }
  .card:nth-child(2n) { margin-top: clamp(0px, 6vw, 60px); }
  .nav__links { gap: 26px; }
}

@media (max-width: 860px) {
  .nav__links, .nav > .btn--small { display: none; }
  .nav__burger { display: block; z-index: 60; }
  .hero { grid-template-columns: 1fr; padding-top: 120px; min-height: 0; }
  .hero__visual { display: none; }
  .hero { min-height: 100vh; min-height: 100svh; align-content: center; padding-bottom: 60px; }
  .about__grid { grid-template-columns: 1fr; margin-left: 0; }
  .figures { grid-template-columns: 1fr; }
  .figure, .figure + .figure { padding: 32px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .exp { grid-template-columns: 1fr; }
  .exp__panel { display: none; }
  .exp__item.is-active .exp__btn { padding-left: 0; }
  .exp__btn::after { content: "+"; opacity: 1; transform: none; color: var(--grey); }
  .exp__item.is-active .exp__btn::after { content: "–"; color: var(--accent); }
  .exp__mobile { display: block; max-height: 0; overflow: hidden; transition: max-height .6s var(--ease); }
  .exp__item.is-active .exp__mobile { max-height: 900px; }
  .exp__mobile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 20px; }
  .exp__mobile p { margin: 0 0 32px; color: var(--ink-soft); }
  .goals { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal__sheet { grid-template-columns: 1fr; max-height: 100vh; height: 100%; }
  .modal__gallery { padding: 16px; padding-top: 72px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 56px; }
  .card:nth-child(2n) { margin-top: 0; }
  .contact__info li { grid-template-columns: 1fr; gap: 4px; }
  .hero__caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
