/* ═══════════════════════════════════════════════════════════
   PRDL STUDIO — Page d'accueil
   S'ajoute à style.css et projet.css : même langage que les pages projets.
═══════════════════════════════════════════════════════════ */

.ac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ─── FOND DU HAUT DE PAGE : grand quadrillage blanc, effacé vers les 4 bords ───
   Derrière le titre, le carrousel et le bandeau de logos, pas plus bas. */
.ac-top {
  position: relative;
  isolation: isolate;
}
.ac-top::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  --grid: 160px;
  --grid-line: rgba(237,237,237,0.07);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  background-position: center top;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 25%, #000 75%, transparent),
    linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 25%, #000 75%, transparent),
    linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-composite: intersect;
}
@media (max-width: 768px) {
  .ac-top::before { --grid: 96px; }
}
/* Dans le bloc contact, le bouton secondaire prend le fond de la page */
.ac-contact-block .btn-ghost { background: var(--white); }

/* ─── CARROUSEL DU HAUT DE PAGE ─────────────────────────── */
/* Un grand visuel au centre, ses voisins derrière lui sur les côtés. La rotation
   n'anime que transform et opacity. */
.ac-carousel {
  width: var(--block-width);
  margin: 0 auto;
  padding: 50px 0;
}
.ac-slides {
  position: relative;
  aspect-ratio: 3.13 / 1;
}
.ac-slide {
  --x: 0%;
  --scale: 0.5;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 60%;
  border-radius: var(--radius-16);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translate(calc(-50% + var(--x)), -50%) scale(var(--scale));
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease), visibility 0s linear 0.8s;
}
.ac-slide img { width: 100%; height: auto; }
.ac-slide.is-active,
.ac-slide.is-prev,
.ac-slide.is-next {
  opacity: 1;
  visibility: visible;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease), visibility 0s;
}
.ac-slide.is-active { --scale: 1; z-index: 3; }
.ac-slide.is-prev { --x: -51.67%; --scale: 0.6333; z-index: 2; }
.ac-slide.is-next { --x: 51.67%; --scale: 0.6333; z-index: 2; }
.ac-slide:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ac-carousel-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  width: 60%;   /* la largeur du visuel du centre */
  margin: var(--space-4) auto 0;
  text-align: center;
}
.ac-carousel-name {
  font-size: var(--text-14);
  font-weight: var(--fw-sb);
  transition: color var(--fast) var(--ease);
}
.ac-carousel-name:hover { color: var(--accent); }
.ac-segs { display: flex; gap: var(--space-1); }
.ac-seg {
  width: 28px;
  padding: 11px 0;
  background: none;
  border: none;
  cursor: pointer;
}
.ac-seg-bar {
  display: block;
  height: 2px;
  background: rgba(237,237,237,0.2);
  border-radius: 2px;
  overflow: hidden;
}
.ac-seg-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.ac-seg.is-active .ac-seg-fill { animation: ac-fill 5s linear forwards; }
@keyframes ac-fill { to { transform: scaleX(1); } }
.ac-carousel:hover .ac-seg-fill,
.ac-carousel:has(:focus-visible) .ac-seg-fill,
.ac-carousel.is-offscreen .ac-seg-fill { animation-play-state: paused; }
.ac-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-4); }

/* ─── BANDEAU DE LOGOS ──────────────────────────────────── */
.ac-logos {
  position: relative;
  width: var(--block-width);
  margin: clamp(48px, 6vw, 80px) auto 0;
  overflow: hidden;
}
.ac-logos::before,
.ac-logos::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 120px;
  pointer-events: none;
}
.ac-logos::before { left: 0; background: linear-gradient(to right, var(--white), transparent); }
.ac-logos::after { right: 0; background: linear-gradient(to left, var(--white), transparent); }
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee-track:hover { animation-play-state: paused; }
.marquee-logos { display: flex; align-items: center; gap: 80px; padding-right: 80px; }
.marquee-logo { flex-shrink: 0; width: auto; height: 28px; object-fit: contain; opacity: 0.55; }
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ─── CARTES PROJETS ────────────────────────────────────── */
.ac-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}
.ac-hint { font-size: var(--text-14); color: var(--gray-text); }
.ac-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.ac-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-card {
  display: flex;
  flex-direction: column;
  background: var(--gray-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-24);
  overflow: hidden;
  transition: border-color var(--fast) var(--ease);
}
.ac-card:hover { border-color: rgba(237,237,237,0.28); }
.ac-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ac-card-thumb {
  height: clamp(220px, 21vw, 300px);
  overflow: hidden;
}
.ac-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ac-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
}
.ac-card-title { font-size: var(--text-h3-2); font-weight: var(--fw-sb); line-height: 1.25; }
.ac-card-desc { flex: 1; margin-top: var(--space-2); font-size: var(--text-14); color: var(--gray-text); }
.ac-card-go { display: block; margin-top: var(--space-4); font-size: var(--text-14); font-weight: var(--fw-sb); color: var(--accent); }

