/*
  L'AgencIA by LSM — Styles principaux
  Design responsive, header sticky, animations modernes, accessibilité et thèmes via variables CSS.
*/

/* Thème clair par défaut */
:root {
  --color-bg: #f7f8fb;
  --color-surface: #ffffff;
  --color-surface-2: #f1f3f9;
  --color-text: #0d0f14;
  --color-muted: #5a6374;
  --color-primary: #2f729d;
  --color-primary-2: #163549;
  --color-accent: #00a39a;
  --border-color: rgba(0,0,0,.08);
  --hover-surface: rgba(0,0,0,.05);
  --header-bg: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75));
  --footer-bg: #f2f4f8;
  --bg-spot-1: rgba(59,91,255,.18);
  --bg-spot-2: rgba(155,59,255,.18);
  --shadow-1: 0 10px 30px rgba(0,0,0,.12);
  --radius-1: 12px;
  --radius-2: 20px;
  --container: 1200px;
  --gutter: 24px;
}

/* Thème sombre */
[data-theme="dark"] {
  --color-bg: #0d0f14;
  --color-surface: #121622;
  --color-surface-2: #1a1f2f;
  --color-text: #e9ecf1;
  --color-muted: #aab3c0;
  --color-primary: #4a9fd1;
  --color-primary-2: #2f729d;
  --color-accent: #00e4d4;
  --border-color: rgba(255,255,255,.08);
  --hover-surface: rgba(255,255,255,.06);
  --header-bg: linear-gradient(180deg, rgba(5,6,10,0.8), rgba(5,6,10,0.6));
  --footer-bg: #0a0c10;
  --bg-spot-1: #151a28;
  --bg-spot-2: #1a1730;
  --shadow-1: 0 10px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--color-text);
  background: radial-gradient(1200px 800px at 10% -10%, var(--bg-spot-1), transparent 60%),
              radial-gradient(1200px 800px at 90% -10%, var(--bg-spot-2), transparent 60%),
              var(--color-bg);
  line-height: 1.6;
  transition: background-color .3s ease, color .3s ease;
}

/* Cross-fade du thème + blur léger lors du switch */
html.theme-fade * {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, fill .35s ease, stroke .35s ease;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0;
}
html.theme-fade body::after { backdrop-filter: blur(6px); opacity: 1; transition: opacity .35s ease; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(100% - 2*var(--gutter), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; background: #000; color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 10000; }

/* Header sticky */
.site-header {
  position: sticky; top: 0; z-index: 10000; backdrop-filter: saturate(1.2) blur(8px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 16px; }
.header-actions { display: none; align-items: center; gap: 10px; }
.theme-toggle--mobile { display: none; }
.brand { display: inline-flex; align-items: flex-end; gap: 12px; }
.brand-logo { filter: drop-shadow(0 4px 16px rgba(0,0,0,.4)); height: auto; }
.brand-name { font-weight: 700; letter-spacing: .2px; }
.brand-name small { font-weight: 600; opacity: .8; }

.nav-toggle { display: none; background: none; border: 0; width: 42px; height: 42px; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--color-primary); transition: .3s; }
[data-theme="dark"] .nav-toggle span { background: #fff; }
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }

.nav ul { list-style: none; display: flex; gap: 18px; align-items: center; margin: 0; padding: 0; }
.nav a { padding: 10px 12px; border-radius: 10px; color: var(--color-text); opacity: .9; }
.nav a:hover { background: var(--hover-surface); opacity: 1; }
.nav a.btn-primary { color: #fff; }
.nav .has-sub { position: relative; z-index: 11000; }
.nav .has-sub > .sub { display: none; position: absolute; top: 100%; left: 0; min-width: 280px; background: var(--color-surface); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-1); padding: 10px; }
.nav .has-sub:hover > .sub,
.nav .has-sub:focus-within > .sub,
.nav .has-sub > .sub:hover { display: grid; gap: 6px; }
.nav .has-sub > .sub { z-index: 12000; }
.nav .sub a { display: block; padding: 10px 12px; border-radius: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--color-surface); color: var(--color-text); }
.btn-primary { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-2)); color: #fff; box-shadow: 0 8px 20px rgba(47,114,157,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: transparent; color: var(--color-primary); border-color: color-mix(in oklab, var(--color-primary) 60%, var(--border-color)); }
.btn-secondary:hover { background: color-mix(in oklab, var(--color-primary) 10%, transparent); }

