/* Cartonnade · site cartonnade.fr — mêmes couleurs et polices que l'appli (src/theme/couleurs.ts). */

@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('/statique/polices/nunito-800.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 900; font-display: swap; src: url('/statique/polices/nunito-900.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-display: swap; src: url('/statique/polices/nunito-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 700; font-display: swap; src: url('/statique/polices/nunito-sans-700.woff2') format('woff2'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 800; font-display: swap; src: url('/statique/polices/nunito-sans-800.woff2') format('woff2'); }

/* Thème sombre (celui de l'appli par défaut) */
:root {
  color-scheme: dark;
  --fond: #121414;
  --surface: #1b1f1f;
  --surface2: #252a2a;
  --ligne: #313737;
  --texte: #f1f5f4;
  --attenue: #9ca8a6;
  --accent: #2bb894;
  --accent-encre: #06231c;
  --accent-doux: rgba(43, 184, 148, 0.15);
  --argent: #f5b841;
  --argent-texte: #f5b841;
  --maison: #252a2a;
  --trait: #f1f5f4;
  --titre: 'Nunito', ui-rounded, system-ui, sans-serif;
  --corps: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --colonne: 42rem;
}

/* Thème clair, si le téléphone ou l'ordinateur est réglé en clair */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --fond: #ffffff;
    --surface: #f2f5f4;
    --surface2: #e6ecea;
    --ligne: #dde4e2;
    --texte: #101a18;
    --attenue: #5a6866;
    --accent: #0b7a68;
    --accent-encre: #ffffff;
    --accent-doux: rgba(11, 122, 104, 0.1);
    --argent-texte: #8a5a00;
    --maison: #e6ecea;
    --trait: #101a18;
  }
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--corps);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); font-weight: 700; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.passer { position: absolute; left: -9999px; top: 0.5rem; background: var(--accent); color: var(--accent-encre); padding: 0.6rem 1rem; border-radius: 12px; z-index: 10; }
.passer:focus { left: 1rem; }

/* ---------- En-tête et pied de page ---------- */

.entete, .pied, main { width: 100%; max-width: 68rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }

.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--texte); text-decoration: none; font-family: var(--titre); font-weight: 900; font-size: 1.45rem; letter-spacing: -0.03em; }
.logo svg { width: 2.1rem; height: 2.1rem; flex: none; }
.logo .marque { fill: var(--accent); }
.logo .carton { stroke: var(--accent-encre); }

.entete-lien { color: var(--attenue); font-weight: 700; font-size: 0.95rem; text-decoration: none; }
.entete-lien:hover { color: var(--texte); }

