/* =========================================
   VARIABLES & RESET UI/UX SENIOR
========================================= */
:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;

  /* Palette Dark Modern */
  --bg-deep: #020617;
  --bg-surface: #0f172a;
  --bg-glass: rgba(30, 41, 59, 0.4);

  /* Couleurs d'accentuation (Glows) */
  --color-prep: #10b981;  /* Green */
  --color-train: #3b82f6; /* Blue */
  --color-help: #f43f5e;  /* Rose/Red */

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);

  --radius-xl: 24px;
  --radius-md: 12px;

  --ease-spring: cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Navigation rail width */
  --rail-width: 80px;
}

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

body {
  background-color: var(--bg-deep);
  /* Fond complexe et profond */
  background-image:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.1), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(244, 63, 94, 0.1), transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Layout shell pour gérer sidebar + content */
.app-shell {
  display: block;
  min-height: 100vh;
}

@media (min-width: 1025px) {
  .app-shell {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    transition: grid-template-columns 420ms var(--ease-spring);
  }

  .nav-rail {
    grid-column: 1;
    align-self: start;
  }

  .container {
    grid-column: 2;
    min-width: 0;
  }
}

/* =========================================
   LAYOUT CENTRÉ & HEADER
========================================= */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 1024px) {
  /* Reserve space for the bottom floating nav */
  .container { padding-bottom: 110px; }
}

.home-center {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}

@media (min-width: 1025px) {
  .container { min-height: 100vh; }
}

/* Footer pinned to bottom when there is space (keeps cards+titre centered). */
.footer { margin-top: auto; }

@media (max-width: 768px) {
  .container {
    padding: 16px;
    padding-bottom: 110px;
  }

  header {
    margin-top: 10px;
    margin-bottom: 16px;
  }

  header::before {
    height: 70px;
    filter: blur(28px);
  }
}

header {
  text-align: center;
  margin-top: 18px;
  margin-bottom: 22px;
  position: relative;
}

/* Choose-level cards on home */
.home-cards{
  width: 100%;
  margin-bottom: 26px;
}
a.data-card{
  text-decoration: none;
  color: inherit;
}

/* Home: mobile-first cards layout */
.home-cards.bento-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

.home-cards .card-content h3,
.home-cards .card-content p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 769px) {
  .home-cards.bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1100px) {
  .home-cards.bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.data-card--primary {
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12) inset;
}

/* Effet de glow derrière le titre */
header::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 100px;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.3), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  white-space: nowrap;
  text-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
}

p.subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.active-level {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.55);
}

.active-level__text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.active-level__link {
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.active-level__link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

/* =========================================
   ANIMATION SYMBOLES MATHÉMATIQUES
========================================= */
.math-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.math-symbol {
  position: absolute;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  color: rgba(255, 255, 255, 0.25);
  font-weight: 300;
  font-family: 'Times New Roman', 'Georgia', serif;
  animation: floatUp linear infinite;
  opacity: 0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.4;
  }
  95% {
    opacity: 0.2;
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Variations de couleurs pour certains symboles */
.math-symbol.green {
  color: rgba(16, 185, 129, 0.4);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.math-symbol.blue {
  color: rgba(59, 130, 246, 0.4);
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.math-symbol.rose {
  color: rgba(244, 63, 94, 0.4);
  text-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

/* Container principal avec z-index */
.container {
  position: relative;
  z-index: 1;
}
