/*
  metacampus.fr — feuille de style unique.
  Charte Sofia (Marion François, 2026) : référence dans metacampus-steering,
  pilotage/branding/2026-11-15-charte-sofia-reference.md.
  - Outfit, police principale (titres en capitales espacées, corps).
  - Source Serif 4, réservée aux citations des textes officiels.
  - Biseau à 45° et anneaux du logo comme éléments graphiques.
  - L'orange #EE5900 est réservé à la gamification : absent du site.
*/

:root {
  --primary: #15288B;        /* Bleu moyen, primaire */
  --ink: #1E1E42;            /* Navy, encre */
  --turquoise: #36CBCF;      /* filets, biseaux, focus — jamais en texte sur fond clair */
  --blue: #1679E1;           /* Bleu Marion — motifs seulement */
  --pearl: #C6C9D1;          /* Gris perle — filets */
  --text: #474B6B;           /* gris moyen pour le texte courant */
  --text-low: #5F6385;
  --bg: #FFFFFF;
  --bg-soft: #F4F5F9;
  --bg-tint: #EAF8F8;        /* turquoise très clair */
  --on-dark: #F4F5FB;
  --on-dark-low: #C9CFF0;

  --font-sans: 'Outfit', Helvetica, Aptos, Arial, sans-serif;
  --font-text: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 0.4rem + 2.4vw, 2.5rem);
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(3rem, 2rem + 3vw, 5rem);
  --space-6: clamp(4.5rem, 3rem + 5vw, 8rem);

  --t-small: 0.875rem;
  --t-body: 1.0625rem;
  --t-lead: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --t-h3: 1.2rem;
  --t-h2: clamp(1.6rem, 1.25rem + 1.4vw, 2.35rem);
  --t-h1: clamp(2.3rem, 1.5rem + 3.4vw, 4rem);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--turquoise); outline-offset: 3px; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; color: var(--ink); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- En-tête ---------- */
.site-head { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.96); border-bottom: 1px solid var(--pearl); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 4.5rem; }
.brand img { width: 118px; height: auto; }
.nav { display: flex; align-items: center; gap: clamp(1rem, 0.5rem + 1.2vw, 2rem); }
.nav ul { list-style: none; display: flex; gap: clamp(1rem, 0.4rem + 1.2vw, 1.75rem); margin: 0; padding: 0; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 400; padding: 0.4rem 0; border-bottom: 2px solid transparent; transition: border-color 160ms ease; }
.nav a:hover { border-color: var(--pearl); }
.nav a[aria-current="page"] { border-color: var(--turquoise); font-weight: 500; }
.menu { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--primary); color: #fff;
  font-family: var(--font-sans); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; border: 1px solid var(--primary); border-radius: 2px;
  transition: background-color 160ms ease, color 160ms ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary); color: #fff; }
