/* =========================================================================
   Shopin'Blog — design system « Nuit acide »
   Un banc de test allumé dans une pièce éteinte : fond nuit, un seul accent
   acide qui sert de faisceau (note, mesure, action), des grilles techniques.
   Tailwind porte les couleurs et la typographie (voir tailwind.config dans
   chaque page) ; ce fichier porte ce que Tailwind ne fait pas : l'instrument.
   ========================================================================= */

:root {
  --nuit: #0b1622;
  --plan: #132434;
  --plan-clair: #1c3247;
  --acide: #c8f751;
  --acide-sombre: #9ccb26;
  --alerte: #ff6a3d;
  --texte: #e9eff4;
  --texte-doux: #93a6b6;
  --filet: #2a4258;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  background-image:
    radial-gradient(1100px 620px at 78% -8%, rgba(200, 247, 81, 0.06), transparent 62%),
    radial-gradient(760px 520px at 4% 12%, rgba(255, 106, 61, 0.05), transparent 60%);
  background-repeat: no-repeat;
}

.chiffre {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* grain de mesure : artefact d'instrument, jamais sur le texte seul */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)' opacity='0.09'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------ grille technique */
.grille-tech {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(42, 66, 88, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(42, 66, 88, 0.55) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 100% at 15% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 100% at 15% 0%, #000 20%, transparent 78%);
}

/* ------------------------------------------------------------- titres */
.titre-1 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  color: var(--texte);
}
.titre-2 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.3vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--texte);
}
.titre-3 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  line-height: 1.2;
  color: var(--texte);
}
.titre-4 {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.14rem;
  line-height: 1.32;
  letter-spacing: -0.008em;
  color: var(--texte);
}

.kicker {
  display: inline-block;
  font-family: "Karla", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--acide);
}
.kicker-alerte { color: var(--alerte); }

.num {
  flex: none;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--nuit);
  background: var(--acide);
  padding: 0.14rem 0.42rem;
  border-radius: 2px;
}

/* ------------------------------------------------------------- boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms ease, background-color 160ms ease, color 160ms ease,
    border-color 160ms ease, box-shadow 160ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-acide { background: var(--acide); color: var(--nuit); border-color: var(--acide); }
.btn-acide:hover { background: #d7ff6e; border-color: #d7ff6e; box-shadow: 0 0 0 4px rgba(200, 247, 81, 0.14); }
.btn-contour { background: transparent; color: var(--acide); border-color: rgba(200, 247, 81, 0.5); }
.btn-contour:hover { background: rgba(200, 247, 81, 0.1); border-color: var(--acide); }
.btn-fantome { background: transparent; color: var(--texte); border-color: var(--filet); }
.btn-fantome:hover { border-color: var(--acide); color: var(--acide); }

/* -------------------------------------------------------- navigation */
.lien-nav {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--texte-doux);
  transition: color 160ms ease;
}
.lien-nav::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--acide);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 190ms ease;
}
.lien-nav:hover { color: var(--texte); }
.lien-nav:hover::after,
.lien-nav[aria-current="page"]::after { transform: scaleX(1); }
.lien-nav[aria-current="page"] { color: var(--acide); }

.sous-menu {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 16rem;
  padding: 0.4rem;
  background: var(--plan);
  border: 1px solid var(--filet);
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
}
.has-dropdown:hover .sous-menu,
.has-dropdown:focus-within .sous-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sous-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  color: var(--texte-doux);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 3px;
  transition: background-color 140ms ease, color 140ms ease;
}
.sous-menu a:hover { background: var(--plan-clair); color: var(--acide); }

