/* ==========================================================
   POLYSTUDIO — feuille de style unique
   Toutes les couleurs, typos et espacements sont réglés ici.
   ========================================================== */

/* ---------- 1. Variables de marque ---------- */
:root {
  --creme: #F2E6CE;
  --creme-fonce: #E8D8B8;   /* fond de cartes / placeholders */
  --terracotta: #B8461F;
  --vert: #1F3D2E;
  --moutarde: #D4A24C;
  --encre: #1F3D2E;         /* couleur du texte principal */

  --font-titre: "Arvo", Georgia, serif;
  --font-texte: "Space Mono", ui-monospace, monospace;

  --largeur: 1180px;        /* largeur max du contenu */
  --gouttiere: clamp(16px, 5vw, 64px);
  --rayon: 20px;
  --section: clamp(64px, 10vw, 128px); /* espace vertical des sections */

  /* Couleurs selon le thème (mode clair par défaut) */
  --fond: var(--creme);
  --fond-2: var(--creme-fonce);
  --texte: var(--vert);
  --texte-doux: rgba(31, 61, 46, .6);
  --accent: var(--terracotta);
  --ligne: var(--vert);
  --ligne-douce: rgba(31, 61, 46, .15);
  --ligne-moyenne: rgba(31, 61, 46, .25);
  --champ-fond: rgba(255, 255, 255, .35);
  --champ-fond-focus: rgba(255, 255, 255, .6);
  --bloc-fonce: var(--vert);
  color-scheme: light;
}

/* Mode sombre : activé par le bouton (data-theme="dark" sur <html>) */
:root[data-theme="dark"] {
  --fond: #13241B;
  --fond-2: #1C3328;
  --texte: #F2E6CE;
  --texte-doux: rgba(242, 230, 206, .6);
  --accent: #E07A50;
  --ligne: #E8D8B8;
  --ligne-douce: rgba(242, 230, 206, .15);
  --ligne-moyenne: rgba(242, 230, 206, .25);
  --champ-fond: rgba(255, 255, 255, .05);
  --champ-fond-focus: rgba(255, 255, 255, .1);
  --bloc-fonce: #0C1812;
  color-scheme: dark;
}
:root[data-theme="dark"] .pastille[data-cat="Son"] { box-shadow: inset 0 0 0 1.5px var(--ligne); }
:root[data-theme="dark"] .champ select option { background: var(--fond); color: var(--texte); }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--font-texte);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* léger grain rétro par-dessus tout le site */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-titre);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; max-width: 62ch; }

.accent { color: var(--accent); }

.conteneur {
  width: 100%;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin: 0 auto;
  padding: 0 var(--gouttiere);
}

.section { padding: var(--section) 0; }

.surtitre {
  display: inline-block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 1rem;
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--moutarde);
  outline-offset: 3px;
}

/* ---------- 3. Boutons ---------- */
/* Un seul bouton principal sur tout le site : "Parlons de votre projet" */
.bouton {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: 1em 1.6em;
  min-height: 48px;
  background: var(--moutarde);
  color: var(--vert);
  font-family: var(--font-texte);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  border: 2px solid var(--ligne);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ligne);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
.bouton:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ligne); }
.bouton:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ligne); }

/* lien secondaire discret */
.lien {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--moutarde);
  padding-bottom: 2px;
}
.lien:hover { border-color: currentColor; }

/* ---------- 4. En-tête ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--fond);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.entete.defile { border-color: var(--ligne-douce); }

.entete .conteneur {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  height: 80px;
}
.entete .logo { margin-right: auto; }

/* Bouton mode clair / sombre */
.theme-bouton {
  order: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--texte);
  border: 1.5px solid var(--ligne);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.theme-bouton:hover { background: rgba(212, 162, 76, .25); transform: rotate(-12deg); }
