/* ==========================================================================
   L'Atelié — feuille de style
   Direction : noir & blanc, lignes fines, grands espaces, logo 3D.
   ========================================================================== */

:root {
  --black: #070707;
  --white: #f4f3ef;
  --bg: var(--black);
  --fg: var(--white);
  --muted: rgba(244, 243, 239, .5);
  --hair: rgba(244, 243, 239, .18);

  --serif: "Newsreader", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 80px);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

body[data-tone="light"] {
  --bg: var(--white);
  --fg: var(--black);
  --muted: rgba(7, 7, 7, .5);
  --hair: rgba(7, 7, 7, .16);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 1.1s var(--ease), color 1.1s var(--ease);
  overflow-x: hidden;
}
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; }
::selection { background: var(--fg); color: var(--bg); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Couches fixes ----------------------------------------------------------- */

#gl {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 60;
  width: 200%; height: 200%;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
body[data-tone="light"] .grain { opacity: .08; filter: invert(1); }
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 5%); }
  100% { transform: translate(-2%, 6%); }
}

/* Curseur */
.cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: difference;
  color: #fff;
  display: none;
}
body.has-cursor .cursor { display: block; }
.cursor__dot {
  position: absolute;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: currentColor;
}
.cursor__ring {
  position: absolute;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transition: transform .5s var(--ease-out), border-radius .5s var(--ease-out), background-color .5s;
}
body.cursor-hover .cursor__ring { transform: scale(1.8); border-radius: 0; background: rgba(255,255,255,.1); }

/* Préloader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--gutter);
  background: var(--black);
  color: var(--white);
}
.loader__num {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(64px, 12vw, 180px);
  line-height: .9;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.loader__bar {
  height: 1px;
  margin-top: 28px;
  background: rgba(244, 243, 239, .18);
}
.loader__bar i { display: block; width: 0; height: 100%; background: var(--white); }
.loader__tag {
  margin-top: 18px;
  font-size: 10px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(244, 243, 239, .5);
}

/* Typo utilitaires ------------------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(28px, 5vh, 56px);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: currentColor;
  flex: none;
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(40px, 6.4vw, 104px);
  line-height: 1;
  letter-spacing: -.02em;
}
.display em { font-style: italic; font-weight: 200; }

.lead {
  max-width: 34em;
  margin: 0;
  font-size: clamp(15px, 1.15vw, 18px);
  color: var(--muted);
}

/* Logo en masque : prend la couleur du texte */
.mark {
  display: block;
  aspect-ratio: 480 / 275;
  background: currentColor;
  -webkit-mask: url("../logo/logo-atelie-noir.svg") center / contain no-repeat;
          mask: url("../logo/logo-atelie-noir.svg") center / contain no-repeat;
}

/* Header ------------------------------------------------------------------ */
/* Sur PC, la barre = le header entier. Sur mobile, seule .header__bar bouge :
   le header reste un simple conteneur fixe, sans transform ni flou, pour que
   le menu plein écran (position: fixed) reste calé sur la fenêtre. */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--gutter);
  pointer-events: none;
  color: var(--fg);
  opacity: 0;
  border-bottom: 1px solid transparent;
  transition:
    opacity 1.2s var(--ease) .3s,
    transform .7s var(--ease-out),
    padding .5s var(--ease),
    background-color .6s var(--ease),
    color 1.1s var(--ease),
    border-color .6s var(--ease);
}
body.is-loaded .header { opacity: 1; }
.header > *, .header__bar > * { pointer-events: auto; }
.header__bar { display: flex; align-items: center; gap: 24px; }

/* Dès qu'on a quitté le haut de page : fond opaque assorti à la section, hauteur réduite */
body.is-scrolled .header {
  padding-block: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-color: var(--hair);
  pointer-events: auto;
}
/* On descend : le header s'efface ; on remonte : il revient */
body.is-scrolled.nav-hidden:not(.menu-open) .header { transform: translateY(-100%); }

.header__logo {
  width: 84px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
body.is-past-hero .header__logo { opacity: 1; transform: none; }

.nav { display: flex; gap: clamp(22px, 3vw, 48px); }
.nav a,
.menu-toggle {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 2px; right: .3em; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .6s var(--ease-out);
}
.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.menu-toggle {
  display: none;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

/* Progression */
.progress {
  position: fixed;
  right: var(--gutter);
  bottom: 30px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--muted);
  transition: color 1.1s var(--ease);
}
.progress i {
  position: relative;
  width: 11px; height: 11px;
  border: 1px solid var(--fg);
  transition: border-color 1.1s var(--ease);
}
.progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transition: background-color 1.1s var(--ease);
  transform-origin: bottom;
  transform: scaleY(var(--progress, 0));
}

/* Sections ---------------------------------------------------------------- */

main { position: relative; z-index: 2; }
section { position: relative; scroll-margin-top: 72px; }
.section { padding: clamp(120px, 18vh, 220px) var(--gutter); }

