/* ═══════════════════════════════════════════════════════════════
   Accueil
   ═══════════════════════════════════════════════════════════════ */

/* ── Intro (compteur façon tableau d'affichage) ────────────── */
.intro {
  position: fixed; inset: 0; z-index: 98;
  display: none;
  grid-template-rows: auto 1fr auto;
  background: var(--bg); color: var(--fg);
  padding-top: 22px;
}
.show-intro .intro { display: grid; }
.intro__top { display: flex; justify-content: space-between; color: var(--fg-dim); }
.intro__count { align-self: end; font-size: clamp(120px, 30vw, 520px); line-height: .78; margin-bottom: 2vh; }
.intro__num { display: inline-block; font-variant-numeric: tabular-nums; }
.intro__bar { height: 6px; background: var(--bg-3); }
.intro__bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: calc(100svh + clamp(56px, 7vw, 120px)); min-height: 660px;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-top: var(--nav-h);
  padding-bottom: clamp(56px, 7vw, 120px);
  overflow: hidden;
  background: var(--bg);
}
.hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero__video {
  width: 100%; height: 100%; object-fit: cover;
  transform-origin: 50% 45%;
  filter: saturate(.92) contrast(1.06);
}
.hero__shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(22,25,28,.7) 0%, rgba(22,25,28,.12) 26%, rgba(22,25,28,.1) 44%, rgba(22,25,28,.9) 100%),
    radial-gradient(60% 50% at 88% 46%, rgba(22,25,28,.45), transparent 70%),
    radial-gradient(130% 90% at 50% 35%, transparent 45%, rgba(22,25,28,.5) 100%);
}
.hero__top {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 14px;
}
.hero__body {
  position: relative; z-index: 2;
  align-self: end;
  perspective: 1400px;
  padding-bottom: 1.4vh;
}
.hero__title { display: block; transform-style: preserve-3d; will-change: transform; }
.hero__first, .hero__last { display: block; overflow: clip; white-space: nowrap; }
.hero__first { font-size: clamp(58px, 12.2vw, 270px); line-height: .82; padding-top: .05em; }
.hero__last  { font-size: 31vw; line-height: .76; padding-top: .04em; margin-bottom: -.03em; }
.hero__line  { display: inline-block; }
.hero__line .char { display: inline-block; will-change: transform; }
.hero__note {
  position: absolute; right: var(--gutter); top: 1vw;
  width: min(330px, 27vw);
  font-size: clamp(14px, 1.08vw, 17px); line-height: 1.42; font-weight: 500;
  text-shadow: 0 1px 14px rgba(22, 25, 28, .7);
}
.hero__top { text-shadow: 0 1px 10px rgba(22, 25, 28, .5); }
.hero__bar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-block: 16px 20px;
  border-top: 1px solid var(--line);
}
.hero__scroll { display: inline-flex; align-items: center; gap: 12px; }
.hero__scroll i { position: relative; width: 44px; height: 1px; background: var(--line); overflow: hidden; }
.hero__scroll i::after {
  content: ""; position: absolute; inset: 0; background: var(--fg);
  animation: scroll-line 2.2s var(--ease-io) infinite;
}
@keyframes scroll-line {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(0); }
  100% { transform: translateX(100%); }
}
/* États initiaux avant l'intro */
.js .hero__line { visibility: hidden; }
.js .hero__top, .js .hero__bar, .js .hero__note { opacity: 0; }
.reduced .hero__line { visibility: visible !important; }
.reduced .hero__top, .reduced .hero__bar, .reduced .hero__note { opacity: 1 !important; }

/* ── Manifeste ─────────────────────────────────────────────── */
.manifesto { position: relative; padding-bottom: clamp(100px, 13vw, 200px); }
.tapes {
  position: relative; z-index: 5;
  height: clamp(120px, 14vw, 230px);
  margin-top: calc(clamp(56px, 7vw, 120px) * -1);
  margin-bottom: clamp(48px, 7vw, 120px);
  pointer-events: none;
}
.tapes .tape { position: absolute; left: 0; top: 50%; }
.tapes .tape--ink { transform: translateY(-62%) rotate(2.4deg); }
.tapes .tape:not(.tape--ink) { transform: translateY(-38%) rotate(-3deg); box-shadow: 0 18px 40px rgba(0,0,0,.18); }

.manifesto__text {
  font-size: clamp(34px, 6.1vw, 108px);
  font-weight: 800; font-stretch: 78%;
  line-height: .96; letter-spacing: -.012em;
  text-transform: uppercase;
  text-indent: 16vw;
}
.manifesto__text .word { will-change: opacity; text-indent: 0; }
.pill {
  display: inline-block; vertical-align: middle;
  width: 1.55em; height: .78em;
  margin: -.12em .06em 0;
  overflow: hidden; background: var(--fg);
  transform: rotate(-3deg);
  text-indent: 0;
}
.pill--tall { width: .6em; height: .92em; transform: rotate(4deg); }
.pill img { width: 100%; height: 100%; object-fit: cover; }