/* --------------------------------------------------------- éditorial */
.prose-conso p { margin-bottom: 1.1rem; }
.prose-conso p:last-child { margin-bottom: 0; }
.prose-conso a {
  color: var(--acide);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: background-color 150ms ease, color 150ms ease;
}
.prose-conso a:hover { background-color: rgba(200, 247, 81, 0.16); }
.prose-conso strong { color: var(--texte); font-weight: 700; }
.prose-conso ul,
.prose-conso ol { margin-bottom: 1.1rem; padding-left: 1.1rem; }
.prose-conso ul { list-style: none; }
.prose-conso ul > li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 0.35rem;
}
.prose-conso ul > li::before {
  content: "";
  position: absolute;
  left: -0.85rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--acide);
  border-radius: 1px;
}
.prose-conso ol { list-style: decimal; }
.prose-conso ol > li { margin-bottom: 0.55rem; }
.prose-conso ol > li::marker { color: var(--acide); font-weight: 700; }
.prose-conso h3 { margin: 1.8rem 0 0.7rem; }
.prose-conso h4 { margin: 1.5rem 0 0.6rem; }

/* ------------------------------------------------------------ encarts */
.encart {
  border: 1px solid var(--filet);
  border-left: 3px solid var(--acide);
  background: var(--plan);
  border-radius: 4px;
  padding: 1.15rem 1.35rem;
}
.encart-alerte { border-left-color: var(--alerte); }
.encart-neutre { border-left-color: var(--texte-doux); }
.encart .tableau-enveloppe { margin-bottom: 0; }

/* --------------------------------------------------- tableaux de mesure */
.tableau-enveloppe { overflow-x: auto; }
.tableau {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--plan);
  border: 1px solid var(--filet);
  border-radius: 4px;
  overflow: hidden;
}
.tableau caption {
  caption-side: top;
  text-align: left;
  font-size: 0.82rem;
  color: var(--texte-doux);
  padding-bottom: 0.55rem;
}
.tableau th,
.tableau td {
  padding: 0.62rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--filet);
  line-height: 1.5;
}
.tableau thead th {
  background: var(--plan-clair);
  color: var(--texte);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--filet);
  white-space: nowrap;
}
.tableau tbody tr { transition: background-color 140ms ease; }
.tableau tbody tr:hover { background: #17293b; }
.tableau tbody tr:last-child td { border-bottom: none; }
.tableau td:first-child { font-weight: 700; color: var(--texte); }
.tableau td.acide { color: var(--acide); font-weight: 700; }
.tableau td.alerte { color: var(--alerte); font-weight: 700; }

/* -------------------------------------------------- fiche de test */
.fiche-test {
  position: relative;
  border: 1px solid var(--filet);
  background: linear-gradient(180deg, var(--plan) 0%, #11212f 100%);
  border-radius: 6px;
  padding: 1.4rem 1.5rem 1.5rem;
  overflow: hidden;
}
.fiche-test::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--acide);
}
.note-geante {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  color: var(--acide);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.note-valeur { font-size: clamp(2.8rem, 8vw, 4rem); letter-spacing: -0.03em; }
.note-sur { font-size: 1.1rem; color: var(--texte-doux); font-weight: 700; }

.mesures { display: grid; gap: 0.55rem; }
.critere {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr 3.4rem;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.87rem;
}
.critere-label { color: var(--texte-doux); }
.poids { color: var(--texte-doux); font-size: 0.78rem; text-align: right; font-variant-numeric: tabular-nums; }
.barre {
  display: block;
  position: relative;
  height: 10px;
  background: var(--plan-clair);
  border-radius: 1px;
  overflow: hidden;
}
.barre-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--acide);
  transition: width 760ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.barre-fill-alerte { background: var(--alerte); }
.mesures.is-visible .barre-fill { width: var(--valeur); }

/* ------------------------------------------------------------ pastilles */
.pastille {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--filet);
  border-radius: 2px;
  color: var(--texte-doux);
  white-space: nowrap;
}
.pastille-acide { border-color: rgba(200, 247, 81, 0.55); color: var(--acide); }
.pastille-alerte { border-color: rgba(255, 106, 61, 0.55); color: var(--alerte); }

/* -------------------------------------------------------- cartes */
.carte-avis {
  background: var(--plan);
  border: 1px solid var(--filet);
  border-radius: 4px;
  transition: transform 170ms ease, border-color 170ms ease, background-color 170ms ease;
}
.carte-avis:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 247, 81, 0.55);
  background: var(--plan-clair);
}

