/* ══════════════════════════════════════════════════════════════════════════
   LE LABO — Brick IA
   ══════════════════════════════════════════════════════════════════════════
   Les couleurs et les typos de la marque, rien d'autre :
     encre #0B0B0D (jamais #000), orange #FFA500, blanc.
     Montserrat Black pour les titres, la police du système pour le texte.
   L'orange est un ACCENT : le point du titre, le mot-clé, le bouton principal,
   le focus. Partout ailleurs il deviendrait une couleur de fond et perdrait
   son rôle.                                                                */

@font-face {
  font-family: "Montserrat Black";
  src: url("fonts/Montserrat-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

:root {
  --encre: #0b0b0d;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --ligne: rgba(255, 255, 255, 0.08);
  --ligne-forte: rgba(255, 255, 255, 0.16);
  --texte: #f4f4f6;
  --doux: #9a9aa2;
  --orange: #ffa500;
  --orange-voile: rgba(255, 165, 0, 0.14);

  --gros: "Montserrat Black", "Arial Black", system-ui, sans-serif;
  --ui: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --largeur: 1180px;
  --gouttiere: clamp(16px, 4vw, 40px);
  --rayon: 16px;
  --courbe: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--encre);
  color: var(--texte);
  font: 400 16px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

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

button {
  font: inherit;
  color: inherit;
}

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

.evitement {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--orange);
  color: var(--encre);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.evitement:focus {
  left: 8px;
}

/* ── L'EN-TÊTE ───────────────────────────────────────────────────────────── */

.entete {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 20px var(--gouttiere);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 15px;
  white-space: nowrap;
}
.marque-carre {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--orange);
}
.marque-nom {
  font-family: var(--gros);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.marque-sep {
  color: var(--ligne-forte);
}
.marque-site {
  color: var(--doux);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--doux);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover {
  color: var(--texte);
  background: var(--surface);
}
.nav .nav-academy {
  color: var(--texte);
  border: 1px solid var(--ligne-forte);
  margin-left: 4px;
}

/* ── L'OUVERTURE ─────────────────────────────────────────────────────────── */

.hero {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: clamp(40px, 9vw, 104px) var(--gouttiere) 28px;
}

.surtitre {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.titre {
  margin: 0;
  max-width: 11ch;
  font-family: var(--gros);
  font-weight: 900;
  font-size: clamp(44px, 9vw, 104px);
  line-height: 0.9;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-wrap: balance;
}
/* Le point final en orange : le seul orange du titre. */
.titre .point {
  color: var(--orange);
}

.intro {
  margin: 24px 0 36px;
  max-width: 52ch;
  font-size: clamp(16px, 1.6vw, 18px);
  color: var(--doux);
}

/* La recherche : grande, parce que c'est la raison d'être de la page. */
.recherche {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 720px;
  height: 62px;
  padding: 0 16px 0 52px;
  background: var(--surface);
  border: 1px solid var(--ligne-forte);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: text;
}
.recherche:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-voile);
}
.recherche-icone {
  position: absolute;
  left: 18px;
  width: 20px;
  height: 20px;
  color: var(--doux);
}
.recherche input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--texte);
  font: 500 17px var(--ui);
}
.recherche input::placeholder {
  color: #6c6c74;
}
.recherche input::-webkit-search-cancel-button {
  filter: invert(0.7);
}
.recherche-touche {
  padding: 2px 8px;
  border: 1px solid var(--ligne-forte);
  border-radius: 6px;
  font: 500 13px var(--mono);
  color: var(--doux);
}

.filtres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.filtre {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  background: transparent;
  color: var(--doux);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filtre:hover {
  color: var(--texte);
  border-color: var(--ligne-forte);
}
.filtre[aria-pressed="true"] {
  background: var(--texte);
  border-color: var(--texte);
  color: var(--encre);
}
.filtre-nombre {
  font: 500 12px var(--mono);
  opacity: 0.6;
}

/* ── LE MOT-CLÉ ─────────────────────────────────────────────────────────────
   Écrit en police à chasse fixe : c'est un code à taper, pas un titre.    */

.mot-cle {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-radius: 8px;
  background: rgba(11, 11, 13, 0.78);
  color: var(--orange);
  font: 600 13px/1.2 var(--mono);
  letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.badge-gratuit {
  background: var(--texte);
  color: var(--encre);
}
.badge-partenaire {
  background: rgba(11, 11, 13, 0.78);
  border: 1px solid var(--ligne-forte);
  color: var(--texte);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ── LA DERNIÈRE VIDÉO ───────────────────────────────────────────────────── */

.une {
  max-width: var(--largeur);
  margin: 28px auto 0;
  padding: 0 var(--gouttiere);
}
.une[hidden] {
  display: none;
}
.une-carte {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(16px, 2.4vw, 24px);
  border: 1px solid var(--ligne);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(19, 19, 22, 0.4) 100%);
}
.une-image {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
}
.une-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--courbe);
}
.une-image:hover img {
  transform: scale(1.03);
}
.une-etiquette {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--doux);
}
.une-titre {
  margin: 14px 0 12px;
  font-family: var(--gros);
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.une-resume {
  margin: 0 0 24px;
  max-width: 56ch;
  color: var(--doux);
}
.une-academy {
  max-width: 520px;
  margin-top: 24px;
}

/* ── LES ACTIONS ─────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--ligne-forte);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--texte);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--courbe), background 0.2s, border-color 0.2s;
}
.bouton:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}
.bouton-principal {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--encre);
}
.bouton-principal:hover {
  border-color: var(--orange);
  background: #ffb42e;
}
.bouton svg {
  width: 15px;
  height: 15px;
}

.code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 440px;
  margin-top: 16px;
  padding: 12px 12px 12px 16px;
  border: 1px dashed rgba(255, 165, 0, 0.5);
  border-radius: 12px;
  background: var(--orange-voile);
}
.code-valeur {
  font: 700 20px/1.1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--orange);
}
.code-detail {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--doux);
}
.code .bouton {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.credit {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--doux);
}

/* ── LA GRILLE ───────────────────────────────────────────────────────────── */

.liste {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 56px var(--gouttiere) 32px;
}
/* Recherche en cours sur téléphone : voir la note dans app.js. */
body.en-recherche .liste {
  min-height: 100vh;
  min-height: 100svh;
}
.liste-tete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ligne);
}
.liste-titre {
  margin: 0;
  font-family: var(--gros);
  font-size: 22px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.compte {
  font: 500 13px var(--mono);
  color: var(--doux);
}

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 28px 20px;
}

