/* =========================================
   GLOBAL.CSS — Arnaud Saunier AS®
   Partagé par toutes les pages du site
   ========================================= */

/* ── GOOGLE FONTS ─────────────────────────
   À garder dans le <head> de chaque HTML :
   <link href="https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap" rel="stylesheet">
   ──────────────────────────────────────── */

/* ── TOKENS ────────────────────────────── */
:root {
  --bg:      #ffffff;
  --ink:     #000000;
  --rule:    #000000;
  --muted:   #999999;
  --pad-x:   24px;
  --gap:     24px;
  --nav-h:   57px;
  --radius:  32px;
  --max-w:   1400px;
}

/* ── RESET MINIMAL ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }

/* ── BASE ───────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── NAV ────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  padding: 0 var(--pad-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand sup {
  font-size: 9px;
  vertical-align: super;
  font-weight: 400;
  margin-left: 1px;
}
.brand img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  transition: opacity 0.2s ease;
  padding: 4px 0;
}
.nav-links a:hover { opacity: 0.5; }
.nav-links a[aria-current="page"] {
  border-bottom: 1px solid var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  margin: 5px 0;
}

/* Menu mobile déployé */
.nav.is-open .nav-links {
  display: flex;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  flex-direction: column;
  background: var(--bg);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--rule);
  z-index: 110;
}
.nav.is-open .nav-links a {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}
.nav.is-open .nav-links a:first-child { border-top: none; }

/* ── FOOTER — version standard (pages internes) ── */
footer {
  padding: 40px var(--pad-x) 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy,
footer a {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
footer ul { display: flex; gap: 24px; flex-wrap: wrap; }
footer a { transition: opacity 0.2s ease; }
footer a:hover { opacity: 0.5; }

/* ── RESPONSIVE MOBILE — base commune ──── */
@media (max-width: 720px) {
  :root { --pad-x: 20px; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px var(--pad-x) 24px;
  }
}

/* ── ACCESSIBILITÉ ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* =========================================
   DARK MODE — tokens & overrides
   Activé via data-theme="dark" sur <html>
   ========================================= */

[data-theme="dark"] {
  --bg:    #202225;
  --ink:   #f0f0f0;
  --rule:  #2a2a2a;
  --muted: #666666;
}
[data-theme="dark"] img[src*="logo-shape-n"] {
  filter: invert(1);
}
/* ── Transition douce au switch ─────────── */
body,
.nav,
footer,
.card-visual,
.drawer,
.drawer-header {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ── Bouton theme toggle ─────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { opacity: 0.5; }

.theme-toggle svg {
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Images — légèrement adoucies en dark ── */
[data-theme="dark"] img {
  filter: brightness(0.92) contrast(1.02);
}

/* ── Prevent flash (à mettre en inline dans <head>) ──
   <script>
     (function(){
       var t = localStorage.getItem('as-theme') ||
         (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
       document.documentElement.setAttribute('data-theme', t);
     })();
   </script>
   ─────────────────────────────────────────── */
