/* DFK — Architecture & Ingénierie · un pôle ISMIS8
   Charte : noir et blanc, Poppins, angles droits, filets fins. */

:root {
  --noir: #0d0d0d;
  --blanc: #ffffff;
  --papier: #f7f7f5;
  --gris-100: #ededed;
  --gris-300: #bdbdbd;
  --gris-500: #6e6e6e;
  --gris-700: #4a4a4a;
  --font: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1240px;
}

html[lang="ar"] { --font: "Noto Sans Arabic", "Poppins", Arial, sans-serif; }
html[lang="zh"] { --font: "Noto Sans SC", "Poppins", Arial, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; font-family: var(--font); color: var(--noir); background: var(--blanc); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--noir); }
a:hover { color: var(--gris-700); }
h1, h2, h3, p, figure, ol, ul { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.skip { position: absolute; left: 8px; top: -80px; background: var(--noir); color: var(--blanc); padding: 10px 16px; z-index: 100; }
.skip:focus { top: 8px; }
html[dir="rtl"] .skip { left: auto; right: 8px; }
:focus-visible { outline: 2px solid var(--noir); outline-offset: 3px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; font: 500 15px/1 var(--font); text-decoration: none; border: 1px solid var(--noir); cursor: pointer; transition: background .2s, color .2s; }
.btn--dark { background: var(--noir); color: var(--blanc); }
.btn--dark:hover { background: var(--gris-700); border-color: var(--gris-700); color: var(--blanc); }
.btn--line { background: transparent; color: var(--noir); }
.btn--line:hover { background: var(--noir); color: var(--blanc); }
.btn--light { background: var(--blanc); color: var(--noir); border-color: var(--blanc); }
.btn--light:hover { background: var(--gris-100); color: var(--noir); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 14px; }
.btn--full { width: 100%; }

/* ---------- Textes communs ---------- */
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 4px; color: var(--gris-500); text-transform: uppercase; }
.eyebrow--light { color: var(--gris-300); }
.lead { font-size: 18px; line-height: 1.6; font-weight: 300; color: var(--gris-700); max-width: 560px; }
.note { font-size: 14px; color: var(--gris-500); }
.rule { width: 72px; height: 3px; background: var(--noir); }

/* ---------- En-tête ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--gris-100); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 80px; }
.header__logo img { width: 72px; height: auto; }
.nav { display: flex; gap: 32px; font-size: 14px; }
.nav a { text-decoration: none; padding: 8px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--noir); color: var(--noir); }
.header__tools { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 4px; }
.lang button { min-width: 44px; min-height: 44px; border: 1px solid var(--gris-300); background: var(--blanc); color: var(--noir); font: 400 12px var(--font); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--noir); border-color: var(--noir); color: var(--blanc); }
.header__burger { display: none; width: 44px; height: 44px; border: 1px solid var(--gris-300); background: var(--blanc); cursor: pointer; padding: 12px 10px; flex-direction: column; justify-content: space-between; }
.header__burger span { display: block; height: 2px; background: var(--noir); transition: transform .2s, opacity .2s; }
.header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Accueil ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 72px; padding-bottom: 64px; }
.hero__text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero__title { font-size: clamp(36px, 5vw, 56px); line-height: 1.08; font-weight: 300; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.hero__visual { flex: 1 1 420px; min-width: 0; background: var(--papier); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.house { width: 100%; height: auto; }
.house__lines { fill: none; stroke: var(--noir); stroke-width: 2; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s ease-out .3s forwards; }
.house__dims { stroke: var(--gris-300); stroke-width: 1; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hero__figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--gris-700); }
.hero__figcaption strong { font-weight: 500; color: var(--noir); }

/* ---------- Points clés ---------- */
.keys { border-top: 1px solid var(--gris-100); border-bottom: 1px solid var(--gris-100); }
.keys__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.keys__title { font-size: 15px; font-weight: 500; }
.keys__text { font-size: 14px; color: var(--gris-500); }

/* ---------- Sections ---------- */
.section { padding-top: 88px; padding-bottom: 88px; display: flex; flex-direction: column; gap: 40px; }
.section-band { background: var(--papier); }
.section__head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.section__title { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; font-weight: 300; }
.section__title--light { color: var(--blanc); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card { border-top: 3px solid var(--noir); background: var(--papier); padding: 28px; display: flex; flex-direction: column; gap: 14px; transition: background .2s; }
.card:hover { background: var(--gris-100); }
.card__num { font-size: 22px; font-weight: 300; color: var(--gris-500); }
.card__title { font-size: 20px; font-weight: 500; }
.card__text { font-size: 15px; line-height: 1.6; font-weight: 300; color: var(--gris-700); }

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px; }
.steps li { border-top: 2px solid var(--noir); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.steps__num { font-size: 28px; font-weight: 300; }
.steps__title { font-size: 16px; font-weight: 500; }
.steps__text { font-size: 14px; line-height: 1.5; color: var(--gris-700); }

/* ---------- Bandeau configurateur ---------- */
.band { background: var(--noir); color: var(--blanc); }
.band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px; padding-top: 80px; padding-bottom: 80px; }
.band__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.band__lead { font-size: 16px; line-height: 1.6; font-weight: 300; color: var(--gris-300); max-width: 620px; }

