/* ==========================================================================
   Sahara Creative World — feuille de style principale
   Palette échantillonnée depuis le logo (contrastes vérifiés WCAG 2.2 AA) :
   - or vif   #D4A94C : réservé aux fonds sombres (8.6:1 sur #111111)
   - or foncé #7D6017 : accents sur fonds clairs (5.5:1 sur #FAF7F2)
   ========================================================================== */

:root {
  --noir: #111111;
  --noir-doux: #1E1B14;
  --creme: #FAF7F2;
  --blanc: #FFFFFF;
  --or-vif: #D4A94C;      /* uniquement sur fonds sombres */
  --or-clair: #E3C06A;    /* survols sur fonds sombres */
  --or-fonce: #7D6017;    /* uniquement sur fonds clairs */
  --gris-texte: #54503F;
  --police-titres: "Syne", Georgia, serif;
  --police-texte: "Instrument Sans", Arial, sans-serif;
  --largeur-max: 72rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--creme);
  color: var(--noir-doux);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

h1, h2, h3 {
  font-family: var(--police-titres);
  line-height: 1.12;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

/* Les ancres de section ne doivent jamais être masquées par la barre
   de navigation collante (WCAG 2.4.11 — focus non obscurci). */
section, [id] { scroll-margin-top: 6rem; }

/* Masqué visuellement mais annoncé par les lecteurs d'écran */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Lien d'évitement ---------- */

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.9rem 1.4rem;
  background: var(--or-vif);
  color: var(--noir);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Focus visible partout ---------- */

:focus-visible {
  outline: 3px solid var(--or-fonce);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-header :focus-visible,
.hero :focus-visible,
.tile-photo :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--or-vif);
}

/* ---------- Barre de navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--noir);
}

.site-header.est-defilee {
  background: rgba(17, 17, 17, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-nav {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-brand { display: inline-flex; }

.nav-brand img {
  border-radius: 6px;
}

/* Sélecteur de langue : masqué sans JS (il serait inopérant) */
.lang-toggle { display: none; }

html.js .lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--or-vif);
  border: 2px solid var(--or-vif);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-toggle:hover {
  background: var(--or-vif);
  color: var(--noir);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-block;
  position: relative;
  padding: 0.75rem 0.9rem;
  color: var(--creme);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.45rem;
  height: 2px;
  background: var(--or-vif);
  transform: scaleX(0);
  transform-origin: left;
}

.nav-links a:hover { color: var(--or-clair); }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { transform: scaleX(1); }

/* Sans JS : pas de sélecteur de langue, les liens se calent à droite */
html:not(.js) .nav-links { margin-left: auto; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--creme);
  border: 2px solid var(--or-vif);
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--or-vif);
}

.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

/* ---------- Héros ---------- */

.hero {
  /* Photo décorative en arrière-plan CSS (ignorée par les lecteurs d'écran),
     recouverte d'un voile sombre garantissant le contraste du texte. */
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.86) 0%, rgba(17, 17, 17, 0.84) 55%, rgba(17, 17, 17, 0.92) 100%),
    url("assets/images/regie-live-projecteurs.jpg") center 30% / cover no-repeat;
  /* Couche de fond opaque sous l'image : (1) le texte reste lisible si la
     photo ne charge pas ; (2) les vérificateurs automatiques de contraste,
     incapables de composer une background-image, calculent contre cette
     couleur au lieu de remonter au fond clair de la page. */
  background-color: var(--noir);
  color: var(--blanc);
  padding: clamp(2.5rem, 6vh, 4rem) 1.25rem clamp(5rem, 13vh, 8rem);
}

/* Jumbotron centré : le lockup complet trône en haut du héros,
   le texte s'aligne au centre sous lui. */
