/* ============================================================
   NEBULA — aperçu des directions de design.
   Deux palettes FIGÉES, jamais retouchées :
   - Sombre = Marine (ex-V6)   - Clair = (ex-V12)
   Appliquées via .nbx[data-mode="dark|light"] (défaut = dark).
   Chaque page importe dist/styles.css (fonts Outfit/DM Mono + tokens de base)
   puis ce fichier surcharge la palette et fournit le "chrome" d'aperçu.
   ============================================================ */

/* ---- Palette SOMBRE (Marine) : défaut ---- */
.nbx {
  --nb-bg: #0d1520; --nb-surface-1: #121c29; --nb-surface-2: #172433; --nb-surface-3: #1d2c3e;
  --nb-bg-glass: rgba(13, 21, 32, 0.82);
  --nb-teal: #2ec4b6; --nb-teal-strong: #25a89c; --nb-teal-soft: rgba(46, 196, 182, 0.12);
  --nb-teal-border: rgba(46, 196, 182, 0.35); --nb-teal-glow: rgba(46, 196, 182, 0.16); --nb-on-teal: #06211e;
  --nb-text: #e9eef4; --nb-text-muted: #93a4b5; --nb-text-faint: #7a8ea1;
  --nb-border: rgba(255, 255, 255, 0.09); --nb-border-strong: rgba(255, 255, 255, 0.16);
  --nb-elevate: 0 24px 60px rgba(0, 0, 0, 0.45);
  --nb-grid-line: rgba(255, 255, 255, 0.05);
}
/* ---- Palette CLAIRE ---- */
.nbx[data-mode="light"] {
  --nb-bg: #f4f5f7; --nb-surface-1: #ffffff; --nb-surface-2: #eceef1; --nb-surface-3: #e3e6ea;
  --nb-bg-glass: rgba(244, 245, 247, 0.82);
  --nb-teal: #0c807d; --nb-teal-strong: #0a6764; --nb-teal-soft: rgba(12, 128, 125, 0.12);
  --nb-teal-border: rgba(12, 128, 125, 0.35); --nb-teal-glow: rgba(12, 128, 125, 0.16); --nb-on-teal: #ffffff;
  --nb-text: #141b26; --nb-text-muted: #485261; --nb-text-faint: #586374;
  --nb-border: rgba(0, 0, 0, 0.1); --nb-border-strong: rgba(0, 0, 0, 0.2);
  --nb-elevate: 0 24px 60px rgba(20, 27, 38, 0.12);
  --nb-grid-line: rgba(20, 27, 38, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.nbx {
  background: var(--nb-bg); color: var(--nb-text);
  font-family: var(--nb-font-sans, "Outfit", system-ui, sans-serif);
  min-height: 100vh; overflow-x: hidden; overflow-x: clip; /* clip : coupe le débord sans créer de conteneur de scroll (sinon position:sticky ne colle plus) */

  transition: background 0.4s cubic-bezier(.2,.7,.3,1), color 0.4s cubic-bezier(.2,.7,.3,1);
}
.nbx img { max-width: 100%; display: block; }
.nbx a { color: inherit; }
.nbx a.pf-btn--primary { color: var(--nb-on-teal); } /* sinon la règle ci-dessus rend le texte illisible sur le teal */

/* ============================================================
   Utilitaires partagés
   ============================================================ */
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 860px; }
.eyebrow {
  font-family: var(--nb-font-mono, "DM Mono", monospace); font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--nb-teal);
}
.mono { font-family: var(--nb-font-mono, "DM Mono", monospace); }
.hair { height: 1px; background: var(--nb-border); border: 0; margin: 0; }

/* Révélation au scroll */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.7,.3,1), transform .8s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }
/* Hero : visible dès le premier rendu, sans attendre site.js (sinon le LCP attend le fondu) ; seule la montée reste */
.js .pf-hero .reveal, .js .cw-hero .reveal { opacity: 1; transform: none; transition: none; animation: nb-rise .8s cubic-bezier(.2,.7,.3,1) both; }
.pf-hero .reveal[data-delay="1"], .cw-hero .reveal[data-delay="1"] { animation-delay: .08s; }
.pf-hero .reveal[data-delay="2"], .cw-hero .reveal[data-delay="2"] { animation-delay: .16s; }
.pf-hero .reveal[data-delay="3"], .cw-hero .reveal[data-delay="3"] { animation-delay: .24s; }
.pf-hero .reveal[data-delay="4"], .cw-hero .reveal[data-delay="4"] { animation-delay: .32s; }
@keyframes nb-rise { from { transform: translateY(28px); } }

[data-parallax] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  [data-parallax] { transform: none !important; }
  .nbx { scroll-behavior: auto; }
}

/* ============================================================
   Sélecteur de langue + liens de pied de page (toutes pages)
   ============================================================ */