.btn.small { padding: 0.55rem 1rem; font-size: 0.9rem; }
.btn.on-dark { background: #fff; color: var(--primary); border-color: #fff; }
.btn.on-dark:hover { background: var(--turquoise); border-color: var(--turquoise); color: var(--ink); }

@media (max-width: 62rem) {
  .nav > ul, .nav > .btn { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; font-weight: 500; color: var(--ink); padding: 0.5rem 0.9rem; border: 1px solid var(--pearl); border-radius: 2px; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { border-color: var(--ink); }
  .menu ul { list-style: none; margin: 0; padding: 0.75rem 0; position: absolute; right: 0; top: calc(100% + 0.5rem); width: min(18rem, calc(100vw - 2rem)); background: #fff; border: 1px solid var(--pearl); box-shadow: 0 12px 32px rgba(30, 30, 66, 0.12); }
  .menu li a { display: block; padding: 0.7rem 1.25rem; color: var(--ink); text-decoration: none; }
  .menu li a[aria-current="page"] { border-left: 3px solid var(--turquoise); padding-left: calc(1.25rem - 3px); font-weight: 500; }
  .menu li.cta-item { border-top: 1px solid var(--pearl); margin-top: 0.5rem; padding-top: 0.5rem; }
}

/* ---------- Typographie ---------- */
.label {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--primary); margin: 0 0 var(--space-3);
  display: flex; align-items: center; gap: 0.9rem;
}
.label::before { content: ""; width: 1.1rem; height: 1.1rem; flex: none; background: linear-gradient(135deg, var(--turquoise) 50%, transparent 50%); }
.label .n { font-weight: 600; }
h1, h2, h3 { font-family: var(--font-sans); color: var(--ink); margin: 0; }
h1 { font-size: var(--t-h1); font-weight: 300; line-height: 1.08; letter-spacing: -0.02em; max-width: 20ch; margin-bottom: var(--space-3); }
h1 b { font-weight: 500; }
h2 { font-size: var(--t-h2); font-weight: 400; line-height: 1.2; letter-spacing: -0.01em; max-width: 30ch; margin-bottom: var(--space-3); }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.3; margin-bottom: 0.5rem; }
.lead { font-size: var(--t-lead); line-height: 1.6; color: var(--text); max-width: 40rem; }
.small, .source { font-size: var(--t-small); color: var(--text-low); }
.measure { max-width: 42rem; }

/* ---------- Ouverture de page ---------- */
.opening { position: relative; overflow: hidden; padding: var(--space-6) 0 var(--space-5); border-bottom: 1px solid var(--pearl); }
.opening .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: var(--space-4); }
.opening .rings {
  position: absolute; right: -9rem; top: 50%; width: 36rem; max-width: none; transform: translateY(-50%);
  opacity: 0.07; pointer-events: none; user-select: none;
}
.opening.inner { padding: var(--space-5) 0 var(--space-4); background: var(--bg-soft); }
.opening.inner .rings { width: 26rem; right: -6rem; opacity: 0.06; }
.opening > .wrap { position: relative; }
.crumb { font-size: var(--t-small); color: var(--text-low); margin: 0 0 var(--space-3); }
.crumb a { color: var(--text-low); }

/* Biseau à 45° — coin de section */
.bevel { position: relative; }
.bevel::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: clamp(3rem, 2rem + 4vw, 6rem); aspect-ratio: 1;
  background: linear-gradient(135deg, transparent 50%, var(--turquoise) 50%);
}

/* ---------- Sections ---------- */
.section { padding: var(--space-6) 0; }
.section + .section { border-top: 1px solid var(--pearl); }
.section.soft { background: var(--bg-soft); border-top: 0; }
.section.soft + .section { border-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 52rem) { .cols, .cols.even { grid-template-columns: 1fr; } }

/* Repères chiffrés */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: var(--space-4) 0 0; border-top: 1px solid var(--ink); }
.facts div { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-right: 1px solid var(--pearl); }
.facts div + div { padding-left: var(--space-3); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); font-weight: 300; color: var(--primary); line-height: 1.1; margin-bottom: 0.5rem; font-variant-numeric: tabular-nums; }
.facts dd { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.facts .source { display: block; margin-top: 0.4rem; font-size: 0.8rem; }
@media (max-width: 46rem) {
  .facts { grid-template-columns: 1fr; }
  .facts div, .facts div + div { padding: var(--space-3) 0; border-right: 0; border-bottom: 1px solid var(--pearl); }
}

/* Citation d'un texte officiel */
.citation { margin: 0 0 var(--space-3); padding: var(--space-3) 0 var(--space-3) var(--space-3); border-left: 3px solid var(--primary); }
.citation blockquote { margin: 0 0 0.75rem; font-family: var(--font-text); font-style: italic; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); line-height: 1.5; color: var(--ink); }
.citation figcaption { font-size: var(--t-small); color: var(--text-low); }

/* Registre : lignes intitulé / texte */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ledger li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--pearl); }
.ledger li > :first-child { font-weight: 600; color: var(--ink); }
.ledger p:last-child { margin-bottom: 0; }
@media (max-width: 40rem) { .ledger li { grid-template-columns: 1fr; gap: 0.35rem; } }

