/* =====================================================================
   CLARIO - base.css
   Variables, reset, typographie, layout commun, header, footer, boutons.
   ===================================================================== */

:root {
  --noir: #050505;
  --noir-2: #101010;
  --noir-3: #181818;
  --or: #d8aa3d;
  --or-fonce: #8c6418;
  --or-clair: #f5d982;
  --ivoire: #fff7df;
  --blanc: #ffffff;
  --gris: #d8d2c3;
  --gris-2: #9f9787;
  --vert: #9ff0a4;
  --bleu: #9cc4ff;
  --rouge: #ff8a8a;
  --verre: rgba(255, 255, 255, 0.065);
  --ligne-or: rgba(245, 217, 130, 0.28);
  --ombre: 0 30px 100px rgba(0, 0, 0, 0.55);
  --ombre-or: 0 24px 70px rgba(216, 170, 61, 0.16);
  --rayon: 28px;
  --rayon-petit: 14px;
  --largeur: 1160px;
  --transition: 220ms ease;
}

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

html { scroll-behavior: smooth; }

/* Décale les ancres pour qu'elles n'apparaissent pas sous le header sticky */
section[id], main[id], article[id] { scroll-margin-top: 100px; }
@media (max-width: 600px) {
  section[id], main[id], article[id] { scroll-margin-top: 80px; }
}

/* Focus accessible (clavier) */
:focus-visible {
  outline: 2px solid var(--or-clair);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Bouton retour haut */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--ligne-or);
  background: linear-gradient(135deg, rgba(245, 217, 130, 0.95), rgba(216, 170, 61, 0.92));
  color: var(--noir);
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover { box-shadow: 0 14px 30px rgba(216, 170, 61, 0.5); }

/* Lien d'évitement clavier (skip to content) */
.skip-link {
  position: absolute;
  left: 12px;
  top: -50px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--or-clair);
  color: var(--noir);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  transition: top 180ms ease;
}
.skip-link:focus { top: 12px; outline: 2px solid var(--noir); outline-offset: 2px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 217, 130, 0.22), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(216, 170, 61, 0.12), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(245, 217, 130, 0.08), transparent 34%),
    linear-gradient(180deg, #070707 0%, #040404 48%, #0a0702 100%);
  color: var(--blanc);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 217, 130, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 217, 130, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at top, black, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at top, black, transparent 72%);
  opacity: 0.42;
  z-index: -1;
}

a { color: inherit; text-decoration: none; }

img, svg { max-width: 100%; display: block; }

.container {
  width: min(100% - 32px, var(--largeur));
  margin: 0 auto;
}

/* ----- TOPBAR / NAV ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(5,5,5,0.98), rgba(18,14,6,0.96), rgba(5,5,5,0.98));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(245, 217, 130, 0.26);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.42);
}

.nav {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.brand { display: flex; align-items: center; gap: 14px; padding: 8px 10px 8px 0; }

.logo-mark {
  width: 50px; height: 50px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--or-clair), var(--or) 48%, #8c6418 100%);
  box-shadow: 0 0 0 6px rgba(216, 170, 61, 0.08), 0 14px 32px rgba(216, 170, 61, 0.18);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-mark svg { width: 31px; height: 31px; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-text strong {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  line-height: 1;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--or-clair);
  text-shadow: 0 0 22px rgba(245, 217, 130, 0.22);
}
.brand-text span {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(245, 217, 130, 0.12);
  color: var(--or-clair);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--ligne-or);
  color: var(--or-clair);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ----- BOUTONS ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--or-clair), var(--or));
  color: var(--noir);
  box-shadow: 0 14px 30px rgba(216, 170, 61, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(216, 170, 61, 0.42); }

.btn-secondary {
  background: transparent;
  color: var(--or-clair);
  border-color: var(--ligne-or);
}
.btn-secondary:hover { background: rgba(245, 217, 130, 0.08); }

.btn-card {
  width: 100%;
  background: linear-gradient(135deg, var(--or-clair), var(--or));
  color: var(--noir);
  margin-top: 14px;
}
.btn-card:hover { transform: translateY(-1px); }

/* ----- TITRES DE SECTION ----- */
.section-title { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-title small {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--ligne-or);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--or-clair);
  margin-bottom: 18px;
}
.section-title h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--ivoire);
  letter-spacing: -0.01em;
}
.section-title p { color: var(--gris); font-size: 1.04rem; }

/* ----- FOOTER ----- */
.footer {
  margin-top: 80px;
  padding: 60px 0 36px;
  border-top: 1px solid rgba(245, 217, 130, 0.18);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}
.footer h4 {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--or-clair);
  margin-bottom: 14px;
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { color: var(--gris); font-size: 0.92rem; transition: var(--transition); }
.footer ul a:hover { color: var(--or-clair); }
.footer p { color: var(--gris-2); font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(245, 217, 130, 0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--gris-2);
  font-size: 0.85rem;
}

/* ----- UTILITAIRES ----- */
.muted { color: var(--gris-2); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ----- ÉTATS DE CHARGEMENT ----- */
.loading {
  display: grid;
  place-items: center;
  padding: 80px 20px;
  color: var(--gris);
}
.loading-spinner {
  width: 42px; height: 42px;
  border: 3px solid rgba(245, 217, 130, 0.18);
  border-top-color: var(--or-clair);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  margin: 60px auto;
  max-width: 540px;
  padding: 30px;
  border: 1px solid rgba(255, 138, 138, 0.4);
  border-radius: var(--rayon-petit);
  background: rgba(255, 138, 138, 0.08);
  text-align: center;
  color: var(--rouge);
}