.pied { margin-top: 5rem; padding-top: 2rem; padding-bottom: 3rem; border-top: 1px solid var(--ligne); color: var(--attenue); font-size: 0.95rem; }
.pied ul { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.pied a { color: var(--texte); font-weight: 700; text-decoration: none; }
.pied a:hover, .pied a[aria-current='page'] { color: var(--accent); }
.pied p { margin: 0; }

/* ---------- Accueil ---------- */

.une { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; padding-top: 2rem; }
@media (min-width: 52rem) { .une { grid-template-columns: 1.05fr 1fr; gap: 3rem; padding-top: 4rem; } }

.une h1 {
  font-family: var(--titre);
  font-weight: 900;
  font-size: clamp(2.5rem, 7.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.une .chapo { font-size: 1.2rem; color: var(--attenue); margin: 0 0 1.5rem; max-width: 32rem; }
.bientot { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.55rem 1rem 0.55rem 0.8rem; border-radius: 999px; background: var(--accent-doux); color: var(--texte); font-weight: 700; font-size: 0.98rem; }
.bientot::before { content: ''; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--accent); flex: none; }

.illustration { width: 100%; height: auto; display: block; }
.illustration .maison { fill: var(--maison); stroke: var(--trait); }
.illustration .trait { stroke: var(--trait); }
.illustration .vert { fill: var(--accent); }
.illustration .ambre { fill: var(--argent); }
.illustration .trajet { stroke: var(--accent); }

/* Un seul mouvement : le trajet se dessine d'une maison à l'autre au chargement. */
@media (prefers-reduced-motion: no-preference) {
  .illustration .revele { stroke-dasharray: 160; stroke-dashoffset: 160; animation: dessiner 1.4s 0.3s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
  .illustration .arrivee { opacity: 0; transform-box: fill-box; transform-origin: center; animation: arriver 0.35s 1.6s ease-out forwards; }
}
@keyframes dessiner { to { stroke-dashoffset: 0; } }
@keyframes arriver { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }

.bloc { margin-top: 5rem; }
.bloc > h2, .bloc-titre { font-family: var(--titre); font-weight: 900; font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 2rem; }

/* Les trois étapes, reliées par le même trajet en pointillés que l'illustration */
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem; counter-reset: etape; position: relative; }
.etapes li { counter-increment: etape; position: relative; padding-left: 4rem; }
.etapes li::before {
  content: counter(etape);
  position: absolute; left: 0; top: -0.15rem;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-encre);
  font-family: var(--titre); font-weight: 900; font-size: 1.3rem;
  z-index: 1;
}
.etapes li:not(:last-child)::after {
  content: ''; position: absolute; left: 1.375rem; top: 2.9rem; bottom: -2rem;
  border-left: 3px dashed var(--accent); opacity: 0.7; transform: translateX(-1.5px);
}
.etapes h3 { font-family: var(--titre); font-weight: 800; font-size: 1.3rem; margin: 0 0 0.35rem; line-height: 1.25; }
.etapes p { margin: 0; color: var(--attenue); max-width: 26rem; }

@media (min-width: 52rem) {
  .etapes { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .etapes li { padding-left: 0; padding-top: 4.25rem; }
  .etapes li::before { top: 0; }
  .etapes li:not(:last-child)::after { left: 3.4rem; right: -2.1rem; top: 1.375rem; bottom: auto; border-left: 0; border-top: 3px dashed var(--accent); transform: translateY(-1.5px); }
}

.duo { display: grid; gap: 1.25rem; }
@media (min-width: 52rem) { .duo { grid-template-columns: 1fr 1fr; gap: 1.5rem; } }
.duo section { background: var(--surface); border-radius: 22px; padding: 1.75rem 1.75rem 1.5rem; }
.duo h2 { font-family: var(--titre); font-weight: 800; font-size: 1.45rem; line-height: 1.2; margin: 0 0 0.75rem; letter-spacing: -0.01em; }
.duo p { margin: 0 0 0.75rem; }
.duo ul { margin: 0; padding-left: 1.2rem; }
.duo li { margin-bottom: 0.35rem; }
.duo li::marker { color: var(--accent); }
.duo .argent h2 { color: var(--argent-texte); }

.contact { text-align: left; }
.contact p { font-size: 1.15rem; margin: 0; }

/* ---------- Pages de texte (conditions, confidentialité…) ---------- */

.document { max-width: var(--colonne); margin: 0 auto; padding-top: 1.5rem; }
.document h1 { font-family: var(--titre); font-weight: 900; font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 0.5rem; text-wrap: balance; }
.document .version { color: var(--attenue); margin: 0 0 2rem; }

.essentiel { background: var(--accent-doux); border-radius: 22px; padding: 1.5rem 1.6rem 1.25rem; margin: 0 0 2.5rem; }
.essentiel h2 { font-family: var(--titre); font-weight: 800; font-size: 1.3rem; margin: 0 0 0.6rem; }
.essentiel ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.essentiel li { margin-bottom: 0.4rem; }
.essentiel li::marker { color: var(--accent); }
.essentiel .nb { margin: 0; color: var(--attenue); font-size: 0.95rem; }

.sommaire { border: 1px solid var(--ligne); border-radius: 18px; padding: 1.1rem 1.4rem; margin: 0 0 3rem; }
.sommaire h2 { font-family: var(--corps); font-weight: 800; font-size: 1rem; margin: 0 0 0.5rem; color: var(--attenue); }
.sommaire ol { margin: 0; padding-left: 1.4rem; columns: 1; }
@media (min-width: 40rem) { .sommaire ol { columns: 2; column-gap: 2rem; } }
.sommaire li { break-inside: avoid; margin-bottom: 0.25rem; }
.sommaire a { font-weight: 700; text-decoration: none; color: var(--texte); }
.sommaire a:hover { color: var(--accent); text-decoration: underline; }
.sommaire li::marker { color: var(--attenue); font-weight: 700; }

.document article h2 { font-family: var(--titre); font-weight: 800; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.01em; margin: 3rem 0 0.9rem; scroll-margin-top: 1.5rem; }
.document article h3 { font-family: var(--corps); font-weight: 800; font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.document article p, .document article ul, .document article ol { margin: 0 0 1rem; }
.document article ul, .document article ol { padding-left: 1.3rem; }
.document article li { margin-bottom: 0.45rem; }
.document article li::marker { color: var(--accent); }
.document strong { font-weight: 800; }

.encadre { background: var(--surface); border-radius: 18px; padding: 1.1rem 1.3rem; margin: 0 0 1.25rem; }
.encadre p:last-child { margin-bottom: 0; }

/* Tableau des données : se transforme en fiches sur téléphone */
.tableau { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.98rem; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 0.8rem 0.75rem; border-bottom: 1px solid var(--ligne); }
.tableau thead th { font-weight: 800; color: var(--attenue); font-size: 0.92rem; border-bottom-width: 2px; }
.tableau tbody th { font-weight: 800; }
.tableau td:first-of-type { min-width: 0; }
@media (max-width: 40rem) {
  .tableau thead { position: absolute; left: -9999px; }
  .tableau, .tableau tbody, .tableau tr, .tableau th, .tableau td { display: block; }
  .tableau tr { background: var(--surface); border-radius: 16px; padding: 0.9rem 1rem; margin-bottom: 0.75rem; }
  .tableau th, .tableau td { border: 0; padding: 0.2rem 0; }
  .tableau tbody th { font-size: 1.05rem; margin-bottom: 0.2rem; }
  .tableau td::before { content: attr(data-titre); display: block; font-weight: 800; color: var(--attenue); font-size: 0.85rem; margin-top: 0.5rem; }
}

.a-completer { background: var(--argent); color: #2a1c00; border-radius: 6px; padding: 0 0.3em; font-weight: 800; }
.a-completer a { color: inherit; }

@media print {
  :root { --fond: #fff; --texte: #000; --attenue: #444; --surface: #f4f4f4; --accent: #0b7a68; --accent-doux: #eef6f4; --ligne: #ccc; }
  .entete-lien, .sommaire, .pied ul, .passer { display: none; }
}