.hero-inner {
  max-width: var(--largeur-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-logo {
  width: 100%;
  max-width: min(40rem, 90%);
  height: auto;
  margin-bottom: clamp(1.75rem, 4.5vh, 3rem);
  filter: drop-shadow(0 14px 38px rgba(0, 0, 0, 0.55));
}

/* Pastille pleine : le contraste du texte est calculé sur ce fond opaque
   (8.6:1), plus aucune dépendance à la photo derrière (WCAG 1.4.3). */
.hero-kicker {
  display: inline-block;
  background: var(--noir);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  color: var(--or-vif);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  /* « PRODUIRE. » (9 glyphes Syne ExtraBold ≈ 1.08 em chacun) doit tenir
     sur une seule ligne jusqu'à 320 px de large. */
  font-size: clamp(1.8rem, 5.5vw + 0.3rem, 5rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.hero-line { display: block; }
.hero-line-gold { color: var(--or-vif); }

.hero-desc {
  max-width: 34em;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: #E9E4DA;
  margin: 0 auto 2.2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  min-height: 44px;
  padding: 0.85rem 1.7rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}

.btn-gold {
  background: var(--or-vif);
  border-color: var(--or-vif);
  color: var(--noir);
}

.btn-gold:hover {
  background: var(--or-clair);
  border-color: var(--or-clair);
}

.btn-outline {
  background: transparent;
  border-color: var(--creme);
  color: var(--blanc);
}

.btn-outline:hover {
  border-color: var(--or-vif);
  color: var(--or-vif);
}

/* ---------- Sections génériques ---------- */

/* Graisse 500 (pas 600+) : un <p> gras en capitales devant un titre
   déclenche l'heuristique « paragraphe utilisé comme titre » d'axe. */
.section-kicker {
  color: var(--or-fonce);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}

.section-head {
  max-width: var(--largeur-max);
  margin: 0 auto 2.5rem;
}

.section-head h2,
.apropos h2,
.contact h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
}

.section-head-dark .section-kicker { color: var(--or-vif); }

.section-sub { color: inherit; max-width: 40em; }

/* ---------- Services : grille bento ---------- */

.services {
  padding: clamp(3.5rem, 9vh, 6.5rem) 1.25rem;
}

.bento {
  max-width: var(--largeur-max);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(15rem, auto);
}

.tile { border-radius: 12px; overflow: hidden; position: relative; }

/* Disposition asymétrique (3 tuiles) :
   [ audiovisuel 4×2 ][ or (tech) 2×1 ]
   [                  ][ marketing 2×1 ] */
.tile-audiovisuel { grid-column: span 4; grid-row: span 2; }
.tile-gold        { grid-column: span 2; }
.tile-mkt         { grid-column: span 2; }

.tile-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 1.6rem;
}

.tile h3 {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  margin-bottom: 0.4rem;
}

.tile p { margin: 0; max-width: 46em; }

/* Tuiles photo : image décorative en CSS + voile sombre pour le contraste.
   Le voile reste ≥ 84 % d'opacité sur toute la tuile : même sur un pixel
   d'image blanc pur, le fond composite reste ≤ #373737, ce qui garantit
   4.5:1 pour l'or #D4A94C (5.4:1) et le blanc (12:1) où que soit le texte. */
.tile-photo { background: var(--noir); color: var(--blanc); }

.tile-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  z-index: 0;
}

.tile-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,17,17,0.84) 0%, rgba(17,17,17,0.92) 100%);
  z-index: 1;
}

.tile-audiovisuel::before { background-image: url("assets/images/plateau-tournage.jpg"); }
.tile-mkt::before         { background-image: url("assets/images/studio-photo.jpg"); }

.tile-photo h3 { color: var(--or-vif); }

.tile-gold {
  background: var(--or-vif);
  color: var(--noir);
}

.tile-gold h3 { color: var(--noir); }

/* ---------- À propos ---------- */

.apropos {
  background: var(--blanc);
  border-top: 4px solid var(--noir);
  padding: clamp(3.5rem, 9vh, 6.5rem) 1.25rem;
}