.ac-side { margin-top: clamp(64px, 7vw, 96px); }
.ac-side .section-label { margin-bottom: var(--space-5); }
.ac-grid--3 .ac-card-thumb { height: clamp(160px, 14vw, 200px); }
.ac-grid--3 .ac-card-title { font-size: var(--text-18); }

/* ─── À PROPOS ──────────────────────────────────────────── */
.ac-about-text { margin-top: var(--space-5); font-size: var(--text-16); line-height: 1.6; color: var(--gray-text); }
.ac-about-text + .ac-about-text { margin-top: var(--space-4); }
.ac-about .ac-actions { margin-top: var(--space-6); }
.ac-skills { border-top: 1px solid var(--pj-line); }
.ac-skill { padding: var(--space-4) 0; border-bottom: 1px solid var(--pj-line); }
.ac-skill dt { font-size: var(--text-16); font-weight: var(--fw-sb); }
.ac-skill dd { margin-top: var(--space-1); font-size: var(--text-14); color: var(--gray-text); }

/* ─── CONTACT ───────────────────────────────────────────── */
.ac-contact { padding-bottom: var(--pj-gap-section); }
.ac-contact-block {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-7) clamp(40px, 6vw, 96px);
  padding: clamp(24px, 4.5vw, 64px);
  background: var(--gray-surface);
  border-radius: var(--radius-24);
}
/* Le titre en haut, LinkedIn en bas : la colonne tient toute la hauteur du formulaire */
.ac-contact-intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
}
.ac-contact-text { margin-top: var(--space-4); max-width: 36ch; color: var(--gray-text); }
.ac-contact .contact-form { max-width: none; margin: 0; }
.ac-contact .contact-form-field input,
.ac-contact .contact-form-field textarea { background: var(--white); }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 960px) {
  .ac-contact-block { grid-template-columns: minmax(0, 1fr); }
  .ac-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .ac-grid,
  .ac-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .ac-head { flex-direction: column; align-items: flex-start; }
  .ac-card-thumb { height: 220px; }
}
@media (max-width: 640px) {
  .ac-carousel { padding: var(--space-5) 0; }
  /* Téléphone : un visuel à la fois, en fondu */
  .ac-slides { aspect-ratio: 1600 / 850; }
  .ac-slide { --x: 0%; --scale: 1; width: 100%; box-shadow: none; }
  .ac-slide.is-prev,
  .ac-slide.is-next { --x: 0%; --scale: 1; opacity: 0; visibility: hidden; }
  .ac-carousel-bar { width: 100%; }
  .ac-actions .btn-primary,
  .ac-actions .btn-ghost { flex: 1 1 100%; }
  /* Bloc contact : mêmes boutons pleine largeur que le reste de la page */
  .ac-contact-intro { align-items: stretch; }
  .ac-contact-intro .btn-ghost,
  .contact-form-actions .btn-primary { width: 100%; }
  .ac-logos::before,
  .ac-logos::after { width: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  /* Le carrousel ne défile plus tout seul, les boutons restent utilisables */
  .ac-seg.is-active .ac-seg-fill { animation: none; transform: scaleX(1); }
  .ac-slide,
  .ac-slide.is-active,
  .ac-slide.is-prev,
  .ac-slide.is-next { transition: none; }
}
