/* ==========================================================================
   nguessan.net — styles communs (reset, tokens, navigation, footer, composants)
   ========================================================================== */

:root {
  --bg: #07080d;
  --bg-2: #0e1018;
  --surface: rgba(255, 255, 255, 0.04);
  --fg: #eef1f8;
  --muted: #9aa3b8;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --grad: linear-gradient(110deg, var(--accent-2), var(--accent) 50%, var(--accent-3));

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1180px;
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-h: 72px;
  --nav-fg: var(--fg);
  --nav-bg: rgba(7, 8, 13, 0.72);
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-accent: var(--accent);
  --nav-cta-fg: #fff;

  /* Jetons de l'accueil (mode sombre par défaut, mode clair plus bas) */
  --text-2: #c9d1e4;
  --heading-2: #dfe4f2;
  --kicker: var(--accent-2);
  --chip-bg: rgba(255, 255, 255, 0.06);
  --chip-line: rgba(255, 255, 255, 0.08);
  --chip-fg: #dbe1ee;
  --ghost-bg: rgba(255, 255, 255, 0.04);
  --ghost-hover: rgba(255, 255, 255, 0.09);
  --ghost-line: rgba(255, 255, 255, 0.18);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  --band-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
  --grid-line: rgba(255, 255, 255, 0.045);
  --marquee-stroke: rgba(255, 255, 255, 0.28);
  --marquee-fill: rgba(255, 255, 255, 0.9);
  --value-ico: #b9a6ff;
  --tl-past: #fb923c;
  --tl-now: #34d399;
  --glow-opacity: 1;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Accueil en mode clair */
:root[data-theme="light"] .page-home {
  --bg: #f6f7fb;
  --bg-2: #eceff7;
  --fg: #11151f;
  --muted: #5b6478;
  --line: rgba(17, 21, 31, 0.09);
  --text-2: #3b4458;
  --heading-2: #2a3145;
  --kicker: #0e7490;
  --chip-bg: rgba(17, 21, 31, 0.045);
  --chip-line: rgba(17, 21, 31, 0.08);
  --chip-fg: #2a3145;
  --ghost-bg: rgba(255, 255, 255, 0.75);
  --ghost-hover: #fff;
  --ghost-line: rgba(17, 21, 31, 0.16);
  --card-bg: linear-gradient(180deg, #ffffff, #fbfbfe);
  --band-bg: linear-gradient(180deg, #ffffff, #f9fafd);
  --grid-line: rgba(30, 40, 90, 0.06);
  --marquee-stroke: rgba(17, 21, 31, 0.28);
  --marquee-fill: #11151f;
  --value-ico: #6d4aff;
  --tl-past: #ea580c;
  --tl-now: #059669;
  --glow-opacity: 0.5;
  --nav-fg: #11151f;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-border: rgba(17, 21, 31, 0.08);
  --footer-bg: #eceff7;
  --footer-fg: #4b5568;
  --footer-head: #11151f;
  --footer-line: rgba(17, 21, 31, 0.08);
}

/* Transition douce lors du changement de thème */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, fill 0.45s ease, box-shadow 0.45s ease, filter 0.45s ease !important;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
p { margin: 0; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--nav-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* ---------- Bilingue FR / EN ---------- */
html[data-lang="fr"] [data-l="en"],
html[data-lang="en"] [data-l="fr"] { display: none !important; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  color: var(--nav-fg);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled,
.site-nav.is-open {
  background: var(--nav-bg);
  border-bottom-color: var(--nav-border);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display, inherit);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee, #8b6cff 55%, #f472b6);
  color: #fff;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px -6px rgba(139, 108, 255, 0.7);
}
.brand-name span { opacity: 0.55; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-menu a {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.86;
  transition: opacity 0.2s, background 0.2s;
}
.nav-menu a:hover { opacity: 1; background: rgba(127, 127, 127, 0.12); }
.nav-menu a[aria-current="page"] { opacity: 1; }
.nav-menu a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--nav-accent);
}
.nav-menu .nav-cta {
  margin-left: 6px;
  background: var(--nav-accent);
  color: var(--nav-cta-fg);
  opacity: 1;
}
.nav-menu .nav-cta:hover { background: var(--nav-accent); filter: brightness(1.1); }

.nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--nav-border);
  background: rgba(127, 127, 127, 0.1);
}
.lang-switch button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.6;
  transition: background 0.2s, opacity 0.2s, color 0.2s;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--nav-accent);
  color: var(--nav-cta-fg);
  opacity: 1;
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 25px;
  padding: 0;
}
.theme-switch svg { width: 15px; height: 15px; }
.theme-switch button[aria-pressed="true"] svg { animation: theme-pop 0.5s var(--ease-bounce); }
@keyframes theme-pop {
  from { transform: rotate(-90deg) scale(0.4); }
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.14);
}
.nav-toggle span:not(.sr-only) {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.site-nav.is-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-nav.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-nav.is-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 20px;
    background: var(--nav-bg);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--nav-border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s 0.3s;
  }
  .site-nav.is-open .nav-menu {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: opacity 0.25s, transform 0.3s var(--ease);
  }
  .nav-menu a { padding: 12px 14px; font-size: 17px; }
  .nav-menu a[aria-current="page"]::after { left: 14px; right: auto; width: 24px; bottom: 6px; }
  .nav-menu .nav-cta { margin: 6px 0 0; text-align: center; }
  .nav-tools { align-self: flex-start; margin: 10px 0 0 6px; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s, background 0.25s, filter 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn svg { width: 18px; height: 18px; }

/* Bouton « Télécharger dans l'App Store » */
.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 22px 8px 16px;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s;
}
.appstore-btn:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.7); }
.appstore-btn svg { width: 28px; height: 28px; fill: currentColor; flex: none; }
.appstore-btn > span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore-btn small { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; opacity: 0.9; }
.appstore-btn strong { font-family: -apple-system, "SF Pro Display", "Helvetica Neue", var(--font-body); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Appareils (cadres de captures) ---------- */
.device {
  --dr: 30px;
  --dp: 10px;
  position: relative;
  padding: var(--dp);
  border-radius: var(--dr);
  background: linear-gradient(145deg, #30333d, #0b0c10 60%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 40px 70px -30px rgba(0, 0, 0, 0.6);
}
.device img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--dr) - var(--dp));
}
.device::after {
  content: "";
  position: absolute;
  inset: var(--dp);
  border-radius: calc(var(--dr) - var(--dp));
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 32%);
  pointer-events: none;
}
.device--phone { --dr: 38px; --dp: 10px; }
.device--landscape { --dr: 28px; --dp: 9px; }
.device--tablet { --dr: 28px; --dp: 14px; }

