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

:root {
  --c-vert:   #16a34a;
  --c-rouge:  #dc2626;
  --c-bleu:   #2563eb;
  --c-jaune:  #facc15;
  --c-violet: #9333ea;
  --c-blanc:  #f9fafb;
  --c-blanc-border: #d1d5db;

  --bg:      #f8fafc;
  --surface: #ffffff;
  --border:  #e2e8f0;
  --text:    #1e293b;
  --muted:   #64748b;
  --font:    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius:  0.75rem;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
}

/* ─── Accessibilité ─── */

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

/* ─── En-tête ─── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

/* ─── Contenu de page ─── */

.page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.page-lead {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ─── Grille des cartons ─── */

.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .color-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.color-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.0625rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  cursor: pointer;
}

.color-card:hover,
.color-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  outline: 3px solid rgba(0, 0, 0, 0.25);
  outline-offset: 2px;
}

.color-card:active {
  transform: translateY(0);
}

.card-vert   { background: var(--c-vert);         color: #fff; }
.card-rouge  { background: var(--c-rouge);         color: #fff; }
.card-bleu   { background: var(--c-bleu);          color: #fff; }
.card-jaune  { background: var(--c-jaune);         color: #1a1a1a; }
.card-violet { background: var(--c-violet);        color: #fff; }
.card-blanc  { background: var(--c-blanc); color: #1a1a1a; border: 2px solid var(--c-blanc-border); }

/* ─── Écran pleine couleur ─── */

.color-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.color-screen:target {
  display: flex;
}

.screen-vert   { background: var(--c-vert);   color: #fff; }
.screen-rouge  { background: var(--c-rouge);  color: #fff; }
.screen-bleu   { background: var(--c-bleu);   color: #fff; }
.screen-jaune  { background: var(--c-jaune);  color: #1a1a1a; }
.screen-violet { background: var(--c-violet); color: #fff; }
.screen-blanc  {
  background: var(--c-blanc);
  color: #1a1a1a;
  outline: 6px solid var(--c-blanc-border);
  outline-offset: -6px;
}

.screen-name {
  font-size: clamp(3.5rem, 20vw, 7rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1rem;
}

.screen-desc {
  font-size: clamp(1rem, 3vw, 1.1875rem);
  max-width: 26ch;
  opacity: 0.88;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.375rem;
  border-radius: 2rem;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.back-btn:hover,
.back-btn:focus-visible {
  background: rgba(0, 0, 0, 0.25);
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.screen-jaune .back-btn,
.screen-blanc .back-btn {
  background: rgba(0, 0, 0, 0.1);
}

/* ─── Page Règles ─── */

.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rule-item {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.rule-swatch {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  margin-top: 0.125rem;
}

.swatch-vert   { background: var(--c-vert); }
.swatch-rouge  { background: var(--c-rouge); }
.swatch-bleu   { background: var(--c-bleu); }
.swatch-jaune  { background: var(--c-jaune); }
.swatch-violet { background: var(--c-violet); }
.swatch-blanc  { background: var(--c-blanc); border: 1.5px solid var(--c-blanc-border); }

.rule-name {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.rule-desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ─── Pied de page ─── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .contact-intro {
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
}

.site-footer .email-display {
  font-weight: 600;
  color: var(--text);
}

/* ─── Page Contact ─── */

.contact-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.contact-intro {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.email-wrap {
  font-size: 1rem;
  font-weight: 600;
}

/* Obfuscation basique : l'adresse est assemblée par CSS, absente du HTML */
.email-display::before {
  content: attr(data-user) "@" attr(data-domain);
}
