/* ===================================================================
   Test de maturité souveraineté numérique — Rhapsodies Conseil
   Polices auto-hébergées (assets/fonts), zéro dépendance externe.
   =================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/Fraunces-Variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("../assets/fonts/PublicSans-Variable.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --dark: #1c293c;
  --dark-2: #141d2b;
  --cyan: #4ae3ed;
  --cyan-deep: #1fb8c4;
  --paper: #faf8f4;
  --paper-2: #f1efe9;
  --ink: #1c293c;
  --ink-soft: rgba(28, 41, 60, 0.64);
  --ink-faint: rgba(28, 41, 60, 0.36);
  --line: rgba(28, 41, 60, 0.14);
  --white: #ffffff;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-variation-settings: "wght" 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- texture de grain, subtile, en pur CSS (aucune image externe) ---------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 5vw, 56px);
  background: var(--dark);
}
.site-header__logo {
  height: 26px;
  width: auto;
  display: block;
}

/* ---------- vues ---------- */
.view {
  display: none;
}
.view.is-active {
  display: block;
}

/* ================= HERO ================= */
.view-hero {
  position: relative;
  min-height: calc(100vh - 64px);
  background: var(--dark);
  color: var(--white);
  overflow: hidden;
}
.view-hero.is-active {
  display: flex;
  align-items: center;
}

.hero-atlas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
}
.hero-atlas svg {
  width: 100%;
  height: 100%;
  transform-origin: 400px 400px;
  animation: atlas-spin 140s linear infinite;
}
@keyframes atlas-spin {
  to { transform: rotate(360deg); }
}
.hero-atlas__lines circle,
.hero-atlas__lines line {
  fill: none;
  stroke: rgba(74, 227, 237, 0.18);
  stroke-width: 1;
}
.hero-atlas__dots circle {
  fill: var(--cyan);
  opacity: 0.55;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 64px clamp(20px, 6vw, 72px);
}

.eyebrow {
  font-family: var(--font-body);
  font-variation-settings: "wght" 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--cyan);
  margin-bottom: 20px;
  opacity: 0;
  animation: rise 0.8s var(--ease) 0.05s forwards;
}

.hero-title {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.08;
  font-variation-settings: "wght" 560, "opsz" 72, "SOFT" 30, "WONK" 1;
  letter-spacing: -0.01em;
  color: var(--white);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.16s forwards;
}
.hero-title em {
  font-style: italic;
  color: var(--cyan);
  font-variation-settings: "wght" 460, "opsz" 72, "SOFT" 60, "WONK" 1;
}

.hero-sub {
  margin-top: 26px;
  max-width: 46ch;
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.32s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-variation-settings: "wght" 560;
  font-size: 0.98rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.25s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--cyan);
  color: var(--dark-2);
}
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(74, 227, 237, 0.55); transform: translateY(-2px); }
.btn-primary:disabled {
  background: var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-large {
  padding: 18px 36px;
  font-size: 1.05rem;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }

.btn-cyan {
  background: var(--cyan);
  color: var(--dark-2);
  text-decoration: none;
  font-variation-settings: "wght" 620;
}
.btn-cyan:hover { box-shadow: 0 10px 30px -8px rgba(74, 227, 237, 0.5); }

#btn-start {
  margin-top: 40px;
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.48s forwards;
}

.hero-privacy {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.6s forwards;
}
.hero-privacy svg { color: var(--cyan); flex-shrink: 0; }

.hero-credit {
  margin-top: 48px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  font-family: var(--font-display);
  opacity: 0;
  animation: rise 0.9s var(--ease) 0.7s forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= QUIZ ================= */
.view-quiz {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 100px;
}

.quiz-progress__bar {
  height: 5px;
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
}
.quiz-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
  border-radius: 3px;
  transition: width 0.5s var(--ease);
}
.quiz-progress__label {
  margin-top: 12px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  font-variation-settings: "wght" 600;
}

