/* ===== Reset & base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Palette et constantes du site : modifier ces valeurs suffit à changer
   les couleurs, largeurs et arrondis sur l'ensemble des pages. */
:root {
  --color-blue: #3b6fed;
  --color-violet: #7c5cff;
  --color-green: #1fcf8d;
  --color-primary: #5b53f5;
  --color-primary-dark: #4338d6;
  --color-text: #1f2430;
  --color-text-light: #5a6275;
  --color-bg: #f2f5fa;
  --color-bg-alt: #f4f6fb;
  --color-border: #e3e7f0;
  --gradient-soft: linear-gradient(135deg, #dfe7ff 0%, #e9defe 50%, #d9f5ea 100%);
  --max-width: 1140px;
  --radius: 8px;
}

/* Légèrement plus grand que la taille par défaut du navigateur :
   comme les titres/textes sont en "rem", tout le site grossit un peu. */
html {
  font-size: 106%;
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  line-height: 1.25;
  margin-bottom: 0.6em;
}

/* Met en valeur certains mots-clés dans les grands titres en reprenant le
   violet de la palette (mêmes teintes que le dégradé du logo et des cubes).
   Au chargement, le violet "balaie" le mot de gauche à droite comme un
   surligneur : on applique au texte (via background-clip: text, comme pour
   .logo-name) un dégradé à bord net moitié violet / moitié couleur du texte
   courant, deux fois plus large que le mot, puis on anime sa position pour
   faire glisser la frontière des deux teintes jusqu'à ce que tout le mot
   soit violet. "--late" décale le second mot du titre pour un effet cascade. */
@keyframes sweep-violet {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

.text-violet {
  background-image: linear-gradient(90deg,
    var(--color-violet) 0%, var(--color-violet) 50%,
    var(--color-text) 50%, var(--color-text) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: sweep-violet 0.9s ease-in-out both;
  animation-delay: 0.4s;
}

.text-violet--late {
  animation-delay: 0.95s;
}

/* Variante du surlignage déclenchée au défilement (et non au chargement) :
   la teinte reste neutre tant que l'élément n'est pas visible à l'écran ;
   "is-visible" (ajoutée en JS via IntersectionObserver lorsque la section
   apparaît au scroll) démarre alors le même balayage violet. */
.text-violet--scroll {
  animation: none;
  background-position: 100% 0;
}

.text-violet--scroll.is-visible {
  animation: sweep-violet 0.9s ease-in-out both;
}

@media (prefers-reduced-motion: reduce) {
  .text-violet,
  .text-violet--late,
  .text-violet--scroll,
  .text-violet--scroll.is-visible {
    animation: none;
    background-position: 0% 0;
  }
}

/* Soulignage progressif des mots importants des paragraphes d'introduction
   (sous les titres) : même principe de "balayage" gauche-à-droite que les
   surlignages ci-dessus (un dégradé animé via background-size), mais en
   trait sous le texte plutôt qu'en couleur des lettres. Démarre une fois les
   surlignages des titres terminés (~1,9 s, cf. délais ci-dessus + leur durée
   de 0,9 s), et chaque mot suivant est légèrement décalé ("--2" à "--5")
   pour souligner les mots les uns après les autres, comme au fil de la
   lecture. */
@keyframes underline-sweep {
  to { background-size: 100% 2px; }
}

.underline-sweep {
  background-image: linear-gradient(var(--color-violet), var(--color-violet));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  padding-bottom: 3px;
  animation: underline-sweep 0.5s ease-out both;
  animation-delay: 2s;
}

.underline-sweep--2 { animation-delay: 2.25s; }
.underline-sweep--3 { animation-delay: 2.5s; }
.underline-sweep--4 { animation-delay: 2.75s; }
.underline-sweep--5 { animation-delay: 3s; }
.underline-sweep--6 { animation-delay: 3.25s; }

@media (prefers-reduced-motion: reduce) {
  .underline-sweep,
  .underline-sweep--2,
  .underline-sweep--3,
  .underline-sweep--4,
  .underline-sweep--5,
  .underline-sweep--6 {
    animation: none;
    background-size: 100% 2px;
  }
}

h2 {
  font-size: 1.8rem;
  text-align: center;
}

section {
  padding: 64px 0;
}

/* Légère animation d'apparition à chaque ouverture de page : reste discrète */
@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: page-enter 0.45s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  main {
    animation: none;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

/* ===== Header ===== */
/* "sticky" : l'en-tête reste visible en haut de l'écran pendant le défilement.
   Le fond semi-transparent + le flou (backdrop-filter) laissent deviner le
   contenu qui défile dessous, et l'ombre lui donne un effet de profondeur. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 8px 24px -10px rgba(31, 36, 48, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav li {
  display: flex;
  align-items: center;
}

/* Petite barre verticale violette discrète entre chaque lien du menu
   (sauf devant le tout premier), pour séparer visuellement les pages. */
.main-nav li:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 2px;
  height: 16px;
  margin: 0 12px;
  background: var(--color-violet);
  opacity: 0.35;
  border-radius: 1px;
}

.main-nav a {
  display: inline-block;
  color: var(--color-text);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: transform 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
  transform: scale(1.08);
}

.main-nav a.active {
  background: var(--color-primary);
  color: #fff;
}

.main-nav a.active:hover {
  color: #fff;
}

/* Logo : icône "digitale" + nom de l'agence, affiché à droite de l'en-tête */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
}

.logo-icon {
  flex-shrink: 0;
  height: 28px;
  width: auto;
  object-fit: contain;
}

/* Texte "Alvarys" colorié avec un dégradé : on applique le dégradé en
   arrière-plan puis on le "découpe" à la forme du texte (background-clip),
   en rendant le texte lui-même transparent pour laisser voir le dégradé. */
.logo-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-blue), var(--color-violet) 55%, var(--color-green));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ===== Hero ===== */
/* Bloc dégradé "carte" : la marge gauche/droite laisse une fine bande de
   fond visible de chaque côté, ce qui fait apparaître les coins arrondis
   au lieu d'une bande pleine largeur. */
