/* =========================================================
   MédiéCraft — Site web V2
   D'après les maquettes Figma « V2 - SITE WEB » (bureau, mobile, clair, sombre)
   ========================================================= */

/* ---------- Thème clair (par défaut) ---------- */
:root {
  color-scheme: light;

  /* Couleurs de marque (identiques dans les deux thèmes) */
  --mc-terracotta: #a95139;
  --mc-sage: #64785d;
  --mc-amber: #d99a43;
  --mc-ink: #302827;
  --mc-cream: #fff7f0;

  /* Couleurs d'interface */
  --mc-bg-page: #fff7f0;
  --mc-bg-surface: #fffcf8;
  --mc-bg-inset: #f5e9dd;
  --mc-bg-nav: #302827;
  --mc-border-subtle: #e6d5c6;
  --mc-border-strong: #8c7b70;
  --mc-text-primary: #302827;
  --mc-text-secondary: #6b5f5d;
  --mc-text-on-nav: #fff7f0;
  --mc-text-on-nav-muted: #d9ccc2;
  --mc-nav-item-hover-bg: #4a3f3e;
  --mc-button-primary-bg: #a95139;
  --mc-button-primary-bg-hover: #8f432f;
  --mc-text-on-primary: #fff7f0;
  --mc-text-link: #a95139;
  --mc-status-info-bg: #dce9f2;
  --mc-status-info-text: #2f5671;
  --mc-status-info-dot: #3f6c8c;
  --mc-status-ok-bg: #e1efe3;
  --mc-status-ok-text: #2c5a36;
  --mc-status-ok-dot: #3d8a4f;
  --mc-status-err-bg: #f6e0da;
  --mc-status-err-text: #873221;
  --mc-status-err-dot: #b8452c;
  --mc-status-warn-bg: #fbe9d2;
  --mc-status-warn-text: #8a4b0f;
  --mc-status-warn-dot: #d9822b;
  --mc-shadow: rgba(48, 40, 39, .3);
  --mc-overlay-scrim: rgba(48, 40, 39, .5);
  --mc-placeholder-border: transparent;
  --mc-logo: url("../assets/logo.svg");
  /* Hero de l'accueil : fond parchemin en clair, encre en sombre */
  --mc-hero-bg: #f5e9dd;
  --mc-hero-lead: #6b5f5d;
  --mc-hero-accent: #a95139;

  /* Typo */
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Mise en page */
  --gutter: 80px;
  --nav-h: 84px;
  --radius: 6px;
  --radius-btn: 4px;
}

/* ---------- Thème sombre (maquettes « V2 - … - SOMBRE ») ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --mc-bg-page: #231d1c;
  --mc-bg-surface: #302827;
  --mc-bg-inset: #231d1c;
  --mc-bg-nav: #1b1615;
  --mc-border-subtle: #4a403e;
  --mc-border-strong: #948681;
  --mc-text-primary: #fff7f0;
  --mc-text-secondary: #cdbfb5;
  --mc-text-on-nav-muted: #bfb0a6;
  --mc-nav-item-hover-bg: #2a2322;
  --mc-button-primary-bg: #b05740;
  --mc-button-primary-bg-hover: #c2664d;
  --mc-text-link: #d99a43;
  --mc-status-info-bg: #25343f;
  --mc-status-info-text: #a9c4dc;
  --mc-status-info-dot: #7fa8c9;
  --mc-status-ok-bg: #1f3324;
  --mc-status-ok-text: #a8d6b2;
  --mc-status-ok-dot: #5fb374;
  --mc-status-err-bg: #42231d;
  --mc-status-err-text: #f0b0a0;
  --mc-status-err-dot: #e0674c;
  --mc-status-warn-bg: #3d2a17;
  --mc-status-warn-text: #f2c08a;
  --mc-status-warn-dot: #e8963f;
  --mc-shadow: rgba(0, 0, 0, .6);
  --mc-overlay-scrim: rgba(18, 14, 13, .7);
  --mc-placeholder-border: #4a403e;
  --mc-logo: url("../assets/logo-cream.svg");
  --mc-hero-bg: #302827;
  --mc-hero-lead: #bfb0a6;
  --mc-hero-accent: #d99a43;
}
:root[data-theme="dark"] .etendard:not(.etendard--cream) { background: #3a312f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --mc-bg-page: #231d1c;
    --mc-bg-surface: #302827;
    --mc-bg-inset: #231d1c;
    --mc-bg-nav: #1b1615;
    --mc-border-subtle: #4a403e;
    --mc-border-strong: #948681;
    --mc-text-primary: #fff7f0;
    --mc-text-secondary: #cdbfb5;
    --mc-text-on-nav-muted: #bfb0a6;
    --mc-nav-item-hover-bg: #2a2322;
    --mc-button-primary-bg: #b05740;
    --mc-button-primary-bg-hover: #c2664d;
    --mc-text-link: #d99a43;
    --mc-status-info-bg: #25343f;
    --mc-status-info-text: #a9c4dc;
    --mc-status-info-dot: #7fa8c9;
    --mc-status-ok-bg: #1f3324;
    --mc-status-ok-text: #a8d6b2;
    --mc-status-ok-dot: #5fb374;
    --mc-status-err-bg: #42231d;
    --mc-status-err-text: #f0b0a0;
    --mc-status-err-dot: #e0674c;
    --mc-status-warn-bg: #3d2a17;
    --mc-status-warn-text: #f2c08a;
    --mc-status-warn-dot: #e8963f;
    --mc-shadow: rgba(0, 0, 0, .6);
    --mc-overlay-scrim: rgba(18, 14, 13, .7);
    --mc-placeholder-border: #4a403e;
    --mc-logo: url("../assets/logo-cream.svg");
    --mc-hero-bg: #302827;
    --mc-hero-lead: #bfb0a6;
    --mc-hero-accent: #d99a43;
  }
  :root:not([data-theme="light"]) .etendard:not(.etendard--cream) { background: #3a312f; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0;
  background: var(--mc-bg-page);
  color: var(--mc-text-primary);
  font-family: var(--font-sans);
  font-variation-settings: "opsz" 14;
  font-size: 16px; line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, ul, ol { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--mc-amber); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--mc-ink); color: var(--mc-cream);
  padding: 10px 16px; border-radius: var(--radius-btn); font-weight: 600; font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* ---------- Typographie ---------- */
