/* La page de téléchargement de 6Ludo.
 *
 * Une réplique, classe par classe, de la page Lovable (`Download.tsx`) :
 * Tailwind et shadcn traduits en CSS ordinaire, sans rien à construire et
 * sans aucun fichier venu d'ailleurs — la politique de sécurité de la page
 * n'accepte que ce que sert le serveur.
 *
 * Les couleurs sont celles du jeu : le crème et l'encre de l'application, et
 * les quatre couleurs des pions (`lib/ui/palette.dart`). Pour le texte posé
 * sur une couleur — bouton, icône, numéro —, la teinte foncée du même pion :
 * le jaune et le bleu du plateau ne se lisent pas sur le crème.
 */

@font-face {
  font-family: 'Manrope';
  src: url('/site/polices/Manrope-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/site/polices/Manrope-600.ttf') format('truetype');
  font-weight: 500 600;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/site/polices/Manrope-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/site/polices/Sora-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --fond: #fdfbf0;
  --encre: #452a1a;
  --gris: #f5eedf;
  --texte-moyen: #5c4c40;
  --carte: #fffef8;
  --bordure: #e8dfcf;
  --telephone: #1e1611;

  --rouge: 232, 38, 42;
  --vert: 15, 157, 58;
  --jaune: 255, 212, 0;
  --bleu: 28, 163, 240;

  --rouge-texte: #c11c20;
  --vert-texte: #0b7a2d;
  --jaune-texte: #8a6700;
  --bleu-texte: #0a6faa;

  --bouton-vert: #007818;
  --bouton-vert-survol: #005e12;
  --bouton-bleu: #0a6faa;
  --bouton-bleu-survol: #085a8a;
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
    Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

/* Comme la remise à zéro de Tailwind : un titre prend la taille de son
   texte, et chacun la sienne ensuite. */
h1,
h2,
h3 {
  font-size: inherit;
  font-weight: inherit;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* min-h-screen bg-gradient-to-b from-background to-muted/40 */
.page {
  min-height: 100vh;
  background-image: linear-gradient(to bottom, var(--fond), rgba(245, 238, 223, 0.4));
}

/* ------------------------------------------------------------------------
 * Les boutons (shadcn Button)
 * --------------------------------------------------------------------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.bouton svg {
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bouton:focus-visible {
  outline: 2px solid var(--encre);
  outline-offset: 2px;
}

/* size="sm" : h-9 px-3 text-sm ; icône w-4 h-4 mr-1.5 */
.bouton-petit {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  gap: 0.375rem;
}

.bouton-petit svg {
  width: 1rem;
  height: 1rem;
}

/* size="lg" h-12 px-6 text-base font-semibold ; icône w-5 h-5 mr-2 */
.bouton-grand {
  height: 3rem;
  padding: 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
}

.bouton-grand svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bouton-vert {
  background: var(--bouton-vert);
}

.bouton-vert:hover {
  background: var(--bouton-vert-survol);
}

.bouton-bleu {
  background: var(--bouton-bleu);
}

.bouton-bleu:hover {
  background: var(--bouton-bleu-survol);
}

/* disabled:pointer-events-none disabled:opacity-50 */
.bouton[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

/* ------------------------------------------------------------------------
 * L'en-tête
 * --------------------------------------------------------------------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(232, 223, 207, 0.6);
  background: rgba(253, 251, 240, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.entete-dedans {
  max-width: 64rem;
  height: 3.5rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.marque img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* hidden sm:inline-flex */
.entete .bouton {
  display: none;
}

/* ------------------------------------------------------------------------
 * Le héros
 * --------------------------------------------------------------------- */

.heros {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

.heros-grille {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.heros-texte {
  text-align: center;
}

.pastille {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--bordure);
  border-radius: 9999px;
  background: var(--gris);
  color: var(--texte-moyen);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}

.pastille-point {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: rgb(var(--rouge));
}

h1 {
  margin-bottom: 1rem;
  font-family: 'Sora', 'Manrope', ui-sans-serif, system-ui, sans-serif;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.chapeau {
  margin-bottom: 2rem;
  color: var(--texte-moyen);
  font-size: 1rem;
  line-height: 1.625;
}

.heros-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.infos-apk {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--texte-moyen);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.infos-apk svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.infos-apk .date {
  color: rgba(92, 76, 64, 0.7);
}

/* ------------------------------------------------------------------------
 * Le téléphone
 * --------------------------------------------------------------------- */

.telephone-place {
  display: flex;
  justify-content: center;
}

.telephone {
  position: relative;
  width: 220px;
  height: 440px;
  padding: 0.5rem;
  border-radius: 2.2rem;
  background: var(--telephone);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.telephone-ecran {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1.8rem;
  background: var(--telephone);
}

.telephone-capture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(0.95);
  filter: blur(4px);
  opacity: 0.6;
}

.telephone-voile {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 17, 0.4);
}

.telephone-centre {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 1rem;
}

.telephone-logo {
  width: 5rem;
  height: 5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(253, 251, 240, 0.2);
}

.telephone-nom {
  text-align: center;
}

.telephone-titre {
  color: var(--fond);
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.telephone-version {
  margin-top: 0.125rem;
  color: rgba(253, 251, 240, 0.7);
  font-size: 0.75rem;
  line-height: 1rem;
}

.telephone-encoche {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  z-index: 10;
  width: 5rem;
  height: 1.25rem;
  transform: translateX(-50%);
  border-radius: 0 0 1rem 1rem;
  background: var(--telephone);
}

/* ------------------------------------------------------------------------
 * Les sections
 * --------------------------------------------------------------------- */

.section {
  max-width: 64rem;
  margin: 0 auto;
  padding: 3rem 1rem;
  border-top: 1px solid rgba(232, 223, 207, 0.6);
}

.section-etroite {
  max-width: 48rem;
}

.section-titre {
  margin-bottom: 2.5rem;
}

.section-titre-court {
  margin-bottom: 2rem;
}

h2 {
  margin-bottom: 0.5rem;
  font-family: 'Sora', 'Manrope', ui-sans-serif, system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.section-titre p {
  color: var(--texte-moyen);
}

h3 {
  font-weight: 600;
}

/* ------------------------------------------------------------------------
 * Les cartes (shadcn Card)
 * --------------------------------------------------------------------- */

.cartes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.carte {
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--bordure);
  border-radius: 0.5rem;
  background: var(--carte);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease;
}

.carte-icone {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.carte-icone svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carte h3 {
  margin-bottom: 0.25rem;
}

.carte p,
.etape p {
  color: var(--texte-moyen);
  font-size: 0.875rem;
  line-height: 1.625;
}

/* Les quatre couleurs, comme les classes ludo-… de l'original : un fond à
   10 %, le texte plein, une bordure à 40 % au survol. */
.rouge .carte-icone,
.rouge .etape-numero {
  background: rgba(var(--rouge), 0.1);
  color: var(--rouge-texte);
}
.vert .carte-icone,
.vert .etape-numero {
  background: rgba(var(--vert), 0.1);
  color: var(--vert-texte);
}
.jaune .carte-icone,
.jaune .etape-numero {
  background: rgba(var(--jaune), 0.1);
  color: var(--jaune-texte);
}
.bleu .carte-icone,
.bleu .etape-numero {
  background: rgba(var(--bleu), 0.1);
  color: var(--bleu-texte);
}

.carte.rouge:hover {
  border-color: rgba(var(--rouge), 0.4);
}
.carte.vert:hover {
  border-color: rgba(var(--vert), 0.4);
}
.carte.jaune:hover {
  border-color: rgba(var(--jaune), 0.4);
}
.carte.bleu:hover {
  border-color: rgba(var(--bleu), 0.4);
}

/* ------------------------------------------------------------------------
 * L'installation
 * --------------------------------------------------------------------- */

.etapes {
  padding: 0;
  list-style: none;
}

.etape {
  display: flex;
  gap: 1rem;
}

.etape + .etape {
  margin-top: 1.25rem;
}

.etape-numero {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
}

.etape h3 {
  margin-bottom: 0.125rem;
}

.bas-action {
  margin-top: 2.5rem;
}

/* ------------------------------------------------------------------------
 * Le pied de page
 * --------------------------------------------------------------------- */

.pied {
  margin-top: 2rem;
  border-top: 1px solid rgba(232, 223, 207, 0.6);
}

.pied-dedans {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.pied-liens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
  color: var(--texte-moyen);
}

.pied-liens a {
  transition: color 0.15s ease;
}

.pied-liens a:hover {
  color: var(--encre);
}

.pied-mention {
  color: rgba(92, 76, 64, 0.8);
  font-size: 0.75rem;
  line-height: 1rem;
}

.pied-prudence {
  margin-top: 0.25rem;
  color: rgba(92, 76, 64, 0.6);
  font-size: 0.75rem;
  line-height: 1rem;
}

/* ------------------------------------------------------------------------
 * Les pages légales
 * --------------------------------------------------------------------- */

.legal {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

.legal-retour {
  display: inline-flex;
  margin-bottom: 1.5rem;
  color: var(--texte-moyen);
  font-size: 0.875rem;
}

.legal-retour:hover {
  color: var(--encre);
}

.legal h1 {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.legal-brouillon {
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  border: 1px solid #f7d9b0;
  border-radius: 0.5rem;
  background: #fdebd6;
  color: #8a4300;
  font-size: 0.875rem;
  line-height: 1.5;
}

.legal-section {
  margin-top: 2rem;
}

.legal-section h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.legal-section p,
.legal-section ul {
  margin: 0.75rem 0 0;
  color: var(--texte-moyen);
  line-height: 1.625;
}

.legal-section ul {
  padding-left: 1.25rem;
}

.legal-section li + li {
  margin-top: 0.375rem;
}

.legal-autres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(232, 223, 207, 0.6);
  font-size: 0.875rem;
}

.legal-autres a {
  color: var(--bouton-vert);
  font-weight: 600;
}

/* ------------------------------------------------------------------------
 * Les points de rupture : sm 640, md 768, lg 1024 — ceux de Tailwind.
 * --------------------------------------------------------------------- */

@media (min-width: 640px) {
  .entete .bouton {
    display: inline-flex;
  }

  .heros-actions {
    flex-direction: row;
  }

  .cartes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .heros {
    padding: 5rem 1rem 6rem;
  }

  .heros-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .heros-texte {
    text-align: left;
  }

  .heros-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .telephone-place {
    justify-content: flex-end;
  }

  h1 {
    font-size: 3rem;
    line-height: 1;
  }

  /* md:text-lg vient après leading-relaxed dans la feuille de Tailwind : son
     interligne de 1,75rem l'emporte. */
  .chapeau {
    font-size: 1.125rem;
    line-height: 1.75rem;
  }

  .section {
    padding: 4rem 1rem;
  }

  h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .cartes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------------
 * Le mouvement : l'apparition de framer-motion, refaite en CSS.
 *
 * Le héros entre au chargement, sans attendre le script. Le reste apparaît
 * au défilement : `site.js` ne cache que ce qui est encore sous la ligne de
 * flottaison — rien ne clignote — et le révèle en arrivant. Sans script, ou
 * pour qui réduit les animations, tout est simplement là — et à l'impression
 * aussi, où rien ne défile.
 * --------------------------------------------------------------------- */

@media screen and (prefers-reduced-motion: no-preference) {
  .apparition {
    animation: apparition 0.4s ease-out both;
  }

  .apparition-tardive {
    animation-duration: 0.5s;
    animation-delay: 0.1s;
  }

  .a-reveler {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
  }

  .a-reveler.vers-la-droite {
    transform: translateX(-8px);
    transition-duration: 0.3s;
  }

  .a-reveler.revele {
    opacity: 1;
    transform: none;
  }

  .rang-1 {
    transition-delay: 0.04s;
  }
  .rang-2 {
    transition-delay: 0.08s;
  }
  .rang-3 {
    transition-delay: 0.12s;
  }
  .rang-4 {
    transition-delay: 0.16s;
  }
  .rang-5 {
    transition-delay: 0.2s;
  }
}

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