/* ==========================================================================
   layout.css — topbar, hero, section aperçu, structure des vues
   ========================================================================== */

/* === TOP BAR (barre fixe en haut) === */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(253, 248, 242, 0.75);
  border-bottom: 1px solid rgba(26, 46, 42, 0.06);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.topbar.visible { transform: translateY(0); }

.logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--grad-hero);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-glow);
}

/* Barre de progression globale dans la topbar */
.progress-track {
  flex: 1;
  max-width: 400px;
  height: 6px;
  background: rgba(26, 46, 42, 0.08);
  border-radius: 3px;
  margin: 0 2rem;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-hero);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 0 0 3px var(--sage-2), var(--shadow-sm);
}

.menu-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(26, 46, 42, 0.1);
  background: white;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.2s;
  font-size: 1.2rem;
}
.menu-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* === HERO (page d'accueil) === */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sage-2);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  animation: fadeDown 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-badge .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  position: relative;
}
.hero-badge .pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 2s infinite;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  margin-bottom: 1.5rem;
  max-width: 900px;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.hero p {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  max-width: 620px;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 4rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.6s both;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}
.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--ink-soft);
  animation: bounce 2s infinite;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.2s;
}
.scroll-hint:hover { background: rgba(26, 46, 42, 0.06); }

/* === STRUCTURE DES VUES (écrans) === */
.view {
  display: none;
  padding: 6rem 2rem 4rem;
  position: relative;
  z-index: 1;
}
.view.active {
  display: block;
  animation: fadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.container {
  max-width: 820px;
  margin: 0 auto;
}

/* === SECTION APERÇU DES CHAPITRES === */
.preview-section {
  padding: 6rem 0 4rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.preview-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}
.preview-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage-2);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.preview-header h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}
.preview-header p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.preview-cta { text-align: center; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .topbar { padding: 0.7rem 1rem; }
  .progress-track { margin: 0 0.8rem; }
  .logo span:not(.logo-icon) { display: none; }
  .view { padding: 5rem 1rem 3rem; }
  .hero-stats { gap: 1rem; }
  .stat { min-width: 90px; }
  .stat-num { font-size: 2rem; }
}