.overline { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.t-hero { font-size: 68px; line-height: 72px; font-weight: 700; letter-spacing: -0.02em; }
.t-h1 { font-size: 44px; line-height: 52px; font-weight: 700; letter-spacing: -0.01em; }
.t-h2 { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.005em; }
.t-h3 { font-size: 22px; line-height: 30px; font-weight: 600; }
.t-sub { font-size: 18px; line-height: 26px; font-weight: 500; }
.t-lead { font-size: 20px; line-height: 30px; }
.t-body { font-size: 16px; line-height: 24px; }
.t-small { font-size: 14px; line-height: 22px; }
.t-caption { font-size: 12px; line-height: 16px; letter-spacing: 0.002em; }
.t-tech { font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
.muted { color: var(--mc-text-secondary); }

/* ---------- Repère (losange) et surtitre ---------- */
.repere {
  display: inline-block; flex-shrink: 0;
  width: 12px; height: 12px; background: var(--mc-amber);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.kicker { display: inline-flex; align-items: center; gap: 10px; color: var(--mc-text-secondary); }
.kicker--hero .repere { width: 14px; height: 14px; }
.section--terracotta .kicker, .section--sage .kicker, .bandeau .kicker, .kicker--light { color: var(--mc-cream); }
.kicker--amber { color: var(--mc-amber); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 26px; border-radius: var(--radius-btn);
  font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0.002em; white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }
.btn--primary { background: var(--mc-button-primary-bg); color: var(--mc-text-on-primary); }
.btn--primary:hover { background: var(--mc-button-primary-bg-hover); }
.btn--secondary { border: 2px solid var(--mc-text-primary); color: var(--mc-text-primary); }
.btn--secondary:hover { background: var(--mc-text-primary); color: var(--mc-bg-page); }
.btn--on-dark { border: 2px solid var(--mc-cream); color: var(--mc-cream); }
.btn--on-dark:hover { background: var(--mc-cream); color: var(--mc-ink); }
.btn--cream { background: var(--mc-cream); color: var(--mc-ink); }
.btn--cream:hover { background: #fff; }
/* Les icônes des boutons prennent la couleur du texte du bouton (blanc sur terracotta…) */
.btn [data-icon] { color: inherit; }
.btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.link-more { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--mc-text-link); }
.link-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Icônes (injectées par js/main.js) ---------- */
[data-icon] { display: inline-flex; flex-shrink: 0; color: var(--mc-text-primary); }
.icon--terracotta { color: var(--mc-terracotta); }
.icon--sage { color: var(--mc-sage); }

/* ---------- Formes de marque ---------- */
/* Bannière suspendue (pilier) : rectangle terminé en pointe */
.banniere {
  position: absolute; top: 0; width: 60px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 36px), 50% 100%, 0 calc(100% - 36px));
}
.banniere--terracotta { background: var(--mc-terracotta); }
.banniere--sage { background: var(--mc-sage); }
.banniere--amber { background: var(--mc-amber); }
.banniere--cream { background: var(--mc-cream); }
.banniere--ink { background: var(--mc-ink); }
/* Monogramme en filigrane */
.marque-decor { position: absolute; pointer-events: none; user-select: none; max-width: none; }
/* Piquet (petit pieu des cartes) */
.piquet {
  flex-shrink: 0; width: 12px; height: 64px; background: var(--mc-terracotta);
  clip-path: polygon(0 0, 100% 0, 100% 46%, 50% 100%, 0 46%);
}
.piquet--lg { width: 14px; height: 72px; }
/* Visuel en forme d'étendard (pointe en bas) */
.etendard {
  position: relative; overflow: hidden; flex-shrink: 0;
  background: var(--mc-bg-inset);
  clip-path: polygon(0 0, 100% 0, 100% 92%, 50% 100%, 0 92%);
}
.etendard--cream { background: var(--mc-cream); }

/* ---------- Emplacements d'images ----------
   Cadre neutre (logo en filigrane) tant que l'image n'existe pas dans assets/images/. */
.placeholder { position: relative; overflow: hidden; background: var(--mc-bg-inset); }
.placeholder::before {
  content: ""; position: absolute; inset: 0;
  background: var(--mc-logo) center / min(42%, 200px) auto no-repeat; opacity: .08;
}
.etendard--cream.placeholder::before { background-image: url("../assets/logo.svg"); }
.placeholder > .slot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.etendard--cream.placeholder { background: var(--mc-cream); }
.hero .etendard--cream.placeholder { background: var(--mc-hero-visual, #fffcf8); }
:root[data-theme="dark"] .hero .etendard--cream.placeholder { background: var(--mc-cream); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero .etendard--cream.placeholder { background: var(--mc-cream); } }
.placeholder.has-image::before { display: none; }
.placeholder.has-image > .slot { opacity: 1; }

/* ---------- Sections ---------- */
.section { position: relative; overflow: hidden; padding: 104px var(--gutter); background: var(--mc-bg-page); }
.section > .wrap { position: relative; max-width: 1280px; margin: 0 auto; }
.section--surface { background: var(--mc-bg-surface); }
.section--88 { padding-block: 88px; }
.section--72 { padding-block: 72px; }
.section--sage { background: var(--mc-sage); color: var(--mc-cream); }
.section--terracotta { background: var(--mc-terracotta); color: var(--mc-cream); }
.stack { display: flex; flex-direction: column; }
.gap-56 { gap: 56px; } .gap-48 { gap: 48px; } .gap-40 { gap: 40px; } .gap-32 { gap: 32px; } .gap-28 { gap: 28px; }
.section-head { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.section-head--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--mc-bg-page); transition: box-shadow .2s ease; isolation: isolate; }
.site-header.is-scrolled { box-shadow: 0 6px 24px -12px var(--mc-shadow); }
.nav {
  position: relative; z-index: 3; background: var(--mc-bg-page);
  height: var(--nav-h); max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav__logo, .nav__logo img { width: 150px; height: 40px; flex-shrink: 0; }
.logo--dark { display: none; }
:root[data-theme="dark"] .logo--light { display: none; }
:root[data-theme="dark"] .logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo--light { display: none; }
  :root:not([data-theme="light"]) .logo--dark { display: block; }
}
.nav__links { display: flex; align-items: center; gap: 4px; align-self: stretch; }
.nav__link {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 14px 0;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--mc-text-secondary); transition: color .15s ease;
}
.nav__link::after {
  content: ""; width: 10px; height: 10px; background: transparent;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); transition: background-color .15s ease;
}
.nav__link:hover { color: var(--mc-text-primary); }
.nav__link:hover::after { background: var(--mc-border-subtle); }
.nav__link[aria-current="page"] { color: var(--mc-text-primary); font-weight: 600; }
.nav__link[aria-current="page"]::after { background: var(--mc-amber); }
.nav__end { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 44px; height: 44px; border-radius: var(--radius-btn); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--mc-text-secondary); border: 1px solid var(--mc-border-subtle);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--mc-text-primary); background: var(--mc-bg-surface); border-color: var(--mc-border-strong); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
/* Bouton menu mobile : trois petites bannières (maquette « Burger ») */
.nav__toggle { display: none; width: 44px; height: 44px; align-items: flex-start; justify-content: center; gap: 6px; padding-top: 9px; }
.nav__toggle span { display: block; width: 9px; transition: height .2s ease; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4px), 50% 100%, 0 calc(100% - 4px)); }
.nav__toggle span:nth-child(1) { height: 26px; background: var(--mc-terracotta); }
.nav__toggle span:nth-child(2) { height: 22px; background: var(--mc-sage); }
.nav__toggle span:nth-child(3) { height: 18px; background: var(--mc-amber); }
.nav__toggle[aria-expanded="true"] span { height: 12px; }
.nav__mobile, .nav__scrim { display: none; }

