/* ============================================================
   Cardin Automation — sobre & pro, fond clair
   Palette : encre #232A33 · texte #454F5B · fond ivoire #F7F6F2
             surface #FDFCFA · accent bleu ardoise #3B5B92 · foncé #2E4770
   Typo : Familjen Grotesk (titres) · Instrument Sans (texte)
          IBM Plex Mono (eyebrows, numéros)
   ============================================================ */

:root {
  --ink: #232A33;
  --body: #454F5B;
  --muted: #707A86;
  --ground: #F7F6F2;
  --surface: #FDFCFA;
  --line: #E3E0D8;
  --accent: #405165;
  --accent-dark: #333F4F;
  --accent-soft: #E9EDF1;
  --radius: 6px;
  --font-display: "Familjen Grotesk", "Segoe UI", Arial, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--ground);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
}

a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo { height: 30px; width: auto; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-accent { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav a {
  text-decoration: none;
  color: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--ink); }

.nav-cta {
  background: var(--accent);
  color: #FFFFFF !important;
  padding: 8px 16px;
  border-radius: var(--radius);
}

.nav-cta:hover { background: var(--accent-dark); }

/* ---------- Hero ---------- */

.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 88px 0 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-visual { margin: 0; }

.flow-svg {
  width: 100%;
  height: auto;
  display: block;
}

.fs-node {
  fill: var(--ground);
  stroke: var(--line);
  stroke-width: 1.5;
}

.fs-node-main { fill: var(--accent); stroke: var(--accent); }

.fs-node-ghost { fill: transparent; stroke-dasharray: 5 4; }

.fs-dot { fill: var(--accent); }

.fs-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 4 5;
  stroke-linecap: round;
  opacity: 0.65;
}

.fs-label {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  fill: var(--ink);
}

.fs-label-inv { fill: #FDFCFA; }

.fs-small { font-family: var(--font-body); font-size: 12px; font-weight: 600; fill: var(--ink); }

.fs-muted { fill: var(--muted); font-weight: 400; }

@keyframes fs-pulse-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.fs-pulse { animation: fs-pulse-anim 2.2s ease-in-out infinite; }

/* Séquence d'apparition du flux (au chargement) */
@keyframes fs-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fs-dash-flow {
  to { stroke-dashoffset: -18; }
}

.fs-seq {
  opacity: 0;
  animation: fs-appear 0.55s ease-out forwards;
}

.fs-seq-1 { animation-delay: 0.3s; }
.fs-seq-2 { animation-delay: 0.9s; }
.fs-seq-3 { animation-delay: 1.3s; }
.fs-seq-4 { animation-delay: 1.9s; }
.fs-seq-5 { animation-delay: 2.3s; }
.fs-seq-6 { animation-delay: 2.55s; }
.fs-seq-7 { animation-delay: 2.8s; }
.fs-seq-8 { animation-delay: 3.5s; }

.fs-flow { animation: fs-appear 0.55s ease-out forwards, fs-dash-flow 1.6s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .fs-pulse { animation: none; }
  .fs-seq, .fs-flow { animation: none; opacity: 1; transform: none; }
}

.hero-caption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  max-width: 30em;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 21em;
}

.hero-sub {
  margin-top: 22px;
  max-width: 38em;
  font-size: 1.125rem;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: var(--muted); }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
  margin-bottom: 14px;
}

.section h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.section-intro {
  margin-top: 14px;
  max-width: 40em;
}

/* ---------- Bande gains (sombre) ---------- */

.section-dark {
  background: var(--accent);
  border-top: 1px solid var(--accent-dark);
  border-bottom: 1px solid var(--accent-dark);
}

.eyebrow-light { color: #AFC0D0; }

.h2-light { color: #F5F7F9; }

.gains-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 40px;
}

.gain {
  border-top: 2px solid rgba(245, 247, 249, 0.25);
  padding-top: 18px;
}

.gain-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: #F5F7F9;
  margin-bottom: 10px;
}