.quiz-step {
  margin-top: 36px;
  animation: step-in 0.5s var(--ease);
}
@keyframes step-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

.quiz-step__theme {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-variation-settings: "wght" 560, "opsz" 40, "SOFT" 20;
  margin-bottom: 8px;
}
.quiz-step__hint {
  color: var(--ink-soft);
  margin-bottom: 32px;
  font-size: 0.98rem;
}

.question {
  border: none;
  padding: 0;
  margin: 0 0 36px;
}
.question:last-child { margin-bottom: 0; }

.question__text {
  padding: 0;
  font-size: 1.08rem;
  line-height: 1.5;
  font-variation-settings: "wght" 520;
  color: var(--ink);
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
}
.question__num {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--cyan-deep);
  font-variation-settings: "wght" 500;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option { position: relative; }
.option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.option span {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.94rem;
  color: var(--ink);
  transition: all 0.2s var(--ease);
}
.option:hover span {
  border-color: var(--cyan-deep);
}
.option input:focus-visible + span {
  outline: 2px solid var(--cyan-deep);
  outline-offset: 2px;
}
.option input:checked + span {
  background: var(--dark);
  border-color: var(--dark);
  color: var(--white);
}

.quiz-nav {
  margin-top: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ================= RESULTS ================= */
.view-results {
  max-width: 920px;
  margin: 0 auto;
  padding: 64px 20px 100px;
}

.results-reveal {
  text-align: center;
  margin-bottom: 56px;
}
.score-dial {
  margin: 22px 0 8px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
}
.score-dial__number {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 7rem);
  font-variation-settings: "wght" 480, "opsz" 144, "SOFT" 20;
  color: var(--dark);
  line-height: 1;
}
.score-dial__scale {
  font-size: 1.4rem;
  color: var(--ink-faint);
}
.niveau-label {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--cyan-deep);
  font-variation-settings: "wght" 560;
}
.niveau-desc {
  max-width: 52ch;
  margin: 14px auto 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.6;
}

.results-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
@media (max-width: 760px) {
  .results-grid { grid-template-columns: 1fr; }
}

.radar-card, .breakdown-card, .obstacle-card, .cta-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.radar-card h3, .breakdown-card h3 {
  font-size: 1.02rem;
  font-variation-settings: "wght" 560;
  margin-bottom: 18px;
  color: var(--ink);
}

.radar-chart svg { width: 100%; height: auto; overflow: visible; }
.radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape {
  fill: rgba(74, 227, 237, 0.22);
  stroke: var(--cyan-deep);
  stroke-width: 2;
  stroke-linejoin: round;
}
.radar-label {
  font-family: var(--font-body);
  font-size: 11px;
  fill: var(--ink-soft);
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.breakdown-item__top {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.breakdown-item__name { color: var(--ink); }
.breakdown-item__score { color: var(--ink-soft); font-variation-settings: "wght" 600; }
.breakdown-item__bar {
  height: 6px;
  border-radius: 3px;
  background: var(--paper-2);
  overflow: hidden;
}
.breakdown-item__fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan-deep), var(--cyan));
  width: 0%;
  transition: width 1s var(--ease);
}

.obstacle-card {
  margin-bottom: 24px;
  background: rgba(74, 227, 237, 0.08);
  border-color: rgba(74, 227, 237, 0.3);
}
.obstacle-card p { color: var(--ink); line-height: 1.6; }
.obstacle-card strong { color: var(--dark); }

.cta-card {
  background: var(--dark);
  border: none;
  color: var(--white);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cta-card__text {
  max-width: 52ch;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.results-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 28px 20px 40px;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ---------- impression ---------- */
@media print {
  .site-header, .site-footer, .results-actions, .noise-overlay { display: none !important; }
  .view-results { padding: 0; }
  body { background: white; }
}

/* ---------- mobile ---------- */
@media (max-width: 560px) {
  .cta-card { flex-direction: column; align-items: flex-start; }
  .quiz-nav { flex-direction: row; }
}