.hero {
  background: var(--gradient-soft);
  text-align: center;
  padding: 96px 0;
  margin: 24px 24px 0;
  border-radius: 24px;
}

.hero h1 {
  font-size: 2.4rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 28px;
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* ===== Bandeau de réassurance ===== */
/* Fine bande de garanties juste sous le hero : quelques promesses clés
   listées à l'horizontale (repli à la ligne sur petit écran), pour rassurer
   le visiteur d'un coup d'œil avant qu'il ne poursuive sa lecture. */
.reassurance {
  padding: 28px 0 8px;
}

.reassurance-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 40px;
  list-style: none;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-light);
}

.reassurance-icon {
  margin-right: 6px;
}

/* "Cubes" décoratifs : petits carrés à coins arrondis, en dégradé semi-
   transparent, qui dérivent et tournent en boucle dans les blocs en dégradé
   (hero de l'accueil + en-têtes des autres pages), pour donner une
   impression de mouvement continu, dans l'esprit "digital".
   ::before/::after étant limités à 2 par sélecteur, on en pose aussi sur des
   éléments internes (.container, h1) : comme .hero/.page-header est le plus
   proche ancêtre "position: relative", tous ces pseudo-éléments partagent le
   même repère de positionnement, ce qui donne ici 5 cubes indépendants par
   bloc sans toucher au HTML. "overflow: hidden" + "border-radius" les garde
   dans les coins arrondis. */
.hero,
.page-header {
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after,
.hero .container::before,
.hero .container::after,
.hero h1::before,
.page-header::before,
.page-header::after,
.page-header .container::before,
.page-header .container::after,
.page-header h1::before {
  content: "";
  position: absolute;
  border-radius: 14px;
  pointer-events: none;
}

.hero::before,
.page-header::before {
  width: 64px;
  height: 64px;
  top: 16%;
  left: 9%;
  background: linear-gradient(135deg, rgba(59, 111, 237, 0.26), rgba(124, 92, 255, 0.18));
  animation: float-cube-a 5s ease-in-out infinite;
}

.hero::after,
.page-header::after {
  width: 46px;
  height: 46px;
  bottom: 14%;
  right: 11%;
  background: linear-gradient(135deg, rgba(31, 207, 141, 0.26), rgba(59, 111, 237, 0.16));
  animation: float-cube-b 6s ease-in-out infinite;
}

.hero .container::before,
.page-header .container::before {
  width: 34px;
  height: 34px;
  top: 60%;
  left: 22%;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.24), rgba(31, 207, 141, 0.18));
  animation: float-cube-c 4s ease-in-out infinite;
}

