/* =========================================================
   THÈME : toutes les couleurs sont centralisées ici
   ========================================================= */
:root {
  --bg: #0b0e14;
  --bg-soft: #10141c;
  --card: #141a24;
  --border: #242d3b;
  --text: #e6edf3;
  --muted: #9aa7b4;          /* contraste ≈ 8:1 sur --bg */
  --accent: #3dffa0;         /* vert néon : débloqué, CTA */
  --accent-ink: #04140c;     /* texte posé sur --accent */
  --accent-2: #5cc8ff;       /* cyan : prochain palier */
  --accent-glow: rgba(61, 255, 160, 0.25);
  --radius: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(61, 255, 160, 0.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--mono); line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
a { color: var(--accent-2); }
a:hover { color: var(--text); }

/* Focus clavier bien visible partout */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

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

/* Lien d'évitement pour la navigation clavier */
.skip-link {
  position: absolute; left: 16px; top: -100px;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem 1rem; border-radius: 6px; font-weight: 600;
  z-index: 10;
}
.skip-link:focus { top: 16px; }

/* ---------- Mise en page ---------- */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}
section { padding: 2.5rem 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: 0; }

/* Titres de section façon commentaire de code */
.section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.section-title::before { content: "// "; color: var(--accent); }

/* ---------- 1. En-tête ---------- */
.hero { padding-top: 4rem; padding-bottom: 2.5rem; }
.hero-prompt {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero-prompt .path { color: var(--accent-2); }
.hero h1 {
  font-size: clamp(2.2rem, 9vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.hero h1 .dollar { color: var(--accent); margin-right: .35em; }
.cursor {
  display: inline-block;
  width: .55em; height: .9em;
  margin-left: .1em;
  background: var(--accent);
  vertical-align: -0.05em;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.tagline {
  margin-top: 1rem;
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  color: var(--muted);
  max-width: 36ch;
}

/* ---------- 2. Message ---------- */
.message p { color: var(--text); }
.message .signature { font-family: var(--mono); color: var(--muted); font-size: .9rem; }

/* ---------- 3. Progression ---------- */
.progress-head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .5rem 1rem;
  margin-bottom: 1rem;
}
.amount {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-weight: 800;
  color: var(--accent);
}
.amount .goal { color: var(--muted); font-weight: 400; font-size: .55em; }
.percent { font-family: var(--mono); color: var(--muted); }

/* La zone des marqueurs a de la marge pour les étiquettes au-dessus/en dessous */
.bar-wrap { position: relative; padding: 1.7rem 0; }
.bar {
  position: relative;
  height: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px var(--accent-glow);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}
.markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute;
  top: 1.7rem;
  height: 14px;
  width: 2px;
  margin-left: -1px;
  background: var(--border);
}
.marker.is-reached { background: var(--accent-ink); }
.marker-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .7rem;
  white-space: nowrap;
  color: var(--muted);
}
.marker.is-reached .marker-label { color: var(--accent); }
.marker.label-top .marker-label { bottom: calc(100% + 6px); }
.marker.label-bottom .marker-label { top: calc(100% + 6px); }
.marker.is-last .marker-label { transform: translateX(-100%); }

.next-tier { color: var(--muted); margin: .5rem 0 0; }
.next-tier strong { color: var(--accent-2); font-weight: 600; }

/* ---------- Bouton principal ---------- */
.cta { text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px;
  padding: .9rem 2rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover, .btn-primary:focus-visible {
  color: var(--accent-ink);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover, .btn-secondary:focus-visible { border-color: var(--accent-2); color: var(--text); }
.btn-block { width: 100%; }
@media (min-width: 560px) { .btn-block { width: auto; min-width: 280px; } }
.cta-note { margin-top: .9rem; font-size: .875rem; color: var(--muted); }

/* ---------- 4. Paliers ---------- */
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 640px) { .tiers { grid-template-columns: 1fr 1fr; } }
.tier {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .25rem 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.tier-icon {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tier-icon svg { width: 1.1rem; height: 1.1rem; }
.tier-amount {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--muted);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.tier-text { margin: 0; color: var(--muted); }
.badge {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .1rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* État débloqué */
.tier.is-unlocked { border-style: solid; border-color: rgba(61, 255, 160, .45); }
.tier.is-unlocked .tier-icon { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tier.is-unlocked .tier-amount { color: var(--accent); }
.tier.is-unlocked .tier-text { color: var(--text); }
.tier.is-unlocked .badge { color: var(--accent); border-color: rgba(61, 255, 160, .45); }

/* Prochain palier à atteindre */
.tier.is-next { border-style: solid; border-color: var(--accent-2); }
.tier.is-next .tier-amount, .tier.is-next .badge { color: var(--accent-2); }
.tier.is-next .badge { border-color: var(--accent-2); }
.tier.is-next .tier-text { color: var(--text); }

/* ---------- 6. Partage ---------- */
.share-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.share-box p { color: var(--muted); }
.share-status {
  min-height: 1.5em;
  margin: .75rem 0 0;
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--accent);
}

/* ---------- 7. Mises à jour ---------- */
.updates { list-style: none; margin: 0; padding: 0; }
.update {
  position: relative;
  padding: 0 0 1.25rem 1.5rem;
  border-left: 1px solid var(--border);
  margin-left: .35rem;
}
.update:last-child { padding-bottom: 0; }
.update::before {
  content: "";
  position: absolute; left: -5px; top: .45rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
}
.update time { font-family: var(--mono); font-size: .8rem; color: var(--accent-2); }
.update p { margin: .15rem 0 0; }

/* ---------- 8. Pied de page ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  font-family: var(--mono);
  font-size: .875rem;
  color: var(--muted);
}
.socials { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.socials a {
  display: inline-block;
  padding: .35rem 0;
  color: var(--text);
  text-decoration: none;
}
.socials a::before { content: "> "; color: var(--accent); }
.socials a:hover { color: var(--accent); }

/* ---------- Animation d'entrée légère ---------- */
.reveal { animation: fade-up .6s ease both; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Respect du réglage « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Marges remises à zéro (remplacent les anciens styles inline) */
.amount, .percent, .tier-amount, footer p { margin: 0; }

/* ---------- Formulaire de don ---------- */
.donate-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}
.amounts { border: 0; margin: 0; padding: 0; min-width: 0; }
.amounts legend, .field label {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .5rem;
  padding: 0;
}
.optional { font-weight: 400; color: var(--muted); }
.amount-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 4.25rem; min-height: 44px;
  padding: .5rem .9rem;
  font-family: var(--mono); font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color .15s ease, background-color .15s ease;
}
.chip:hover span { border-color: var(--accent-2); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.field { display: grid; }
.custom-amount { margin-top: .75rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .7rem .8rem;
  min-height: 44px;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent-2); }
.field input:disabled { opacity: .5; }
.checkbox { display: flex; align-items: center; gap: .6rem; color: var(--muted); cursor: pointer; }
.checkbox input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.donate-box .cta-note { margin: 0; text-align: center; }
.form-error { margin: 0; color: #ff8b8b; font-size: .9rem; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- Derniers soutiens ---------- */
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.recent-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
}
.recent-head { display: flex; justify-content: space-between; gap: 1rem; margin: 0; }
.recent-name { font-weight: 600; overflow-wrap: anywhere; }
.recent-amount { font-family: var(--mono); color: var(--accent); white-space: nowrap; }
.recent-message { margin: .25rem 0 0; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Page merci ---------- */
.thanks { text-align: center; padding: 5rem 0 3rem; }
.thanks h1 { font-size: clamp(2rem, 8vw, 3rem); margin-bottom: 1rem; }
.thanks p { color: var(--muted); max-width: 42ch; margin-left: auto; margin-right: auto; }
.thanks .btn { margin-top: 1rem; }

/* ---------- Photo de profil (en-tête) ---------- */
.avatar {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 28px var(--accent-glow);
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .avatar { width: 136px; height: 136px; } }
