/* Page d'accueil commune des domaines de prospection Communia.
   Couleurs et ombres reprises des tokens de communia-frontend/src/app/globals.css ;
   aucune couleur hors charte (TASTE.md §3). */

:root {
  --blue: #6ab3f8;          /* action */
  --navy: #173475;          /* encre */
  --text: #333333;
  --muted: rgba(23, 52, 117, 0.68);
  --ground: #F5F8FC;
  --line: #E4EAF4;
  --brand-soft: rgba(106, 179, 248, 0.13);
  --brand-soft-border: rgba(106, 179, 248, 0.25);
  --focus-ring: rgba(106, 179, 248, 0.35);
  --shadow-card: 0 1px 3px rgba(23, 52, 117, 0.07);
  --shadow-pill: 0 4px 24px rgba(23, 52, 117, 0.10), 0 1px 3px rgba(23, 52, 117, 0.06);
  --ease: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--navy); }
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 8px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Icônes Lucide : trait 2, currentColor */
.ic {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic--sm { width: 16px; height: 16px; }
.ic--xs { width: 15px; height: 15px; stroke-width: 2; }
.ic--line { width: 24px; height: 24px; color: var(--navy); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 1024px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 8px 12px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.skip:focus { top: 12px; }

/* ---------- Boutons et liens ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn--primary { background: var(--blue); color: #FFFFFF; box-shadow: var(--shadow-card); }
.btn--primary:hover { background: var(--navy); }
.btn--secondary { background: #FFFFFF; color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.btn--secondary:hover { border-color: var(--brand-soft-border); background: var(--brand-soft); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 0.9rem; }

.navlink, .textlink {
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  text-underline-offset: 4px;
}
.navlink { display: inline-flex; align-items: center; }
.navlink:hover, .textlink:hover { text-decoration: underline; }
.textlink .ic { margin-left: 6px; vertical-align: -2px; transition: transform var(--ease); }
.nw { white-space: nowrap; }
.textlink:hover .ic { transform: translateX(2px); }

/* ---------- En-tête ---------- */
.topbar { background: #FFFFFF; border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.topbar__logo img { height: 34px; width: auto; }
.topbar__nav { display: flex; align-items: center; gap: 24px; }
.topbar__nav .navlink { display: none; font-size: 0.925rem; }
@media (min-width: 720px) { .topbar__nav .navlink { display: inline-flex; } }
@media (max-width: 420px) { .topbar__logo img { height: 28px; } .btn--small { padding: 0 12px; font-size: 0.85rem; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ground); padding: 48px 0 64px; }
@media (min-width: 1024px) { .hero { padding: 84px 0 96px; } }
/* Carte de France duotone (reprise du hero de communia.net), ordinateur seulement */
.hero__map, .hero__fade { display: none; }
@media (min-width: 1024px) {
  .hero__map {
    display: block;
    position: absolute;
    top: 50%;
    right: -3%;
    height: 108%;
    width: auto;
    max-width: none;
    transform: translateY(-50%);
    pointer-events: none;
    user-select: none;
  }
  .hero__fade {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to right, var(--ground) 32%, rgba(245, 248, 252, 0.8) 50%, rgba(245, 248, 252, 0) 78%);
  }
}
.hero__grid { position: relative; z-index: 1; display: grid; gap: 48px; align-items: center; }
@media (min-width: 1024px) { .hero__grid { grid-template-columns: 1.08fr 1fr; gap: 64px; } }

h1 {
  font-size: 2.125rem;
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
  text-wrap: balance;
}
@media (min-width: 640px) { h1 { font-size: 2.5rem; } }
@media (min-width: 1200px) { h1 { font-size: 2.75rem; } }

.lead { margin-top: 24px; max-width: 34em; font-size: 1.125rem; line-height: 1.65; }
.lead--second { margin-top: 12px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
@media (max-width: 480px) { .actions .btn { width: 100%; } }

/* ---------- Mockup de conversation ---------- */
.mock {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-pill);
  overflow: hidden;
}
.mock__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}
.mock__brand { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.mock__tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.mock__body { padding: 20px 18px 18px; }
@media (min-width: 640px) { .mock__body { padding: 24px 24px 20px; } }

.mock__question {
  margin-left: auto;
  max-width: 88%;
  padding: 10px 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 18px 18px 6px 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--navy);
}
.mock__answer { margin-top: 18px; font-size: 0.9rem; line-height: 1.65; }
.mock__answer p + p { margin-top: 8px; }

.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: 1px;
}

