:root {
  --background: #f8f7f4;
  --surface: #ffffff;
  --text: #101510;
  --muted: #59625b;
  --border: #e3e7df;
  --border-strong: #cdd9c3;
  --control: #f3f5ee;
  --accent: #426b05;
  --action: #ccf381;
  --action-dark: #b8e36b;
  --accent-text: #101510;
  --focus: #426b05;
  --feature: #e9f7d1;
  --shadow: 0 12px 40px rgb(16 21 16 / 5%);
}

html[data-theme="dark"] {
  --background: #050505;
  --surface: #111410;
  --text: #f5f7f0;
  --muted: #b7c1b1;
  --border: #2b3327;
  --border-strong: #52634a;
  --control: #1d251a;
  --accent: #ccf381;
  --action: #ccf381;
  --action-dark: #b8e36b;
  --accent-text: #101510;
  --focus: #ccf381;
  --feature: #243218;
  --shadow: 0 12px 40px rgb(0 0 0 / 25%);
}

@media (prefers-color-scheme: dark) {
  html[data-theme-preference="system"]:not([data-theme]) {
    color-scheme: dark;
    --background: #050505;
    --surface: #111410;
    --text: #f5f7f0;
    --muted: #b7c1b1;
    --border: #2b3327;
    --border-strong: #52634a;
    --control: #1d251a;
    --accent: #ccf381;
    --action: #ccf381;
    --action-dark: #b8e36b;
    --accent-text: #101510;
    --focus: #ccf381;
    --feature: #243218;
    --shadow: 0 12px 40px rgb(0 0 0 / 25%);
  }
}

.site-header { padding-top: 16px; }
.header-shell { min-height: 64px; }
.brand { letter-spacing: -.09em; }
.desktop-navigation, .desktop-navigation > a, .header-actions { height: 64px; }
.feature-link { color: var(--accent); }
.search-link { border-radius: 8px; }
.search-link:hover { background: var(--control); }
.theme-controls button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #31520a; }
.home main { padding-top: 28px; }
.home-intro { text-align: left; scroll-margin-top: 90px; }
.home-intro > p:first-child { color: var(--accent); }
.home-intro h1 { margin-top: 8px; font-size: clamp(2.75rem, 5vw, 4.8rem); line-height: 1.04; letter-spacing: -.055em; }
.home-intro h1 span { color: var(--accent); }
.home-intro > p:nth-of-type(2) { max-width: 780px; margin: 12px 0 0; font-size: clamp(1rem, 1.4vw, 1.16rem); line-height: 1.55; }