/* ---------- Pied de page ---------- */
.site-footer { position: relative; overflow: hidden; background: var(--mc-bg-nav); color: var(--mc-text-on-nav); }
.footer__bande { display: flex; height: 10px; }
.footer__bande span { flex: 1; }
.footer__bande span:nth-child(1) { background: var(--mc-terracotta); }
.footer__bande span:nth-child(2) { background: var(--mc-sage); }
.footer__bande span:nth-child(3) { background: var(--mc-amber); }
.site-footer .marque-decor { width: 520px; left: calc(50% + 280px); top: -110px; opacity: .06; }
/* Pas de monogramme en double : si la page se termine par un bandeau coloré, ce bandeau
   n'affiche pas le sien et on garde celui du pied de page. La bande tricolore reste toujours au-dessus du décor. */
main > .cta:last-child .marque-decor { display: none; }
.footer__bande { position: relative; z-index: 1; }
.site-footer__inner { position: relative; max-width: 1440px; margin: 0 auto; padding: 56px var(--gutter) 40px; display: flex; flex-direction: column; gap: 40px; }
.footer__cols { display: flex; gap: 80px; align-items: flex-start; }
.footer__brand { width: 440px; display: flex; flex-direction: column; gap: 16px; }
.footer__brand img { width: 190px; height: 51px; }
.footer__brand .overline, .footer__brand .t-small, .footer__col .overline, .footer__legal { color: var(--mc-text-on-nav-muted); }
.footer__col { display: flex; flex-direction: column; gap: 12px; white-space: nowrap; }
.footer__col a { font-size: 14px; line-height: 20px; font-weight: 500; }
.footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__rule { height: 1px; background: var(--mc-nav-item-hover-bg); }