/* ------------------------------------------------------- sommaire */
.sommaire {
  display: grid;
  gap: 0.15rem;
}
.sommaire a {
  display: block;
  padding: 0.32rem 0 0.32rem 0.85rem;
  border-left: 2px solid var(--filet);
  color: var(--texte-doux);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 150ms ease, border-color 150ms ease, padding-left 150ms ease;
}
.sommaire a:hover { color: var(--texte); border-left-color: var(--acide); }
.sommaire a.is-active {
  color: var(--acide);
  font-weight: 700;
  border-left-color: var(--acide);
  padding-left: 1.1rem;
}

/* --------------------------------------------------------- details */
.plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  flex: none;
  border: 1px solid rgba(200, 247, 81, 0.5);
  border-radius: 3px;
  color: var(--acide);
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color 150ms ease, color 150ms ease, transform 200ms ease;
}
details[open] .plus { background: var(--acide); color: var(--nuit); transform: rotate(45deg); }

/* --------------------------------------------------------- formulaires */
.champ {
  width: 100%;
  padding: 0.62rem 0.75rem;
  background: var(--nuit);
  border: 1px solid var(--filet);
  border-radius: 4px;
  color: var(--texte);
  font-size: 0.98rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.champ::placeholder { color: #65808f; }
.champ:focus { border-color: var(--acide); box-shadow: 0 0 0 3px rgba(200, 247, 81, 0.16); outline: none; }
label.etiquette { display: block; margin-bottom: 0.35rem; font-size: 0.86rem; font-weight: 700; color: var(--texte); }
.aide { margin-top: 0.3rem; font-size: 0.76rem; color: var(--texte-doux); }

/* --------------------------------------------------------- simulateur */
.simu-panneau {
  border: 1px solid var(--filet);
  border-radius: 6px;
  background: var(--plan);
  padding: 1.25rem 1.3rem;
}
.simu-champ {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--filet);
  border-radius: 4px;
  background: var(--nuit);
  font-weight: 700;
  color: var(--acide);
  font-variant-numeric: tabular-nums;
}
.simu-sortie {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-weight: 800;
  color: var(--acide);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.simu-verdict {
  border-left: 3px solid var(--acide);
  background: var(--plan-clair);
  border-radius: 0 4px 4px 0;
  padding: 0.9rem 1.1rem;
}
.barre-simu { height: 16px; background: var(--plan-clair); border-radius: 2px; overflow: hidden; }
.barre-simu > span { display: block; height: 100%; background: var(--acide); transition: width 420ms ease; }
.barre-simu.barre-alerte > span { background: var(--alerte); }

/* --------------------------------------------------------- motion
   Les états masqués sont conditionnés à la classe `js` posée dans le <head> :
   sans JavaScript, tout le contenu reste visible au lieu de disparaître. */
html.js .reveal { opacity: 0; transform: translateY(14px); }
.reveal { transition: opacity 520ms ease, transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
.cascade > * { animation: montee 640ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.cascade > *:nth-child(1) { animation-delay: 40ms; }
.cascade > *:nth-child(2) { animation-delay: 130ms; }
.cascade > *:nth-child(3) { animation-delay: 220ms; }
.cascade > *:nth-child(4) { animation-delay: 310ms; }
.cascade > *:nth-child(5) { animation-delay: 400ms; }
.cascade > *:nth-child(6) { animation-delay: 490ms; }

@keyframes montee {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------ focus & a11y */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--acide);
  outline-offset: 3px;
  border-radius: 2px;
}
.lien-evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--acide);
  color: var(--nuit);
  padding: 0.65rem 1rem;
  font-weight: 700;
}
.lien-evitement:focus { left: 0.5rem; top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  .cascade > * { animation: none; }
  .btn:hover,
  .carte-avis:hover { transform: none; }
  .barre-fill,
  .barre-simu > span { transition: none; }
}

@media print {
  body::after,
  header,
  footer,
  .sommaire,
  .grille-tech { display: none !important; }
  body { background: #fff; color: #000; }
}