.mock__sources { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.mock__sources-title {
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.mock__sources li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.mock__sources li + li { border-top: 1px solid var(--line); }
.src { display: flex; flex-direction: column; min-width: 0; }
.src__ref { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.src__code { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.src__btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--navy);
  white-space: nowrap;
}
@media (max-width: 400px) { .src__btn { font-size: 0.7rem; padding: 3px 8px; } }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
@media (min-width: 1024px) { .section { padding: 104px 0; } }
.section--ground { background: var(--ground); }
.section--tight { padding: 56px 0; }
@media (min-width: 1024px) { .section--tight { padding: 72px 0; } }

.intro { max-width: 720px; }
h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--navy);
  text-wrap: balance;
}
@media (min-width: 640px) { h2 { font-size: 2.125rem; } }
.intro h2 + p { margin-top: 20px; }
.intro p { font-size: 1.0625rem; line-height: 1.7; }
.intro p + p { margin-top: 8px; }

h3 { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--navy); }

/* Cas d'usage : cartes sobres */
.uses { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 640px) { .uses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .uses { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.use {
  padding: 24px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.use__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--navy);
}
.use p { margin-top: 6px; line-height: 1.6; }

/* Visuel question → réponse → sources */
.flow {
  display: grid;
  gap: 12px;
  align-items: stretch;
  margin-top: 48px;
}
@media (min-width: 900px) { .flow { grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; } }
.flow__step {
  padding: 20px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  font-size: 0.925rem;
  line-height: 1.6;
}
.flow__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow__arrow {
  width: 22px;
  height: 22px;
  align-self: center;
  justify-self: center;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
}
@media (min-width: 900px) { .flow__arrow { transform: none; } }
.flow__sources li { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.flow__sources li + li { margin-top: 6px; }
.flow__sources .ic { color: var(--muted); }

.trio, .quad { display: grid; gap: 32px; margin-top: 56px; }
@media (min-width: 900px) { .trio { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
@media (min-width: 640px) { .quad { grid-template-columns: repeat(2, 1fr); gap: 40px; } }
@media (min-width: 1100px) { .quad { grid-template-columns: repeat(4, 1fr); } }
.trio__item, .quad__item { border-top: 1px solid var(--line); padding-top: 24px; }
.trio__item .ic, .quad__item .ic { margin-bottom: 14px; }
.trio__item p, .quad__item p { margin-top: 8px; line-height: 1.65; }
.quad__item h3 { min-height: 0; }

/* Chiffres de spécialisation */
.figures {
  display: grid;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) { .figures { grid-template-columns: 1fr 1fr 1.6fr; } }
.figures__item { padding: 28px 0; }
.figures__item + .figures__item { border-top: 1px solid var(--line); }
@media (min-width: 900px) {
  .figures__item { padding: 36px 32px; }
  .figures__item:first-child { padding-left: 0; }
  .figures__item + .figures__item { border-top: 0; border-left: 1px solid var(--line); }
}
.figures dt {
  font-size: 2.75rem;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.figures dd { margin-top: 6px; color: var(--muted); font-size: 1rem; }

.more { margin-top: 40px; }

/* Territoires d'IA : bloc secondaire */
.funding {
  display: grid;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FFFFFF;
}
.funding__logo { width: 180px; height: auto; }
@media (min-width: 900px) {
  .funding { grid-template-columns: 200px 1fr auto; align-items: center; gap: 40px; padding: 32px 40px; }
  .funding__logo { width: 100%; }
}
.funding__title { font-size: 1.25rem; letter-spacing: -0.01em; }
.funding p { margin-top: 10px; max-width: 62ch; line-height: 1.65; }
.funding p + p { margin-top: 6px; }
.funding .textlink { justify-self: start; }

/* CTA final */
.final {
  display: grid;
  gap: 32px;
  padding: 36px 28px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
@media (min-width: 960px) {
  .final { grid-template-columns: 1.3fr 1fr; align-items: center; gap: 56px; padding: 56px; }
}
.final h2 { font-size: 1.625rem; }
@media (min-width: 640px) { .final h2 { font-size: 2rem; } }
.final__text p { margin-top: 16px; font-size: 1.0625rem; line-height: 1.7; }
.final__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
@media (max-width: 480px) { .final__actions .btn { width: 100%; } }
.final__alt { display: flex; flex-direction: column; gap: 4px; font-size: 0.925rem; color: var(--muted); }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0 48px; }
.footer__inner { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 900px) { .footer__inner { flex-direction: row; align-items: center; justify-content: space-between; } }
.footer__brand img { height: 30px; width: auto; }
.footer__brand p { margin-top: 8px; font-size: 0.875rem; color: var(--muted); }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.875rem; }
.footer__links a { color: var(--muted); text-decoration: none; }
.footer__links a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