/* Hero */
.hero { position: relative; padding: 120px 0 80px; overflow: clip; width: 100vw; margin-left: calc(50% - 50vw); }
.hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 60%; background: radial-gradient(600px 300px at 10% 0%, rgba(107,124,255,.25), transparent 60%), radial-gradient(600px 300px at 90% 0%, rgba(200,107,255,.25), transparent 60%); filter: blur(20px); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; background: linear-gradient(90deg,
  color-mix(in oklab, var(--color-bg) 50%, transparent) 0%,
  color-mix(in oklab, var(--color-bg) 70%, transparent) 50%,
  color-mix(in oklab, var(--color-bg) 50%, transparent) 100%
); }
.hero .bg-video {
  position: absolute;
  left: 50%; right: auto; top: -12.8vw; /* shift up to crop more top, show lower area */
  width: 100vw; /* always full window width */
  height: 70.875vw; /* 56.25vw (16:9) * 1.26 for crop */
  transform: translateX(-50%);
  object-fit: cover;
  opacity: 1;
  z-index: -1;
  border: 0;
  pointer-events: none;
}
.hero .hero-grid { position: relative; z-index: 1; }
.hero .hero-grid > .reveal { position: relative; z-index: 3; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(32px, 4vw, 56px); line-height: 1.05; margin: 0 0 16px; }
.hero p { font-size: clamp(17px, 1.3vw, 22px); color: var(--color-muted); margin: 0 0 24px; }
.hero .reveal { opacity: 1 !important; transform: none !important; }
.hero-media { position: relative; border-radius: var(--radius-2); overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--shadow-1); background: transparent; z-index: 2; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Sections */
section { padding: 80px 0; }
.section-title { font-size: clamp(24px, 2.8vw, 40px); margin: 0 0 10px; }
.section-lead { color: var(--color-muted); margin: 0 0 32px; }
.lead-strong { font-weight: 700; }
.hero .lead-strong { color: var(--color-text) !important; text-shadow: 0 1px 2px rgba(0,0,0,.18); display: block; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { background: linear-gradient(180deg, var(--color-surface), var(--color-surface-2)); border: 1px solid var(--border-color); border-radius: var(--radius-1); padding: 22px; box-shadow: var(--shadow-1); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background-color .25s ease; }
.card:hover { transform: translateY(-6px) scale(1.01); border-color: color-mix(in oklab, var(--color-primary) 35%, var(--border-color)); box-shadow: 0 16px 40px color-mix(in oklab, var(--color-primary) 25%, transparent); }
.card:active { transform: translateY(-2px) scale(0.995); }
.card h3 { margin-top: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 20px; background: rgba(255,255,255,.08); color: #fff; font-size: 12px; }

/* Reveal animations */
.reveal { opacity: 0; transform: var(--reveal-init-transform, translateY(22px)); transition: opacity .6s ease, transform .6s ease; will-change: opacity, transform; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal[data-reveal="left"] { --reveal-init-transform: translateX(-24px); }
.reveal[data-reveal="right"] { --reveal-init-transform: translateX(24px); }
.reveal[data-reveal="up"] { --reveal-init-transform: translateY(24px); }
.reveal[data-reveal="down"] { --reveal-init-transform: translateY(-24px); }
.reveal[data-reveal="zoom"] { --reveal-init-transform: scale(0.96); }

/* Hover utilities */
.hover-raise:hover { transform: translateY(-4px); }
.hover-glow:hover { box-shadow: 0 16px 44px color-mix(in oklab, var(--color-accent) 30%, transparent); }

/* Footer */
.site-footer { background: var(--footer-bg); border-top: 1px solid var(--border-color); margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 24px; padding: 40px 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--color-muted); }
.footer-links a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 16px 0 28px; color: var(--color-muted); font-size: 14px; border-top: 1px dashed var(--border-color); }

/* Forms */
input, textarea, select { width: 100%; padding: 12px 14px; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--border-color); border-radius: 12px; outline: none; }
label { display: block; margin: 10px 0 6px; }
form .row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
form .actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border-color); padding: 12px 10px; text-align: left; }
th { color: var(--color-muted); font-weight: 600; }

