/* Kimia Snack — feuille de style
   Couleurs et typographies : voir la charte graphique */

@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --chocolat: #59322B;
  --framboise: #D54751;
  --creme: #FFFCC7;
  --abricot: #EF9A48;
  --menthe: #4DA394;
  --blanc: #FFFFFF;
  --creme-fonce: #F5EFB0;
  --framboise-fonce: #B83A44; /* framboise assombrie pour les petits textes crème */

  --font-titre: "Fredoka", "Arial Rounded MT Bold", Arial, sans-serif;
  --font-texte: "Rubik", Arial, sans-serif;

  --largeur: 1120px;
  --rayon: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--creme);
  color: var(--chocolat);
  font-family: var(--font-texte);
  font-size: 18px;
  line-height: 1.6;
}

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

a { color: var(--framboise); }
a:hover { color: var(--chocolat); }

:focus-visible { outline: 3px solid var(--chocolat); outline-offset: 3px; border-radius: 6px; }

.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 24px; }

.lien-evitement {
  position: absolute; left: -9999px; top: 8px;
  background: var(--chocolat); color: var(--creme); padding: 10px 16px; border-radius: 8px; z-index: 10;
}
.lien-evitement:focus { left: 8px; }

/* ---------- Logo ---------- */
.logo {
  display: inline-flex; align-items: baseline; gap: 0.25em;
  font-family: var(--font-titre); font-weight: 700; font-size: 32px; line-height: 1;
  letter-spacing: -0.02em; text-decoration: none;
}
.logo .kimia { color: var(--chocolat); }
.logo .snack { color: var(--framboise); }
.logo .point {
  width: 0.24em; height: 0.24em; border-radius: 50%;
  background: var(--abricot); display: inline-block; margin-left: -0.12em;
}
.logo:hover .kimia { color: var(--chocolat); }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 40; padding: 24px 0; background: var(--creme);
  transition: padding 0.25s ease, box-shadow 0.25s ease;
}
.entete.defile { padding: 12px 0; box-shadow: 0 3px 0 var(--chocolat); }
main [id] { scroll-margin-top: 84px; }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.nav a { color: var(--chocolat); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--framboise); }
.nav .lien-secondaire { position: relative; transition: color 0.2s ease; }
.nav .lien-secondaire::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; border-radius: 3px;
  background: var(--framboise); transform: scaleX(0); transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav .lien-secondaire:hover::after,