/* ---------- Statut du serveur ---------- */
.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 100px;
  background: var(--mc-status-info-bg); color: var(--mc-status-info-text); font-size: 12px; line-height: 16px;
}
.status__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--mc-status-info-dot); }
.status[data-state="loading"] .status__dot { animation: status-pulse 1.2s ease-in-out infinite; }
.status[data-state="online"] { background: var(--mc-status-ok-bg); color: var(--mc-status-ok-text); }
.status[data-state="online"] .status__dot { background: var(--mc-status-ok-dot); animation: status-ping 2s ease-out infinite; }
.status[data-state="offline"] { background: var(--mc-status-err-bg); color: var(--mc-status-err-text); }
.status[data-state="offline"] .status__dot { background: var(--mc-status-err-dot); }
/* Statut non configuré ou service de statut injoignable : « hors ligne » en orange */
.status[data-state="warning"] { background: var(--mc-status-warn-bg); color: var(--mc-status-warn-text); }
.status[data-state="warning"] .status__dot { background: var(--mc-status-warn-dot); }
@keyframes status-pulse { 50% { opacity: .35; } }
@keyframes status-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mc-status-ok-dot) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Cartes ---------- */
.card { background: var(--mc-bg-surface); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
a.card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-3px); border-color: var(--mc-border-strong); box-shadow: 0 16px 32px -20px var(--mc-shadow); }
.card__barre { height: 8px; flex-shrink: 0; }
.barre--terracotta { background: var(--mc-terracotta); }
.barre--sage { background: var(--mc-sage); }
.barre--amber { background: var(--mc-amber); }
/* Carte pilier / étape / rôle : barre colorée + contenu */
.card__body { display: flex; flex-direction: column; gap: 16px; padding: 32px 32px 36px; align-items: flex-start; }
.card__body--14 { gap: 14px; padding: 30px 32px 34px; }
.card__top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.card__top .t-tech { color: var(--mc-text-secondary); }
.repere--28 { width: 28px; height: 28px; }
/* Carte lieu / actualité : image + piquet + texte */
.card__media { height: 220px; flex-shrink: 0; }
.card__content { display: flex; gap: 16px; padding: 22px 24px 24px; align-items: flex-start; }
.card__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card__text .overline, .card__text .t-small { color: var(--mc-text-secondary); }
/* Carte info avec piquet (Rejoindre) */
.info-card { display: flex; gap: 20px; padding: 28px; background: var(--mc-bg-page); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); }
.info-card .t-tech, .info-card .t-small { color: var(--mc-text-secondary); }