.carte {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.carte-image {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--ligne);
  transition: border-color 0.25s;
}
.carte-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--courbe);
}
.carte:hover .carte-image {
  border-color: var(--ligne-forte);
}
.carte:hover .carte-image img {
  transform: scale(1.04);
}
.carte-haut,
.carte-bas {
  position: absolute;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.carte-haut {
  top: 10px;
}
.carte-bas {
  bottom: 10px;
}
.carte-titre {
  margin: 14px 0 4px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.carte-resume {
  margin: 0;
  font-size: 14px;
  color: var(--doux);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vide {
  padding: 48px 0;
  text-align: center;
  color: var(--doux);
}
.vide strong {
  color: var(--texte);
}
.vide .bouton {
  margin-top: 16px;
}

/* ── LA FICHE ────────────────────────────────────────────────────────────── */

.fiche {
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--ligne-forte);
  border-radius: 24px;
  background: var(--surface);
  color: var(--texte);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.fiche::backdrop {
  background: rgba(5, 5, 7, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.fiche[open] {
  animation: fiche-entree 0.28s var(--courbe);
}
@keyframes fiche-entree {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
.fiche-corps {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 28px;
  padding: 24px;
}
.fiche-image {
  aspect-ratio: 3 / 4;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--surface-2);
}
.fiche-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fiche-infos {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fiche-haut {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-right: 44px;
}
.fiche-titre {
  margin: 16px 0 10px;
  font-family: var(--gros);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.fiche-resume {
  margin: 0 0 22px;
  color: var(--doux);
}
.fiche-pied {
  margin-top: auto;
  padding-top: 20px;
}
.fiche-fermer {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ligne-forte);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
}
.fiche-fermer svg {
  width: 16px;
  height: 16px;
}
/* Le renvoi vers l'Academy, en bas de fiche : une carte sobre, le carré de
   la marque devant le nom. */
.academy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--ligne-forte);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--texte);
  text-decoration: none;
  transition: transform 0.2s var(--courbe), border-color 0.2s;
}
.academy:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.3);
}
.academy-texte {
  min-width: 0;
}
.academy-titre {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--gros);
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.academy-titre::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--orange);
}
.academy-detail {
  display: block;
  margin-top: 5px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--doux);
}
.academy-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--ligne-forte);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.academy-action svg {
  width: 14px;
  height: 14px;
}

/* ── LE PIED ─────────────────────────────────────────────────────────────── */

.pied {
  max-width: var(--largeur);
  margin: 40px auto 0;
  padding: 28px var(--gouttiere) 48px;
  border-top: 1px solid var(--ligne);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--doux);
}
.pied p {
  margin: 0;
  max-width: 60ch;
}
.pied-liens {
  display: flex;
  gap: 18px;
}
.pied-liens a {
  text-decoration: none;
}
.pied-liens a:hover {
  color: var(--texte);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--texte);
  color: var(--encre);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s var(--courbe);
  z-index: 20;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── L'APPARITION ────────────────────────────────────────────────────────────
   Tout monte de 10 px en fondu, un élément après l'autre. Pas de rebond,
   pas de flou : la page doit paraître posée, pas animée.                  */

.apparait {
  animation: monte 0.55s var(--courbe) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes monte {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── MOBILE ──────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .nav a:not(.nav-academy) {
    display: none;
  }
  .recherche-touche {
    display: none;
  }
  .une-carte {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .une-image {
    aspect-ratio: 4 / 5;
  }
  .grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }
  .carte-titre {
    font-size: 15px;
  }
  .carte-resume {
    display: none;
  }
  .fiche-corps {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px;
  }
  .fiche-image {
    aspect-ratio: 16 / 10;
  }
  .bouton {
    flex: 1 1 auto;
  }
  .academy {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .academy-action {
    justify-content: center;
    min-height: 42px;
  }
  .pied {
    flex-direction: column;
  }
}
