/* assets/styles.css */
/* Avatar Video AI — Global styles (WCAG 2.2 AA, CWV-friendly) */

/* =========================
   CSS Variables & Resets
   ========================= */
:root {
  /* Color system */
  --bg: #0b0f19;
  --bg-alt: #111726;
  --surface: #12192b;
  --card: #151e31;
  --text: #e7ecf7;
  --text-muted: #a8b2c8;
  --primary: #5aa9ff;
  --primary-contrast: #08111f;
  --accent: #9ef0ff;
  --border: #22314f;
  --success: #2ecc71;
  --warning: #ffcc00;
  --danger: #ff5861;
  --focus: #b5e4ff;

  /* Layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 24px;
  --gap-lg: 48px;
  --shadow: 0 8px 28px rgba(0,0,0,.35);

  /* Typography */
  --font: ui-sans-serif, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --fs-xxl: clamp(2.2rem, 3.2vw + 1rem, 3.2rem);
  --fs-xl: clamp(1.6rem, 2.2vw + .5rem, 2.2rem);
  --fs-lg: 1.125rem;
  --fs: 1rem;
  --fs-sm: .9375rem;
  --lh: 1.55;

  /* Transitions */
  --t: 180ms ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-alt: #f7f9fc;
    --surface: #ffffff;
    --card: #f7f9fe;
    --text: #0b0f19;
    --text-muted: #4a5672;
    --primary: #165dff;
    --primary-contrast: #ffffff;
    --accent: #0bbbd6;
    --border: #dbe3f0;
    --focus: #165dff;
    --shadow: 0 10px 30px rgba(13, 44, 107, .12);
  }
}

/* Box sizing & resets */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  color: var(--text);
  background: radial-gradient(1200px 600px at 70% -10%, rgba(90,169,255,.07), transparent 60%) ,
              var(--bg);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none; } /* (corrigé) pas d'!important pour permettre l’override via .lang-hint */

/* Focus styles (WCAG) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =========================
   Layout
   ========================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: clamp(48px, 6vw, 88px);
}
.section.alt {
  background: linear-gradient(0deg, rgba(255,255,255,.02), rgba(255,255,255,.02)),
              var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* =========================
   Typo utilities
   ========================= */
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: var(--fs-xxl); letter-spacing: -.02em; }
h2 { font-size: var(--fs-xl); letter-spacing: -.01em; }
h3 { font-size: 1.125rem; }

.lead { font-size: clamp(1.05rem, 1.2vw + .6rem, 1.25rem); color: var(--text); opacity: .92; }
.muted { color: var(--text-muted); }
.tiny { font-size: .86rem; }
.center { text-align: center; }
.note { font-size: .95rem; color: var(--text-muted); }

/* =========================
   Skip link
   ========================= */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px; top: 16px;
  width: auto; height: auto;
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 10px 14px; border-radius: 10px;
  z-index: 1000;
}

/* =========================
   Header / Nav
   ========================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}
.brand img {
  width: clamp(140px, 20vw, 220px);
  height: auto;
}

.burger {
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  display: grid; place-items: center;
}
.burger .burger-bar {
  width: 22px; height: 2px; background: var(--text);
  position: relative; transition: transform var(--t), background var(--t);
}
.burger .burger-bar + .burger-bar { margin-top: 5px; }
@media (min-width: 960px) { .burger { display: none; } }

.nav { position: relative; }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: none;
}
.nav a { color: var(--text); font-weight: 600; }
.nav .lang-switch { margin-left: 4px; }

@media (min-width: 960px) {
  .nav ul {
    display: flex; gap: 18px; justify-content: flex-end; align-items: center;
  }
}

.nav.is-open ul {
  display: grid;
  gap: 10px;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-width: 220px;
  box-shadow: var(--shadow);
}

.lang-switch strong { color: var(--accent); }
.lang-footer { display: flex; gap: 8px; align-items: center; }

/* =========================
   Hero
   ========================= */
.hero .hero-copy { padding-block: 8px; }
.hero .cta-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-block: 16px 10px;
}
.microproofs {
  margin: 12px 0 0; padding-left: 18px;
  color: var(--text-muted); font-size: .95rem;
}
.disclosure {
  margin-top: 12px;
  font-size: .92rem;
  color: var(--text-muted);
}
.hero-media img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #000;
}

/* =========================
   Buttons
   ========================= */
.btn {
  --btn-bg: var(--primary);
  --btn-fg: var(--primary-contrast);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform var(--t), background var(--t), border-color var(--t), color var(--t);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}