/* Parcours en étapes */
.path { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.path li { position: relative; padding: 2.75rem var(--space-3) 0 0; counter-increment: step; }
.path li::before {
  content: counter(step, decimal-leading-zero); position: absolute; top: 0; left: 0;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.12em; color: var(--primary);
  background: var(--bg); padding-right: 0.75rem;
}
.section.soft .path li::before { background: var(--bg-soft); }
.path li::after { content: ""; position: absolute; top: 0.65rem; left: 2.4rem; right: 0; height: 1px; background: var(--pearl); }
.path li:last-child::after { display: none; }
.path p { margin: 0; font-size: 0.98rem; }
@media (max-width: 56rem) {
  .path { grid-template-columns: 1fr; }
  .path li { padding: 0 0 var(--space-4) 3.5rem; }
  .path li::after { top: 1.9rem; bottom: 0.4rem; left: 0.75rem; right: auto; width: 1px; height: auto; }
}

/* Statut d'une fonction (sobre) */
.status { display: inline-block; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: #6B4A00; border-left: 3px solid #FB9D19; padding: 0.1rem 0 0.1rem 0.55rem; margin: 0 0 0.6rem; }

/* Blocs */
.panel { background: #fff; border: 1px solid var(--pearl); padding: var(--space-4); }
.panel.tint { background: var(--bg-tint); border-color: transparent; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 56rem) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 46rem) { .grid-2 { grid-template-columns: 1fr; } }
.entry { display: block; padding: var(--space-4); background: #fff; border: 1px solid var(--pearl); text-decoration: none; color: var(--text); transition: border-color 160ms ease; position: relative; }
.entry:hover { border-color: var(--primary); text-decoration: none; }
.entry h3 { color: var(--ink); }
.entry .more { display: inline-block; margin-top: 0.75rem; color: var(--primary); font-weight: 500; }
.entry .more::after { content: " →"; transition: margin-left 160ms var(--ease); }
.entry:hover .more::after { margin-left: 0.25rem; }

ul.dash { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.dash li { position: relative; padding-left: 1.4rem; margin-bottom: 0.6rem; }
ul.dash li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.7rem; height: 1px; background: var(--primary); }

/* Ce que Sofia n'est pas */
.not { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); border-top: 1px solid var(--ink); }
.not li { padding: var(--space-3) 0; border-bottom: 1px solid var(--pearl); }
@media (max-width: 46rem) { .not { grid-template-columns: 1fr; } }

/* Vidéo */
.video { aspect-ratio: 16 / 9; background: var(--ink); }
.video video { width: 100%; height: 100%; display: block; object-fit: contain; }

/* ---------- Appel final ---------- */
.closing { position: relative; overflow: hidden; background: var(--primary); color: var(--on-dark); padding: var(--space-5) 0; }
.closing::after { content: ""; position: absolute; right: 0; bottom: 0; width: clamp(6rem, 4rem + 10vw, 14rem); aspect-ratio: 1; background: linear-gradient(135deg, transparent 50%, var(--turquoise) 50%); }
.closing .label { color: var(--on-dark-low); }
.closing .label::before { background: linear-gradient(135deg, var(--turquoise) 50%, transparent 50%); }
.closing h2 { color: #fff; }
.closing p { color: var(--on-dark-low); max-width: 38rem; }
.closing .wrap { position: relative; z-index: 1; }
.closing a:not(.btn) { color: #fff; }

/* ---------- Pied de page ---------- */
/* Fond blanc : la charte n'autorise le logotype que sur blanc (§02, « Interdits ») */
.site-foot { background: #FFFFFF; border-top: 1px solid var(--pearl); padding: var(--space-5) 0 var(--space-4); font-size: 0.92rem; }
.site-foot .cols4 { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-4); }
@media (max-width: 56rem) { .site-foot .cols4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 34rem) { .site-foot .cols4 { grid-template-columns: 1fr; } }
.site-foot h2 { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); margin: 0 0 1rem; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin-bottom: 0.5rem; }
.site-foot a { color: var(--text); text-decoration: none; }
.site-foot a:hover { color: var(--primary); text-decoration: underline; }
.site-foot .legal { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--pearl); font-size: var(--t-small); color: var(--text-low); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.site-foot .brand img { width: 104px; margin-bottom: 1rem; }

/* Pages légales */
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.35rem; font-weight: 500; margin: var(--space-4) 0 var(--space-2); }
.prose h2:first-child { margin-top: 0; }
.todo { background: #FFF4DF; color: #6B4A00; padding: 0 0.3rem; }

@media (prefers-reduced-motion: reduce) { *, ::before, ::after { transition: none !important; } }
@media print { .site-head, .closing, .site-foot .cols4 { display: none; } }

/* Le bouton de l'en-tête garde ses couleurs malgré les règles de navigation */
.nav a.btn { color: #fff; border-bottom: 1px solid var(--primary); padding: 0.55rem 1rem; }
.nav a.btn:hover { border-color: var(--ink); }

