/* Fourth Expedition — MPA (server-rendered).
   MARSWELL design system: tokens + atmosphere + motion from preview/css/styles.css.
   Pure CSS/HTML — no React build dependency. */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@200;300;400;600&family=Manrope:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --radius: 0.875rem;
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);

  --background: oklch(0.13 0.035 268);
  --foreground: oklch(0.985 0.01 90);
  --primary: oklch(0.72 0.17 45);
  --primary-foreground: oklch(0.13 0.035 268);
  --accent: oklch(0.78 0.15 90);
  --muted-foreground: oklch(0.72 0.03 250);
  --destructive: oklch(0.7 0.2 22);
  --border: oklch(1 0 0 / 10%);
  --ring: oklch(0.72 0.17 45);

  --nombres: #f97316;
  --espace: #22d3ee;
  --grandeurs: #10b981;
  --problemes: #a855f7;

  --font-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-micro: 120ms;
  --duration-standard: 200ms;
  --duration-entrance: 240ms;
  --lift-y: -2px;
  --press-scale: 0.98;
  --shadow-lift:
    0 10px 24px -12px rgba(0, 0, 0, 0.55),
    0 2px 6px -2px rgba(0, 0, 0, 0.35);

  --card-radius: 1.25rem;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-bg-elevated: rgba(255, 255, 255, 0.065);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-elevated: rgba(255, 255, 255, 0.12);
  --card-blur: 20px;
  --card-shadow-elevated:
    0 24px 60px -28px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

html { scroll-padding-top: 96px; }

body {
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.025em;
  margin: 0;
}

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Atmosphere layers (fixed behind content) ─────────────────────────────── */
.mpa-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 600px at 50% 100%, rgba(96, 165, 250, 0.12), transparent 60%),
    radial-gradient(circle 800px at 80% 20%, rgba(249, 115, 22, 0.1), transparent 60%),
    linear-gradient(180deg, oklch(0.11 0.04 268) 0%, oklch(0.13 0.035 268) 100%);
}

.mpa-starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6) 50%, transparent 50%),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,0.7) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 70%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.45) 50%, transparent 50%),
    radial-gradient(1px 1px at 35% 50%, rgba(255,255,255,0.35) 50%, transparent 50%);
  background-size: 600px 600px, 520px 520px, 680px 680px, 440px 440px, 580px 580px, 720px 720px, 500px 500px;
  animation: drift 28s ease-in-out infinite;
}

.mpa-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><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>");
}

.mpa-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Atmospheres (section-level) ─────────────────────────────────────────── */
.atmosphere-rust {
  background:
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(249, 115, 22, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(251, 191, 36, 0.18), transparent 60%),
    linear-gradient(180deg, oklch(0.16 0.04 280) 0%, oklch(0.13 0.035 268) 100%);
}

.atmosphere-orbit {
  background:
    radial-gradient(circle 600px at 50% 100%, rgba(96, 165, 250, 0.12), transparent 60%),
    radial-gradient(circle 800px at 80% 20%, rgba(249, 115, 22, 0.1), transparent 60%),
    linear-gradient(180deg, oklch(0.11 0.04 268) 0%, oklch(0.13 0.035 268) 100%);
}

.grid-dots {
  background-image: radial-gradient(rgba(249, 115, 22, 0.22) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ── Typography utilities ────────────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }

/* ── Glass / cards ───────────────────────────────────────────────────────── */
.glass-pill {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(36px) saturate(1.4);
  -webkit-backdrop-filter: blur(36px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.2),
    0 30px 80px -20px rgba(0, 0, 0, 0.5);
}

.card,
.card-flat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(var(--card-blur)) saturate(1.3);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.3);
}

.card + .card { margin-top: 1rem; }

.card.elevated,
.card-elevated {
  background: var(--card-bg-elevated);
  border-color: var(--card-border-elevated);
  box-shadow: var(--card-shadow-elevated);
}

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }

.stat .stat-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
}
.stat .stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.mpa-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  box-shadow: 0 8px 30px -12px rgba(0, 0, 0, 0.55);
}

