/* UNPURE SALMON — Dark theme, red accent */

:root {
  --bg: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --text: #e8e8ed;
  --text-muted: #8b8b9a;
  --accent: #ff3355;
  --accent-dim: #cc2944;
  --accent-glow: rgba(255, 51, 85, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --glass: rgba(10, 10, 15, 0.75);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1100px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.05rem;
  overflow-x: hidden;
}

/* ── Typography ── */

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 1rem;
}

h2 .accent { color: var(--accent); }

p { margin-bottom: 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover { opacity: 0.8; }

/* ── Nav ── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.nav-logo .unpure { color: var(--accent); }

.nav-logo .pure {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  opacity: 0.5;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--accent); opacity: 1; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Hero ── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%),
    var(--bg);
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 10vw, 6rem);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero h1 .unpure { color: var(--accent); }

.hero h1 .pure {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 4px;
  opacity: 0.45;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  max-width: 650px;
  margin-bottom: 2rem;
}

.hero-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.9rem 2.2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  transition: background 0.2s, transform 0.2s;
}

.hero-cta:hover {
  background: var(--accent-dim);
  opacity: 1;
  transform: translateY(-2px);
}

/* ── Key figures strip ── */

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.figure {
  background: var(--bg-elevated);
  padding: 2rem 1.5rem;
  text-align: center;
}

.figure-value {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.figure-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ── Sections ── */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-intro {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin-bottom: 3rem;
}

/* ── Fléau cards ── */

.fleaux {
  display: grid;
  gap: 1.5rem;
}

.fleau {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
  transition: border-color 0.3s;
}

.fleau:hover {
  border-color: rgba(255, 51, 85, 0.3);
}

.fleau-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 51, 85, 0.1);
  border-radius: 8px;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.fleau-counter {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.fleau-counter-suffix {
  font-size: 1.2rem;
}

.fleau h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.fleau p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.fleau-link {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Timeline / context ── */

.context-box {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.context-box strong { color: var(--accent); }

/* ── Opposition stats ── */

.opp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.opp-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.opp-stat .value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
}

.opp-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

/* ── Fiches détaillées cards ── */

.fiches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.fiche-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.fiche-card:hover {
  border-color: rgba(255, 51, 85, 0.5);
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(255, 51, 85, 0.12);
  transform: translateY(-2px);
}

.fiche-icon {
  font-size: 2rem;
  line-height: 1;
}

.fiche-title {
  line-height: 1.3;
}

/* ── Markdown overlay ── */

.md-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.md-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.md-overlay[hidden] {
  display: none;
}

.md-overlay:not([hidden]) {
  display: flex;
}

.md-backdrop {
  position: absolute;
  inset: 0;
  background: #0a0a0fee;
  cursor: pointer;
}

.md-panel {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: #111118;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  overflow: hidden;
  transform: scale(0.94);
  transition: transform 0.3s ease;
}

.md-overlay.is-open .md-panel {
  transform: scale(1);
}

.md-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2a2a3a;
  flex-shrink: 0;
}

.md-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.md-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.md-source {
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.md-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.md-close:hover {
  color: var(--accent);
  border-color: rgba(255, 51, 85, 0.4);
  background: rgba(255, 51, 85, 0.08);
}

.md-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem 2rem;
  scrollbar-width: thin;
  scrollbar-color: #2a2a3a transparent;
}

.md-body::-webkit-scrollbar {
  width: 8px;
}

.md-body::-webkit-scrollbar-track {
  background: transparent;
}

.md-body::-webkit-scrollbar-thumb {
  background: #2a2a3a;
  border-radius: 4px;
}

.md-body::-webkit-scrollbar-thumb:hover {
  background: #3a3a4a;
}

.md-loading,
.md-error {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.md-error { color: var(--accent); }

/* Markdown content inside overlay */

.md-content h1,
.md-content h2,
.md-content h3,
.md-content h4 {
  color: #ff3355;
  margin: 1.5rem 0 0.75rem;
  line-height: 1.2;
}

.md-content h1:first-child,
.md-content h2:first-child,
.md-content h3:first-child {
  margin-top: 0;
}

.md-content h1 { font-size: 1.6rem; }
.md-content h2 { font-size: 1.35rem; }
.md-content h3 { font-size: 1.15rem; }

.md-content p,
.md-content li {
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.md-content strong {
  color: var(--text);
}

.md-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.md-content a:hover { opacity: 0.85; }

.md-content ul,
.md-content ol {
  margin: 0 0 1rem 1.25rem;
}

.md-content li { margin-bottom: 0.35rem; }

.md-content hr {
  border: none;
  border-top: 1px solid #2a2a3a;
  margin: 1.5rem 0;
}

.md-content blockquote {
  border-left: 3px solid #ff3355;
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}

.md-content code {
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.88em;
  color: #e8e8ed;
}

.md-content pre {
  background: #1a1a24;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.md-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.md-content th,
.md-content td {
  border: 1px solid #2a2a3a;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.md-content th {
  background: #1a1a24;
  color: #ff3355;
  font-weight: 700;
}

.md-content td { color: var(--text-muted); }

/* ── CTA section ── */

.cta-section {
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 100%, var(--accent-glow) 0%, transparent 60%),
    var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 5rem 1.5rem;
}

.cta-section h2 { margin-bottom: 1rem; }

.cta-section p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  transition: transform 0.2s, background 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dim); opacity: 1; }

.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-outline:hover {
  background: rgba(255, 51, 85, 0.1);
  opacity: 1;
}

/* ── Footer ── */

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

.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* ── Animations ── */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--glass);
    backdrop-filter: blur(16px);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: block; }

  .fleau {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .fleau-icon { margin: 0 auto; }

  .md-header {
    flex-wrap: wrap;
  }

  .md-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .md-body {
    padding: 1.25rem 1rem 1.5rem;
  }

  .md-panel {
    max-height: 95vh;
  }
}
