/* ===== Variables ===== */
:root {
  --primary: #6c8cff;
  --primary-dark: #4d6bfe;
  --primary-light: #a8b8ff;
  --text: #1a2233;
  --text-secondary: #4a5568;
  --text-muted: #8892a6;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-card: #ffffff;
  --border: #e8ecf5;
  --border-soft: #f0f2f7;
  --shadow-sm: 0 1px 3px rgba(108,140,255,0.04);
  --shadow-md: 0 8px 40px rgba(108,140,255,0.08);
  --shadow-lg: 0 20px 60px rgba(108,140,255,0.15);
  --shadow-glow: 0 0 40px rgba(108,140,255,0.18);
  --radius: 20px;
  --radius-pill: 999px;
  --t: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --text: #e8ecf5;
  --text-secondary: #b0b8c8;
  --text-muted: #6b7280;
  --bg: #0a0e17;
  --bg-soft: #121826;
  --bg-card: #161c2c;
  --border: #232a3d;
  --border-soft: #1c2333;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 40px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(108,140,255,0.25);
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--t), color 0.4s var(--t);
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
svg { display: block; }
::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== Loader ===== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo { width: 72px; height: 72px; animation: loaderPulse 1.4s ease-in-out infinite; }
.loader-logo svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 20px rgba(108,140,255,0.4)); }
@keyframes loaderPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.12) rotate(8deg); }
}

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 200;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(108,140,255,0.6);
}

/* ===== Header ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 48px;
  transition: all 0.4s var(--t);
}
.site-header.scrolled {
  padding: 14px 48px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
}
[data-theme="dark"] .site-header.scrolled { background: rgba(10,14,23,0.72); }

/* Logo */
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.3px;
  transition: transform 0.3s var(--t);
}
.logo:hover { transform: scale(1.02); }
.logo-mark {
  width: 34px; height: 34px;
  transition: transform 0.5s var(--t);
  filter: drop-shadow(0 2px 8px rgba(108,140,255,0.25));
}
.logo:hover .logo-mark {
  transform: rotate(180deg);
  filter: drop-shadow(0 4px 14px rgba(108,140,255,0.5));
}

/* Header right */
.header-right { display: flex; align-items: center; gap: 20px; }
.get-app {
  font-size: 15px; color: var(--text); font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.get-app::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 0; height: 1.5px; background: var(--primary);
  transition: width 0.3s var(--t);
}
.get-app:hover { color: var(--primary); }
.get-app:hover::after { width: 100%; }

/* Lang switch */
.lang-switch {
  display: flex;
  background: var(--bg-soft);
  border-radius: var(--radius-pill);
  padding: 3px;
  position: relative;
}
.lang-btn {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
  z-index: 2;
  transition: color 0.3s;
}
.lang-btn.active { color: var(--text); }
.lang-slider {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--bg-card);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.3s var(--t);
}
.lang-switch[data-active="en"] .lang-slider { transform: translateX(100%); }

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-soft);
  transition: all 0.3s var(--t);
  position: relative;
}
.theme-toggle:hover {
  color: var(--primary);
  background: rgba(108,140,255,0.1);
  transform: rotate(20deg);
}
.theme-toggle svg { position: absolute; transition: all 0.4s var(--t); }
.icon-sun { opacity: 1; transform: rotate(0); }
.icon-moon { opacity: 0; transform: rotate(-90deg); }
[data-theme="dark"] .icon-sun { opacity: 0; transform: rotate(90deg); }
[data-theme="dark"] .icon-moon { opacity: 1; transform: rotate(0); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 120px 24px 120px;
  overflow: hidden;
  text-align: center;
}
.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(190,205,255,0.6) 0%, rgba(220,230,255,0.25) 40%, transparent 75%),
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(200,215,255,0.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(200,215,255,0.4) 0%, transparent 60%),
    linear-gradient(180deg, #eef3ff 0%, #f8faff 40%, var(--bg) 100%);
  z-index: 0;
  transition: background 0.4s var(--t);
}
[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(108,140,255,0.25) 0%, rgba(50,70,150,0.15) 40%, transparent 75%),
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(120,150,255,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 15%, rgba(120,150,255,0.15) 0%, transparent 60%),
    linear-gradient(180deg, #0d1424 0%, #0a0e17 60%, var(--bg) 100%);
}

.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(130,160,230,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130,160,230,0.08) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.particles {
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.6;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
}
.glow-orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(108,140,255,0.4), transparent 70%); top: -100px; left: 10%; }
.glow-orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(140,160,255,0.3), transparent 70%); top: 20%; right: 5%; animation-delay: -7s; }
.glow-orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(190,205,255,0.35), transparent 70%); bottom: 10%; left: 40%; animation-delay: -14s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.1); }
  66% { transform: translate(-30px,40px) scale(0.95); }
}

/* ===== Version banner ===== */
.version-banner {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 720px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 40px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  transition: all 0.3s var(--t);
  position: relative;
}
.version-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}
.version-banner:hover { color: var(--primary); transform: translateY(-2px); }
.version-banner:hover::before { opacity: 1; }
.version-banner .sparkle {
  color: var(--primary);
  font-size: 14px;
  margin-top: 2px;
  animation: sparkleRotate 3s linear infinite;
  display: inline-block;
}
@keyframes sparkleRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
}
.version-banner strong { font-weight: 600; color: var(--text); }
.version-banner .arrow {
  color: var(--text-secondary);
  margin-left: 4px;
  transition: transform 0.3s var(--t);
}
.version-banner:hover .arrow { transform: translateX(4px); color: var(--primary); }