.gain p:not(.gain-title) { color: #C9D2DC; font-size: 0.98rem; }

/* ---------- Cartes problème → système ---------- */

.grid {
  display: grid;
  gap: 20px;
  margin-top: 40px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.card-pain { color: var(--muted); }

.card-fix strong { color: var(--accent-dark); }

/* ---------- Avant / Après ---------- */

.compare {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
}

.compare-panel {
  border-radius: var(--radius);
  padding: 24px 26px;
}

.compare-before {
  background: var(--surface);
  border: 1px dashed var(--line);
}

.compare-after {
  background: var(--accent);
  color: #EDF1F5;
}

.compare-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.compare-before .compare-title { color: var(--muted); }
.compare-after .compare-title { color: #C4CFDB; }

.compare-panel ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.compare-before li { color: var(--muted); }

.compare-panel li::before {
  content: "—";
  margin-right: 10px;
  opacity: 0.55;
}

.compare-after li::before { content: "✓"; opacity: 0.8; }

.compare-arrow {
  display: flex;
  align-items: center;
  color: var(--accent);
}

.compare-arrow svg { width: 44px; height: 22px; }

/* ---------- Méthode ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-dark);
  background: var(--accent-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step h3 { font-size: 1.15rem; font-weight: 600; }

/* ---------- Démo conversation ---------- */

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}

.chat-window {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(35, 42, 51, 0.08);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: #EDF1F5;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.chat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8FD3A8;
  flex-shrink: 0;
}

.chat-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 300px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.98rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.chat-bubble.chat-visible { opacity: 1; transform: translateY(0); }

.chat-in {
  align-self: flex-start;
  background: var(--ground);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  color: var(--ink);
}

.chat-out {
  align-self: flex-end;
  background: var(--accent);
  color: #F2F5F8;
  border-bottom-right-radius: 4px;
}

.chat-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 6px;
}

.chat-caret {
  display: none;
  width: 2px;
  height: 1em;
  background: #F2F5F8;
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: chat-caret-blink 0.8s step-end infinite;
}

@keyframes chat-caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-typing {
  display: none;
  align-self: flex-end;
  gap: 5px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  border-bottom-right-radius: 4px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: chat-typing-bounce 1.1s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.chat-chips.chat-visible { opacity: 1; transform: translateY(0); }

.chat-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

/* ---------- Apparitions au scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .chat-bubble, .chat-chips { opacity: 1; transform: none; transition: none; }
  .chat-typing span, .chat-caret { animation: none; }
}

/* ---------- Secteurs ---------- */

.sector-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.sector {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.sector-tile {
  margin: 0 -22px 12px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line);
}

.sector-tile svg {
  display: block;
  width: 100%;
  height: auto;
}

.st-shape { fill: var(--accent); }
.st-outline { fill: none; stroke: var(--accent); stroke-width: 2; }
.st-stroke { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.st-stroke-bold { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.st-window { fill: var(--ground); stroke: var(--accent); stroke-width: 1.4; }
.st-window-inv { fill: var(--accent-soft); }

.sector h3 { font-size: 1.1rem; font-weight: 600; }
.sector p { font-size: 0.98rem; }

.sector-note {
  margin-top: 36px;
  font-size: 0.98rem;
  color: var(--muted);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.contact-form {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hidden-field { display: none; }

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.form-row input,
.form-row textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  resize: vertical;
}

.form-row input::placeholder,
.form-row textarea::placeholder { color: var(--muted); }

.contact-form .btn { align-self: flex-start; }

/* ---------- FAQ ---------- */

.faq-list {
  margin-top: 36px;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  position: relative;
  padding-right: 48px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item summary:hover { background: var(--ground); }

.faq-item p {
  padding: 0 22px 20px;
  color: var(--body);
}

/* ---------- Carte contact ---------- */

.contact-card {
  margin-top: 30px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(35, 42, 51, 0.06);
  max-width: 420px;
}

.contact-card-logo {
  width: 44px;
  height: auto;
  flex-shrink: 0;
  margin-top: 3px;
}

.contact-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.contact-card-role {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2px;
}

.contact-card-email {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.contact-card-email:hover { border-bottom-color: var(--accent); }

.contact-card-note {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---------- Pages légales ---------- */

.legal { max-width: 760px; }

.legal h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 10px;
}

.legal h2 {
  font-size: 1.25rem;
  margin-top: 36px;
  margin-bottom: 10px;
}

.legal p { margin-bottom: 12px; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 36px 0;
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
}

.footer-tagline { margin-top: 4px; font-size: 0.85rem; }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links a {
  color: var(--body);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent-dark); text-decoration: underline; }

.footer-copy { font-size: 0.85rem; align-self: flex-end; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .sector-list { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .demo-grid { grid-template-columns: 1fr; gap: 36px; }
  .gains-grid { grid-template-columns: 1fr; gap: 26px; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { justify-content: center; transform: rotate(90deg); }
  .section { padding: 60px 0; }
}

@media (max-width: 640px) {
  .site-nav { gap: 14px; }
  .site-nav a:not(.nav-cta) { display: none; }
}