.masonry { display: grid; width: min(1320px, calc(100% - 40px)); margin-top: 28px; column-count: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; align-items: stretch; scroll-margin-top: 94px; }
.masonry > .home-item { display: block; width: auto; margin: 0; break-inside: auto; }
.home-card-shell:hover { box-shadow: none; transform: none; }
.home-card-featured, .method-card, .contact-card { grid-column: span 2; }
.home-card-shell { height: 100%; border: 1px solid var(--border); }
.home-card-standard-shell, .home-card-featured-shell, .home-card-tile-shell { min-height: 0; }
.home-card-content { flex: 1; margin-bottom: 0; }
.home-card-category { height: auto; min-height: 48px; margin-bottom: 19px; gap: 10px; }
.home-card-category-letter { flex: none; color: #101510; background: var(--action); }
.home-card-category > span:last-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.home-card-standard-shell .home-card-content:not(:first-child) { padding-top: 0; }
.home-card-title { margin-top: 12px; font-size: clamp(1.4rem, 1.65vw, 1.75rem); line-height: 1.17; }
.home-card-excerpt { margin-top: 12px; font-size: 14px; line-height: 1.62; }
.home-card-footer { margin-top: 21px; padding-bottom: 14px; }
.home-card-footer a { white-space: nowrap; }
.card-meta { justify-content: space-between; }
.home-card-featured-shell { background: var(--feature); }
.home-card-featured .home-card-category > span:last-child { color: var(--text); }
.home-card-featured .home-card-title { max-width: 22ch; font-size: clamp(1.7rem, 2.3vw, 2.5rem); }
.home-card-featured .home-card-excerpt { max-width: 66ch; }
.home-card-featured .home-card-footer { border-color: var(--border-strong); }

.method-card .home-card-tile-shell { padding: 24px; color: #ffffff; background: #101510; }
.method-card .home-card-tile-shell::after { display: none; }
.method-card .home-card-tile-body { justify-content: flex-start; }
.method-card .card-meta { color: #ccf381; }
.method-card .home-card-title { max-width: 20ch; margin: 16px 0 0; font-size: clamp(1.65rem, 2.2vw, 2.2rem); }
.method-card .home-card-excerpt { margin-top: 10px; color: #c2cbbd; }
.method-steps { display: grid; margin: 24px 0 0; padding: 0; list-style: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.method-steps li { padding-top: 10px; border-top: 1px solid #40503b; }
.method-steps strong, .method-steps span { display: block; }
.method-steps strong { color: #ccf381; font-size: 14px; }
.method-steps span { margin-top: 4px; color: #c2cbbd; font-size: 13px; line-height: 1.45; }

.contact-card { display: flex !important; padding: 24px; flex-direction: column; color: #101510; background: linear-gradient(145deg, #ccf381, #b8e36b); }
.contact-card h2 { max-width: 20ch; margin: 18px 0 0; font-size: clamp(1.7rem, 2.3vw, 2.5rem); line-height: 1.14; letter-spacing: -.04em; }
.contact-card > p:nth-of-type(2) { max-width: 55ch; margin: 13px 0 18px; font-size: 15px; line-height: 1.6; }
.contact-card .button { width: max-content; margin-top: auto; padding: 12px 18px; color: #ffffff; background: #101510; }
.contact-card .button:hover { color: #ccf381; }
.contact-card .button:focus-visible { outline-color: #101510; box-shadow: 0 0 0 2px #ffffff; }

.site-footer { margin-top: 44px; padding-top: 36px; }
.footer-logo { letter-spacing: -.09em; }
.footer-grid { gap: 30px; }
.footer-grid > div p { margin-top: 8px; }
.footer-bottom { margin-top: 34px; }

#poste-tenu, #geste-tenu, #actif-numerique, #methode, #contact { scroll-margin-top: 94px; }

@media (max-width: 1199px) {
  .masonry { column-count: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .site-header { padding: 8px 12px 0; }
  .header-shell { min-height: 58px; }
  .header-actions { height: 58px; }
  .brand { font-size: 22px; }
  .home main { padding-top: 20px; }
  .home-intro { max-width: calc(100% - 24px); }
  .home-intro h1 { margin-top: 7px; font-size: clamp(2.1rem, 9vw, 2.65rem); }
  .home-intro > p:nth-of-type(2) { margin-top: 10px; font-size: 15px; line-height: 1.5; }
  .masonry { width: calc(100% - 24px); max-width: none; margin-top: 20px; column-count: auto; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .home-card-featured, .method-card, .contact-card { grid-column: 1; }
  .home-card-standard-shell, .home-card-featured-shell, .method-card .home-card-tile-shell { min-height: 0; padding: 20px; }
  .home-card-category { margin-bottom: 13px; }
  .home-card-title { font-size: 1.5rem; }
  .home-card-featured .home-card-title { font-size: 1.75rem; }
  .home-card-excerpt { margin-top: 9px; line-height: 1.5; }
  .home-card-footer { margin: 16px 0 -20px; padding: 12px 0; }
  .method-steps { gap: 13px; }
  .contact-card { padding: 20px; }
  .contact-card h2 { font-size: 1.75rem; }
  .site-footer { margin-top: 28px; padding: 30px 20px 24px; }
  .footer-grid { gap: 24px; }
  .footer-bottom { margin-top: 25px; }
}

@media (max-width: 360px) {
  .theme-controls button { width: 27px; }
  .search-link { width: 32px; }
  .method-steps { grid-template-columns: 1fr; }
}
