/* ==========================================================================
   RiverLog · page vitrine
   Ambiance : tapis de poker vert foncé, jetons de couleur, chiffres en mono
   ========================================================================== */

:root {
  --bg: #0b1410;
  --surface: #112019;
  --surface-2: #162a21;
  --line: #22392e;
  --ink: #eef5f0;
  --muted: #8fa89b;
  --felt: #2fbf71;
  --red: #e5484d;
  --gold: #f5b942;
  --blue: #3e8ef7;
  --radius: 16px;
  --font-title: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  /* Halo vert en haut de page, sans répétition si la page est plus courte que l'écran */
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47, 191, 113, 0.16), transparent 70%) no-repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-title);
  line-height: 1.1;
  margin: 0;
}

a {
  color: inherit;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding-inline: 24px;
}

/* ---------- Navigation ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 22px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
}

.nav-link {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s;
}

.nav-link:hover {
  border-color: var(--ink);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--felt);
  border-color: var(--felt);
  color: #06120c;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: 56px 40px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.08);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Point qui pulse : le projet est en cours */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(245, 185, 66, 0);
    opacity: 0.5;
  }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.02em;
  max-width: 13em;
  margin: 0 auto;
}

.hero h1 span {
  color: var(--felt);
}

.lead {
  max-width: 36em;
  margin: 22px auto 30px;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Aperçu du dashboard ---------- */

.preview {
  margin: 56px 0 0;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  text-align: left;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.preview-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
}

.preview-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
}

.stat {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.stat dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat dd {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
}

.stat dd.is-up {
  color: var(--felt);
}

.stat dd.is-down {
  color: var(--red);
}

.chart {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.chart-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.chart svg {
  display: block;
  width: 100%;
  height: 200px;
}

.chart-line {
  fill: none;
  stroke: var(--felt);
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  /* La courbe se dessine au chargement */
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: draw 2s ease-out 0.3s forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.chart-zero {
  stroke: var(--line);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- Sections ---------- */

.section {
  padding-block: 64px;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.section-lead {
  max-width: 40em;
  margin: 10px 0 0;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.feature {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Icônes en forme de jeton de poker */
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 1.1rem;
}

.chip-red { background: var(--red); }
.chip-gold { background: var(--gold); color: #3a2a05; }
.chip-blue { background: var(--blue); }
.chip-green { background: var(--felt); color: #06120c; }

.feature h3 {
  font-size: 1.15rem;
}

.feature p {
  margin: 8px 0 0;
  color: var(--muted);
}

.pill {
  display: inline-block;
  margin: 0 2px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8rem;
}

/* Formules de calcul */
.formulas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.formula {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.formula-name {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.formula code {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--felt);
}

.formula p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Import en 3 étapes */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--felt);
  color: #06120c;
  font-family: var(--font-mono);
  font-weight: 700;
}

.steps h3 {
  font-size: 1.15rem;
}

.steps p {
  margin: 8px 0 0;
  color: var(--muted);
}

/* Appel final */
.cta {
  padding: 44px 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(47, 191, 113, 0.16), transparent 70%), var(--surface);
  text-align: center;
}

.cta p {
  margin: 12px auto 24px;
  max-width: 34em;
  color: var(--muted);
}

.footer a {
  color: var(--ink);
}

/* ---------- Pied de page ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat dd {
    font-size: 1.2rem;
  }

  .chart svg {
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge-dot,
  .chart-line {
    animation: none;
  }

  .chart-line {
    stroke-dashoffset: 0;
  }
}

/* Liens de navigation (GitHub, connexion) */
.nav-actions {
  display: flex;
  gap: 8px;
}

/* Cartes cliquables (défis du jour) */
.feature-link {
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.feature-link:hover {
  border-color: var(--felt);
  transform: translateY(-2px);
}
