/* Grafen — socle commun : tokens, reset, typographie, composants partagés */

:root {
  --bg: #f6f4f1;
  --ink: #12262e;
  --paper: #f6f4f1;
  --accent: #c96eb9;
  --on-accent: #ffffff; /* texte posé sur l'accent */
  --ink-rgb: 18, 38, 46;
  --paper-rgb: 246, 244, 241;
  --bg-rgb: 246, 244, 241;
  /* thème clair par défaut : encre sur papier */
  --fg: var(--ink);
  --fg-rgb: var(--ink-rgb);
  --font-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: 48px;
  --max: 1280px;
}

.theme-dark {
  --bg: #12262e;
  --bg-rgb: 18, 38, 46;
  --fg: var(--paper);
  --fg-rgb: var(--paper-rgb);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  font-family: inherit;
}

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

/* --- typographie utilitaire --- */
.mono {
  font-family: var(--font-mono);
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}
.label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  opacity: 0.4;
}
.label--accent {
  color: var(--accent);
  opacity: 1;
}

/* --- marque --- */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.brand__name {
  font-size: 19px;
  letter-spacing: 0.16em;
  font-weight: 500;
}
.brand__dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  display: block;
}

/* --- boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 26px;
  border-radius: 2px;
  font-size: 15px;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: background 0.25s, color 0.25s, opacity 0.25s;
  cursor: pointer;
}
.btn .arrow {
  font-family: var(--font-mono);
}
.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--accent:hover {
  background: var(--ink);
  color: var(--on-accent);
}
.theme-dark .btn--accent:hover {
  background: var(--paper);
  color: var(--ink);
}
.btn--ink {
  background: var(--ink);
  color: var(--on-accent);
  gap: 10px;
  padding: 11px 20px;
  font-size: 13.5px;
}
.btn--ink:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.theme-dark .btn--ink {
  background: var(--paper);
  color: var(--ink);
}
.theme-dark .btn--ink:hover {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--lg {
  padding: 18px 30px;
  font-size: 16px;
}
.btn[disabled],
.btn.is-disabled {
  background: rgba(var(--fg-rgb), 0.08);
  color: rgba(var(--fg-rgb), 0.4);
  cursor: default;
}
.btn[disabled]:hover,
.btn.is-disabled:hover {
  background: rgba(var(--fg-rgb), 0.08);
  color: rgba(var(--fg-rgb), 0.4);
}
.link-quiet {
  font-size: 15px;
  opacity: 0.5;
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.25);
  padding-bottom: 2px;
}

/* --- pyramide générique : 6 étages, niveau 6 en haut --- */
.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.pyramid__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--fg-rgb), 0.22);
  transition: border-color 0.3s;
}
.pyramid__fill {
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.35s;
}
.pyramid__label {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  transition: color 0.8s, opacity 0.3s;
}
.pyramid__row:nth-child(1) { width: 36%; }
.pyramid__row:nth-child(2) { width: 48%; }
.pyramid__row:nth-child(3) { width: 60%; }
.pyramid__row:nth-child(4) { width: 72%; }
.pyramid__row:nth-child(5) { width: 84%; }
.pyramid__row:nth-child(6) { width: 96%; }

/* --- animations --- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.rise {
  animation: rise 0.6s ease both;
}

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

@media (max-width: 880px) {
  :root {
    --gutter: 24px;
  }
}


/* --- bandeau d'information sur la mesure d'audience --- */
.consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: auto;
  z-index: 900;
  width: min(560px, calc(100vw - 32px));
  padding: 18px 20px;
  background: var(--panel, #fff);
  color: var(--fg);
  border: 1px solid rgba(var(--fg-rgb), 0.16);
  border-radius: 3px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  animation: rise 0.4s 0.6s ease both;
}
.theme-dark .consent { background: #1a2e37; }
.consent.is-leaving { opacity: 0; transition: opacity 0.25s; }
.consent__text {
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.85;
}
.consent__text strong { font-weight: 500; }
.consent__text a {
  border-bottom: 1px solid rgba(var(--fg-rgb), 0.35);
  white-space: nowrap;
}
.consent__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.consent__btn {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  padding: 9px 14px;
  border: 1px solid rgba(var(--fg-rgb), 0.3);
  border-radius: 2px;
  color: var(--fg);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.consent__btn:hover { border-color: var(--accent); color: var(--accent); }
.consent__btn--ok {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.consent__btn--ok:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.consent-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--fg-rgb), 0.16);
  border-radius: 3px;
  font-size: 15px;
}
@media (max-width: 880px) {
  .consent { right: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 14px 16px; }
}