/* ===== Hero title ===== */
.hero-title {
  font-size: 76px;
  font-weight: 400;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 56px;
  line-height: 1.1;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-40deg);
  animation: wordReveal 0.9s var(--t) forwards;
}
.hero-title .word:nth-child(1) { animation-delay: 0.4s; }
.hero-title .word:nth-child(2) { animation-delay: 0.55s; }
.hero-title .word:nth-child(3) { animation-delay: 0.7s; }
.hero-title .gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #c5d0ff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: wordReveal 0.9s var(--t) 0.7s forwards, gradientShift 4s ease infinite 1.6s;
}
@keyframes wordReveal { to { opacity: 1; transform: translateY(0) rotateX(0); } }
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== Chat box ===== */
.chat-box {
  width: 100%;
  max-width: 800px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 24px 16px;
  box-shadow: var(--shadow-md), 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 40px;
  transition: box-shadow 0.4s var(--t), border-color 0.4s var(--t), transform 0.4s var(--t);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--t) 0.9s forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
.chat-box:hover { box-shadow: var(--shadow-lg), 0 1px 3px rgba(0,0,0,0.06); }
.chat-box:focus-within {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: rgba(170,190,255,0.9);
  transform: translateY(-2px);
}
.chat-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 300% 300%;
  opacity: 0;
  z-index: -1;
  filter: blur(12px);
  transition: opacity 0.5s;
  animation: gradientShift 3s ease infinite;
}
.chat-box:focus-within .chat-glow { opacity: 0.35; }

.chat-box textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
  font-family: inherit;
  background: transparent;
  max-height: 160px;
  min-height: 28px;
}
.chat-box textarea::placeholder { color: var(--text-muted); }

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-tags { display: flex; gap: 8px; }

.tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  transition: all 0.25s var(--t);
}
.tag-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}
.tag-btn.active {
  background: rgba(108,140,255,0.1);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,140,255,0.08);
}
.tag-btn .tag-icon { display: inline-flex; align-items: center; transition: transform 0.3s var(--t); }
.tag-btn:hover .tag-icon { transform: rotate(180deg); }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}
[data-tooltip]:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Send btn */
.send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s var(--t);
  flex-shrink: 0;
}
.send-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(108,140,255,0.4);
}
.send-btn:active:not(:disabled) { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.send-btn svg { transition: transform 0.3s var(--t); }
.send-btn:hover:not(:disabled) svg { transform: translateY(-2px); }

/* ===== CTA row ===== */
.cta-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap; /* permet le retour à la ligne sur mobile */
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--t) 1.1s forwards;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.3s var(--t);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  white-space: nowrap; /* empêche le texte de passer à la ligne */
  flex-shrink: 0; /* empêche le bouton de se réduire */
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}
.cta-btn > * { position: relative; z-index: 1; }
.cta-btn:hover {
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108,140,255,0.3);
  transform: translateY(-2px);
}
.cta-btn:hover::before { opacity: 1; }

/* ===== Scroll indicator ===== */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 3;
  animation: bounceDown 2s ease-in-out infinite;
}
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}
@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ===== Features ===== */
.features { padding: 100px 24px; background: var(--bg); }
.features-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.4s var(--t);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--t);
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: inline-block;
  transition: transform 0.4s var(--t);
}
.feature-card:hover .feature-icon { transform: scale(1.2) rotate(-8deg); }
.feature-card h3 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Footer ===== */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  padding: 64px 48px 32px;
  transition: background 0.4s var(--t);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border-soft);
}
.footer-brand .logo { margin-bottom: 24px; font-size: 20px; }
.footer-licenses { font-size: 13px; color: var(--text-muted); line-height: 1.9; margin-bottom: 24px; }
.footer-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-socials a {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--bg-soft);
  transition: all 0.25s var(--t);
}
.footer-socials a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(108,140,255,0.35);
}
.footer-col h4 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 20px; }
.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  transition: all 0.2s var(--t);
  position: relative;
  width: fit-content;
}
.footer-col a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1px;
  background: var(--primary);
  transition: width 0.3s var(--t);
}
.footer-col a:hover { color: var(--primary); transform: translateX(3px); }
.footer-col a:hover::after { width: 100%; }

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}
.footer-made { font-style: italic; opacity: 0.7; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-title { font-size: 60px; }
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .site-header { padding: 14px 20px; }
  .site-header.scrolled { padding: 10px 20px; }
  .get-app { display: none; }
  .hero { padding: 100px 16px 80px; }
  .hero-title { font-size: 40px; letter-spacing: -1px; gap: 12px; }
  .version-banner { font-size: 13px; padding: 8px 14px; }
  .chat-box { padding: 18px 18px 12px; gap: 32px; }
  .chat-box textarea { font-size: 15px; }
  .tag-btn { padding: 6px 10px; font-size: 12px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-btn { justify-content: center; }
  .features { padding: 60px 16px; }
  .site-footer { padding: 40px 20px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .scroll-indicator { display: none; }
}