/* Sésame : page d'accueil. Identité : l'ambre d'une clé et d'une porte qui s'ouvre, sur fond sable (clair) ou nuit (sombre). */
:root {
  --fond: #f7f1e6;          /* sable */
  --surface: #fffdf8;
  --encre: #26201a;
  --discret: #6b6154;
  --trait: #e0d4bd;
  --ambre: #b8620a;         /* accent : texte et traits, contraste suffisant sur le fond */
  --or: #f2a93b;            /* la clé, les repères */
  --ok: #2f7d4f;
  --alerte: #b3321f;
  --code-fond: #2a221a;
  --code-encre: #f7f1e6;
  --rayon: 8px;
  --large: 70rem;
  --texte: 66ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #17130e;
    --surface: #211b14;
    --encre: #f1e8d8;
    --discret: #b3a68f;
    --trait: #3a3125;
    --ambre: #f2a93b;
    --or: #f2a93b;
    --ok: #6cc08b;
    --alerte: #ff8a75;
    --code-fond: #0f0c08;
    --code-encre: #f1e8d8;
  }
}
:root[data-theme="dark"] {
  --fond: #17130e; --surface: #211b14; --encre: #f1e8d8; --discret: #b3a68f; --trait: #3a3125;
  --ambre: #f2a93b; --or: #f2a93b; --ok: #6cc08b; --alerte: #ff8a75; --code-fond: #0f0c08; --code-encre: #f1e8d8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; background: var(--fond); color: var(--encre);
  font-family: "Source Serif 4", Georgia, "Noto Serif", serif;
  font-size: 1.0625rem; line-height: 1.65;
}
a { color: inherit; text-decoration-color: var(--or); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ambre); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 2px; }

code, pre { font-family: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, monospace; font-size: 0.88em; }
p code, li code { background: var(--surface); border: 1px solid var(--trait); border-radius: 4px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.12; margin: 0; font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); letter-spacing: -0.01em; max-width: 24ch; }
h3 { font-size: 1.2rem; }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.entete { max-width: var(--large); margin: 0 auto; padding: 1.25rem 1rem; display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: center; justify-content: space-between; }
.marque { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.2rem; }
.entete nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.98rem; }
.entete nav a { text-decoration: none; color: var(--discret); }
.entete nav a:hover { color: var(--encre); text-decoration: underline; }

main { max-width: var(--large); margin: 0 auto; padding: 0 1rem; }
section + section { border-top: 1px solid var(--trait); }

/* Ouverture */
.ouverture { padding: 2.5rem 0 4rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2.5rem 3.5rem; align-items: center; }
h1 { font-size: clamp(3.4rem, 11vw, 7.5rem); letter-spacing: -0.035em; line-height: 0.92; font-weight: 700; }
h1 em { font-style: italic; color: var(--ambre); }
.chapeau { font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.5; max-width: 34ch; margin: 1.25rem 0 0; }
.apercu { margin: 0; }
.apercu img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--trait); box-shadow: 0 22px 44px -26px rgba(40, 25, 5, .5); }
.installation-courte { grid-column: 1 / -1; max-width: 52rem; }
.installation-courte > p:first-child { margin: 0 0 0.5rem; font-weight: 700; }
.nuance { color: var(--discret); max-width: var(--texte); margin: 0.75rem 0 0; font-size: 0.95rem; }

/* Commandes */
.commande { display: flex; align-items: stretch; background: var(--code-fond); color: var(--code-encre); border-radius: var(--rayon); overflow: hidden; }
.commande pre { margin: 0; padding: 0.85rem 1rem; overflow-x: auto; flex: 1; min-width: 0; }
.commande pre code { white-space: pre; }
.copier { flex: none; font: inherit; font-family: system-ui, sans-serif; font-size: 0.85rem; cursor: pointer; background: transparent; color: var(--code-encre); border: 0; border-left: 1px solid rgba(255, 255, 255, .16); padding: 0 1rem; min-width: 5.5rem; }
.copier:hover { background: rgba(255, 255, 255, .08); }
.copier.copie { color: var(--or); }

/* Sections */
.pourquoi, .etapes, .securite, .installer { padding: 4rem 0; }
.pourquoi > p, .installer > p { max-width: var(--texte); }
.pourquoi h2, .etapes h2, .securite h2, .installer h2 { margin-bottom: 1.25rem; }

.liste-etapes { list-style: none; margin: 2rem 0 0; padding: 0; counter-reset: e; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 3rem; }
.liste-etapes li { counter-increment: e; border-top: 3px solid var(--or); padding-top: 0.8rem; }
.liste-etapes li::before { content: counter(e, decimal-leading-zero); display: block; font-family: Fraunces, Georgia, serif; font-weight: 700; color: var(--ambre); font-size: 0.95rem; }
.liste-etapes h3 { margin-bottom: 0.3rem; }
.liste-etapes p { margin: 0; max-width: 46ch; }

.garde { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.garde > div { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem; }
.garde h3 { margin-bottom: 0.4rem; }
.garde p { margin: 0; font-size: 0.98rem; }

.pas { margin: 2rem 0; padding: 0; list-style: none; counter-reset: pas; max-width: 60rem; }
.pas li { counter-increment: pas; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 0.75rem; margin-bottom: 1.5rem; }
.pas li::before { content: counter(pas); grid-row: span 2; font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--or); color: var(--ambre); }
.pas p { margin: 0.35rem 0 0.6rem; }

.liens { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1rem; }

/* Pied */
.pied { max-width: var(--large); margin: 0 auto; padding: 2.5rem 1rem 3rem; border-top: 1px solid var(--trait); color: var(--discret); font-size: 0.95rem; }
.pied p { margin: 0.3rem 0; }
.pied code { overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .ouverture { grid-template-columns: 1fr; }
  .liste-etapes, .garde { grid-template-columns: 1fr; }
  .copier { min-width: 4.5rem; padding: 0 0.75rem; }
}
