/* ==========================================================================
   BIDRIX LAB — Feuille de style principale
   Direction : atelier technique / plan de fabrication
   ========================================================================== */

:root {
  /* Couleurs — palette d'origine (graphite & ambre) */
  --bg: #121316;
  --bg-panel: #1a1c20;
  --bg-panel-alt: #202226;
  --ink: #edeae2;
  --ink-dim: #9c9a93;
  --ink-faint: #6b6963;
  --accent: #e8a33d;
  --accent-dim: #8a6224;
  --line: #34373c;
  --line-strong: #4a4d53;

  /* Typo */
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;

  /* Échelle */
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  --step-3: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  --step-4: clamp(3.25rem, 2.5rem + 3vw, 5.5rem);

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* Grille de fond, très discrète */
.blueprint-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(236, 232, 222, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 232, 222, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

/* ==========================================================================
   Repères de calage (signature du site)
   ========================================================================== */

.reg-mark {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.reg-mark::before, .reg-mark::after {
  content: "";
  position: absolute;
  background: var(--accent-dim);
}
.reg-mark::before { top: 8px; left: 0; width: 18px; height: 1px; }
.reg-mark::after { top: 0; left: 8px; width: 1px; height: 18px; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 19, 22, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 32px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav-brand .reg-mark::before, .nav-brand .reg-mark::after {
  background: var(--accent);
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links a {
  color: var(--ink-dim);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  color: var(--accent);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 2px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.nav-current {
  display: none;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

@media (max-width: 760px) {
  .nav-toggle { display: block; order: 2; margin-left: auto; }
  .nav { justify-content: flex-end; }
  .nav-current { display: inline-flex; margin-right: auto; }
  .back-link { display: none !important; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 300px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 16px 32px; }
  .nav-links a[aria-current="page"]::after { display: none; }
}

/* ==========================================================================
   Ligne de cotation — divider signature entre sections
   ========================================================================== */

.dim-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 auto;
  max-width: var(--maxw);
  padding: 0 32px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dim-line::before, .dim-line::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 1px dashed var(--line-strong);
}

.dim-line .tick {
  color: var(--ink-faint);
}

/* ==========================================================================
   Sections & reveal
   ========================================================================== */

section { padding: 110px 0; }

/* Le bloc juste avant la nav de projet (généralement la galerie) n'a pas
   besoin de son padding-bottom complet : la nav a déjà son propre espacement. */
section:has(+ .project-nav) { padding-bottom: 40px; }
section:has(+ .project-nav) .eyebrow { color: var(--ink-faint); }
section:has(+ .project-nav) .eyebrow::before { background: var(--ink-faint); }

.linkedin-embed {
  display: flex;
  justify-content: center;
}
.linkedin-embed iframe {
  width: 100%;
  max-width: 504px;
  aspect-ratio: 504 / 399;
  height: auto;
  border: 0;
}

.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-panel);
  border: 1px solid var(--line);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.no-slide { transform: none; }

.fade-card {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.fade-card.is-visible { opacity: 1; }

.reveal-delay-4 { transition-delay: 0.42s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.58s; }
.reveal-delay-7 { transition-delay: 0.66s; }

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent-dim);
}

/* ==========================================================================
   Bandeau image plein largeur
   ========================================================================== */

.top-banner {
  width: 100%;
  height: 42vh;
  min-height: 260px;
  max-height: 520px;
  overflow: hidden;
}

.top-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: 40px 0 50px;
  position: relative;
}

.hero-frame {
  position: relative;
  padding: 48px;
  border: 1px solid var(--line);
}

.hero-frame .reg-mark { position: absolute; }
.hero-frame .reg-mark.tl { top: -9px; left: -9px; }
.hero-frame .reg-mark.tr { top: -9px; right: -9px; }
.hero-frame .reg-mark.bl { bottom: -9px; left: -9px; }
.hero-frame .reg-mark.br { bottom: -9px; right: -9px; }

.hero h1 {
  font-size: var(--step-4);
  max-width: 14ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: 28px;
  max-width: none;
  white-space: nowrap;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.hero-cta {
  margin-top: 44px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .hero { padding-bottom: 20px; }
  .work-grid { margin-top: 8px !important; }
  .hero-sub { margin-top: 8px !important; }
  .sectors-line { margin-top: 8px !important; }
}

@media (max-width: 760px) {
  .hero-sub {
    white-space: normal;
  }
}

/* ==========================================================================
   Boutons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16130a;
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

/* ==========================================================================
   Spec list (pipeline / compétences)
   ========================================================================== */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 56px;
}

.spec-item {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 30px;
}

.spec-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 18px;
  display: block;
}

.spec-item h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.spec-item p {
  color: var(--ink-dim);
  font-size: 0.92rem;
}

@media (max-width: 760px) {
  .spec-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Cartes projets
   ========================================================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  margin-top: 56px;
  border: 1px solid var(--line);
}

.project-card {
  background: var(--bg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background 0.25s ease;
}

.project-card:hover {
  background: var(--bg-panel);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.project-meta .year { color: var(--accent); }

.project-card h3 {
  font-size: 1.4rem;
}

.project-card .role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-card p.desc {
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
}

@media (max-width: 760px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Bandeau clients
   ========================================================================== */

.client-row {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.client-row span { white-space: nowrap; }

/* ==========================================================================
   À propos
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: start;
}

.about-lede {
  font-size: 1.15rem;
  color: var(--ink);
  max-width: 46ch;
}

.about-body p + p { margin-top: 20px; }
.about-body p { color: var(--ink-dim); max-width: 56ch; }

.spec-sheet {
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.spec-sheet-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.spec-sheet-row:last-child { border-bottom: none; }
.spec-sheet-row .k { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; }
.spec-sheet-row .v { color: var(--ink); text-align: right; }

.photo-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-frame .ph-fill {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
}

.contact-info .item {
  margin-bottom: 32px;
}
.contact-info .k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 8px;
  display: block;
}
.contact-info .v { font-size: 1.05rem; }
.contact-info a.v { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color 0.2s ease, text-decoration-color 0.2s ease; }
.contact-info a.v:hover { color: var(--accent); text-decoration-color: var(--accent); }

.social-row {
  display: flex;
  gap: 14px;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.social-icon svg { width: 20px; height: 20px; }
.social-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.field input, .field textarea {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea { resize: vertical; min-height: 140px; }

.form-note {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ==========================================================================
   Dernières réalisations — cartes photo avec titre en surimpression
   ========================================================================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
}

.work-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--line);
}

.work-card .ph-fill {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.work-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(6, 16, 30, 0.92), transparent);
  pointer-events: none;
}

.work-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
}

.work-meta .year {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 5px;
}

.work-meta h3 {
  font-size: 1.05rem;
  color: var(--ink);
  transition: color 0.2s ease;
}

.work-card:hover h3 { color: var(--accent); }
.work-card:hover img { transform: scale(1.04); }
.work-card:hover .ph-fill { color: var(--ink-dim); }

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .work-grid { grid-template-columns: 1fr; }
}

.sectors-line {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

/* ==========================================================================
   Détail projet — galerie & lightbox
   ========================================================================== */

.project-detail-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 80px;
  align-items: start;
}

.desc {
  font-size: 1.02rem;
  color: var(--ink-dim);
  max-width: 90ch;
}
.desc + .desc { margin-top: 18px; }

.project-detail-grid .desc {
  font-size: 1.02rem;
  color: var(--ink-dim);
  max-width: 60ch;
}
.project-detail-grid .desc + .desc { margin-top: 18px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent); }

@media (max-width: 860px) {
  .project-detail-grid { grid-template-columns: 1fr; gap: 40px; }
}

.gallery-wrap {
  position: relative;
  margin-top: 20px;
  opacity: 0;
  transition: opacity 1.1s ease-out;
  transition-delay: 0.16s;
}
.gallery-wrap.is-visible { opacity: 1; }

.gallery-grid {
  display: flex;
  gap: 1px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-grid::-webkit-scrollbar { display: none; }

.gallery-tile {
  flex: 1 0 calc((100% - 2px) / 3);
  aspect-ratio: 4 / 3;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  padding: 0;
  overflow: hidden;
  position: relative;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.2s ease;
  scroll-snap-align: start;
}

/* Fondu de révélation des vignettes : plus lent et doux (comme les cartes de l'accueil) */
.gallery-tile.reveal {
  transition: opacity 1.1s ease-out, background 0.2s ease;
  transition-delay: 0.16s, 0s;
}

.gallery-tile:hover { background: var(--bg-panel-alt); color: var(--ink-dim); }

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-tile .ph-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  position: relative;
}
.gallery-tile .ph-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 1px;
  background: var(--line-strong);
  transform: rotate(-18deg);
}

.gallery-tile .play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-tile .play-icon::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #fff;
  margin-left: 4px;
}
.gallery-tile[data-embed-src] { position: relative; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 19, 22, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.gallery-arrow:hover { border-color: var(--accent); color: var(--accent); }
.gallery-arrow-left { left: 8px; }
.gallery-arrow-right { right: 8px; }

.gallery-arrow::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.gallery-arrow-left::before { transform: rotate(135deg); margin-left: 4px; }
.gallery-arrow-right::before { transform: rotate(-45deg); margin-right: 4px; }

@media (max-width: 760px) {
  .gallery-tile { flex-basis: calc((100% - 1px) / 2); }
}

@media (max-width: 480px) {
  .gallery-tile { flex-basis: 100%; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 40px;
}
.lightbox.open { opacity: 1; pointer-events: auto; }

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border: 1px solid var(--line-strong);
}

.lightbox-video {
  width: min(90vw, 960px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
}
.lightbox-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.lightbox-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.lightbox-close {
  position: absolute;
  top: 28px;
  right: 32px;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 40px;
  height: 40px;
  font-family: var(--font-mono);
  cursor: pointer;
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 19, 22, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.lightbox-prev:hover, .lightbox-next:hover { border-color: var(--accent); color: var(--accent); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev::before,
.lightbox-next::before {
  content: "";
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.lightbox-prev::before { transform: rotate(135deg); margin-left: 5px; }
.lightbox-next::before { transform: rotate(-45deg); margin-right: 5px; }

@media (max-width: 600px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
  .lightbox-prev::before, .lightbox-next::before { width: 10px; height: 10px; }
}

/* Prochain / précédent projet */
.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.project-nav a {
  padding: 40px 32px;
  font-family: var(--font-mono);
}
.project-nav a:first-child { border-right: 1px solid var(--line); }
.project-nav .dir { font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 10px; text-align: center; }
.project-nav .title { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); display: block; text-align: center; }
.project-nav a:hover .title { color: var(--accent); }
.project-nav a:last-child { text-align: right; }

@media (max-width: 600px) {
  .project-nav a { padding: 24px 16px; }
  .project-nav .dir { font-size: 0.62rem; margin-bottom: 6px; }
  .project-nav .title { font-size: 0.95rem; }
}

/* ==========================================================================
   Cartouche technique (footer façon plan d'exécution)
   ========================================================================== */

.title-block {
  border: 1px solid var(--line-strong);
}

.tb-row.main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-strong);
}

.tb-project {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.tb-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.tb-cells {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tb-cell {
  padding: 16px 24px;
  border-right: 1px solid var(--line-strong);
  font-family: var(--font-mono);
}
.tb-cell:last-child { border-right: none; }

.tb-cell .k {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.tb-cell .v {
  font-size: 0.82rem;
  color: var(--ink);
}
.tb-cell .v a:hover { color: var(--accent); }

@media (max-width: 700px) {
  .tb-cells { grid-template-columns: repeat(2, 1fr); }
  .tb-cell:nth-child(2) { border-right: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
  margin-top: 60px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.footer-row a:hover { color: var(--accent); }

/* Page header (pages secondaires) */
.page-header {
  padding: 16px 0 40px;
}

.page-header:not(:has(.back-link)) {
  padding-top: 40px;
}

.page-header .eyebrow { margin-bottom: 24px; }

.page-header h1 { font-size: var(--step-3); max-width: 20ch; }

.page-header .sub {
  margin-top: 20px;
  color: var(--ink-dim);
  max-width: 60ch;
}

.project-meta-line {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.studio-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.studio-link:hover {
  opacity: 0.75;
}

@media (max-width: 760px) {
  .page-header { padding-top: 32px; }

  main > section:has(.gallery-wrap) { order: 1; padding-bottom: 24px !important; }
  main > section:has(.desc) { order: 2; padding-top: 0 !important; }
  main > .project-nav { order: 3; }

  /* Le contenu d'un post LinkedIn ne se redimensionne pas de façon fluide ;
     sur mobile il a besoin de plus de hauteur relative que sur desktop pour
     ne pas couper le contenu. */
  .linkedin-embed iframe { aspect-ratio: 350 / 780 !important; }
}