.mpa-nav .brand {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: 0.02em;
  margin-right: 0.35rem;
  font-size: 1.05rem;
}

.mpa-nav .brand span {
  color: var(--primary);
  font-weight: 600;
}

.mpa-nav a.nav-link {
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition:
    color var(--duration-micro) var(--ease-standard),
    background var(--duration-micro) var(--ease-standard);
}

.mpa-nav a.nav-link:hover { color: var(--foreground); background: rgba(255, 255, 255, 0.05); }

.mpa-nav a.nav-link.current {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.08);
}

.mpa-nav .spacer { flex: 1; min-width: 0.5rem; }

.mpa-nav .who {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}

.lang-switch { display: flex; gap: 0.15rem; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.mpa-main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
  flex: 1;
  animation: page-enter var(--duration-standard) var(--ease-standard) both;
}

.mpa-main.mpa-main--wide {
  max-width: 72rem;
}

.mpa-kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.mpa-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.35rem;
  font-weight: 300;
}

.mpa-title.strong { font-weight: 600; }

.mpa-sub {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  line-height: 1.55;
}

/* ── Marketing hero ──────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: min(88vh, 42rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 4rem;
  overflow: hidden;
  border-radius: 0 0 2rem 2rem;
  margin: -2.5rem -1.5rem 2rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(249, 115, 22, 0.4), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(251, 191, 36, 0.2), transparent 60%),
    radial-gradient(circle 500px at 20% 30%, rgba(167, 139, 250, 0.12), transparent 55%),
    linear-gradient(180deg, oklch(0.14 0.05 280) 0%, oklch(0.12 0.04 268) 55%, var(--background) 100%);
  animation: drift 18s ease-in-out infinite;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><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>");
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.55;
  animation: pulse-glow 5s ease-in-out infinite;
  pointer-events: none;
}

.hero-orb-a {
  width: 18rem;
  height: 18rem;
  background: rgba(249, 115, 22, 0.45);
  top: 10%;
  left: 15%;
}

.hero-orb-b {
  width: 14rem;
  height: 14rem;
  background: rgba(251, 191, 36, 0.35);
  bottom: 15%;
  right: 12%;
  animation-delay: 1.5s;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  text-align: center;
  animation: slide-up 0.9s var(--ease-out-expo) both;
}

.hero-inner .glass-pill {
  border-radius: 2.75rem;
  padding: 2rem 1.75rem 1.75rem;
}

.hero-mark {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    radial-gradient(circle at 35% 30%, rgba(251, 191, 36, 0.5), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(249, 115, 22, 0.65), transparent 50%),
    linear-gradient(145deg, oklch(0.35 0.08 45), oklch(0.18 0.04 268));
  box-shadow: 0 20px 50px -15px rgba(249, 115, 22, 0.55);
  animation: float 6s ease-in-out infinite;
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hero-ctas .btn { width: 100%; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
}

/* Pricing cards */
.price-slot {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.25rem 0 1.25rem;
}
.price-amount {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
}
.price-period {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  font-weight: 400;
}

/* ── Buttons / forms ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
  cursor: pointer;
  transition:
    transform var(--duration-micro) var(--ease-standard),
    box-shadow var(--duration-micro) var(--ease-standard),
    background var(--duration-micro) var(--ease-standard),
    opacity var(--duration-micro) var(--ease-standard);
  will-change: transform;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(var(--lift-y));
  box-shadow: var(--shadow-lift);
}

.btn:active:not(:disabled) {
  transform: scale(var(--press-scale));
  transition-duration: 80ms;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: var(--primary-foreground);
  border: none;
  box-shadow: 0 10px 40px -10px rgba(249, 115, 22, 0.5);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  box-shadow: none;
}

.btn-link:hover { transform: none; box-shadow: none; text-decoration: underline; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input:not([type]) {
  font: inherit;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  width: 100%;
  transition: border-color var(--duration-micro), box-shadow var(--duration-micro);
}

input:focus {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

label.field {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
}

.form-row { margin-bottom: 1rem; }

/* ── Notices / feedback ──────────────────────────────────────────────────── */
.notice {
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  animation: slide-up 0.35s var(--ease-out-expo) both;
}

