/* ─── Kairos MFI landing — CSS avec illustrations et animations ─────────── */

:root {
  --primary: #047857;
  --primary-dark: #065f46;
  --primary-light: #10b981;
  --primary-soft: #d1fae5;
  --text: #0f172a;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-mesh: #f0fdf4;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --accent: #fef3c7;
  --accent-text: #b45309;
  --max-width: 1180px;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 20px 40px -12px rgba(4, 120, 87, 0.18);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img, svg { max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navigation ───────────────────────────────────────────────────────── */

header.site-nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: var(--text);
}

.nav-brand-mark {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-weight: 900; border-radius: 10px;
  box-shadow: 0 4px 12px -3px rgba(4, 120, 87, 0.4);
}

.nav-links { display: flex; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); text-decoration: none; }

.nav-cta {
  background: var(--primary); color: #fff;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.nav-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -4px rgba(4, 120, 87, 0.4);
}

@media (max-width: 720px) {
  .nav-links { display: none; }
}

/* ─── Sections communes ────────────────────────────────────────────────── */

main { max-width: 100%; margin: 0; padding: 0; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

section { padding: 72px 0; }

h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(32px, 5.5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.8vw, 34px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 0 0 14px; color: var(--text); }

.section-title { text-align: center; margin-bottom: 12px; }
.section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 48px;
  font-size: 17px;
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */

.hero-section {
  position: relative;
  padding: 88px 0 96px;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 90% -100px, var(--primary-soft) 0%, transparent 60%),
    radial-gradient(800px 400px at -100px 200px, var(--bg-mesh) 0%, transparent 60%),
    var(--bg);
}

.hero-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
  .hero-illustration { order: -1; }
}

.hero-content h1 { max-width: 620px; }
.hero-content h2 {
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 500;
  color: var(--text-muted);
  margin: 20px 0 24px;
  max-width: 580px;
  line-height: 1.5;
}
.hero-content p { font-size: 17px; max-width: 560px; }

.hero-content .cta-row {
  margin-top: 32px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
@media (max-width: 900px) {
  .hero-content .cta-row { justify-content: center; }
}

.cta-primary, .cta-secondary, .cta-link {
  display: inline-flex;
  align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  transition: all .18s ease;
}
.cta-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 6px 16px -4px rgba(4, 120, 87, 0.35);
}
.cta-primary:hover {
  background: var(--primary-dark); text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -4px rgba(4, 120, 87, 0.5);
}
.cta-secondary {
  background: #fff; color: var(--text);
  border: 1.5px solid var(--border);
}
.cta-secondary:hover {
  border-color: var(--primary); color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}
.cta-link { color: var(--text-muted); padding: 13px 6px; }
.cta-link:hover { color: var(--primary); text-decoration: none; }

/* Illustration hero — device flottant */
.hero-illustration {
  position: relative;
  display: flex; justify-content: center; align-items: center;
  min-height: 380px;
}

.device-phone {
  width: 220px;
  height: 440px;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.35), 0 0 0 3px rgba(15, 23, 42, 0.08);
  position: relative;
  animation: float 6s ease-in-out infinite;
}
.device-phone::before {
  content: '';
  position: absolute; top: 18px; left: 50%;
  transform: translateX(-50%);
  width: 60px; height: 5px;
  background: #0f172a; border-radius: 3px; z-index: 2;
}
.device-screen {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 28px;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 34px 14px 14px;
  gap: 10px;
}
.device-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; color: var(--text);
}
.device-header .k-avatar {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px;
}
.device-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  animation: fade-slide 0.7s ease both;
}
.device-tile.balance {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none; color: #fff;
}
.device-tile.balance .label { font-size: 9px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; }
.device-tile.balance .value { font-size: 20px; font-weight: 800; margin-top: 2px; }
.device-tile.tx { display: flex; justify-content: space-between; align-items: center; font-size: 10px; }
.device-tile.tx .tx-label { color: var(--text); font-weight: 600; }
.device-tile.tx .tx-date { color: var(--text-muted); font-size: 9px; }
.device-tile.tx .tx-amount { color: #16a34a; font-weight: 700; font-size: 11px; }
.device-tile.tx.debit .tx-amount { color: #dc2626; }
.device-tile:nth-of-type(2) { animation-delay: 0.15s; }
.device-tile:nth-of-type(3) { animation-delay: 0.3s; }
.device-tile:nth-of-type(4) { animation-delay: 0.45s; }
.device-tile:nth-of-type(5) { animation-delay: 0.6s; }

.hero-illustration .badge-notif {
  position: absolute;
  top: 20px; right: 6%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  max-width: 220px;
  animation: pop-in 0.8s 0.5s both, float-slow 5s 1.3s ease-in-out infinite;
}
.hero-illustration .badge-notif .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  flex-shrink: 0;
}
.hero-illustration .badge-notif strong { display: block; font-weight: 700; font-size: 12px; }
.hero-illustration .badge-notif span { color: var(--text-muted); font-size: 11px; }

.hero-illustration .badge-metric {
  position: absolute;
  bottom: 8%; left: 4%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 14px;
  animation: pop-in 0.8s 0.9s both, float-slow 6s ease-in-out infinite;
}
.hero-illustration .badge-metric .metric-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.hero-illustration .badge-metric .metric-icon svg { width: 22px; height: 22px; }
.hero-illustration .badge-metric .metric-value { font-weight: 800; font-size: 15px; }
.hero-illustration .badge-metric .metric-label { color: var(--text-muted); font-size: 11px; margin-top: -2px; }

@media (max-width: 620px) {
  .hero-illustration .badge-notif,
  .hero-illustration .badge-metric { display: none; }
}

/* ─── Trust bar ────────────────────────────────────────────────────────── */

.trust-bar {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.trust-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 40px;
  color: var(--text-muted); font-size: 13px; letter-spacing: 0.02em;
  text-transform: uppercase; font-weight: 600;
}
.trust-inner span { display: inline-flex; align-items: center; gap: 8px; }
.trust-inner strong { color: var(--primary); font-weight: 700; text-transform: none; letter-spacing: normal; font-size: 14px; }

/* ─── Features (bénéfices) ─────────────────────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.feature-card:hover {
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  transition: transform .3s ease, background .3s ease;
}
.feature-icon svg { width: 28px; height: 28px; }
.feature-card:hover .feature-icon {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08) rotate(-4deg);
}
.feature-card h3 { margin: 0 0 8px; }
.feature-card p { color: var(--text-muted); margin: 0; font-size: 15px; line-height: 1.6; }

/* ─── Personas ─────────────────────────────────────────────────────────── */

.personas-section {
  background: var(--bg-soft);
}
.personas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.persona-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.persona-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.persona-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.persona-icon svg { width: 24px; height: 24px; }
.persona-card h3 { font-size: 18px; margin: 0 0 6px; }
.persona-card p { color: var(--text-muted); margin: 0; font-size: 14px; line-height: 1.6; }

/* ─── How it works ─────────────────────────────────────────────────────── */

.steps-section { background: var(--bg); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
  margin-top: 8px;
}
@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .steps-grid { grid-template-columns: 1fr; }
}
.step {
  text-align: center;
  padding: 24px 16px;
  position: relative;
}
.step-num {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px -6px rgba(4, 120, 87, 0.4);
}
.step h3 { font-size: 17px; margin: 0 0 8px; }
.step p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ─── CTA final ────────────────────────────────────────────────────────── */