.manifesto__facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 32px; align-items: end;
  margin-top: clamp(64px, 9vw, 140px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.manifesto__facts p + p { margin-top: 8px; font-size: 17px; line-height: 1.35; max-width: 30ch; }

/* ── Travaux choisis : la table de tirage ──────────────────── */
.featured { position: relative; padding-top: clamp(100px, 12vw, 190px); }
.featured__head { margin-bottom: 0; }
.deal {
  position: relative; overflow: hidden;
  height: 100svh; min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0 clamp(24px, 4vw, 64px);
  padding: calc(var(--nav-h) + 8px) var(--gutter) 22px;
}
.deal__info { position: relative; z-index: 3; display: grid; align-self: center; pointer-events: none; }
.deal__item { grid-area: 1 / 1; align-self: center; }
.deal__item.is-active { pointer-events: auto; }
.deal__meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--fg-dim); }
.deal__meta b { color: var(--accent-text); font-weight: 600; }
.deal__title { font-size: clamp(48px, 6.2vw, 128px); margin: 18px 0 22px; max-width: 9ch; }
.deal__mask { display: block; overflow-x: visible; overflow-y: clip; padding-top: .05em; margin-top: -.05em; }
.deal__title-in { display: block; }
.deal__desc {
  max-width: 38ch; color: var(--fg-dim);
  font-size: clamp(16px, 1.2vw, 19px); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.deal__foot { display: flex; align-items: center; gap: 20px; margin-top: 28px; }

.deal__stage { position: relative; z-index: 2; perspective: 1600px; }
.deal__num { position: absolute; inset: 0; display: grid; place-items: center start; pointer-events: none; }
.deal__num span {
  grid-area: 1 / 1; opacity: 0;
  font-size: min(70vh, 42vw); line-height: .8;
  transform-origin: 30% 50%;
  translate: -18% 0;
  color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--accent-text) 45%, transparent);
}
.deal__table { position: absolute; inset: 0; transform-style: preserve-3d; }
.deal__card {
  position: absolute; left: 50%; top: 50%;
  display: block; height: min(58vh, 580px); aspect-ratio: var(--r, .5625); max-width: 78%;
  overflow: hidden; background: var(--bg-3);
  box-shadow: 0 2px 6px rgba(0,0,0,.12), 0 34px 64px -14px rgba(0,0,0,.5);
  will-change: transform;
}
.deal__card.is-wide { height: min(38vh, 380px); }
.deal__card img { width: 100%; height: 100%; object-fit: cover; }

.deal__progress {
  grid-column: 1 / -1; position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 10px;
}
.deal__progress button {
  display: grid; gap: 10px; text-align: left;
  color: var(--fg-mute); transition: color .4s;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.deal__progress button:hover, .deal__progress button.is-active { color: var(--fg); }
.deal__progress i { position: relative; display: block; height: 2px; background: var(--line); overflow: hidden; }
.deal__progress i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(var(--p, 0)); transform-origin: left;
}
.deal__progress span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sans animation : une série à la fois, sélectionnable */
.deal.is-static .deal__item:not(.is-active), .deal.is-static .deal__pile:not(.is-active) { display: none; }
.deal.is-static .deal__num span.is-active { opacity: 1; }

/* ── Le mur 3D ─────────────────────────────────────────────── */
.wall { position: relative; background: var(--bg); }
.wall__pin { position: relative; height: 100svh; overflow: hidden; }
.wall__stage { position: absolute; inset: 0; }
.wall__stage canvas { width: 100% !important; height: 100% !important; cursor: grab; touch-action: pan-y; }
.wall__stage canvas.is-dragging { cursor: grabbing; }
.wall__ui {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: grid; grid-template-rows: auto 1fr auto;
  padding-top: calc(var(--nav-h) + 12px); padding-bottom: 24px;
}
.wall__title { font-size: clamp(76px, 13vw, 230px); display: flex; gap: .14em; }
.wall__title .t-outline { --outline: var(--accent-text); }
.wall__hint { grid-row: 3; align-self: end; }
.wall__count {
  position: absolute; right: var(--gutter); bottom: 18px;
  font-size: clamp(54px, 7vw, 120px); line-height: .8;
  font-variant-numeric: tabular-nums;
}
.wall__count-sep { color: var(--accent-text); padding-inline: .06em; }
.wall__label {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  display: grid; gap: 4px; padding: 10px 14px 11px;
  background: var(--accent); color: var(--on-accent);
  opacity: 0; scale: .8;
  transition: opacity .3s, scale .4s var(--ease-out);
}
.wall__label.is-on { opacity: 1; scale: 1; }
.wall__label-name { font-stretch: 75%; font-weight: 800; font-size: 18px; text-transform: uppercase; line-height: 1; }
/* Repli sans WebGL / mouvement réduit */
.wall.is-fallback .wall__pin { height: auto; padding: calc(var(--nav-h) + 40px) 0 100px; }
.wall.is-fallback .wall__ui { position: relative; inset: auto; padding: 0 var(--gutter) 40px; display: block; }
.wall.is-fallback .wall__hint, .wall.is-fallback .wall__count, .wall.is-fallback .wall__stage { display: none; }
.wall__fallback { columns: 4 200px; column-gap: 12px; }
.wall__fallback a { display: block; margin-bottom: 12px; break-inside: avoid; }