/* ---------- Accueil : hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--mc-hero-bg); color: var(--mc-text-primary); }
.hero__inner { position: relative; max-width: 1440px; height: 720px; margin: 0 auto; padding: 130px var(--gutter) 0; display: flex; gap: 40px; align-items: flex-start; }
.hero .marque-decor { width: 980px; left: 560px; top: -140px; opacity: .07; }
.hero .banniere:nth-of-type(1) { right: 290px; height: 360px; }
.hero .banniere:nth-of-type(2) { right: 206px; height: 290px; }
.hero .banniere:nth-of-type(3) { right: 122px; height: 230px; }
.hero__text { position: relative; z-index: 1; width: 520px; flex-shrink: 0; margin-top: 10px; display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.hero__text .t-lead { width: 500px; max-width: 100%; color: var(--mc-hero-lead); }
.hero .kicker--hero { color: var(--mc-hero-accent); }
.hero .marque--encre { opacity: .06; }
.hero .marque--encre, :root[data-theme="dark"] .hero .marque--creme { display: block; }
.hero .marque--creme, :root[data-theme="dark"] .hero .marque--encre { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero .marque--creme { display: block; }
  :root:not([data-theme="light"]) .hero .marque--encre { display: none; }
}
/* Bouton « Découvrir l'univers » : contour encre en clair, crème en sombre */
.btn--hero-alt { border: 2px solid var(--mc-text-primary); color: var(--mc-text-primary); }
.btn--hero-alt:hover { background: var(--mc-text-primary); color: var(--mc-hero-bg); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 6px; }
.hero__piliers { display: flex; align-items: center; gap: 12px; padding-top: 16px; color: var(--mc-hero-accent); }
.hero__piliers .repere { background: var(--mc-amber); }
.hero__visual { position: relative; z-index: 1; width: 400px; height: 500px; }

/* ---------- Bandeau des pages intérieures ---------- */
.bandeau { position: relative; overflow: hidden; color: var(--mc-cream); }
.bandeau--terracotta { background: var(--mc-terracotta); }
.bandeau--sage { background: var(--mc-sage); }
.bandeau--amber { background: var(--mc-amber); color: var(--mc-ink); }
.bandeau--ink { background: var(--mc-ink); }
.bandeau__inner { position: relative; max-width: 1440px; height: 380px; margin: 0 auto; padding: 88px var(--gutter) 0; }
.bandeau .marque-decor { width: 720px; left: 700px; top: -170px; opacity: .1; }
.bandeau .banniere:nth-of-type(1) { right: 250px; height: 260px; }
.bandeau .banniere:nth-of-type(2) { right: 166px; height: 200px; }
.bandeau .banniere:nth-of-type(3) { right: 82px; height: 160px; }
.bandeau__text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.bandeau__text .t-lead { max-width: 620px; }
.bandeau--amber .kicker { color: var(--mc-ink); }
.bandeau--amber .repere { background: var(--mc-ink); }
.bandeau--ink .t-lead { color: var(--mc-text-on-nav-muted); }