.hero .container::after,
.page-header .container::after {
  width: 40px;
  height: 40px;
  top: 22%;
  right: 24%;
  background: linear-gradient(135deg, rgba(31, 207, 141, 0.22), rgba(124, 92, 255, 0.2));
  animation: float-cube-d 7s ease-in-out infinite;
}

.hero h1::before,
.page-header h1::before {
  width: 26px;
  height: 26px;
  bottom: 26%;
  left: 40%;
  background: linear-gradient(135deg, rgba(59, 111, 237, 0.24), rgba(31, 207, 141, 0.18));
  animation: float-cube-e 5.5s ease-in-out infinite;
}

@keyframes float-cube-a {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%      { transform: translate(50px, -36px) rotate(55deg) scale(1.1); }
}

@keyframes float-cube-b {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%      { transform: translate(-54px, 30px) rotate(-45deg) scale(0.9); }
}

@keyframes float-cube-c {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(34px, 28px) rotate(65deg); }
}

@keyframes float-cube-d {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(-36px, -24px) rotate(-60deg); }
}

@keyframes float-cube-e {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(28px, -20px) rotate(40deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after,
  .hero .container::before,
  .hero .container::after,
  .hero h1::before,
  .page-header::before,
  .page-header::after,
  .page-header .container::before,
  .page-header .container::after,
  .page-header h1::before {
    animation: none;
  }
}

/* ===== Cards ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
  align-items: stretch;
}

/* Variante "3 colonnes fixes" (page Solutions) : impose un agencement
   régulier en 2 rangées de 3 cartes, là où la grille générique ci-dessus
   pourrait afficher 4 colonnes sur grand écran. Les media queries plus bas
   la replient en 2 puis 1 colonne sur tablette/mobile. */
.cards--solutions {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--color-bg);
}

/* Les cartes de la page Solutions gardent la teinte de fond précédente
   (couleur fixe, plutôt que la variable --color-bg) : elles ne suivent donc
   pas le récent éclaircissement appliqué au reste du site. */
.cards--solutions .card {
  background: #eef1f6;
}

/* Cartes "solutions" de l'accueil et de la page Solutions : non cliquables,
   mais réactives au survol (légère mise à l'échelle + ombre portée, pour un
   effet de "relief" qui les fait paraître soulevées). */
.services-overview .card,
.cards--solutions .card,
.contact-info li,
.project-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.services-overview .card:hover,
.cards--solutions .card:hover,
.contact-info li:hover,
.project-card:hover {
  transform: scale(1.03);
  box-shadow: 0 14px 30px rgba(91, 83, 245, 0.14);
}

.card h3 {
  color: var(--color-primary);
  font-size: 1.2rem;
}

/* Vignette d'aperçu d'un site client (page Réalisations) : capture d'écran
   de sa page d'accueil. La carte entière redirige vers le site grâce au
   lien "étiré" .project-card-link superposé à tout l'article. */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.project-card .project-preview {
  display: block;
  position: relative;
  margin: -28px -28px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  aspect-ratio: 16 / 10;
  min-height: 240px;
  background: #eef1f6;
}

.project-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-preview-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 36, 48, 0.78);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.link-more {
  display: block;
  text-align: center;
  margin-top: 32px;
  font-weight: 600;
}

/* ===== Why us ===== */
.why-us {
  background: var(--color-bg-alt);
}

/* Grille en 2 colonnes de 3 lignes : grid-auto-flow: column remplit
   d'abord toute la colonne de gauche (les 3 premiers <li>), puis la
   colonne de droite (les 3 suivants), plutôt que de les alterner. */