.feedback {
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  animation: slide-up 0.3s var(--ease-out-expo) both;
}
.feedback.ok { border: 1px solid rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.12); }
.feedback.ko { border: 1px solid rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.12); }
.feedback .expected { color: var(--muted-foreground); font-size: 0.85rem; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
table.mpa-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.mpa-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
table.mpa-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ── Pills / mastery ─────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.pill.mastered { color: #34d399; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.pill.practicing { color: var(--espace); border-color: rgba(34, 211, 238, 0.4); background: rgba(34, 211, 238, 0.08); }
.pill.learning { color: var(--primary); border-color: rgba(249, 115, 22, 0.4); background: rgba(249, 115, 22, 0.08); }
.pill.needs_review { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.pill.not_started { opacity: 0.65; }
.pill.locked { opacity: 0.5; }

.mastery-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mastery-row .title { font-weight: 600; font-size: 0.9rem; }
.mastery-row .meta { font-size: 0.75rem; color: var(--muted-foreground); }

.progress-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 0.4rem;
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

/* ── Question / mission ──────────────────────────────────────────────────── */
.question-prompt {
  font-size: 1.35rem;
  font-family: var(--font-display);
  font-weight: 300;
  margin: 0.75rem 0 1.25rem;
}

.mcq-options { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.mcq-options label {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--duration-micro), border-color var(--duration-micro), transform var(--duration-micro);
}
.mcq-options label:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(var(--lift-y));
}
.mcq-options input { margin-right: 0.6rem; }

details.hint { margin: 0 0 1.25rem; font-size: 0.9rem; color: var(--muted-foreground); }
details.hint summary { cursor: pointer; color: var(--primary); font-size: 0.85rem; }

.progress-dots {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
}
.progress-dots span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  transition: background var(--duration-standard), transform var(--duration-standard), box-shadow var(--duration-standard);
}
.progress-dots span.done {
  background: var(--grandeurs);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.progress-dots span.now {
  background: var(--primary);
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.65);
}

/* ── Codex ───────────────────────────────────────────────────────────────── */
.specimen-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.specimen {
  text-align: center;
  padding: 1.1rem 0.85rem;
  transition: transform var(--duration-micro) var(--ease-standard), box-shadow var(--duration-micro);
}

.specimen:hover:not(.locked) {
  transform: translateY(var(--lift-y));
  box-shadow: var(--shadow-lift);
}

.specimen .glyph {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 0.45rem;
  display: block;
}

.specimen .art {
  width: 100%;
  max-width: 10rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 0.5rem;
  border-radius: 0.85rem;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.specimen.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.specimen.locked .art {
  filter: grayscale(1) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.specimen .name {
  font-weight: 600;
  font-size: 0.9rem;
}

.specimen .rarity {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.specimen .rarity.rare { color: var(--espace); }
.specimen .rarity.legendaire,
.specimen .rarity.holo { color: var(--accent); }

.holo-frame {
  position: relative;
}
.holo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.25rem;
  padding: 2px;
  background: linear-gradient(120deg, #22d3ee, #8b5cf6, #ec4899, #f97316, #22d3ee);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: holo-spin 6s linear infinite;
  pointer-events: none;
}

.holo-sheen-wrap {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}
.holo-sheen-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  animation: holo-sheen 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* ── Rewards ─────────────────────────────────────────────────────────────── */
.reward-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.reward-row .medal { font-size: 1.5rem; flex-shrink: 0; }
.reward-row .info { flex: 1; min-width: 0; }
.reward-row .info .title { font-weight: 600; }
.reward-row .desc { color: var(--muted-foreground); font-size: 0.85rem; }
.reward-row.locked { opacity: 0.45; }
.reward-row.unlocked .medal { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }

/* ── Parent ──────────────────────────────────────────────────────────────── */
.child-card h3 { font-size: 1.2rem; margin-bottom: 0.25rem; font-weight: 600; }
.mini-stats { display: flex; gap: 1.25rem; margin: 0.75rem 0; flex-wrap: wrap; }
.mini-stats .stat-value { font-size: 1.15rem; }

.inline-form { display: inline; }
.row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 10rem; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }

/* ── 404 lost in space ───────────────────────────────────────────────────── */
.lost-in-space {
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
}
.lost-in-space .glyph {
  font-size: 3.5rem;
  animation: float 5s ease-in-out infinite;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 0 20px rgba(249, 115, 22, 0.4));
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.mpa-footer {
  margin-top: auto;
  padding: 1.25rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.mpa-footer a:hover { color: var(--primary); }

/* ── Keyframes ───────────────────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.45; filter: blur(60px); }
  50% { opacity: 0.8; filter: blur(90px); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -8px, 0) scale(1.02); }
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes holo-spin {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes holo-sheen {
  0% { transform: translateX(-120%) skewX(-20deg); }
  100% { transform: translateX(220%) skewX(-20deg); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 5s ease-in-out infinite; }
.animate-drift { animation: drift 9s ease-in-out infinite; }
.animate-in-up { animation: slide-up 0.8s var(--ease-out-expo) both; }
.page-enter { animation: page-enter var(--duration-standard) var(--ease-standard) both; }

/* ── Interactive lift (cards/buttons already covered; general cards) ─────── */
.card:not([data-no-motion]):hover,
.card-flat:not([data-no-motion]):hover,
.card-elevated:not([data-no-motion]):hover {
  /* subtle — only when not full form cards with inputs focused */
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity, color, background-color, border-color !important;
    transition-duration: var(--duration-micro) !important;
    scroll-behavior: auto !important;
  }

  .page-enter,
  .animate-in-up,
  .mpa-main {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .btn:hover:not(:disabled),
  .specimen:hover:not(.locked) {
    transform: none !important;
  }

  .mpa-starfield,
  .hero-bg,
  .hero-orb,
  .hero-mark {
    animation: none !important;
  }
}

/* ── Difficulty annotator ────────────────────────────────────────────────── */
.annotator-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 20rem) 1fr;
  gap: 1.25rem;
  align-items: start;
}
.annotator-help .annotator-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.15rem;
  line-height: 1.55;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}
.annotator-help .annotator-steps li { margin: 0.4rem 0; }
.annotator-help .annotator-steps strong { color: var(--foreground); }
.annotator-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.annotator-card { margin: 0; }
.annotator-pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  min-height: 14rem;
  text-align: left;
  cursor: pointer;
  padding: 1.1rem 1.15rem;
  border-radius: var(--card-radius);
  border: 1px solid var(--card-border-elevated);
  background: var(--card-bg-elevated);
  color: var(--foreground);
  font: inherit;
  transition: transform var(--duration-standard) var(--ease-standard),
              border-color var(--duration-standard) var(--ease-standard),
              box-shadow var(--duration-standard) var(--ease-standard);
}
.annotator-pick:hover {
  transform: translateY(var(--lift-y));
  border-color: color-mix(in oklch, var(--primary) 55%, var(--card-border));
  box-shadow: var(--shadow-lift);
}
.annotator-pick:active { transform: scale(var(--press-scale)); }
.annotator-side {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}
.annotator-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.annotator-prompt {
  margin: 0.35rem 0 0;
  line-height: 1.45;
  font-size: 1rem;
}
.annotator-lang {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-right: 0.25rem;
}
.annotator-cta {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 52rem) {
  .annotator-layout { grid-template-columns: 1fr; }
  .annotator-pair { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .mpa-title { font-size: 1.5rem; }
  .question-prompt { font-size: 1.1rem; }
  .hero {
    min-height: min(78vh, 36rem);
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .mpa-main { padding-left: 1rem; padding-right: 1rem; }
  .mpa-nav { padding-left: 1rem; padding-right: 1rem; gap: 0.4rem; }
  .mpa-nav a.nav-link { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
}