.apropos-grid {
  max-width: var(--largeur-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

/* DÉCISION TYPOGRAPHIQUE (audit axe « p ressemble à un titre ») :
   dans cette section, SEUL #apropos-titre est un titre. Le kicker est un
   libellé (petit, 500) et les trois paragraphes sont du corps de texte —
   cette règle épingle leur style pour empêcher toute dérive future. */
.apropos-text > p:not(.section-kicker) {
  font-size: 1.0625rem;
  font-weight: 400;
}

.apropos-media img {
  border-radius: 12px;
  border-bottom: 6px solid var(--or-fonce);
}

/* ---------- Clients / références ---------- */

.clients {
  /* Fond blanc : les logos clients à fond blanc s'y fondent sans détourage */
  background: var(--blanc);
  border-top: 4px solid var(--noir);
  padding: clamp(3rem, 8vh, 5.5rem) 1.25rem;
}

.clients-inner {
  max-width: var(--largeur-max);
  margin: 0 auto;
}

.clients-liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.clients-liste img {
  height: clamp(6rem, 10vw, 7.5rem);
  width: auto;
  /* Les logos livrés sur fond sombre deviennent des vignettes arrondies ;
     ceux sur fond blanc se fondent dans la bande. */
  border-radius: 10px;
}

/* ---------- Contact ---------- */

.contact {
  padding: clamp(3.5rem, 9vh, 6.5rem) 1.25rem;
}

.contact-grid {
  max-width: var(--largeur-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

.contact-form {
  background: var(--blanc);
  border: 1px solid #E2DCCE;
  border-top: 5px solid var(--or-fonce);
  border-radius: 12px;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.form-hint { color: var(--gris-texte); font-size: 0.95rem; }

.form-field { margin-bottom: 1.2rem; }

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  font: inherit;
  color: var(--noir-doux);
  background: var(--creme);
  border: 2px solid #8A8471;
  border-radius: 6px;
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 3px solid var(--or-fonce);
  outline-offset: 1px;
}

/* Indicatif pays + numéro : l'indicatif garde une largeur fixe,
   le numéro prend le reste ; passage sur deux lignes si trop étroit */
.tel-groupe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tel-groupe select {
  flex: 0 1 11rem;
  min-width: 8rem;
}

.tel-groupe input {
  flex: 1 1 9rem;
  min-width: 0;
}

/* Erreurs : signalées par le texte ET un repère visuel non chromatique
   (préfixe « Erreur : » ajouté par script.js), pas seulement la couleur. */
.form-field.a-erreur input,
.form-field.a-erreur textarea {
  border-color: #8F2B10;
  border-style: dashed;
}

.form-error {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #8F2B10; /* 7.4:1 sur blanc */
}

.form-error:empty { display: none; }

/* Sur fond clair, la limite du bouton doit contraster à 3:1 (WCAG 1.4.11) */
.btn-submit {
  width: 100%;
  border-color: var(--or-fonce);
}

.form-status {
  margin: 1rem 0 0;
  font-weight: 600;
  color: #245B26; /* 8.1:1 sur blanc */
}

/* L'échec d'envoi est annoncé par le texte (« Erreur : … »), la couleur
   n'est qu'un renfort (WCAG 1.4.1) */
.form-status.est-erreur { color: #8F2B10; }

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-status:empty { margin: 0; }

/* ---------- Pied de page ---------- */

.site-footer {
  background: var(--noir);
  color: #D8D2C4;
  padding: 3.5rem 1.25rem 1.5rem;
  border-top: 5px solid var(--or-vif);
}

.footer-grid {
  max-width: var(--largeur-max);
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 2rem;
}

.footer-brand img { border-radius: 8px; }
.footer-brand p { margin-top: 1rem; }

.site-footer h2 {
  font-size: 1.05rem;
  color: var(--or-vif);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.site-footer address { font-style: normal; line-height: 1.9; }

.site-footer a { color: var(--or-vif); text-decoration-thickness: 1px; }
.site-footer a:hover { color: var(--or-clair); }

.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { display: inline-block; padding: 0.35rem 0; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

.footer-legal {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid #35301F;
  font-size: 0.9rem;
  color: #B7B1A2;
}

/* ---------- Liens dans le corps de page (fonds clairs) ---------- */

main a:not(.btn) { color: var(--or-fonce); }

/* ==========================================================================
   ANIMATIONS — uniquement si JS est actif ET si l'utilisateur n'a pas
   demandé la réduction des animations. Sans JS ou avec
   prefers-reduced-motion: reduce, tout le contenu est visible immédiatement.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  html.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  html.js .reveal.est-visible {
    opacity: 1;
    transform: none;
  }

  .nav-links a::after { transition: transform 0.25s ease; }
  .nav-links a { transition: color 0.2s ease; }
  .btn { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }

  .tile-photo::before { transition: transform 0.5s ease; }
  .tile-photo:hover::before { transform: scale(1.05); }

  /* Entrée douce du lockup au chargement (une seule fois, < 1 s) */
  html.js .hero-logo {
    animation: hero-logo-entree 0.8s ease both;
  }

  @keyframes hero-logo-entree {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Écrans étroits / reflow 400 % (WCAG 1.4.10) ---------- */

@media (max-width: 47.99rem) {

  .nav-toggle { display: inline-flex; }

  /* Sans JS, le bouton Menu serait inopérant : liens affichés en permanence */
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-links { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-bottom: 0.5rem;
  }

  .nav-links.est-ouvert { display: flex; }

  .nav-links a { display: block; padding: 0.85rem 0.5rem; }
  .nav-links a::after { left: 0.5rem; right: auto; width: 3rem; }

  .bento { grid-template-columns: 1fr; }

  .tile-audiovisuel, .tile-gold, .tile-mkt {
    grid-column: auto;
    grid-row: auto;
  }

  .tile { min-height: 14rem; }

  .apropos-grid, .contact-grid { grid-template-columns: 1fr; }

  .hero-logo {
    max-width: min(84vw, 20rem);
    margin-bottom: 1.75rem;
  }

  .hero-actions .btn { width: 100%; text-align: center; }
}