.bullet-list {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  column-gap: 48px;
}

.bullet-list li {
  padding: 10px 0 10px 28px;
  position: relative;
}

.bullet-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-green);
  font-weight: 700;
}

/* ===== Étapes du projet ===== */
.process {
  text-align: center;
}

/* Liste numérotée des étapes, présentée en grille (repli automatique sur
   petit écran) ; "list-style: none" masque la numérotation native du <ol>
   au profit du gros numéro violet ci-dessous (les lecteurs d'écran
   continuent d'annoncer la position grâce à la sémantique de liste). */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  max-width: 1040px;
  margin: 32px auto;
  list-style: none;
}

.process-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Numéro mis en avant en violet pour ressortir visuellement de l'étape */
.process-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-violet);
}

.process-title {
  font-weight: 600;
}

.process-steps p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ===== FAQ (accordéon) =====
   Repose sur <details>/<summary> : ouverture/fermeture native au clic et au
   clavier, sans JavaScript, et accessible par défaut pour les lecteurs
   d'écran. On masque juste le triangle natif au profit d'un "+" qui pivote
   en "×" lorsque l'élément est ouvert. */
.faq-list {
  max-width: 760px;
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 18px 24px;
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--color-violet);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin-top: 12px;
  color: var(--color-text-light);
}

@media (prefers-reduced-motion: reduce) {
  .faq-item summary::after {
    transition: none;
  }
}

/* ===== CTA ===== */
.cta {
  text-align: center;
}

.cta p {
  color: var(--color-text-light);
  margin-bottom: 24px;
}

/* ===== Generic page sections ===== */
/* En-tête des pages secondaires : même technique de "carte" arrondie
   que le hero de l'accueil, avec un dégradé identique pour la cohérence. */
.page-header {
  background: var(--gradient-soft);
  text-align: center;
  padding: 64px 0;
  margin: 24px 24px 0;
  border-radius: 24px;
}

.page-header p {
  color: var(--color-text-light);
  max-width: 640px;
  margin: 0 auto;
}

.contact-form-intro {
  max-width: 560px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--color-text-light);
}

/* ===== Contact form ===== */
.contact-form {
  max-width: 560px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

/* Coordonnées présentées sous forme de petites cartes (icône + libellé en
   violet + valeur), alignées avec le style des cartes du reste du site. */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto 40px;
  list-style: none;
  text-align: left;
}

.contact-info li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

.contact-info-icon {
  font-size: 1.3rem;
}

.contact-info-label {
  font-weight: 600;
  color: var(--color-violet);
}

.contact-info a {
  color: var(--color-text);
  text-decoration: none;
}

.contact-info a:hover,
.contact-info a:focus-visible {
  color: var(--color-violet);
  text-decoration: underline;
}

.contact-info-note {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* Champ piège anti-spam, masqué visuellement mais lisible par les robots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-feedback {
  max-width: 560px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
}

.form-feedback--success {
  background: rgba(31, 207, 141, 0.12);
  color: #0e9468;
  border: 1px solid rgba(31, 207, 141, 0.4);
}

.form-feedback--error {
  background: rgba(91, 83, 245, 0.1);
  color: var(--color-primary-dark);
  border: 1px solid rgba(91, 83, 245, 0.35);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  background: rgba(255, 255, 255, 0.85);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.footer-nav a {
  color: var(--color-text-light);
}

/* ===== Responsive ===== */
/* Sur tablette, la grille "3 colonnes fixes" de la page Solutions repasse à
   2 colonnes (3 cartes ne tiendraient plus confortablement côte à côte). */
@media (max-width: 860px) {
  .cards--solutions {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Ajustements pour les petits écrans (mobiles) : en-tête empilé, menu
   centré, titres réduits et liste "Pourquoi nous choisir" sur une seule
   colonne pour rester lisible sans trop défiler horizontalement. */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }

  .main-nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .bullet-list {
    grid-template-rows: none;
    grid-auto-flow: row;
  }

  .cards--solutions {
    grid-template-columns: 1fr;
  }
}