.lang { display: inline-flex; gap: 2px; font-family: var(--nb-font-mono); font-size: 11px; letter-spacing: .1em; }
.lang a { color: var(--nb-text-faint); padding: 6px 7px; border-radius: 8px; text-decoration: none; }
.lang a:hover { color: var(--nb-text); }
.lang a[aria-current="true"] { color: var(--nb-teal); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-nav a { color: var(--nb-text-muted); text-decoration: none; }
.foot-nav a:hover { color: var(--nb-teal); }
/* Barre de navigation : jamais de retour à la ligne, éléments secondaires masqués en largeur moyenne */
.pf-nav .pf-brand, .pf-nav__links a, .pf-nav .pf-btn { white-space: nowrap; }
@media (max-width: 1180px) { .pf-nav .nav-opt, .pf-nav .pf-brand small { display: none; } }

/* ---- Bouton de thème (auto / clair / sombre) ---- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--nb-border); background: transparent; color: var(--nb-text-muted);
  transition: color .2s, border-color .2s;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--nb-teal); border-color: var(--nb-teal-border); }
.theme-toggle span { display: none; line-height: 0; }
.theme-toggle[data-state="auto"] .tt-auto,
.theme-toggle[data-state="light"] .tt-light,
.theme-toggle[data-state="dark"] .tt-dark { display: inline; }

/* ---- Retours à la ligne : titres équilibrés, pas de mot orphelin, pas de césure auto
   (les traits d'union automatiques coupaient des mots courts en colonne étroite) ---- */
.nbx { overflow-wrap: break-word; }
@supports not (overflow-x: clip) { .nbx { overflow-x: visible; } html { overflow-x: hidden; } } /* Safari < 16 : garde le sticky */
.nbx h1, .nbx h2, .nbx h3 { text-wrap: balance; }
.nbx p, .nbx li, .nbx summary, .nbx dd { text-wrap: pretty; }

/* ---- En-têtes en mobile : rien ne doit sortir de l'écran ---- */
.nbx .pf-brand, .nbx .pt-brand { white-space: nowrap; }
/* en-tête des pages : langue + thème en plus des liens, il faut de la place */
.nbx .pf-nav .pf-brand small { display: none; } /* « Smart Devices Lab » est déjà dans le hero */
.nbx .pf-nav__in { gap: 20px; }
.nbx .pf-nav .lang a { padding: 6px 5px; }
@media (max-width: 1200px) {
  .nbx .pf-nav__in > .pf-btn { display: none; } /* l'appel à l'action reste dans le hero */
}
@media (max-width: 900px) {
  .nbx .pf-nav__in .lang { margin-left: auto; }
}
@media (max-width: 640px) {
  .nbx .pf-nav__in { gap: 10px; }
  .nbx .pf-brand { font-size: 13px; letter-spacing: .14em; }
  .nbx .lang a { padding: 6px 4px; }
  .nbx .pt-top { flex-wrap: wrap; row-gap: 10px; }
  .nbx .pt-brand { font-size: 14px; letter-spacing: .14em; }
}
@media (max-width: 420px) {
  .nbx .pt-space { padding: 9px; }
  .nbx .pt-space b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* icône seule, nom lu par les lecteurs d'écran */
}

/* ---- Bannière cookies (site.js) : refuser aussi simple qu'accepter, rien ne se charge avant le choix ---- */
.nbx > .nb-cc.nb-cc { /* plus spécifique que « .pf > *:not(.pf__bg) » des pages, qui le remettrait en position relative */
  position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 620px;
  display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 16px 18px;
  background: var(--nb-surface-1); color: var(--nb-text); border: 1px solid var(--nb-border-strong);
  border-radius: 14px; box-shadow: var(--nb-elevate); font-size: 13.5px; line-height: 1.5;
}
.nb-cc[hidden] { display: none; }
.nb-cc p { margin: 0; flex: 1 1 300px; color: var(--nb-text-muted); }
.nb-cc__btns { display: flex; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.nb-cc__btn {
  font: inherit; font-weight: 600; cursor: pointer; padding: 9px 18px; border-radius: 999px; min-height: 40px;
  background: transparent; color: var(--nb-text); border: 1px solid var(--nb-teal-border);
}
.nb-cc__btn:hover, .nb-cc__btn:focus-visible { border-color: var(--nb-teal); color: var(--nb-teal); }
.nb-cc-link { font: inherit; color: var(--nb-text-muted); background: none; border: 0; padding: 0; cursor: pointer; }
.nb-cc-link:hover, .nb-cc-link:focus-visible { color: var(--nb-teal); }
.pt-legal { display: flex; justify-content: center; padding: 0 20px 14px; font-size: 12px; }
.pt-legal .nb-cc-link { color: var(--nb-text-faint); }