.btn-secondary {
  --btn-bg: color-mix(in oklab, var(--primary) 72%, #00ffe1 18%);
  --btn-fg: var(--primary-contrast);
}

/* =========================
   Features grid
   ========================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.2vw, 24px);
  margin-top: 20px;
}
@media (max-width: 1100px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .feature-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card .icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  margin-bottom: 10px;
}
.card .icon svg { width: 22px; height: 22px; fill: var(--accent); }
.card img {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* =========================
   Steps
   ========================= */
.steps {
  display: grid;
  gap: 16px;
  counter-reset: step;
  margin-top: 10px;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  list-style: none;
}
.steps img {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* =========================
   Use cases pills
   ========================= */
.pill-grid {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 8px;
}
.pill-grid li {
  list-style: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}

/* =========================
   Comparison table
   ========================= */
.table-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table {
  width: 100%; border-collapse: collapse; min-width: 560px;
  background: var(--surface);
}
th, td { padding: 12px 14px; text-align: left; }
thead th {
  background: color-mix(in oklab, var(--surface) 70%, #fff 6%);
  border-bottom: 1px solid var(--border);
}
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--border); }

/* =========================
   Gallery
   ========================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 20px);
  margin-top: 12px;
}
@media (max-width: 1100px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .gallery { grid-template-columns: 1fr; } }
figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: clip;
  box-shadow: var(--shadow);
}
figure img { display: block; }
figcaption {
  padding: 10px 12px;
  font-size: .95rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* =========================
   Newsletter
   ========================= */
.newsletter-form {
  display: grid; gap: 12px; max-width: 560px;
}
.control label { display: block; font-weight: 700; margin-bottom: 6px; }
.control input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.control input[type="email"]:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--focus) 35%, transparent);
}
.hp { position: absolute; left: -999rem; }
.consent {
  display: flex; gap: 10px; align-items: center; font-size: .95rem; color: var(--text-muted);
}
.form-note { min-height: 1.2em; color: var(--text-muted); }

/* =========================
   FAQ Accordion
   ========================= */
.accordion details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.accordion details + details { margin-top: 10px; }
.accordion summary {
  cursor: pointer; font-weight: 700;
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion details[open] { outline: 2px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.accordion p { color: var(--text-muted); margin-top: 8px; }

/* =========================
   Footer
   ========================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  padding-block: 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr .4fr;
  gap: 20px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer nav a { color: var(--text); }
.site-footer .tiny { margin-top: 16px; }

/* =========================
   Language Suggest (non-blocking)
   ========================= */
.lang-suggest {
  position: sticky; top: 64px; z-index: 40;
  margin: 0 0 -8px;
  background: linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.0)) , var(--surface);
  color: var(--text);
  border-bottom: 1px dashed var(--border);
  padding: 10px 20px;
  text-align: center;
  font-size: .95rem;
}

/* =========================
   Consent Banner (CNIL/CMP-lite)
   ========================= */
#consent-banner[aria-hidden="false"], #consent-banner:not([hidden]) {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 1000;
  display: grid; gap: 10px;
  max-width: 760px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.consent-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end;
}
.consent-actions .btn { padding: 10px 14px; }
.consent-actions .btn-outline {
  --btn-bg: transparent; --btn-fg: var(--text);
  border-color: var(--border);
}

/* =========================
   YouTube Lite (click-to-load)
   ========================= */
.yt-lite {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
  contain: content;
}
.yt-lite::before {
  content: "";
  display: block;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.06), rgba(0,0,0,.0));
  inset: 0; position: absolute; pointer-events: none;
}
.yt-lite > iframe {
  width: 100%; height: 100%; border: 0; position: absolute; inset: 0;
}
.yt-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(0,0,0,.25), rgba(0,0,0,.45));
  color: #fff; border: none;
}
.yt-play::after {
  content: "";
  width: 68px; height: 68px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  mask: 
    radial-gradient(closest-side, #0000 70%, #000 71%) center/100% 100% no-repeat,
    url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/36% 36% no-repeat;
}
.yt-lite:hover .yt-play::after { filter: brightness(1.05); transform: scale(1.02); transition: transform var(--t); }

/* =========================
   Utilities
   ========================= */
.hp input, .hp label { visibility: hidden; }
.notranslate { unicode-bidi: plaintext; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* =========================
   Print (minimal)
   ========================= */
@media print {
  .site-header, .site-footer, .lang-suggest, .burger, .nav, .cta-row, .yt-lite, #consent-banner { display: none !important; }
  a::after { content: " (" attr(href) ")"; font-size: .85em; color: #666; }
  body { background: #fff; color: #000; }
}

/* =========================
   JS state hooks (corrigé)
   ========================= */
html.lang-hint #lang-suggest { display: block; } /* affiche la suggestion langue */
html.nav-open { overflow: hidden; }               /* bloque le scroll quand le menu mobile est ouvert */

/* =========================
   Year placeholder
   ========================= */
#year { white-space: nowrap; }

/* =========================
   Forms: error/success states
   ========================= */
.is-error input { border-color: var(--danger) !important; }
.is-success input { border-color: var(--success) !important; }
.form-note.error { color: var(--danger); }
.form-note.success { color: var(--success); }
