/* Metasoft.be — feuille de style commune (accueil + guide)
   Palette reprise des codes de KitchenFlow : ambre = tâche, vert pâle = attente. */

:root {
  --bg: #fafaf9;
  --bg-alt: #f5f5f4;
  --card: #ffffff;
  --text: #292524;
  --text-soft: #57534e;
  --accent: #b45309;
  --accent-strong: #92400e;
  --accent-soft: #fef3c7;
  --wait-soft: #dcfce7;
  --border: #e7e5e4;
  --shadow: 0 1px 3px rgb(41 37 36 / 0.08), 0 4px 14px rgb(41 37 36 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --bg-alt: #231f1d;
    --card: #292524;
    --text: #e7e5e4;
    --text-soft: #a8a29e;
    --accent: #f59e0b;
    --accent-strong: #fbbf24;
    --accent-soft: #452c0a;
    --wait-soft: #14321f;
    --border: #3b3735;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 14px rgb(0 0 0 / 0.3);
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  font-size: 1.05rem;
}

/* ---------- En-tête ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand img { width: 1.7rem; height: 1.7rem; }

.brand .dot { color: var(--accent); }

.site-nav {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: var(--bg-alt);
}

/* Onglet actif. Deux natures d'entrées (charte §3) :
   - une entrée qui désigne une PAGE est ambrée tant que cette page est affichée ;
   - une entrée qui désigne une SECTION de la page courante n'est ambrée que
     quand cette section est ciblée (clic ou URL avec fragment), via :target
     et :has() — sans JavaScript. Une nouvelle entrée de nav à ancre ajoute
     son id à la liste ci-dessous. */
.site-nav a[aria-current="page"],
body:has(#projets:target)     .site-nav a[href="#projets"],
body:has(#contact:target)     .site-nav a[href="#contact"],
body:has(#kitchenflow:target) .site-nav a[href="#kitchenflow"],
body:has(#soutenir:target)    .site-nav a[href="#soutenir"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

/* ---------- Structure commune ---------- */

main { max-width: 72rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }

section + section { border-top: 1px solid var(--border); }

h1, h2, h3 { line-height: 1.2; color: var(--text); }

h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 1rem; }

h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 1rem; }

h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }

p { margin: 0 0 1rem; }

.lead { font-size: 1.15rem; color: var(--text-soft); max-width: 46rem; }

a { color: var(--accent); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fffbeb;
}

.btn-primary:hover { background: var(--accent-strong); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--card);
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); }

.btn-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

/* Bouton « bientôt disponible » (Play Store pas encore publié) */
.btn.soon {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

/* ---------- Héro ---------- */

.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem); }

.hero .kicker {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

/* ---------- Cartes de fonctionnalités ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 1rem;
  margin-top: 1.8rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
}

.card h3 { margin-top: 0; }

.card p { margin-bottom: 0; color: var(--text-soft); font-size: 0.98rem; }

.card .icon {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
  margin-bottom: 0.6rem;
}

/* ---------- Encadrés ---------- */

.callout {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0.6rem;
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
  max-width: 46rem;
}

.callout p { margin: 0; }

.callout .title { font-weight: 700; margin-right: 0.4rem; }

.recipe {
  font-variant-ligatures: none;
  color: var(--text-soft);
}

/* ---------- Badges (codes couleur KitchenFlow) ---------- */

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-task { background: var(--accent-soft); color: var(--accent-strong); }

.badge-wait { background: var(--wait-soft); color: #166534; }

@media (prefers-color-scheme: dark) {
  .badge-wait { color: #86efac; }
}

/* ---------- Chaîne d'étapes (guide) ---------- */

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin: 1.3rem 0;
  max-width: 60rem;
}

.step {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.step em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.85em;
  opacity: 0.75;
  white-space: nowrap;
}

.step-task { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }

.step-wait { background: var(--wait-soft); color: #166534; border-color: transparent; }

@media (prefers-color-scheme: dark) {
  .step-wait { color: #86efac; }
}

/* ---------- Remarques et légendes ---------- */

.note {
  border-left: 3px solid var(--border);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 1.1rem 0;
  color: var(--text-soft);
  font-size: 0.97rem;
  max-width: 46rem;
}

.legend-lines {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 1rem;
  max-width: 46rem;
  font-size: 0.97rem;
  color: var(--text-soft);
}

.legend-lines li { margin: 0.35rem 0; }

.ln {
  display: inline-block;
  width: 2.4rem;
  height: 0;
  border-top: 2px solid var(--text-soft);
  vertical-align: middle;
  margin: 0 0.6rem 0 0.2rem;
}

.ln-link { border-top-style: dashed; }

.ln-cook { border-top-style: dotted; border-top-width: 3px; }

/* ---------- Code ---------- */

code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.9em;
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  max-width: 46rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre code { background: none; border: none; padding: 0; }

/* ---------- Tableaux ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  margin: 1.2rem 0;
  font-size: 0.98rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-weight: 700;
  color: var(--text);
  border-bottom-width: 2px;
}

tbody tr:last-child td { border-bottom: none; }

caption {
  caption-side: bottom;
  text-align: left;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding-top: 0.5rem;
}

/* ---------- Téléchargements ---------- */

/* Tableau de fichiers : plus large que les tableaux du guide, et noms de
   fichiers sans retour à la ligne ; sur écran étroit, la zone défile
   horizontalement plutôt que de casser le nom ou la mise en page. */
.table-wrap {
  max-width: 60rem;
  overflow-x: auto;
}

.table-wrap table {
  max-width: none;
}

.table-wrap td:first-child,
.table-wrap th:first-child {
  white-space: nowrap;
}

/* ---------- Guide ---------- */

.guide-toc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.2rem 1.5rem;
  max-width: 46rem;
}

.guide-toc ol { margin: 0.5rem 0 0; padding-left: 1.4rem; }

.guide-toc li { margin: 0.25rem 0; }

.guide-section h2 {
  padding-top: 1rem;
}

dt { font-weight: 700; margin-top: 1rem; }

dd { margin: 0.25rem 0 0.8rem 1.2rem; color: var(--text-soft); }

kbd {
  font-family: inherit;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 0.35rem;
  padding: 0.05rem 0.45rem;
  font-size: 0.9em;
}

/* ---------- Statut / téléchargement ---------- */

.status-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.4rem 1.6rem;
  margin-top: 1.8rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-box .state {
  flex: 1 1 16rem;
}

.status-box .state p { margin: 0.3rem 0 0; color: var(--text-soft); font-size: 0.98rem; }

.status-box .state strong { display: block; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--wait-soft);
  color: #166534;
}

@media (prefers-color-scheme: dark) {
  .pill { color: #86efac; }
}

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer .inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 4vw, 2.5rem) 2.4rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