/* ---------- Galerie défilante ---------- */
.gallery {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  padding: 20px 16px 36px;
  margin-inline: -16px;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery > * { flex: 0 0 auto; scroll-snap-align: center; }
.gallery a { display: block; cursor: zoom-in; }
.gallery-nav { display: flex; gap: 12px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.lightbox img {
  max-width: min(1200px, 100%);
  max-height: 86vh;
  width: auto;
  border-radius: 18px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transform: scale(0.94);
  transition: transform 0.4s var(--ease);
}
.lightbox.is-open img { transform: none; }
.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.24); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- Apparition au défilement ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal--left { transform: translateX(-40px); }
html.js .reveal--right { transform: translateX(40px); }
html.js .reveal--zoom { transform: scale(0.9); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding: 72px 0 32px;
  background: var(--footer-bg, #05060a);
  color: var(--footer-fg, #c9cfdd);
  font-size: 15px;
  border-top: 1px solid var(--footer-line, rgba(255, 255, 255, 0.07));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
}
.footer-grid h4 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-head, #fff);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; opacity: 0.8; transition: opacity 0.2s, color 0.2s; }
.footer-grid a:hover { opacity: 1; color: var(--footer-head, #fff); }
.footer-brand p { margin-top: 14px; max-width: 34ch; opacity: 0.75; }
.footer-brand .brand { color: var(--footer-head, #fff); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--footer-line, rgba(255, 255, 255, 0.07));
  font-size: 13px;
  opacity: 0.6;
}
.footer-bottom a { text-decoration: none; border-bottom: 1px solid currentColor; }
.footer-bottom a:hover { color: var(--footer-head, #fff); }

/* E-mail protégé : affiché à l'envers dans le code, remis à l'endroit par CSS (sans JS) ou par JS */
.mail-txt:empty::before {
  content: attr(data-mail);
  unicode-bidi: bidi-override;
  direction: rtl;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}