/* Utilities */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 24px; }
.center { text-align: center; }
.pill { border-radius: 999px; }
.surface { background: var(--color-surface); border: 1px solid var(--border-color); border-radius: var(--radius-1); }

/* Icons in headings/cards */
.hicon { display: inline-flex; align-items: center; gap: 10px; }
.service-icon { width: 28px; height: 28px; color: var(--color-primary); flex: 0 0 auto; }
.service-icon.lg { width: 36px; height: 36px; }

/* Responsive */
@media (max-width: 1000px) {
  .hero { padding: 5px 0 0; }
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero h1 { margin-bottom: 100px; }
  .hero .actions { flex-wrap: nowrap; }
  .hero .btn { flex: 1; min-width: 0; padding: 10px 8px; font-size: 14px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .header-actions { display: inline-flex; }
  .theme-toggle--mobile { display: inline-flex; }
  /* masquer le bouton thème du menu en mobile, on garde celui près du hamburger */
  #nav .theme-toggle { display: none !important; }
  .brand { max-width: calc(100% - 72px); }
  .brand-logo { width: 200px; height: auto; }
  .brand-name { font-size: 14px; display: none; }
  .nav { position: fixed; inset: 60px 16px auto 16px; background: var(--color-surface); border: 1px solid var(--border-color); border-radius: 14px; padding: 12px; transform: translateY(-10px); opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow-1); }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav .has-sub > .sub { position: static; display: grid; background: transparent; border: 0; box-shadow: none; padding: 0 0 6px; gap: 1px; }
  .nav .sub li { overflow: hidden; }
  .nav .sub a { color: var(--color-muted); padding: 4px 12px 4px 24px; line-height: 1.4; width: 100%; }
  .nav .sub a:hover { background: var(--hover-surface); color: var(--color-text); padding: 4px 12px 4px 24px; }
  /* Garder un espacement fixe même au survol du parent Services */
  .nav .has-sub:hover > .sub,
  .nav .has-sub:focus-within > .sub,
  .nav .has-sub > .sub:hover { gap: 1px; }
  .nav > ul > li > a { font-weight: 700; display: block; width: 100%; }
  /* Unifier le lien Contact (btn) avec les autres entrées */
  .nav a.btn,
  .nav a.btn.btn-primary {
    background: transparent;
    color: var(--color-text);
    box-shadow: none;
    border: 0;
    padding: 10px 12px;
    border-radius: 10px;
    display: block;
    gap: 0;
    min-width: 0;
    height: auto;
    filter: none;
  }
  .nav a.btn:hover { background: var(--hover-surface); }
  form .row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border-color);
  background: var(--color-surface); color: var(--color-text);
}
.theme-toggle:hover { background: var(--hover-surface); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }

/* BG toggle minimal label */
#bgToggle { font-weight: 700; letter-spacing: .5px; }

/* (supprimé) styles du bouton BG */

/* AI background canvas layering — visible au-dessus du fond, sous le contenu */
.ai-bg { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
main, .site-footer { position: relative; z-index: 2; }
.ai-bg--back { z-index: 0; opacity: .7; }