.theme-bouton svg { width: 18px; height: 18px; }
.icone-lune { fill: currentColor; }
.icone-soleil { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icone-soleil circle { fill: currentColor; stroke: none; }
.icone-soleil, :root[data-theme="dark"] .icone-lune { display: none; }
:root[data-theme="dark"] .icone-soleil { display: block; }

.logo {
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: 1.6rem;
  text-decoration: none;
  letter-spacing: -.01em;
  color: var(--texte);
}
.logo span { color: var(--accent); }

.nav ul {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  text-decoration: none;
  text-transform: uppercase;
  font-size: .85rem;
  letter-spacing: .08em;
  padding: .4em 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-color: var(--moutarde); }
.nav a[aria-current="page"] { border-color: var(--accent); color: var(--accent); }

.burger {
  display: none;
  background: none;
  border: 0;
  width: 48px;
  height: 48px;
  margin-right: -12px;
  cursor: pointer;
  color: var(--texte);
}
.burger span, .burger span::before, .burger span::after {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 0 auto;
  position: relative;
  transition: transform .2s, background .2s;
}
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -7px; }
.burger span::after { top: 7px; }
.menu-ouvert .burger span { background: transparent; }
.menu-ouvert .burger span::before { transform: translateY(7px) rotate(45deg); }
.menu-ouvert .burger span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .burger { display: block; order: 3; }
  .entete .conteneur { gap: .8rem; }
  .nav {
    position: fixed;
    inset: 80px 0 0 0;
    background: var(--fond);
    padding: 2rem var(--gouttiere);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .25s ease, visibility .25s;
  }
  .menu-ouvert .nav { transform: none; visibility: visible; }
  .menu-ouvert { overflow: hidden; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a {
    display: block;
    font-family: var(--font-titre);
    font-weight: 700;
    text-transform: none;
    font-size: 2rem;
    letter-spacing: 0;
    padding: .5em 0;
    border-bottom: 1px solid var(--ligne-douce);
  }
}

/* ---------- 5. Hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 var(--section); }
.hero .conteneur {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-texte p { font-size: 1.05rem; }
.hero-competences {
  font-size: .9rem;
  letter-spacing: .04em;
  margin: 1.2rem 0 2.2rem;
}
.hero-competences span { color: var(--accent); }

.visuel {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--fond-2);
  border: 2px solid var(--ligne);
}
.visuel img, .visuel video, .visuel iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}
.visuel--portrait { aspect-ratio: 4 / 5; }
.visuel--video { aspect-ratio: 16 / 9; }

/* Emplacement à remplacer par une vraie image */
.a-remplacer {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--texte-doux);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(31,61,46,.05) 14px 28px);
}

@media (max-width: 860px) {
  .hero .conteneur { grid-template-columns: 1fr; }
  .hero .visuel { order: -1; }
}

/* ---------- 6. Bandeau projet à la une ---------- */
.une-entete {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.une-entete h2 { margin: 0; }
.une-legende {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  margin-top: 1.2rem;
  font-size: .9rem;
}
.une-legende strong { font-family: var(--font-titre); }

/* ---------- 7. Section terracotta ---------- */
.bloc-terracotta {
  background: var(--terracotta);
  color: var(--creme);
}
.bloc-terracotta .surtitre { color: var(--moutarde); }
/* crème sur terracotta : on grossit le texte pour la lisibilité */
.bloc-terracotta p { font-size: 1.05rem; line-height: 1.7; }
.bloc-terracotta .lien { border-color: var(--moutarde); }

.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
@media (max-width: 860px) {
  .deux-colonnes { grid-template-columns: 1fr; }
}

/* ---------- 8. Compétences (fond crème, moutarde en accent) ---------- */
.competences-liste {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-top: 2px solid var(--ligne);
}
.competence {
  display: grid;
  grid-template-columns: 4rem 1fr 1.4fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--ligne-moyenne);
  transition: background .2s, padding .2s;
}
.competence:hover { background: rgba(212, 162, 76, .18); padding-left: 1rem; }
.competence-num { font-size: .85rem; color: var(--accent); }
.competence h3 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.competence p { margin: 0; font-size: .95rem; }
@media (max-width: 700px) {
  .competence { grid-template-columns: 2.5rem 1fr; }
  .competence p { grid-column: 2; }
}

/* ---------- 9. Étapes ("Comment ça se passe") ---------- */
.etapes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 2.5rem 0 0;
  counter-reset: etape;
}
.etape {
  padding: 1.6rem;
  border: 2px solid var(--ligne);
  border-radius: var(--rayon);
  background: var(--fond);
  counter-increment: etape;
}
.etape::before {
  content: "0" counter(etape);
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--moutarde);
  font-weight: 700;
  font-size: .85rem;
}
.etape h3 { font-size: 1.2rem; }
.etape p { font-size: .9rem; margin: 0; }
@media (max-width: 960px) { .etapes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .etapes { grid-template-columns: 1fr; } }

/* ---------- 10. Projets ---------- */
.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 2rem 0 2.5rem;
}
.filtre {
  font-family: var(--font-texte);
  font-size: .85rem;
  padding: .55em 1.2em;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--ligne);
  background: transparent;
  color: var(--texte);
  cursor: pointer;
}
.filtre:hover { background: rgba(212, 162, 76, .25); }
.filtre[aria-pressed="true"] { background: var(--texte); color: var(--fond); }

.grille-projets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 2rem;
}
@media (max-width: 760px) { .grille-projets { grid-template-columns: 1fr; } }

