/* ==========================================================================
   Informatique Quantique 101 — feuille de style
   Signature : la pièce en superposition (pile ET face), fil rouge du cours
   ========================================================================== */

:root {
  /* Couleurs — thème clair, palette bleu/jaune inspirée de Bon Pote */
  --bg: #FAFAF6;
  --bg-alt: #F1F3FC;
  --bg-alt-yellow: #FFF8E4;
  --bg-card: #FFFFFF;
  --ink: #1C2033;
  --ink-soft: #565B72;
  --ink-faint: #8C90A3;
  --blue: #2E4BDA;      /* état "pile" */
  --yellow: #FFC93C;    /* état "face" */
  --blue-soft: #E7EBFC;
  --yellow-soft: #FFF1C2;
  --line: rgba(28, 32, 51, 0.09);
  --line-strong: rgba(28, 32, 51, 0.18);
  --danger: #D6483C;
  --success: #1E9A63;

  /* Typo */
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(46,75,218,0.06), transparent),
    radial-gradient(ellipse 900px 500px at 85% 0%, rgba(255,201,60,0.10), transparent),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2.6em; font-weight: 600; }
h3 { font-size: 1.2rem; color: var(--blue); font-weight: 600; margin-top: 2em; }
p { margin: 0 0 1.1em; color: var(--ink); }
a { color: var(--blue); }
strong { color: var(--ink); font-weight: 700; }

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}
.wide { max-width: 980px; }

/* ---------- Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(250, 250, 246, 0.86);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}
.brand-coin { width: 26px; height: 26px; flex-shrink: 0; }

.topbar-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--yellow));
  transition: width 0.5s ease;
}
.progress-label {
  font-size: 0.78rem;
  color: var(--ink-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Coin (signature element) ---------- */
.coin {
  position: relative;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}
.coin-face-0 { background: var(--blue); color: #FFFFFF; }
.coin-face-1 { background: var(--yellow); color: #2e2007; }
.coin-super {
  background: linear-gradient(180deg, var(--yellow), var(--blue));
}

.hero-visual {
  width: 148px;
  height: 178px;
  margin: 0 auto 34px;
  position: relative;
}
.hero-visual .coin-super {
  width: 148px;
  height: 148px;
  position: absolute;
  top: 15px;
  left: 0;
  box-shadow: 0 0 60px rgba(255,201,60,0.35), 0 0 60px rgba(46,75,218,0.18);
}
.bloch-pole {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.bloch-pole-0 { top: -2px; }
.bloch-pole-1 { bottom: -2px; }
.bloch-equator {
  position: absolute;
  left: -9px;
  top: 50%;
  width: 166px;
  height: 40px;
  transform: translateY(-50%);
  border: 1.5px solid rgba(28,32,51,0.22);
  border-radius: 50%;
  pointer-events: none;
}
.bloch-vector {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 50px;
  background: var(--ink);
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(32deg);
  border-radius: 2px;
}
.bloch-vector::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--ink);
}
.bloch-vector::before {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  padding: 90px 0 50px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 22px;
}
.hero p.lede {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* ---------- Cards / sections ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin: 22px 0;
}
section.block { margin: 56px 0; }

/* Preamble */
.preamble { font-size: 1.05rem; color: var(--ink-soft); }
.preamble strong { color: var(--ink); }

/* Objectives checklist */
.objectives {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.objectives li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--ink-soft);
}
.objectives li::before {
  content: "";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue), var(--yellow));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/60% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/60% no-repeat;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(90deg, var(--blue), var(--yellow));
  color: #14162b;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(255,201,60,0.35); }
.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn[disabled], .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Roadmap (chapter list) ---------- */
.roadmap { list-style: none; margin: 0; padding: 0; }
.roadmap-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  background: var(--bg-card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.roadmap-item:hover:not(.locked) { border-color: var(--line-strong); transform: translateX(2px); }
.roadmap-item.locked { opacity: 0.45; cursor: not-allowed; }
.roadmap-item.done .roadmap-coin { background: linear-gradient(135deg, var(--blue), var(--yellow)); }
.roadmap-coin {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  color: var(--ink);
}
.roadmap-text { flex: 1; min-width: 0; }
.roadmap-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; }
.roadmap-sub { font-size: 0.85rem; color: var(--ink-faint); margin-top: 2px; }
.roadmap-status { font-size: 0.78rem; font-family: var(--font-mono); color: var(--ink-faint); white-space: nowrap; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 22px 0;
  border-left: 3px solid var(--blue);
  background: var(--bg-alt);
}
.callout-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}
.callout.yellow { border-left-color: var(--yellow); }
.callout.yellow .callout-title { color: var(--yellow); }
.callout p:last-child { margin-bottom: 0; }

/* Formula */
.formula {
  font-family: var(--font-mono);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 20px 0;
}
.formula sub { color: var(--ink-faint); }

/* Table (logic gates) */
table.gates {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}
table.gates th, table.gates td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
table.gates th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
table.gates td.result-1 { color: var(--yellow); font-family: var(--font-mono); font-weight: 700; }
table.gates td.result-0 { color: var(--blue); font-family: var(--font-mono); font-weight: 700; }

/* ---------- Quiz ---------- */
.quiz-question {
  margin-bottom: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.quiz-question:last-of-type { border-bottom: none; }
.quiz-q-title { font-family: var(--font-body); font-weight: 700; margin-bottom: 14px; color: var(--ink); }
.quiz-options { display: grid; gap: 10px; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: var(--line-strong); }
.quiz-option input { accent-color: var(--yellow); margin-top: 3px; }
.quiz-option.selected { border-color: var(--blue); background: rgba(46,75,218,0.06); }
.quiz-option.correct { border-color: var(--success); background: rgba(111,207,151,0.10); }
.quiz-option.incorrect { border-color: var(--danger); background: rgba(232,102,79,0.10); }

.quiz-result {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: var(--radius);
  text-align: center;
}
.quiz-result.pass { background: rgba(111,207,151,0.10); border: 1px solid var(--success); }
.quiz-result.fail { background: rgba(232,102,79,0.10); border: 1px solid var(--danger); }
.quiz-result.neutral { background: var(--bg-alt); border: 1px solid var(--line-strong); }
.quiz-score { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 6px; }

/* ---------- Chapter nav footer ---------- */
/* ---------- Exercice pratique ---------- */
.exercise {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 30px 0;
  background: var(--bg-alt);
}
.exercise-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.exercise details.reveal { margin-top: 16px; }
.exercise details.reveal summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--blue);
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  width: fit-content;
  user-select: none;
}
.exercise details.reveal summary::-webkit-details-marker { display: none; }
.exercise details.reveal summary::after { content: "▾"; transition: transform 0.15s ease; }
.exercise details.reveal[open] summary::after { transform: rotate(180deg); }
.exercise details.reveal .correction {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--line);
}
.exercise details.reveal .correction p:last-child { margin-bottom: 0; }

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 60px 0 40px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

/* ---------- Footer ---------- */
footer.site-footer {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding: 50px 0 60px;
}

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: 40px; }
.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.badge-soon {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  padding: 2px 10px;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .card { padding: 22px 20px; }
  .hero { padding: 60px 0 30px; }
  .roadmap-item { flex-wrap: wrap; }
}