/* Ancrages du logo 3D : zones invisibles que le logo vient occuper */
.anchor { position: absolute; pointer-events: none; }

/* Hero ------------------------------------------------------------------- */

.hero { height: 100vh; height: 100svh; overflow: hidden; }
.hero__anchor {
  left: 50%; top: 44%;
  width: min(66vw, 820px);
  transform: translate(-50%, -50%);
  aspect-ratio: 480 / 275;
}
.hero__fallback {
  position: absolute;
  inset: 0;
  fill: var(--fg);
  display: none;
}
body.no-gl .hero__fallback { display: block; }

.hero__tagline {
  position: absolute;
  left: 50%;
  top: 72%;
  width: min(92vw, 960px);
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(22px, 2.8vw, 42px);
  line-height: 1.25;
}
.hero__tagline em { font-style: italic; }

.hero__side {
  position: absolute;
  bottom: 40px;
  left: var(--gutter);
  display: flex;
  gap: 40px;
  font-size: 10px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero__hint i {
  position: relative;
  width: 1px; height: 52px;
  overflow: hidden;
  background: var(--hair);
}
.hero__hint i::after {
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 1px; height: 100%;
  background: var(--fg);
  animation: hint 2.4s var(--ease) infinite;
}
@keyframes hint { to { top: 100%; } }

/* Bandeau défilant -------------------------------------------------------- */

.marquee {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(22px, 2.6vw, 40px);
  white-space: nowrap;
}
.marquee__track { display: flex; width: max-content; will-change: transform; }
.marquee span { padding: 0 .8em; }
.marquee i {
  display: inline-block;
  width: 9px; height: 9px;
  margin: 0 0 .1em;
  background: var(--fg);
  vertical-align: middle;
}

/* Manifeste --------------------------------------------------------------- */

.manifesto {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "head anchor" "foot anchor";
  align-content: center;
  align-items: center;
  column-gap: var(--gutter);
  padding: 0 var(--gutter);
}
.manifesto__head { grid-area: head; align-self: end; }
.manifesto__foot { grid-area: foot; align-self: start; }
.manifesto__text {
  max-width: 15em;
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(32px, 4.6vw, 76px);
  line-height: 1.08;
  letter-spacing: -.015em;
}
.manifesto__text .word { opacity: .1; }
.manifesto__text em { font-style: italic; }
.manifesto__foot { margin-top: clamp(40px, 7vh, 80px); }
.manifesto__anchor { grid-area: anchor; position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.manifesto__stat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 60px;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1;
}
.stat span { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }

/* Savoir-faire / 360° ----------------------------------------------------- */

.services__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 8vw, 140px);
  align-items: start;
  margin-top: clamp(60px, 10vh, 120px);
}
.orbit {
  position: sticky;
  top: 20vh;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
}
.orbit::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hair);
  border-radius: 50%;
}
.orbit strong {
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(56px, 6.6vw, 104px);
  line-height: 1;
  letter-spacing: -.03em;
}
.orbit small {
  margin-top: 12px;
  font-size: 10px;
  letter-spacing: .36em;
  text-transform: uppercase;
  color: var(--muted);
}

.steps { list-style: none; margin: 0; padding: 0; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px 24px;
  padding: clamp(30px, 4.5vh, 46px) 0;
  border-top: 1px solid var(--hair);
}
.step:last-child { border-bottom: 1px solid var(--hair); }
.step__num {
  grid-row: span 2;
  padding-top: 10px;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--muted);
}
.step h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1.1;
}
.step p { margin: 0; max-width: 32em; color: var(--muted); }

/* Réalisations : défilement horizontal ------------------------------------ */

.works { height: 100vh; height: 100svh; overflow: hidden; }
.works__stage {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 60px;
}
.works__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  padding: 0 var(--gutter);
  margin-bottom: clamp(28px, 6vh, 64px);
}
.works__head .display { font-size: clamp(34px, 4.8vw, 76px); }
.works__count {
  font-family: var(--serif);
  font-weight: 200;
  font-size: 28px;
  color: var(--muted);
  white-space: nowrap;
}
.works__count b { font-weight: 200; color: var(--fg); }
.works__track {
  display: flex;
  gap: clamp(28px, 5vw, 100px);
  width: max-content;
  padding: 0 var(--gutter);
  will-change: transform;
}

.work { width: clamp(260px, 30vw, 460px); flex: none; }
.work__art {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 48vh;
  border: 1px solid var(--hair);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color .6s;
}
.work:hover .work__art { border-color: var(--fg); }
.work__art svg { width: 72%; height: 80%; overflow: visible; transition: transform .8s var(--ease-out); }
.work:hover .work__art svg { transform: scale(1.05); }
.work__art .ln {
  fill: none;
  stroke: var(--fg);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2.6s var(--ease-out);
}
.work__art .ln--soft { stroke: var(--muted); }
.work__art .sq {
  fill: var(--fg);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(.2);
  transition: opacity 1s var(--ease) 1.6s, transform 1.2s var(--ease-out) 1.6s;
}
.work.is-in .ln { stroke-dashoffset: 0; }
.work.is-in .sq { opacity: 1; transform: none; }
.work__idx {
  position: absolute;
  top: 18px; left: 20px;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--muted);
}
.work__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
}
.work__meta h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.1;
}
.work__meta p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.work__year { font-size: 11px; letter-spacing: .2em; color: var(--muted); padding-top: 8px; }