.carte-projet .visuel { aspect-ratio: 16 / 10; }
.carte-projet-infos {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-top: 1rem;
}
.carte-projet h3 { margin: 0 0 .3rem; font-size: 1.3rem; }
.carte-projet-client { font-size: .85rem; opacity: .8; margin: 0; }
.carte-projet-contexte { font-size: .9rem; margin: .8rem 0 0; }

.pastille {
  flex-shrink: 0;
  font-size: .75rem;
  padding: .3em .9em;
  border-radius: 999px;
  background: var(--moutarde);
  color: var(--vert);
  white-space: nowrap;
}
.pastille[data-cat="Photo"] { background: var(--terracotta); color: var(--creme); }
.pastille[data-cat="Son"] { background: var(--vert); color: var(--creme); }
.pastille[data-cat="Web"] { background: var(--creme-fonce); }
.pastille[data-cat="Communication"] { background: transparent; border: 1.5px solid var(--ligne); color: var(--texte); }

/* cartes cliquables (projets avec un lien) */
.carte-lien { display: block; text-decoration: none; color: inherit; }
/* Un élément masqué (filtres) reste masqué, même s’il a un display défini */
[hidden] { display: none !important; }
.carte-lien .visuel img { transition: transform .4s ease; }
.carte-lien:hover .visuel img { transform: scale(1.04); }
.carte-lien:hover h3, .carte-lien:hover .une-legende strong { color: var(--accent); }
.voir-projet {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  padding: .5em 1em;
  border-radius: 999px;
  background: var(--moutarde);
  border: 2px solid var(--vert);
  color: var(--vert);
  font-size: .8rem;
  font-weight: 700;
  transition: transform .2s;
}
.carte-lien:hover .voir-projet { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--vert); }

/* bouton lecture sur les vignettes vidéo */
.lecture {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  cursor: pointer;
  width: 100%;
}
.lecture::after {
  content: "";
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--moutarde) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%231F3D2E'/%3E%3C/svg%3E") center / 32px no-repeat;
  border: 2px solid var(--vert);
  transition: transform .2s;
}
.lecture:hover::after { transform: scale(1.08); }

.vide { opacity: .7; }

/* ---------- 11. Page Studio ---------- */
.faits {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
}
.faits li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  font-size: 1rem;
}
.faits li::before { content: "→"; color: var(--moutarde); font-weight: 700; }

.citation {
  font-family: var(--font-titre);
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.3;
  max-width: 28ch;
  margin: 0;
}

/* ---------- 12. Contact ---------- */
.formulaire {
  display: grid;
  gap: 1.2rem;
}
.champ { display: grid; gap: .4rem; }
.champ label { font-weight: 700; font-size: .9rem; }
.champ input, .champ textarea, .champ select {
  font: inherit;
  color: var(--texte);
  background: var(--champ-fond);
  border: 2px solid var(--ligne);
  border-radius: 12px;
  padding: .9em 1em;
  min-height: 48px;
}
.champ textarea { min-height: 160px; resize: vertical; }
.champ input:focus, .champ textarea:focus, .champ select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--champ-fond-focus);
}
.deux-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 560px) { .deux-champs { grid-template-columns: 1fr; } }

.coordonnees {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  gap: 1.4rem;
}
.coordonnees span {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
}
.coordonnees a { font-size: 1.1rem; font-weight: 700; text-decoration: none; }
.coordonnees a:hover { text-decoration: underline; }

/* ---------- 13. Appel final (vert) ---------- */
.bloc-vert {
  background: var(--bloc-fonce);
  color: var(--creme);
}
.bloc-vert .conteneur {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.bloc-vert h2 { margin-bottom: .3em; }
.bloc-vert p { margin: 0; }
.bloc-vert .bouton { box-shadow: 4px 4px 0 var(--creme); border-color: var(--creme); }
.bloc-vert .bouton:hover { box-shadow: 6px 6px 0 var(--creme); }

/* ---------- 14. Pied de page ---------- */
.pied {
  padding: 4rem 0 2rem;
  font-size: .85rem;
}
.pied .conteneur {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.pied ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.pied a { text-decoration: none; }
.pied a:hover { text-decoration: underline; }
.pied-titre {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.pied-bas {
  grid-column: 1 / -1;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--ligne-douce);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  opacity: .75;
}
@media (max-width: 700px) {
  .pied .conteneur { grid-template-columns: 1fr 1fr; }
  .pied .conteneur > :first-child { grid-column: 1 / -1; }
}

/* ---------- 15. Apparition douce au défilement ---------- */
.apparait { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.apparait.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .apparait { opacity: 1; transform: none; }
}

/* évite que les longs mots (adresse mail) élargissent la page sur mobile */
.deux-colonnes > *, .hero .conteneur > *, .formulaire > *, .champ > * { min-width: 0; }
.champ select { width: 100%; }
.coordonnees a, .pied a { overflow-wrap: anywhere; }
