/* =========================================================================
   Cardasoft — feuille de style du site corporate (statique, vanilla)
   Identité studio : teal #0F8A75, encre #10243A, corail #FF7A59, Lexend.
   Mobile-first, contrastes AA, dark mode via prefers-color-scheme.
   ========================================================================= */

/* ----- 1. Tokens (variables CSS) ----- */
:root {
  /* Marque */
  --teal-700: #0E6B5C;   /* texte/accent sur fond clair (AA sur blanc) */
  --teal-600: #0F8A75;   /* couleur de marque principale */
  --teal-500: #13A38A;   /* dégradés, éléments actifs */
  --teal-100: #D6F2EC;   /* fonds doux */

  --ink-900: #10243A;    /* texte principal */
  --ink-700: #34506B;    /* texte secondaire */
  --ink-400: #7E93A6;    /* texte tertiaire */

  --corail-500: #FF7A59; /* accent chaleureux (parcimonie) */
  --corail-100: #FFE3D9;

  /* Neutres / surfaces */
  --surface: #FFFFFF;
  --surface-alt: #F6F8F9;
  --border: #E2E8EC;

  /* Rôles dérivés (clair par défaut) */
  --bg: var(--surface);
  --bg-alt: var(--surface-alt);
  --text: var(--ink-900);
  --text-soft: var(--ink-700);
  --text-mute: var(--ink-400);
  --brand: var(--teal-600);
  --brand-strong: var(--teal-700);
  --accent: var(--corail-500);
  --card-bg: var(--surface);
  --card-border: var(--border);
  --code-bg: var(--surface-alt);

  /* Typo */
  --font: "Lexend", "Inter", system-ui, "Roboto", "Segoe UI", sans-serif;

  /* Rythme */
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 72rem;
  --gap: clamp(1rem, 3vw, 2rem);
  --shadow: 0 2px 10px rgba(16, 36, 58, 0.06), 0 8px 28px rgba(16, 36, 58, 0.05);
}

/* ----- 2. Dark mode ----- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1620;
    --bg-alt: #14222F;
    --text: #E7EDF1;
    --text-soft: #B9C6D2;
    --text-mute: #8AA0B2;
    --brand: #2DC4A8;        /* vert éclairci pour AA sur sombre */
    --brand-strong: #2DC4A8;
    --accent: #FF7A59;
    --card-bg: #14222F;
    --card-border: #243443;
    --code-bg: #14222F;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35), 0 8px 28px rgba(0, 0, 0, 0.3);
  }
}

/* ----- 3. Police locale (Lexend, repli système si absente) ----- */
/* Pas de CDN obligatoire : le site reste lisible avec la pile système.
   Si les fichiers de police sont ajoutés dans assets/fonts/, ils sont utilisés. */
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: local("Lexend"), local("Lexend-Regular");
}

/* ----- 4. Reset doux ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;          /* 16 px */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 600; margin-top: 0; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1rem; }

/* ----- 5. Accessibilité : focus visible + skip link ----- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ----- 6. Layout ----- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
section { padding-block: clamp(2.5rem, 7vw, 5rem); }
.section-alt { background: var(--bg-alt); }

/* ----- 7. En-tête / navigation ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.brand-link .logo { width: 30px; height: 30px; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-menu a {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-alt);
}
.nav-menu a[aria-current="page"] { color: var(--brand-strong); }

/* Sélecteur de langue (FR | EN) — groupe de 2 liens, sans JS */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.4rem;
  padding-left: 0.6rem;
  border-left: 1px solid var(--card-border);
}
.lang-switch a {
  display: inline-block;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  color: var(--text-mute);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.lang-switch a:hover { color: var(--text); background: var(--bg-alt); }
.lang-switch a[aria-current="true"] {
  color: var(--brand-strong);
  background: var(--bg-alt);
  cursor: default;
}

/* ----- 8. Boutons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand-strong);
  color: #fff;
}
.btn-primary:hover { background: var(--teal-600); color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--brand-strong);
  border-color: var(--brand-strong);
}
.btn-secondary:hover { background: var(--teal-100); color: var(--teal-700); }
@media (prefers-color-scheme: dark) {
  .btn-secondary:hover { background: rgba(45, 196, 168, 0.12); color: var(--brand); }
}

/* ----- 9. Hero ----- */
.hero {
  padding-block: clamp(3rem, 9vw, 6rem);
}
.hero .eyebrow {
  display: inline-block;
  font-weight: 600;
  color: var(--brand-strong);
  background: var(--teal-100);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
@media (prefers-color-scheme: dark) {
  .hero .eyebrow { background: rgba(45, 196, 168, 0.12); color: var(--brand); }
}
.hero p.lead {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  color: var(--text-soft);
  max-width: 42rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

/* ----- 10. Cartes ----- */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0.4rem; }
.card .icon {
  font-size: 1.8rem;
  line-height: 1;
}
.card p:last-child { margin-bottom: 0; }

/* Badge de statut (ex. « En conception ») */
.badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--corail-100);
  color: #8a2e15;
}
@media (prefers-color-scheme: dark) {
  .badge { background: rgba(255, 122, 89, 0.18); color: #ffb59f; }
}

/* ----- 11. Sondage : options ----- */
.poll-list {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.poll-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.poll-card .poll-emoji { font-size: 2rem; line-height: 1; }
.poll-card h3 { margin: 0; }
.poll-card .poll-pitch { color: var(--text-soft); flex: 1; }
/* Jauge purement décorative (PAS de vote backend) */
.poll-gauge {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}
.poll-gauge > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-500), var(--brand-strong));
  width: 0;
}
.poll-note {
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ----- 12. Bloc d'appel (callout) ----- */
.callout {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}

/* ----- 13. Contenu long (pages légales) ----- */
.prose { max-width: 48rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose code, .placeholder {
  font-size: 0.95em;
  background: var(--code-bg);
  border: 1px dashed var(--card-border);
  padding: 0.05em 0.4em;
  border-radius: 6px;
}
.note {
  font-size: 0.9rem;
  color: var(--text-mute);
  border-top: 1px solid var(--card-border);
  margin-top: 2rem;
  padding-top: 1rem;
}

/* ----- 14. Pied de page ----- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--card-border);
  padding-block: 2.5rem;
  color: var(--text-soft);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--text-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-meta { font-size: 0.9rem; color: var(--text-mute); }

/* ----- 15. Utilitaires ----- */
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.muted { color: var(--text-mute); }

/* ----- 16. Navigation mobile (sans JS : <details>/checkbox non requis,
   mais on garde un fallback CSS via .nav-open piloté par JS optionnel) ----- */
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--card-border);
    padding: 0.5rem;
  }
  .nav-menu a { padding: 0.8rem 1rem; }
  .nav.nav-open .nav-menu { display: flex; }
  .nav { position: relative; }
  /* Le sélecteur de langue reste visible dans la barre, à côté du bouton menu */
  .lang-switch { order: 2; margin-left: auto; }
  .nav-toggle { order: 3; }
}

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