.cta-section {
  padding: 88px 0;
  background:
    radial-gradient(600px 300px at 20% 20%, var(--primary-soft) 0%, transparent 60%),
    linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-align: center;
}
.cta-section h2 { color: #fff; margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.9); max-width: 560px; margin: 0 auto 32px; font-size: 17px; }
.cta-section .cta-primary {
  background: #fff; color: var(--primary);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.3);
}
.cta-section .cta-primary:hover { background: var(--bg-soft); color: var(--primary-dark); }
.cta-section .cta-secondary {
  background: transparent; color: #fff; border-color: rgba(255,255,255,0.4);
}
.cta-section .cta-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }

/* ─── Changelog preview sur home ───────────────────────────────────────── */

.changelog-preview { background: var(--bg-soft); }
.changelog-preview h2 { text-align: center; }
.changelog-preview .changelog-version {
  background: #fff;
  border-left: 4px solid var(--primary);
  padding: 24px 28px;
  margin: 40px auto 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 780px;
  box-shadow: var(--shadow-sm);
}
.changelog-preview .changelog-version h2 {
  text-align: left; margin: 0 0 8px; font-size: 22px;
}
.changelog-preview .changelog-category { margin-top: 20px; }
.changelog-preview .changelog-category h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--primary); margin: 0 0 10px; font-weight: 700;
}
.changelog-preview .changelog-category ul { padding-left: 20px; margin: 0; }
.changelog-preview .changelog-category li { margin-bottom: 8px; font-size: 14px; }
.changelog-preview .more-link { text-align: center; }
.changelog-preview .more-link a {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--primary);
}

/* ─── Reveal animations (Intersection Observer) ────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }
.reveal.delay-5 { transition-delay: .4s; }
.reveal.delay-6 { transition-delay: .48s; }
.reveal.delay-7 { transition-delay: .56s; }
.reveal.delay-8 { transition-delay: .64s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .device-phone, .badge-notif, .badge-metric { animation: none; }
}

/* ─── Keyframes ────────────────────────────────────────────────────────── */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes fade-slide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Article (docs, manuel, module, changelog complet) ────────────────── */

.article-body {
  max-width: 760px;
  margin: 32px 0;
}
.article-body h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-top: 36px; }
.article-body code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}
.article-body pre code { background: transparent; padding: 0; }
.article-body table { border-collapse: collapse; margin: 16px 0; width: 100%; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--bg-soft); font-weight: 600; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent);
  padding: 12px 16px;
  margin: 16px 0;
  color: var(--accent-text);
  border-radius: 0 8px 8px 0;
}

.breadcrumb {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }

/* ─── Docs index (pages hors home) ─────────────────────────────────────── */

.docs-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.docs-nav a {
  display: block;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.docs-nav a:hover {
  border-color: var(--primary); color: var(--primary);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.docs-nav .doc-role {
  display: block; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}

/* Sur les pages internes (docs, article) : sections plus resserrées */
main > section:not(.hero-section):not(.cta-section):not(.trust-bar):not(.personas-section):not(.steps-section):not(.changelog-preview) {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

/* ─── Footer ───────────────────────────────────────────────────────────── */

footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
}
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--primary); text-decoration: none; }