.nav .lien-secondaire.actif::after { transform: scaleX(1); transform-origin: left; }
.nav .lien-secondaire.actif { color: var(--framboise); }
.logo:hover .point { animation: rebond 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 28px; border-radius: 999px;
  font-family: var(--font-titre); font-weight: 700; font-size: 19px;
  text-decoration: none; border: 3px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.bouton:hover { transform: translateY(-2px); }
.bouton-principal { background: var(--framboise); color: var(--creme); }
.bouton-principal:hover { background: var(--chocolat); color: var(--creme); }
.bouton-secondaire { background: transparent; color: var(--chocolat); border-color: var(--chocolat); }
.bouton-secondaire:hover { background: var(--chocolat); color: var(--creme); }
.nav .bouton { min-height: 44px; padding: 8px 20px; font-size: 17px; }
.nav .bouton-principal { color: var(--creme); }
.nav .bouton-principal:hover { color: var(--creme); }

/* ---------- Héros ---------- */
.heros { padding: 48px 0 96px; }
.heros .conteneur {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px; align-items: center;
}
.etiquette {
  display: inline-block; background: var(--blanc); border: 2px solid var(--chocolat);
  border-radius: 999px; padding: 6px 16px; font-weight: 500; font-size: 15px; letter-spacing: 0.04em;
}
h1, h2, h3 { font-family: var(--font-titre); line-height: 1.08; margin: 0; }
h1 { font-weight: 700; font-size: clamp(40px, 6vw, 68px); letter-spacing: -0.01em; margin: 20px 0 24px; }
h1 .accent { color: var(--framboise); }
.heros p.intro { font-size: 20px; max-width: 560px; margin: 0 0 36px; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Illustration de distributeur (décorative) */
.machine {
  justify-self: center; width: 100%; max-width: 340px; aspect-ratio: 3 / 4.6;
  background: var(--chocolat); border-radius: 32px; padding: 22px;
  display: grid; grid-template-columns: 1fr 76px; gap: 16px;
  box-shadow: 14px 14px 0 var(--menthe);
}
.vitrine {
  background: var(--creme); border-radius: 18px; padding: 14px;
  display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px;
}
.rangee { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-bottom: 4px solid var(--creme-fonce); padding-bottom: 6px; }
.produit { border-radius: 8px; align-self: end; }
.p1 { background: var(--framboise); height: 78%; }
.p2 { background: var(--abricot); height: 62%; border-radius: 50% 50% 8px 8px; }
.p3 { background: var(--menthe); height: 88%; }
.panneau { display: flex; flex-direction: column; gap: 12px; }
.ecran { background: var(--menthe); border-radius: 10px; height: 54px; }
.clavier { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.clavier span { background: var(--creme); opacity: 0.85; border-radius: 6px; height: 16px; }
.carte { background: var(--abricot); border-radius: 10px; height: 46px; margin-top: 8px; }
.trappe { margin-top: auto; background: #3F231E; border-radius: 10px; height: 64px; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.section-blanche { background: var(--blanc); }
.section-chocolat { background: var(--chocolat); color: var(--creme); }
.surtitre { font-weight: 500; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 12px; }
h2 { font-weight: 700; font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 20px; }
.chapo { font-size: 20px; max-width: 680px; margin: 0 0 56px; }

/* Avantages */
.grille-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.carte-avantage {
  background: var(--blanc); border: 2px solid var(--chocolat); border-radius: var(--rayon); padding: 32px 26px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 6px 6px 0 var(--chocolat);
}
.icone {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: var(--chocolat);
}
.icone svg { width: 28px; height: 28px; }
.icone-framboise { background: var(--framboise); color: var(--creme); }
.icone-abricot { background: var(--abricot); }
.icone-menthe { background: var(--menthe); }
.icone-chocolat { background: var(--chocolat); color: var(--creme); }
.carte-avantage { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.carte-avantage:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--chocolat); }
.carte-avantage h3 { font-weight: 600; font-size: 23px; }
.carte-avantage p { margin: 0; font-size: 17px; }

/* Étapes */
.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: etape; list-style: none; padding: 0; margin: 0; }
.etape { position: relative; padding-top: 88px; }
.etape::before {
  counter-increment: etape; content: counter(etape);
  position: absolute; top: 0; left: 0; width: 64px; height: 64px; border-radius: 50%;
  background: var(--framboise); color: var(--creme);
  font-family: var(--font-titre); font-weight: 700; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
}
.etape h3 { font-weight: 600; font-size: 26px; margin-bottom: 10px; }
.etape p { margin: 0; }

/* Lieux */
.lieux { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; margin: 0; }
.lieux li {
  background: var(--creme); color: var(--chocolat); border-radius: 999px;
  padding: 12px 24px; font-family: var(--font-titre); font-weight: 600; font-size: 20px;
}
.section-chocolat .surtitre { color: var(--abricot); }

/* À propos + contact */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: start; }
.bloc-contact {
  background: var(--framboise-fonce); color: var(--creme); border-radius: 32px; padding: 48px;
  display: flex; flex-direction: column; gap: 20px;
}
.bloc-contact h2 { margin: 0; }
.bloc-contact p { margin: 0; font-size: 19px; }
.bloc-contact .email {
  font-family: var(--font-titre); font-weight: 700; font-size: clamp(22px, 3vw, 32px);
  color: var(--creme); text-decoration: underline; text-underline-offset: 6px; word-break: break-word;
}
.bloc-contact .email:hover { color: var(--chocolat); }
.bloc-contact .telephone {
  font-family: var(--font-titre); font-weight: 600; font-size: clamp(20px, 2.4vw, 26px);
  color: var(--creme); text-decoration: underline; text-underline-offset: 6px; white-space: nowrap;
}
.bloc-contact .telephone:hover { color: var(--chocolat); }
.bloc-contact .zone { font-weight: 500; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.faq details { background: var(--blanc); border: 2px solid var(--chocolat); border-radius: 18px; padding: 0 24px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative;
  font-family: var(--font-titre); font-weight: 600; font-size: 21px; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 30px; color: var(--framboise);
}
.faq summary::after { transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1); }
.faq details[open]:not(.fermeture) summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details { transition: background-color 0.2s ease; }
.faq details:hover { background: #FFFEF0; }
.faq details p { margin: 0 0 22px; }

/* Pied de page */
.pied { padding: 40px 0; border-top: 3px solid var(--chocolat); }
.pied .conteneur { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 16px; }
.pied a { color: var(--chocolat); }
.pied a:hover { color: var(--framboise); }

/* Page mentions légales */
.page-texte { padding: 48px 0 96px; }
.page-texte .conteneur { max-width: 820px; }
.page-texte h1 { font-size: clamp(36px, 5vw, 52px); }
.page-texte h2 { font-size: 28px; margin: 48px 0 12px; }
.page-texte p, .page-texte li { font-size: 18px; }
.a-completer { background: var(--abricot); padding: 0 6px; border-radius: 4px; }

/* ---------- Barre de défilement ---------- */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--creme); }
::-webkit-scrollbar-thumb { background: var(--framboise); border: 3px solid var(--creme); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--chocolat); }
::-webkit-scrollbar-corner { background: var(--creme); }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--framboise) var(--creme); }
}
::selection { background: var(--abricot); color: var(--chocolat); }

