/* ==========================================================================
   CLAD — Styles globaux partagés
   - Design tokens (couleurs, typo, espacements)
   - Thème clair / sombre via [data-theme]
   - Navbar partagée (.clad-nav)
   - Footer partagé (.clad-footer)
   - Bouton thème (.clad-theme-toggle)
   - Tokens ALIASES pour compat avec la landing (--bg, --surface, --text, etc.)
   ========================================================================== */

/* ===== Thème sombre (default) ===== */
:root,
[data-theme="dark"] {
  /* Tokens principaux (utilisés par navbar/footer/thème) */
  --bg: #0a0d0f;
  --bg-soft: #15191c;
  --bg-elevated: #1c2024;
  --text: #f0f4f7;
  --text-muted: #9aa5b1;
  --text-dim: #6b7280;
  --accent: #c8ff3e;
  --accent-dim: #5a8c00;
  --accent-2: #3dffb0;
  --accent-glow: rgba(200, 255, 62, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* Tokens ALIASES pour la landing (utilisent les mêmes valeurs) */
  --surface: #11161a;
  --surface-2: #1a2128;
  --surface-3: #232b34;
  --text-sec: #8b96a3;
  --text-ter: #4d5662;
  --accent-dim: rgba(200,255,62,0.12);
  --accent-glow: rgba(200,255,62,0.35);
  --success: #3dffb0;
  --warn: #ffb83d;
  --danger: #ff5c5c;
  --display: var(--font-display);
  --mono: var(--font-mono);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
}

/* ===== Thème clair ===== */
[data-theme="light"] {
  /* Tokens principaux */
  --bg: #fafbfc;
  --bg-soft: #f1f3f5;
  --bg-elevated: #ffffff;
  --text: #1a1d20;
  --text-muted: #4a5560;
  --text-dim: #6b7280;
  --accent: #5a8c00;
  --accent-dim: #3d6200;
  --accent-2: #00a878;
  --accent-glow: rgba(90, 140, 0, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);

  /* Tokens ALIASES pour la landing */
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #e9ecef;
  --text-sec: #4a5560;
  --text-ter: #6b7280;
  --accent-dim: rgba(90, 140, 0, 0.12);
  --accent-glow: rgba(90, 140, 0, 0.25);
  --success: #00a878;
  --warn: #d97706;
  --danger: #dc2626;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==========================================================================
   NAVBAR partagée
   ========================================================================== */
.clad-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.clad-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.clad-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.clad-nav-brand:hover { text-decoration: none; }

.clad-nav-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #0a0d0f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  font-family: var(--font-mono);
}
[data-theme="light"] .clad-nav-logo { color: #ffffff; }

.clad-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.clad-nav-links a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.clad-nav-links a:hover,
.clad-nav-links a.active {
  color: var(--text);
}

.clad-nav-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.clad-theme-toggle {
  margin-right: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s, border-color 0.15s;
}
.clad-theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--border-strong);
}

[data-theme="dark"] .clad-theme-icon-light { display: none; }
[data-theme="light"] .clad-theme-icon-dark { display: none; }

.clad-nav-cta {
  background: var(--accent);
  color: #0a0d0f;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}
[data-theme="light"] .clad-nav-cta { color: #ffffff; }
.clad-nav-cta:hover {
  text-decoration: none;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.clad-nav-burger {
  display: none;
  background: transparent;
  border: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}
.clad-nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}

@media (max-width: 768px) {
  .clad-nav-links {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    display: none;
  }
  .clad-nav-links.open { display: flex; }
  .clad-nav-burger { display: flex; }
  .clad-nav-cta { display: none; }
}

/* ==========================================================================
   FOOTER partagé
   ========================================================================== */
.clad-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 60px 24px 24px;
  margin-top: 80px;
}

.clad-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 48px;
}

.clad-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clad-footer-brand > div,
.clad-footer-brand > span {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
}
.clad-footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 280px;
}

.clad-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.clad-footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.clad-footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-decoration: none;
}
.clad-footer-col a:hover { color: var(--text); }

.clad-footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}

@media (max-width: 768px) {
  .clad-footer-inner {
    grid-template-columns: 1fr;
  }
  .clad-footer-cols {
    grid-template-columns: 1fr 1fr;
  }
  .clad-footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
