/* Page d’accueil « tout l’atelier » : mise en page et animations propres à l’accueil (index.html).
   Les apparitions au défilement et le compteur viennent de motion.js (data-reveal, data-count) ;
   les vidéos se lancent à l’écran avec accueil.js. Rien ne bouge si les mouvements réduits sont
   demandés ou si les animations sont mises en pause depuis l’en-tête (.motion-paused). */

.ax-kicker {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-dark);
}

.ax-link {
  font-weight: 600;
  color: var(--wine);
  text-underline-offset: 4px;
}

/* Haut de page ------------------------------------------------------------------------------ */
.ax-hero {
  background: var(--linen);
  padding-top: clamp(48px, 8vw, 96px);
  overflow: hidden;
}

.ax-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.ax-hero-copy .install-card {
  text-align: left;
}

.ax-hero h1 {
  margin: 0;
  max-width: 15ch;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 5.6vw, 4.25rem);
  line-height: 1.04;
}

.ax-hero h1 em {
  color: var(--wine);
}

.ax-lead {
  margin: 0;
  max-width: 44rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-soft);
}

.ax-hero .cta-row {
  justify-content: center;
}

.ax-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted);
}

.ax-hero-media {
  position: relative;
  margin-top: 36px;
  margin-bottom: -120px;
  max-width: 1220px;
}

.ax-hero + .ax-doors-section {
  padding-top: calc(120px + clamp(56px, 8vw, 96px));
}

/* Fenêtre d’appli autour des vidéos et des captures */
.ax-win {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.ax-win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--linen);
}

.ax-win-bar i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.ax-win-bar span {
  margin-left: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.ax-win video,
.ax-win img {
  display: block;
  width: 100%;
  height: auto;
}

.ax-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  animation: ax-float 6s ease-in-out infinite;
  left: -8px;
  top: 18%;
}

.ax-chip-b {
  left: auto;
  right: -8px;
  top: 36%;
  animation-delay: -2s;
}

.ax-chip-c {
  left: auto;
  top: auto;
  right: 12%;
  bottom: -20px;
  animation-delay: -4s;
}

.ax-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  animation: ax-pulse 1.6s ease-in-out infinite;
}

/* Entrée du haut de page */
.ax-rise {
  animation: ax-rise 0.9s var(--ease-out) both;
}

.ax-d1 { animation-delay: 0.08s; }
.ax-d2 { animation-delay: 0.18s; }
.ax-d3 { animation-delay: 0.3s; }
.ax-d4 { animation-delay: 0.45s; }

/* Reflet qui passe sur le bouton principal */
.ax-shine {
  position: relative;
  overflow: hidden;
}

.ax-shine::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgb(255 255 255 / 28%) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: ax-shine 4.5s ease-in-out 1.5s infinite;
  pointer-events: none;
}

/* Cinq entrées -------------------------------------------------------------------------------- */
.ax-head {
  max-width: 44rem;
  margin-bottom: 36px;
}

.ax-head h2,
.ax-txt h2,
.ax-txt h3,
.ax-materials h2,
.ax-tools h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
}

.ax-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }

.ax-head p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.ax-doors {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.ax-door {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, border-color 0.3s;
}

.ax-door:hover,
.ax-door:focus-visible {
  transform: translateY(-6px);
  border-color: var(--rose);
  box-shadow: var(--shadow);
}

.ax-door svg,
.ax-mat svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--wine);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ax-door svg * {
  stroke-dasharray: 80;
}

.ax-door:hover svg *,
.ax-door:focus-visible svg * {
  animation: ax-stitch 1s ease both;
}

.ax-door strong { font-size: 1.125rem; }

.ax-door span {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Lignes de fonctionnalités ------------------------------------------------------------------- */
.ax-features .wrap,
.ax-features .ax-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 9vw, 112px);
}

.ax-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.ax-row-reverse {
  flex-direction: row-reverse;
}

.ax-txt {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.ax-txt h2,
.ax-txt h3 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin: 0;
}

.ax-txt p:not(.ax-kicker) {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.ax-media {
  flex: 1.5 1 480px;
  min-width: 0;
  margin: 0;
}

.ax-score {
  position: relative;
}

.ax-score-badge {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 14px 20px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.ax-score-badge span {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--sage-dark);
}

.ax-score-badge small {
  color: var(--muted);
  font-size: 1rem;
}

/* Mise en scène : fondu entre les cinq décors ------------------------------------------------- */
.ax-scene-section {
  padding-block: clamp(64px, 9vw, 104px);
  background: var(--wine-deep);
  color: #fff;
}

.ax-scene-section .ax-kicker { color: var(--petal); }
.ax-scene-section h2,
.ax-materials h2 { color: #fff; }
.ax-scene-section .ax-txt p:not(.ax-kicker) { color: var(--wine-line); }

.ax-scenes {
  position: relative;
  aspect-ratio: 1084 / 680;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 55%);
}

.ax-scenes img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: ax-fade 20s infinite;
}