/* Artistes ---------------------------------------------------------------- */

.artists { min-height: 100vh; }
.artists__grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: var(--gutter);
  align-items: center;
}
.artists__anchor { position: relative; aspect-ratio: 1; width: 100%; }
.artists .display { max-width: 11em; margin-bottom: clamp(32px, 5vh, 56px); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 80px);
  margin-top: clamp(80px, 14vh, 160px);
}
.pillar { border-top: 1px solid var(--hair); padding-top: 28px; }
.pillar span { font-size: 11px; letter-spacing: .24em; color: var(--muted); }
.pillar h3 {
  margin: 18px 0 12px;
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(28px, 2.6vw, 42px);
}
.pillar p { margin: 0; color: var(--muted); }

/* Contact & footer -------------------------------------------------------- */

.contact {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.contact__anchor {
  left: 50%; top: 50%;
  width: min(72vw, 900px);
  aspect-ratio: 480 / 275;
  transform: translate(-50%, -50%);
}
.contact .eyebrow { justify-content: center; }
.contact .display { max-width: 11em; font-size: clamp(44px, 7vw, 120px); }
.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin-top: clamp(40px, 7vh, 80px);
  font-family: var(--serif);
  font-weight: 200;
  font-size: clamp(22px, 2.4vw, 38px);
  font-style: italic;
}
.contact__mail i {
  width: 56px; height: 1px;
  background: currentColor;
  transition: width .7s var(--ease);
}
.contact__mail:hover i { width: 120px; }

.footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 32px;
  padding: 40px var(--gutter) 34px;
  border-top: 1px solid var(--hair);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer p { margin: 0; }
.footer__logo { width: 88px; color: var(--fg); }
.footer__tag { text-align: center; }
.footer__tag b { font-weight: 300; color: var(--fg); }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .header,
  body.is-scrolled .header,
  body.is-scrolled.nav-hidden:not(.menu-open) .header {
    display: block;
    padding: 0;
    background: none;
    border: 0;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    transform: none;
  }
  .header__bar {
    position: relative;
    z-index: 1;
    justify-content: space-between;
    padding: 22px var(--gutter);
    border-bottom: 1px solid transparent;
    transition:
      transform .7s var(--ease-out),
      padding .5s var(--ease),
      background-color .6s var(--ease),
      border-color .6s var(--ease);
  }
  body.is-scrolled .header__bar {
    padding-block: 14px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(14px);
            backdrop-filter: blur(14px);
    border-color: var(--hair);
  }
  body.is-scrolled.nav-hidden:not(.menu-open) .header__bar { transform: translateY(-100%); }
  body.menu-open .header__bar { background: var(--bg); border-color: transparent; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background: var(--bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s var(--ease), visibility .6s;
  }
  .nav a { font-family: var(--serif); font-weight: 200; font-size: 38px; letter-spacing: 0; text-transform: none; }
  .nav a::after { display: none; }
  body.menu-open .nav { opacity: 1; visibility: visible; }

  .hero__anchor { width: 88vw; top: 42%; }
  .hero__tagline { top: 68%; }
  .hero__side { display: none; }

  .manifesto {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "anchor" "foot";
    padding-block: 110px 40px;
    min-height: 0;
  }
  .manifesto__anchor { aspect-ratio: 4 / 3; max-width: none; margin: 8px 0 16px; }
  .manifesto__foot { margin-top: 0; }
  .manifesto__stat { margin-top: 40px; }

  .services__grid { grid-template-columns: 1fr; }
  .orbit { position: relative; top: 0; max-width: 280px; margin: 0 auto 40px; }
  .services__grid { margin-top: 48px; }

  .artists__grid { grid-template-columns: 1fr; gap: 0; }
  .artists__anchor { aspect-ratio: 4 / 3; order: 1; margin-top: 24px; }
  .pillars { grid-template-columns: 1fr; }

  .footer { grid-template-columns: 1fr; justify-items: start; }
  .footer__tag { text-align: left; }
}

@media (max-width: 560px) {
  .step { grid-template-columns: 36px minmax(0, 1fr); }
  .works__head { flex-direction: column; align-items: flex-start; }
  .manifesto__stat { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation: none !important;
  }
  .grain { display: none; }
  .manifesto__text .word { opacity: 1; }
  .works { height: auto; }
  .works__track { width: auto; overflow-x: auto; }
}
