/* ==========================================================================
   Yvan Dumas, ferronnier d'art — thème « forge »
   Charbon, orange braise du logo (#fca044), acier. Grain, plaque rivetée,
   filets de métal chauffé.
   ========================================================================== */

:root {
  --forge-900: #0d0b0a;
  --forge-800: #15110f;
  --forge-700: #1e1815;
  --forge-600: #2a221d;
  --steel-100: #e9e7e4;
  --steel-300: #b9bcc0;
  --steel-500: #7b7f85;
  --ember: #fca044;
  --ember-deep: #c8621c;
  --ember-dark: #7a2e0a;
  --heat: linear-gradient(90deg, transparent, var(--ember-dark) 10%, var(--ember-deep) 36%,
    var(--ember) 62%, #ffe6b8 80%, transparent);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--forge-900);
  color: var(--steel-300);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Grain de fonderie, fixe par-dessus toute la page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { max-width: 100%; }
h1, h2, p, figure, blockquote { margin: 0; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 0.7rem 1rem;
  background: var(--ember);
  color: var(--forge-900);
  font: 600 0.9rem var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav call";
  align-items: center;
  gap: 6px 24px;
  padding: 10px var(--gutter);
  background: rgba(13, 11, 10, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--heat);
  opacity: 0.8;
}
.brand { grid-area: brand; display: block; line-height: 0; }
.brand img { width: 150px; height: auto; }

.site-header nav {
  grid-area: nav;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 3vw, 40px);
}
.site-header nav a {
  padding: 0.45rem 0;
  border-bottom: 1px solid transparent;
  color: var(--steel-300);
  font: 500 0.95rem var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.site-header nav a:hover { color: var(--ember); border-color: var(--ember); }

.call {
  color: var(--ember);
  text-decoration: none;
  white-space: nowrap;
}
.site-header .call {
  grid-area: call;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ember);
  font: 600 0.95rem var(--font-label);
  letter-spacing: 0.14em;
  transition: background 0.2s, color 0.2s;
}
.site-header .call:hover { background: var(--ember); color: var(--forge-900); }
.call-label { color: var(--steel-300); margin-right: 0.35em; transition: color 0.2s; }
.site-header .call:hover .call-label { color: var(--forge-900); }

/* --------------------------------------------------------------------------
   Héros
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  min-height: min(88svh, 860px);
  padding: clamp(40px, 7vw, 96px) var(--gutter) clamp(64px, 8vw, 116px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 70% at 78% 52%, rgba(200, 98, 28, 0.3), transparent 70%),
    radial-gradient(45% 55% at 6% 100%, rgba(122, 46, 10, 0.4), transparent 70%);
}
#sparks {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero-copy { container-type: inline-size; }
.hero-copy > * { animation: rise 0.9s var(--ease) both; }
.hero-copy > .lede { animation-delay: 0.18s; }
.hero-copy > .btn { animation-delay: 0.32s; }

h1 { line-height: 1; }
.h1-name {
  display: block;
  padding-bottom: 0.06em;
  font: 600 clamp(3.5rem, 30cqi, 9.5rem) / 0.88 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--steel-100);
  background: linear-gradient(180deg, #fff 18%, var(--steel-100) 44%, var(--ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px rgba(252, 160, 68, 0.28));
  text-wrap: balance;
}
.h1-role {
  display: block;
  margin-top: 1.1rem;
  color: var(--ember);
  font: 500 clamp(0.9rem, 1.5vw, 1.1rem) var(--font-label);
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.lede {
  max-width: 34ch;
  margin-top: 1.6rem;
  color: var(--steel-100);
  font: italic 500 clamp(1.25rem, 1.9vw, 1.5rem) / 1.42 var(--font-display);
}

.btn {
  display: inline-flex;
  align-items: center;
  margin-top: 1.8rem;
  padding: 0.95rem 1.7rem;
  color: var(--forge-900);
  font: 600 0.95rem var(--font-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(180deg, #ffc27d, var(--ember) 45%, #e9822a);
  /* angles coupés : plaque découpée au plasma */
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: filter 0.2s, transform 0.2s var(--ease);
}
.btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--forge-900); outline-offset: -6px; }