/* ---------- Réalisations ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.project { display: flex; flex-direction: column; gap: 12px; }
.project img, .projects__ph { aspect-ratio: 3 / 2; width: 100%; height: auto; object-fit: cover; }
.projects__ph { background: var(--gris-100); border: 1px dashed var(--gris-300); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--gris-500); }
.project figcaption { display: flex; flex-direction: column; gap: 2px; }
.project figcaption strong { font-size: 16px; font-weight: 500; }
.project figcaption span { font-size: 14px; color: var(--gris-500); }

/* ---------- Contact ---------- */
.contact { flex-direction: row; flex-wrap: wrap; gap: 48px; }
.contact__info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.contact__list { list-style: none; padding: 8px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.form { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; background: var(--blanc); padding: 28px; }
.form__field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.form__field input, .form__field textarea { min-height: 44px; border: 1px solid var(--gris-300); border-radius: 0; padding: 10px 12px; font: 400 15px var(--font); color: var(--noir); background: var(--blanc); }
.form__field textarea { resize: vertical; }
.form__field input:focus, .form__field textarea:focus { border-color: var(--noir); outline: none; }
.form__error { font-size: 14px; color: var(--noir); border-left: 3px solid var(--noir); padding-left: 10px; }

/* ---------- Pied de page ---------- */
.footer { background: var(--noir); color: var(--blanc); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; padding-top: 56px; padding-bottom: 56px; }
.footer__logo { width: 260px; height: auto; opacity: 0; transform: translateY(16px); transition: opacity 1s ease, transform 1s ease; }
.footer__logo.is-visible { opacity: 1; transform: none; }
.footer__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: var(--gris-300); }
.footer__meta a { color: var(--blanc); }

/* ---------- Arabe : lecture de droite à gauche ---------- */
html[dir="rtl"] .footer__meta { align-items: flex-start; }
html[dir="rtl"] .form__error { border-left: 0; border-right: 3px solid var(--noir); padding-left: 0; padding-right: 10px; }
html[dir="rtl"] .eyebrow { letter-spacing: 0; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 1024px) {
  .header__burger { display: flex; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--blanc); border-bottom: 1px solid var(--gris-100); flex-direction: column; gap: 0; padding: 8px 24px 16px; display: none; }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--gris-100); }
  .header__inner { position: relative; flex-wrap: wrap; }
  .header__logo { margin-right: auto; }
}

@media (max-width: 640px) {
  .header__tools .btn { display: none; }
  .header__tools { order: 3; width: 100%; padding-bottom: 12px; }
  .hero { padding-top: 40px; gap: 32px; }
  .hero__visual { padding: 20px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .band__inner { padding-top: 56px; padding-bottom: 56px; }
  .btn { width: 100%; }
  .actions { flex-direction: column; }
  .form { padding: 20px; }
  .footer__meta, html[dir="rtl"] .footer__meta { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .house__lines { animation: none; stroke-dashoffset: 0; }
  .footer__logo { opacity: 1; transform: none; transition: none; }
}

/* ---------- Page d'ouverture (site) ---------- */
.intro { position: fixed; inset: 0; z-index: 300; background: var(--blanc); display: flex; align-items: center; justify-content: center; cursor: pointer; animation: intro-out .7s ease 2.9s forwards; }
.no-intro .intro { display: none; }
.intro.is-skipped { animation: intro-out .35s ease forwards; }
.intro__inner { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px; }
.intro__logo { position: relative; width: min(380px, 72vw); direction: ltr; }
.intro__logo img { display: block; width: 100%; height: auto; clip-path: inset(0 100% 0 0); animation: intro-draw 1.7s cubic-bezier(.65, .05, .3, 1) .25s forwards; }
.intro__pencil { position: absolute; top: -4%; bottom: -4%; left: 0; width: 2px; background: var(--noir); opacity: 0; animation: intro-pencil 1.7s cubic-bezier(.65, .05, .3, 1) .25s forwards; }
.intro__pole { margin: 0; color: var(--gris-500); font-size: 12px; letter-spacing: .32em; text-transform: uppercase; opacity: 0; animation: intro-fade .7s ease 1.9s forwards; }
html[dir="rtl"] .intro__pole, html[lang="zh"] .intro__pole { letter-spacing: .08em; }
@keyframes intro-draw { to { clip-path: inset(0 0 0 0); } }
@keyframes intro-pencil { 0% { left: 0; opacity: 1; } 92% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes intro-fade { to { opacity: 1; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .intro { animation-delay: 1s; }
  .intro__logo img { clip-path: none; animation: none; }
  .intro__pencil { display: none; }
  .intro__pole { opacity: 1; animation: none; }
}

/* ---------- Galerie des réalisations ---------- */
.project__open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.project__open img { transition: opacity .2s; }
.project__open:hover img { opacity: .9; }
.project__open:focus-visible { outline: 2px solid var(--noir); outline-offset: 3px; }
.project__count { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: var(--noir); font-size: 12px; font-weight: 500; padding: 4px 10px; }
html[dir="rtl"] .project__count { right: auto; left: 10px; }
.has-lightbox { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 250; background: var(--blanc); display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lightbox__bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--gris-100); }
.lightbox__info { margin: 0; flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lightbox__info strong { font-weight: 500; }
.lightbox__info span { color: var(--gris-500); }
.lightbox__counter { font-size: 13px; color: var(--gris-500); }
.lightbox__close { width: 44px; height: 44px; border: 1px solid var(--gris-300); background: var(--blanc); font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox__stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px 72px; touch-action: pan-y; user-select: none; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .2s; }
.lightbox__stage img.is-loading { opacity: .25; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 1px solid var(--gris-300); background: var(--blanc); font-size: 28px; line-height: 1; cursor: pointer; }
.lightbox__nav:hover { border-color: var(--noir); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }
.lightbox__nav[hidden] { display: none; }
@media (max-width: 700px) {
  .lightbox__stage { padding: 8px; }
  .lightbox__nav { top: auto; bottom: 16px; transform: none; background: rgba(255, 255, 255, .9); }
  .lightbox__info span { display: none; }
}
