/* Accueil — feuille unique, sans dépendance externe.

   Mêmes jetons, même barre, même colophon que les applications (Notion :
   « Modèle d'application »). La page n'a pas d'accent de marque : elle prête à
   chaque carte celui de son application — rouge AdapteUnRein, bleu MICMAC,
   violet BmiReal — et garde pour elle une encre neutre. */

:root {
  color-scheme:  light;
  --bg:          #f6f7f8;
  --surface:     #ffffff;
  --surface-2:   #f9fafb;
  --ink:         #1b1d20;
  --ink-2:       #4f5660;
  --ink-3:       #77808b;
  --line:        #dfe3e8;
  --line-strong: #c8ced6;
  --accent:      #3d4651;
  --accent-ink:  #ffffff;
  --accent-soft: #eceff3;
  --radius:      10px;
  --radius-sm:   7px;
  --shadow:      0 1px 2px rgba(20, 28, 38, .06), 0 4px 16px rgba(20, 28, 38, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* Accents des applications, copiés de leurs feuilles. */
  --adapteunrein: #c0322a;
  --micmac:       #00589a;
  --bmireal:      #6b3fa0;
}

/* theme.js résout « auto » et pose data-theme : une seule palette sombre à décrire. */
:root[data-theme="dark"] {
  color-scheme:  dark;
  --bg:          #121417;
  --surface:     #1a1d21;
  --surface-2:   #1f2328;
  --ink:         #e7eaee;
  --ink-2:       #aeb6bf;
  --ink-3:       #939ba4;
  --line:        #2d3239;
  --line-strong: #3d444d;
  --accent:      #c4ccd6;
  --accent-ink:  #121417;
  --accent-soft: #262b31;
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  --adapteunrein: #ff7d72;
  --micmac:       #4d9fe0;
  --bmireal:      #b79cf0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}

.skip { position: absolute; left: -9999px; top: 0; z-index: 10;
  background: var(--surface); color: var(--ink); padding: .5rem .8rem; }
.skip:focus { left: .5rem; top: .5rem; }

/* ------------------------------------------------------------------ topbar */

:root { --barre: calc(56px + 1.5rem + 1px); }
@media (max-width: 480px) { :root { --barre: calc(36px + 1.5rem + 1px); } }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--barre);
  padding: .75rem clamp(.8rem, 2vw, 1.4rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.brand .nom { font-size: 1.15rem; letter-spacing: .02em; }

.theme {
  display: flex; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2);
}
.theme label { display: flex; }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme span {
  display: grid; place-items: center; cursor: pointer;
  width: 2rem; height: 1.75rem; color: var(--ink-3);
  border-left: 1px solid var(--line-strong);
}
.theme label:first-child span { border-left: 0; }
.theme span:hover { color: var(--ink-2); background: var(--surface); }
.theme input:checked + span { color: var(--accent); background: var(--accent-soft); }
.theme input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* -------------------------------------------------------------------- page */

.page {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 3rem) clamp(.8rem, 3vw, 1.6rem) 1rem;
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .4rem; letter-spacing: -.01em; }
.chapeau { margin: 0 0 1.8rem; color: var(--ink-2); max-width: 46em; }

.applis {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.applis li { display: flex; }

.appli {
  --couleur: var(--accent);
  flex: 1; display: flex; flex-direction: column; gap: .7rem;
  padding: 1.3rem 1.3rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--couleur);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.appli-adapteunrein { --couleur: var(--adapteunrein); }
.appli-micmac       { --couleur: var(--micmac); }
.appli-bmireal      { --couleur: var(--bmireal); }
.appli:hover { border-color: var(--couleur); transform: translateY(-1px); }
.appli:focus-visible { outline: 2px solid var(--couleur); outline-offset: 2px; }

/* Les logos sont rognés à la même hauteur par ./<application> logo : à hauteur
   égale ici, ils se lisent comme une famille. */
.appli-logo { display: block; height: 44px; }
.logo { display: block; height: 44px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.logo.sombre { display: none; }
:root[data-theme="dark"] .logo.clair { display: none; }
:root[data-theme="dark"] .logo.sombre { display: block; }

.appli-texte  { color: var(--ink); }
.appli-source { color: var(--ink-3); font-size: .88rem; }
.appli-hote {
  margin-top: auto; padding-top: .5rem;
  color: var(--couleur); font-weight: 600; font-size: .92rem;
}

@media (max-width: 480px) {
  .appli-logo, .logo { height: 36px; }
}

/* --------------------------------------------------------------- colophon */

.colophon {
  max-width: 1080px; margin: 0 auto;
  padding: 1.5rem clamp(.8rem, 3vw, 1.6rem) 3rem;
  font-size: .84rem; line-height: 1.55; color: var(--ink-2);
}
.colophon p { margin: 0 0 .55em; }
.colophon strong { font-weight: 600; color: var(--ink); }
.colophon a { color: var(--accent); }