/* ---------- Écran d'introduction ---------- */
.ecran-intro { display: none; }
.avec-intro .ecran-intro {
  position: fixed; inset: 0; z-index: 100; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  background: var(--chocolat);
  animation: rideau 0.7s cubic-bezier(0.7, 0, 0.3, 1) 1.5s forwards;
}
.intro-produits { display: flex; align-items: flex-end; gap: 10px; height: 72px; }
.intro-produits .produit { width: 34px; animation: tomber 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
.intro-produits .p2 { animation-delay: 0.12s; }
.intro-produits .p3 { animation-delay: 0.24s; }
.intro-logo {
  display: flex; align-items: baseline; gap: 0.25em; overflow: hidden; padding: 0 0.1em 0.12em;
  font-family: var(--font-titre); font-weight: 700; font-size: clamp(44px, 9vw, 72px); line-height: 1; letter-spacing: -0.02em;
}
.intro-logo .kimia, .intro-logo .snack { display: inline-block; animation: monter 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.intro-logo .kimia { color: var(--creme); animation-delay: 0.45s; }
.intro-logo .snack { color: var(--framboise); animation-delay: 0.6s; }
.intro-logo .point {
  width: 0.24em; height: 0.24em; border-radius: 50%; background: var(--abricot);
  display: inline-block; margin-left: -0.12em;
  animation: pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 0.85s both;
}

/* ---------- Entrée du héros ---------- */
.avec-intro { --apres-intro: 1.5s; }
.js .heros .etiquette,
.js .heros h1,
.js .heros .intro,
.js .heros .actions { animation: monter 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.js .heros .etiquette { animation-delay: var(--apres-intro, 0s); }
.js .heros h1 { animation-delay: calc(var(--apres-intro, 0s) + 0.08s); }
.js .heros .intro { animation-delay: calc(var(--apres-intro, 0s) + 0.16s); }
.js .heros .actions { animation-delay: calc(var(--apres-intro, 0s) + 0.24s); }
.js .heros .machine { animation: arriver 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--apres-intro, 0s) + 0.2s) both; }
.ecran { animation: lueur 3s ease-in-out infinite; }

/* ---------- Apparition au défilement ---------- */
.js .reveler {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delai, 0s);
}
.js .reveler.visible { opacity: 1; transform: none; }
@media print { .js .reveler { opacity: 1; transform: none; } .retour-haut, .ecran-intro { display: none !important; } }

/* ---------- Bouton « haut de page » ---------- */
.retour-haut {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--framboise); color: var(--creme); border: 3px solid var(--chocolat);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background-color 0.15s ease;
}
.retour-haut::before {
  content: ""; position: absolute; inset: -9px; border-radius: 50%; z-index: -1;
  background: conic-gradient(var(--abricot) calc(var(--progression, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.retour-haut svg { width: 24px; height: 24px; }
.retour-haut:hover { background: var(--chocolat); color: var(--creme); transform: translateY(-3px); }
.retour-haut:hover svg { animation: fleche 0.6s ease-in-out infinite; }
.js .retour-haut:not(.visible) { opacity: 0; visibility: hidden; transform: translateY(16px) scale(0.8); }

/* ---------- Animations ---------- */
@keyframes monter { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes arriver { from { opacity: 0; transform: translateY(40px) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes tomber { from { opacity: 0; transform: translateY(-60vh); } 40% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes rideau { to { transform: translateY(-100%); visibility: hidden; } }
@keyframes rebond { 50% { transform: translateY(-0.35em); } }
@keyframes lueur { 50% { opacity: 0.7; } }
@keyframes fleche { 50% { transform: translateY(-3px); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .heros .conteneur { grid-template-columns: 1fr; }
  .machine { max-width: 280px; }
  .grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  section { padding: 72px 0; }
  .grille-4, .etapes { grid-template-columns: 1fr; }
  .nav { gap: 16px; }
  .nav .lien-secondaire { display: none; }
  .bloc-contact { padding: 32px 24px; }
  .entete { padding: 16px 0; }
  .entete.defile { padding: 10px 0; }
  .retour-haut { right: 16px; bottom: 16px; width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bouton:hover, .carte-avantage:hover, .retour-haut:hover { transform: none; }
  .avec-intro .ecran-intro { display: none; }
}
