/* ==========================================================================
   CONTREPREUVE — SOCLE COMMUN
   Palette et typographie reprises de « Principes sous tension ».
   Utilisé par la page d'accueil, la page 404 et « Tout s'explique ».
   « Principes sous tension » garde sa propre feuille, qui partage ces valeurs.
   ========================================================================== */

:root {
  --bg: #f4efe6;
  --paper: #fbf8f2;
  --paper-strong: #fffdf9;
  --ink: #1c2528;
  --ink-soft: #344043;
  --muted: #677071;
  --line: #d8d1c6;
  --line-strong: #bdb5a8;
  --accent: #315f5d;
  --accent-deep: #244b49;
  --accent-soft: #dce9e6;
  --accent-faint: #edf4f2;
  --warm: #8a7258;
  --warm-soft: #eee4d7;
  --shadow: 0 14px 40px rgba(36, 43, 43, 0.06);
  --radius: 22px;
  --radius-small: 14px;
  --serif: Georgia, "Times New Roman", ui-serif, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --content: 760px;
  --content-wide: 1040px;
  --header-h: 64px;
  --ease: 220ms cubic-bezier(.2, .75, .25, 1);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 95, 93, .035), transparent 32rem),
    radial-gradient(circle at 88% 34%, rgba(98, 79, 61, .025), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; }

a:focus-visible,
button:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(49, 95, 93, .35);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transition: top var(--ease);
}
.skip-link:focus { top: 12px; }

/* --- Marque ------------------------------------------------------------- */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent-deep);
  font-weight: 750;
  letter-spacing: -.01em;
}
.mark svg { width: 26px; height: 26px; flex: none; }

.site-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: rgba(244, 239, 230, .9);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(120, 110, 95, .10);
}
.site-bar-brand { display: flex; align-items: center; min-width: 0; }
.site-bar .mark { font-size: 14px; }
.site-bar .experience-name {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.site-bar .experience-name::before {
  content: "/";
  margin: 0 8px 0 2px;
  color: var(--line-strong);
}

/* --- Boutons ------------------------------------------------------------ */
.primary-button,
.secondary-button,
.choice-button {
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 12px 22px;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.primary-button {
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 8px 24px rgba(49, 95, 93, .16);
}
.primary-button:hover { background: var(--accent-deep); transform: translateY(-1px); }
a.primary-button,
a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.primary-button:active { transform: none; }
.primary-button:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.secondary-button {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 700;
}
.secondary-button:hover { background: rgba(255, 255, 255, .45); }
.text-button {
  border: 0;
  background: none;
  padding: 8px 2px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(103, 112, 113, .35);
  text-underline-offset: 3px;
}
.button-row {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Textes ------------------------------------------------------------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.lead {
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.56;
  color: var(--ink-soft);
  margin: 22px 0 0;
}
.microcopy {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* --- Pied de page ------------------------------------------------------- */
.site-footer {
  margin-top: 72px;
  padding: 28px max(20px, env(safe-area-inset-right)) 36px max(20px, env(safe-area-inset-left));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.site-footer-inner {
  width: min(100%, var(--content-wide));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}
.site-footer p { margin: 0; max-width: 60ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.quiet-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color var(--ease), border-color var(--ease);
}
.quiet-link:hover,
.quiet-link:focus-visible { color: var(--accent-deep); border-color: var(--accent); }

/* ==========================================================================
   PAGE D'ACCUEIL
   ========================================================================== */
.home {
  width: min(100% - 40px, var(--content-wide));
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) 0 0;
}
.home-mark { font-size: 17px; }
.home-mark svg { width: 34px; height: 34px; }

.home-title {
  margin-top: clamp(40px, 8vh, 80px);
  max-width: 15ch;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6.4vw, 5.2rem);
  line-height: 1;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.home .lead { max-width: 58ch; }

.experiments {
  margin: clamp(44px, 8vh, 72px) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.experiment {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 248, 242, .84);
  box-shadow: var(--shadow);
  padding: clamp(22px, 3.4vw, 34px);
  transition: border-color var(--ease), transform var(--ease);
}
.experiment:has(a:hover) { border-color: var(--accent); transform: translateY(-2px); }
.experiment:has(a:focus-visible) { border-color: var(--accent); }
.experiment-motif {
  width: 88px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 26px;
}
.experiment h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.05;
}
.experiment h2 a { text-decoration: none; }
/* Toute la carte est cliquable, sans imbriquer de contenu dans le lien. */
.experiment h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}
.experiment h2 a:focus-visible { outline: none; }
.experiment p { margin: 14px 0 0; color: var(--ink-soft); max-width: 42ch; }
.experiment .experiment-meta {
  margin-top: auto;
  padding-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.experiment-go {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.experiment:has(a:hover) .experiment-go { background: var(--accent-deep); }

.upcoming {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 15px;
}
.upcoming::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
}

.home-principles {
  margin-top: 44px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 14px;
}

/* --- 404 ---------------------------------------------------------------- */
.not-found { padding-bottom: 40px; }

@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .experiments { grid-template-columns: 1fr; }
  .site-bar .experience-name { display: none; }
  .site-footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-bar, .skip-link { display: none; }
  body { background: #fff; }
}