/* ---------- Bandeau d'appel (terracotta / sauge) ---------- */
.cta { position: relative; overflow: hidden; padding: 88px var(--gutter); }
.cta__inner { position: relative; max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.cta .marque-decor { width: 760px; left: calc(50% + 100px); top: -190px; opacity: .14; }
.cta--compact { padding: 80px var(--gutter); }
.cta--compact .cta__inner { gap: 24px; }
.cta--compact .marque-decor { width: 680px; left: calc(50% + 140px); top: -170px; }
.cta .t-lead { max-width: 620px; }
.cta__actions { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 6px; }

/* ---------- Tuiles « Le royaume » ---------- */
.tuile { display: flex; align-items: center; gap: 20px; padding: 28px; background: var(--mc-cream); color: var(--mc-ink); border-radius: var(--radius); }
.tuile [data-icon] { color: var(--mc-ink); width: 48px; justify-content: center; }
.tuile__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* ---------- Univers : piliers détaillés ---------- */
.feature { display: flex; align-items: center; gap: 96px; }
.feature__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.feature__head { display: flex; align-items: center; gap: 16px; color: var(--mc-text-secondary); }
.feature__text .t-lead { color: var(--mc-text-secondary); }
.feature .etendard { width: 400px; height: 460px; }

/* ---------- Actualités ---------- */
.headline { display: flex; align-items: center; gap: 56px; padding: 40px 56px; background: var(--mc-bg-surface); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); }
.headline .etendard { width: 320px; height: 360px; }
.headline__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.headline__text .t-body, .headline__text .kicker { color: var(--mc-text-secondary); }
.news-empty { display: flex; gap: 20px; padding: 32px; background: var(--mc-bg-surface); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); }
.news-empty__text { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.news-empty .t-body { color: var(--mc-text-secondary); }
.news-empty .btn { margin-top: 6px; }

/* ---------- Règlement ---------- */
/* La section du règlement ne masque pas son contenu : sinon le sommaire ne peut pas rester visible au défilement */
.section:has(.rules) { overflow: visible; }
.rules { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 64px; align-items: start; }
.toc {
  position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto;
  background: var(--mc-bg-surface); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); padding: 24px;
}
.toc details > summary { list-style: none; cursor: default; color: var(--mc-text-secondary); }
.toc details > summary::-webkit-details-marker { display: none; }
.toc__links { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.toc a { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--mc-text-secondary); transition: color .15s ease; }
.toc a::before { content: ""; display: none; width: 10px; height: 10px; margin-top: 5px; flex-shrink: 0; background: var(--mc-amber); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.toc a:hover { color: var(--mc-text-primary); }
.toc a.is-active { color: var(--mc-text-primary); font-weight: 600; }
.toc a.is-active::before { display: block; }
.articles { display: flex; flex-direction: column; gap: 48px; max-width: 896px; }
.article { display: flex; flex-direction: column; gap: 14px; }
.article .t-body, .article ul { color: var(--mc-text-secondary); }
.article ul { padding-left: 24px; }
.article li { margin-bottom: 6px; }
.article li:last-child { margin-bottom: 0; }
.article li::marker { color: var(--mc-terracotta); }
.article a { color: var(--mc-text-link); }
.article a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Communauté : galerie d'étendards ---------- */
.galerie { display: flex; justify-content: space-between; gap: 24px; }
.galerie .etendard { width: 260px; height: 320px; }

/* ---------- Téléchargement ---------- */
.download { display: flex; align-items: center; gap: 80px; }
.download__media { width: 640px; height: 400px; flex-shrink: 0; border-radius: 8px; border: 1px dashed var(--mc-border-strong); }
.download__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.download__buttons { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.download__text .t-body { color: var(--mc-text-secondary); }

/* ---------- Apparition au scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
  .status__dot { animation: none !important; }
}

/* =========================================================
   Écrans moyens (1081 – 1280 px)
   ========================================================= */
@media (max-width: 1280px) {
  :root { --gutter: 48px; }
  .hero__text { width: 440px; }
  .hero__visual { width: 340px; height: 425px; }
  .hero .marque-decor { left: 420px; }
  .hero .banniere:nth-of-type(1) { right: 160px; }
  .hero .banniere:nth-of-type(2) { right: 96px; }
  .hero .banniere:nth-of-type(3) { right: 32px; }
  .bandeau .marque-decor { left: auto; right: -80px; }
  .bandeau .banniere:nth-of-type(1) { right: 160px; }
  .bandeau .banniere:nth-of-type(2) { right: 96px; }
  .bandeau .banniere:nth-of-type(3) { right: 32px; }
  .feature { gap: 56px; }
  .feature .etendard { width: 340px; height: 400px; }
  .headline { gap: 40px; padding: 32px 40px; }
  .headline .etendard { width: 260px; height: 300px; }
  .download { gap: 48px; }
  .download__media { width: 50%; height: auto; aspect-ratio: 16 / 10; }
  .footer__cols { gap: 48px; }
  .footer__brand { width: 360px; }
  .galerie .etendard { width: calc((100% - 72px) / 4); height: auto; aspect-ratio: 260 / 320; }
}

/* =========================================================
   Tablette (641 – 1080 px) — pas de maquette dédiée :
   interpolation entre bureau et mobile.
   ========================================================= */
@media (max-width: 1080px) {
  :root { --gutter: 40px; }

  /* Menu mobile (maquette « V2 / Navigation / Mobile ») */
  .nav__links, .nav__cta { display: none; }
  .nav__end { gap: 8px; }
  .nav__toggle { display: inline-flex; }
  .nav__mobile {
    display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 2;
    background: var(--mc-bg-surface); border-bottom: 1px solid var(--mc-border-subtle);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .nav__mobile.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, transform .2s ease; }
  .nav__mobile ul { list-style: none; margin: 0; padding: 8px var(--gutter) 24px; display: flex; flex-direction: column; gap: 6px; }
  .nav__mobile a:not(.btn) { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 18px; line-height: 26px; font-weight: 500; color: var(--mc-text-primary); }
  .nav__mobile a[aria-current="page"] { font-weight: 700; }
  .nav__mobile a[aria-current="page"]::after { content: ""; width: 10px; height: 10px; background: var(--mc-amber); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
  .nav__mobile .btn { margin-top: 8px; width: 100%; }
  .nav__scrim { display: block; position: fixed; inset: 0; z-index: 1; background: var(--mc-overlay-scrim); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
  .nav__scrim.is-open { opacity: 1; visibility: visible; transition: opacity .2s ease; }
  body.menu-open { overflow: hidden; }

  .section { padding-block: 80px; }
  .section--88, .section--72 { padding-block: 64px; }
  .t-hero { font-size: 56px; line-height: 60px; }
  .t-h1 { font-size: 36px; line-height: 44px; }

  /* Hero empilé */
  .hero__inner { height: auto; flex-direction: column; gap: 40px; padding: 80px var(--gutter) 64px; }
  .hero__text { width: 100%; margin-top: 0; padding-right: 190px; }
  .hero__visual { width: 100%; max-width: 520px; height: auto; aspect-ratio: 4 / 5; }
  .hero .marque-decor { width: 760px; left: auto; right: -260px; top: -120px; }
  .hero .banniere { width: 40px; }
  .hero .banniere:nth-of-type(1) { right: 136px; height: 220px; }
  .hero .banniere:nth-of-type(2) { right: 84px; height: 176px; }
  .hero .banniere:nth-of-type(3) { right: 32px; height: 140px; }

  .bandeau__inner { height: auto; padding: 72px var(--gutter); }
  .bandeau__text { max-width: calc(100% - 180px); }
  .bandeau .banniere { width: 40px; }
  .bandeau .banniere:nth-of-type(1) { right: 136px; height: 200px; }
  .bandeau .banniere:nth-of-type(2) { right: 84px; height: 156px; }
  .bandeau .banniere:nth-of-type(3) { right: 32px; height: 120px; }

  .section-head--split { flex-direction: column; align-items: flex-start; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .grid-3 > :nth-child(3):last-child { grid-column: 1 / -1; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .feature { flex-direction: column; align-items: stretch; gap: 32px; }
  .feature .etendard { order: -1; width: 100%; max-width: 480px; height: auto; aspect-ratio: 400 / 460; align-self: center; }
  .headline { flex-direction: column; align-items: stretch; }
  .headline .etendard { width: 100%; max-width: 360px; height: auto; aspect-ratio: 320 / 360; align-self: center; }
  .download { flex-direction: column; align-items: stretch; }
  .download__media { width: 100%; }
  .galerie { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .galerie .etendard { width: 100%; }

  .rules { grid-template-columns: 1fr; gap: 32px; }
  .toc { position: static; max-height: none; padding: 0; }
  .toc details > summary { cursor: pointer; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
  .toc details > summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s ease; }
  .toc details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
  .toc__links { margin: 0; padding: 0 24px 20px; }
  .articles { max-width: none; }

  .footer__cols { flex-wrap: wrap; row-gap: 40px; }
  .footer__brand { width: 100%; }
  .site-footer .footer__legal { white-space: normal; }
  .site-footer .marque-decor { left: auto; right: -160px; }
}

/* =========================================================
   Téléphone (≤ 640 px) — maquettes « V2 - SITE WEB - MOBILE » (390 px)
   ========================================================= */
@media (max-width: 640px) {
  :root { --gutter: 20px; --nav-h: 64px; }
  .nav__logo, .nav__logo img { width: 124px; height: 33px; }
  .theme-toggle { width: 40px; height: 40px; }

  .t-hero { font-size: 40px; line-height: 44px; letter-spacing: -0.03em; }
  .t-h1 { font-size: 30px; line-height: 36px; letter-spacing: -0.02em; }
  .t-h2 { font-size: 22px; line-height: 30px; letter-spacing: 0; }
  .t-lead { font-size: 16px; line-height: 24px; }

  .section, .section--88, .section--72 { padding-block: 40px; }
  .gap-56, .gap-48, .gap-40, .gap-32, .gap-28 { gap: 20px; }
  .section-head { gap: 12px; }
  .section-head--split { gap: 16px; align-items: stretch; }
  .section-head--split > .btn { order: 2; }

  /* Hero : texte, boutons pleine largeur, étendard sous les boutons */
  .hero__inner { padding: 32px var(--gutter) 40px; gap: 24px; }
  .hero__text { gap: 18px; }
  .hero__actions { flex-direction: column; width: 100%; gap: 12px; padding-top: 0; }
  .hero__actions .btn { width: 100%; }
  .hero__piliers { display: none; }
  .hero__visual { max-width: none; aspect-ratio: 350 / 330; }
  .hero .marque-decor { width: 520px; right: -200px; top: -60px; }
  .hero .banniere { width: 14px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 50% 100%, 0 calc(100% - 8px)); }
  .hero .banniere:nth-of-type(1) { right: 56px; height: 64px; }
  .hero .banniere:nth-of-type(2) { right: 38px; height: 52px; }
  .hero .banniere:nth-of-type(3) { right: 20px; height: 42px; }
  .hero__text { padding-right: 0; }
  .hero .kicker { padding-right: 60px; }

  .bandeau__inner { padding: 32px var(--gutter); }
  .bandeau__text { max-width: none; gap: 12px; padding-right: 72px; }
  .bandeau .marque-decor { width: 420px; right: -160px; top: -60px; }
  .bandeau .banniere { width: 16px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), 50% 100%, 0 calc(100% - 9px)); }
  .bandeau .banniere:nth-of-type(1) { right: 60px; height: 96px; }
  .bandeau .banniere:nth-of-type(2) { right: 40px; height: 76px; }
  .bandeau .banniere:nth-of-type(3) { right: 20px; height: 60px; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .grid-3 > :nth-child(3):last-child { grid-column: auto; }
  .card__body, .card__body--14 { padding: 20px; gap: 8px; }
  .card__body .t-h2 { font-size: 22px; line-height: 30px; }
  .card__body .t-body { font-size: 14px; line-height: 22px; }
  .card__top { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Tuiles : icône + titre seulement */
  .tuiles { grid-template-columns: 1fr; gap: 10px; }
  .tuile { padding: 12px 16px; gap: 14px; }
  .tuile [data-icon] { width: 28px; }
  .tuile [data-icon] svg { width: 28px; height: auto; }
  .tuile .t-small { display: none; }
  .tuile .t-h3 { font-size: 18px; line-height: 26px; font-weight: 500; }

  .cta, .cta--compact { padding: 40px var(--gutter); }
  .cta__inner, .cta--compact .cta__inner { gap: 16px; align-items: stretch; }
  .cta .marque-decor { width: 420px; left: auto; right: -170px; top: -60px; }
  .cta__actions { flex-direction: column; gap: 12px; padding-top: 0; }
  .cta__actions .btn { width: 100%; }
  .cta__actions .btn--on-dark { display: none; }
  .cta .status { border-radius: 14px; align-self: flex-start; }

  .feature .etendard { max-width: none; aspect-ratio: 350 / 330; }
  .feature__text { gap: 12px; }
  .feature__head .overline { display: none; }
  .feature__text .t-hero { font-size: 40px; line-height: 44px; }

  .headline { padding: 20px; gap: 20px; }
  .headline .etendard { max-width: none; aspect-ratio: 350 / 300; }
  .headline__text .btn { width: 100%; }
  .news-empty { padding: 20px; }
  .news-empty .btn { width: 100%; }

  .galerie { grid-template-columns: 1fr 1fr; gap: 14px; }

  .download { gap: 24px; }
  .download__buttons, .download__buttons .btn { width: 100%; }

  .rules { gap: 14px; }
  .toc details > summary { padding: 16px 20px; }
  .toc__links { padding: 0 20px 16px; }
  .articles { gap: 14px; }
  .article { background: var(--mc-bg-surface); border: 1px solid var(--mc-border-subtle); border-radius: var(--radius); padding: 20px; gap: 10px; }
  .article .t-h2 { font-size: 22px; line-height: 30px; }

  .info-card { padding: 20px; }
  .btn { white-space: normal; text-align: center; height: auto; min-height: 52px; padding-block: 14px; }

  /* Pied de page mobile : logo, slogan, liens sur deux colonnes */
  .site-footer__inner { padding: 36px var(--gutter); gap: 20px; }
  .footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
  .footer__brand { grid-column: 1 / -1; gap: 16px; }
  .footer__brand img { width: 160px; height: 43px; }
  .footer__brand .t-small, .footer__brand .overline { display: none; }
  .footer__col { white-space: normal; }
  .footer__col .overline { display: none; }
  .footer__rule { display: none; }
  .site-footer .marque-decor { width: 380px; right: -150px; top: -40px; }
}