/* Plaque d'acier rivetée, chauffée au blanc puis refroidie à l'arrivée */
.plate {
  --rivet: #c9c2b7 0 1.4px, #5b544d 2.6px, transparent 4.2px;
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 900px;
  padding: clamp(10px, 1.4vw, 18px);
  background: linear-gradient(145deg, #3d3732, #1b1714 55%, #2c2621);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 1px #000, 0 30px 80px -20px #000, 0 0 90px -10px rgba(252, 160, 68, 0.35);
  animation: cool 3.4s var(--ease) 0.15s both;
}
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 9px 9px, var(--rivet)),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--rivet)),
    radial-gradient(circle at 9px calc(100% - 9px), var(--rivet)),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--rivet));
}
.plate img { display: block; width: 100%; height: auto; }

.place {
  position: absolute;
  left: var(--gutter);
  bottom: 24px;
  color: var(--steel-500);
  font: 500 0.75rem var(--font-label);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
}
@keyframes cool {
  0% {
    opacity: 0;
    transform: translateY(26px);
    filter: brightness(1.7) saturate(1.3);
    box-shadow: 0 0 0 1px #000, 0 30px 80px -20px #000, 0 0 170px 30px rgba(255, 214, 150, 0.85);
  }
  22% { opacity: 1; }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
    box-shadow: 0 0 0 1px #000, 0 30px 80px -20px #000, 0 0 90px -10px rgba(252, 160, 68, 0.35);
  }
}

/* --------------------------------------------------------------------------
   Sections : titres et filets
   -------------------------------------------------------------------------- */
.eyebrow {
  color: var(--ember);
  font: 600 0.95rem var(--font-label);
  letter-spacing: 0.34em;
  text-transform: uppercase;
}
.eyebrow::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 14px;
  background: var(--heat);
}

.manifeste,
.realisations,
.contact { position: relative; }
.manifeste::before,
.realisations::before,
.contact::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--heat);
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Manifeste
   -------------------------------------------------------------------------- */
.manifeste {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 3.2fr);
  gap: clamp(24px, 5vw, 88px);
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}
.manifeste .eyebrow { position: sticky; top: 120px; align-self: start; }

.passion {
  max-width: 34em;
  margin-bottom: 1.7em;
  color: var(--steel-100);
  font: 500 clamp(1.4rem, 2.2vw, 1.95rem) / 1.46 var(--font-display);
}
.passion::first-letter {
  float: left;
  margin: 0.04em 0.1em 0 0;
  color: var(--ember);
  font-size: 4.1em;
  font-weight: 600;
  line-height: 0.78;
}
.defi {
  max-width: 40rem;
  margin-bottom: clamp(48px, 7vw, 88px);
  padding-left: 1.3rem;
  border-left: 2px solid var(--ember-deep);
  font-size: 1.15rem;
  line-height: 1.75;
}
.question p {
  color: var(--ember);
  font: italic 500 clamp(2rem, 5.2vw, 4.4rem) / 1.04 var(--font-display);
  text-wrap: balance;
  text-shadow: 0 0 60px rgba(252, 160, 68, 0.3);
}
.question footer {
  margin-top: 1.3rem;
  color: var(--steel-500);
  font: 500 0.95rem var(--font-label);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Bandeau de bannières (900x350 natives)
   -------------------------------------------------------------------------- */
.bandeau {
  display: flex;
  gap: 14px;
  padding: 0 var(--gutter) 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--ember-deep) transparent;
}
.bandeau img {
  flex: 0 0 auto;
  width: min(900px, 86vw);
  height: auto;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px -24px #000;
}

/* --------------------------------------------------------------------------
   Réalisations : filtres + grille
   -------------------------------------------------------------------------- */
.realisations {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(72px, 9vw, 124px) var(--gutter);
}
.realisations h2 {
  margin-bottom: 1.6rem;
  color: var(--steel-100);
  font: 600 clamp(2.6rem, 6vw, 5rem) / 1 var(--font-display);
}

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
}
#filters button {
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--steel-300);
  font: 500 0.9rem var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
#filters button:hover { border-color: var(--ember); color: var(--steel-100); }
#filters button[aria-pressed="true"] {
  border-color: transparent;
  background: linear-gradient(180deg, #ffc27d, var(--ember));
  color: var(--forge-900);
}

#grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--forge-700);
  overflow: hidden;
  cursor: zoom-in;
  isolation: isolate;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.4s;
}
/* Légende = nom de la catégorie, révélée au survol / au focus */
.tile::after {
  content: attr(data-label);
  position: absolute;
  inset: auto 0 0;
  padding: 2.4rem 0.8rem 0.75rem;
  color: #fff;
  font: 500 0.8rem/1.2 var(--font-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  background: linear-gradient(transparent, rgba(13, 11, 10, 0.94));
  transform: translateY(100%);
  transition: transform 0.35s var(--ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 3px;
  background: var(--heat);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.tile:focus-visible { outline-offset: -4px; }
.tile:focus-visible::after { transform: none; }
.tile:focus-visible::before { transform: scaleX(1); }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.06); filter: brightness(1.06); }
  .tile:hover::after { transform: none; }
  .tile:hover::before { transform: scaleX(1); }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact {
  padding: clamp(80px, 11vw, 150px) var(--gutter);
  text-align: center;
  background: radial-gradient(60% 90% at 50% 110%, rgba(200, 98, 28, 0.32), transparent 70%);
}
.contact .eyebrow::after { margin-inline: auto; }
.who {
  margin: 1.3rem 0 1.8rem;
  color: var(--steel-100);
  font: italic 500 clamp(1.4rem, 3vw, 2rem) / 1.35 var(--font-display);
}
.call.big {
  display: inline-block;
  padding: 0.05em 0.25em 0.12em;
  border-bottom: 2px solid var(--ember-deep);
  font: 600 clamp(2.6rem, 9vw, 6.5rem) / 1 var(--font-display);
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff 10%, var(--ember) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 36px rgba(252, 160, 68, 0.3));
  transition: filter 0.3s, border-color 0.3s;
}
.call.big:hover { border-color: var(--ember); filter: drop-shadow(0 0 48px rgba(252, 160, 68, 0.6)); }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 30px var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--steel-500);
  font-size: 0.85rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
#lightbox {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--steel-100);
}
#lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 8px;
  padding: clamp(12px, 3vw, 32px);
}
#lightbox::backdrop {
  background: rgba(9, 7, 6, 0.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
#lightbox figure {
  display: grid;
  justify-items: center;
  gap: 16px;
  min-width: 0;
}
/* 1x maximum : jamais agrandie au-delà de sa taille native */
.lb-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, calc(var(--w) * 1px));
  max-height: min(78vh, calc(var(--h) * 1px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--forge-800);
  box-shadow: 0 30px 90px -20px #000, 0 0 90px -20px rgba(252, 160, 68, 0.45);
}
#lightbox figcaption {
  color: var(--steel-300);
  font: 500 0.9rem var(--font-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.lb-count { margin-left: 0.8em; color: var(--ember); }

.lb-prev,
.lb-next,
.lb-close {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0 0 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(20, 16, 14, 0.7);
  color: var(--steel-100);
  font: 400 2rem/1 var(--font-display);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.lb-prev:hover,
.lb-next:hover,
.lb-close:hover { border-color: var(--ember); background: var(--ember); color: var(--forge-900); }
.lb-close { position: absolute; top: 16px; right: 16px; z-index: 2; }

/* --------------------------------------------------------------------------
   Révélation au scroll (là où le navigateur sait le faire en CSS)
   -------------------------------------------------------------------------- */
@supports (animation-timeline: view()) {
  #grid li,
  .manifeste-body > * {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Le nombre de colonnes auto-fill se calcule sur le MAX de minmax() : avec 1fr il suit le
   minimum (190px). Une tuile fait alors au plus ~296px, sous les 300px natifs des photos. */
@media (min-width: 560px) {
  #grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (max-width: 899px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding-bottom: 72px;
  }
  .plate { justify-self: stretch; }
  .place { display: none; }
  .manifeste { grid-template-columns: minmax(0, 1fr); }
  .manifeste .eyebrow { position: static; }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand call" "nav nav";
    gap: 4px 12px;
  }
  .brand img { width: 118px; }
  .site-header nav { justify-content: space-between; }
  .call-label { display: none; }
  #filters {
    flex-wrap: nowrap;
    margin-inline: calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #filters button { flex: 0 0 auto; white-space: nowrap; }
  #lightbox[open] { grid-template-columns: minmax(0, 1fr); }
  .lb-prev,
  .lb-next {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
  }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

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