/* ── Savoir-faire ──────────────────────────────────────────── */
.services__intro { max-width: 30ch; }
.services__list { border-top: 1px solid var(--line); }
.svc a {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 64px minmax(0, 1.5fr) minmax(0, 1fr) 190px;
  gap: 24px; align-items: center;
  padding: clamp(18px, 2vw, 30px) 0;
  border-bottom: 1px solid var(--line);
  transition: color .5s var(--ease-out);
}
.svc a::before {
  content: ""; position: absolute; z-index: -1;
  inset: -1px calc(var(--gutter) * -1);
  background: var(--accent);
  transform: scaleY(0); transform-origin: 50% 100%;
  transition: transform .6s var(--ease-out);
}
.svc a:hover { color: var(--on-accent); }
.svc a:hover::before { transform: scaleY(1); }
.svc__num { font-size: 14px; transition: color .5s; }
.svc a:hover .svc__num { color: var(--on-accent); }
.svc__title { font-size: clamp(38px, 5.6vw, 96px); transition: transform .7s var(--ease-out); }
.svc a:hover .svc__title { transform: translateX(18px); }
.svc__desc { font-size: 16px; line-height: 1.4; max-width: 34ch; }
.svc__tools { text-align: right; opacity: .7; }
.svc-preview {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  width: clamp(200px, 17vw, 280px); aspect-ratio: 4 / 5;
  margin: -170px 0 0 -110px;
  overflow: hidden; background: var(--bg-3);
  opacity: 0; scale: .5;
  transition: opacity .35s, scale .6s var(--ease-out);
}
.svc-preview.is-on { opacity: 1; scale: 1; }
.svc-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── Contact ───────────────────────────────────────────────── */
.cta { overflow: hidden; }
.cta__title { font-size: clamp(96px, 21vw, 390px); line-height: .8; }
.cta__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  gap: clamp(24px, 4vw, 64px); align-items: end;
  margin-top: clamp(40px, 5vw, 80px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.cta__text { max-width: 32ch; }
.cta__mail {
  font-stretch: 72%; font-weight: 800; text-transform: uppercase;
  font-size: clamp(24px, 3.3vw, 58px); line-height: 1; padding-bottom: 6px;
  background-size: 100% 2px;
  background-image: linear-gradient(currentColor, currentColor);
}
.cta__round {
  width: clamp(120px, 11vw, 168px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--fg); color: var(--bg);
  transition: background .5s, color .5s;
}
.cta__round svg { width: 22px; height: 22px; transition: transform .6s var(--ease-out); }
.cta__round:hover { background: var(--bg-2); color: var(--fg); }
.cta__round:hover svg { transform: rotate(45deg); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .svc a { grid-template-columns: 48px minmax(0, 1fr) minmax(0, .8fr); }
  .svc__tools { display: none; }
  .manifesto__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero__meta--mid { display: none; }
  .hero__first { font-size: 13.6vw; }
  .hero__note { position: static; width: auto; max-width: 34ch; margin-top: 16px; }
  .hero__cta { display: none; }
  .manifesto__text { text-indent: 0; }
  .deal { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; gap: 14px; padding-top: calc(var(--nav-h) + 4px); }
  .deal__stage { grid-row: 1; }
  .deal__info { grid-row: 2; align-self: start; }
  .deal__card { height: 34svh; }
  .deal__card.is-wide { height: 22svh; }
  .deal__title { font-size: clamp(40px, 11vw, 76px); margin: 10px 0 12px; max-width: none; }
  .deal__desc { -webkit-line-clamp: 2; }
  .deal__foot { margin-top: 16px; }
  .deal__progress span { display: none; }
  .svc a { grid-template-columns: 36px minmax(0, 1fr); gap: 6px 14px; }
  .svc__desc { grid-column: 2; }
  .cta__row { grid-template-columns: 1fr; justify-items: start; }
  .cta__round { justify-self: end; margin-top: -40px; }
  .wall__count { font-size: 52px; }
}
@media (max-width: 520px) {
  .hero__top span:last-child { display: none; }
  .hero__bar .chip { font-size: 10px; }
  .manifesto__facts { grid-template-columns: 1fr; gap: 22px; }
  .cta__round { margin-top: 0; justify-self: start; }
}
@media (max-width: 900px) and (max-height: 720px) {
  .deal__card { height: 28svh; }
  .deal__desc { display: none; }
}