.ax-scenes img:nth-child(1) { animation-delay: 0s; }
.ax-scenes img:nth-child(2) { animation-delay: 4s; }
.ax-scenes img:nth-child(3) { animation-delay: 8s; }
.ax-scenes img:nth-child(4) { animation-delay: 12s; }
.ax-scenes img:nth-child(5) { animation-delay: 16s; }

.ax-scene-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.ax-scene-names li {
  padding: 8px 14px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 999px;
  font-size: 0.875rem;
  color: var(--wine-line);
  animation: ax-lit 20s infinite;
}

.ax-scene-names li:nth-child(2) { animation-delay: 4s; }
.ax-scene-names li:nth-child(3) { animation-delay: 8s; }
.ax-scene-names li:nth-child(4) { animation-delay: 12s; }
.ax-scene-names li:nth-child(5) { animation-delay: 16s; }

/* Matières ------------------------------------------------------------------------------------ */
.ax-materials {
  padding-block: clamp(56px, 8vw, 88px);
  background: var(--wine);
  color: #fff;
}

.ax-materials h2 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  margin-bottom: 32px;
}

.ax-mats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ax-mat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: var(--radius);
}

.ax-mat svg {
  width: 38px;
  height: 38px;
  stroke: var(--wine-soft);
  stroke-width: 1.6;
  animation: ax-float 5s ease-in-out infinite;
}

.ax-mat:nth-child(2) svg { animation-delay: -1.2s; }
.ax-mat:nth-child(3) svg { animation-delay: -2.4s; }
.ax-mat:nth-child(4) svg { animation-delay: -3.6s; }

.ax-mat strong { font-size: 1.1875rem; }

.ax-mat span {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--wine-line);
}

/* Aperçu 3D qui avance doucement */
.ax-kb-frame {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.ax-kb {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 45% 60%;
  animation: ax-kb 18s ease-in-out infinite alternate;
}

/* Outils gratuits : bandeau qui défile -------------------------------------------------------- */
.ax-tools {
  padding-block: clamp(56px, 8vw, 88px);
  background: var(--sage-soft);
}

.ax-tools-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}

.ax-tools h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); }

.ax-tools-head p {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.ax-tools .ax-link { color: var(--sage-dark); }

.ax-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.ax-track {
  display: flex;
  width: max-content;
  animation: ax-slide 45s linear infinite;
}

.ax-marquee:hover .ax-track,
.ax-marquee:focus-within .ax-track {
  animation-play-state: paused;
}

.ax-track ul {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0 10px 0 0;
  list-style: none;
}

.ax-track a {
  display: block;
  padding: 10px 16px;
  border: 1px solid #d6e2cf;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.ax-track a:hover { border-color: var(--sage); }

/* Animations ---------------------------------------------------------------------------------- */
@keyframes ax-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes ax-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes ax-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

@keyframes ax-shine {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes ax-stitch {
  from { stroke-dashoffset: 80; }
  to { stroke-dashoffset: 0; }
}

@keyframes ax-fade {
  0% { opacity: 0; transform: scale(1.04); }
  4%, 20% { opacity: 1; }
  26% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}

@keyframes ax-lit {
  0%, 22% { background: #fff; color: var(--wine); border-color: #fff; }
  26%, 100% { background: transparent; color: var(--wine-line); border-color: rgb(255 255 255 / 25%); }
}

@keyframes ax-kb {
  from { transform: scale(1); }
  to { transform: scale(1.12) translate(-2%, -1%); }
}

@keyframes ax-slide {
  to { transform: translateX(-50%); }
}

/* Petits écrans : tout tient sans défilement horizontal */
@media (max-width: 1000px) {
  .ax-doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-mats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ax-chip { display: none; }
  .ax-row-reverse { flex-direction: row; }
}

@media (max-width: 560px) {
  .ax-doors,
  .ax-mats { grid-template-columns: minmax(0, 1fr); }
  .ax-hero-media { margin-bottom: -60px; }
  .ax-hero + .ax-doors-section { padding-top: calc(60px + 56px); }
  .ax-score-badge { right: 10px; bottom: 10px; padding: 10px 14px; }
  .ax-score-badge span { font-size: 2rem; }
}

/* Pas de mouvement demandé, ou animations en pause depuis l’en-tête : le premier décor reste affiché */
@media (prefers-reduced-motion: reduce) {
  .ax-rise,
  .ax-chip,
  .ax-dot,
  .ax-shine::before,
  .ax-scenes img,
  .ax-scene-names li,
  .ax-mat svg,
  .ax-kb,
  .ax-track,
  .ax-door svg * { animation: none !important; }
  .ax-scenes img:first-child { opacity: 1; }
  .ax-marquee { overflow-x: auto; }
}

.motion-paused .ax-scenes img:first-child { opacity: 1; }
