/* ============================================================
   Klemly — Feuille de style du site klemly.fr
   Site statique (HTML/CSS pur, sans framework).
   Mode clair uniquement · Français uniquement.
   Identité : palette sauge / crème, Fraunces pour les titres.
   ============================================================ */

/* ----------------------------------------------------------------
   1. Variables d'identité (jetons de design)
   ---------------------------------------------------------------- */
:root {
  /* Couleurs — fonds & surfaces */
  --bg:        #F7F2EA;   /* fond crème principal */
  --surface:   #FBF8F2;   /* surface légèrement surélevée (cartes, tableaux) */
  --border:    #E8DFD0;   /* bordures discrètes */

  /* Couleurs — encre & texte */
  --ink:       #2B2722;   /* encre principale (titres, corps) */
  --ink-2:     #6B655C;   /* texte secondaire / méta */
  --ink-3:     #A09A8E;   /* texte tertiaire / mentions discrètes */

  /* Couleurs — accents */
  --sage:      #5C7559;   /* sauge profond — surfaces, boutons, le point du mark */
  --sage-text: #475C45;   /* sauge texte — liens, "ly" du wordmark (conforme WCAG AA) */
  --terracotta:#B8775C;   /* terracotta — accent secondaire, très ponctuel */

  /* Typographie */
  --font-title: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:  'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Mesures */
  --reading-width: 700px;  /* largeur de lecture confortable (pages légales) */
  --page-width:    1080px; /* largeur max de l'en-tête / pied de page */
  --radius:        14px;
  --radius-sm:     10px;
}

/* ----------------------------------------------------------------
   2. Réinitialisation & base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--sage-text); }

::selection { background: rgba(92, 117, 89, 0.16); }

/* ----------------------------------------------------------------
   3. Wordmark — klem + ly (ly en italique sauge)
   ---------------------------------------------------------------- */
.wordmark {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}
.wordmark em {
  font-style: italic;
  color: var(--sage-text);
}
/* Lien wordmark : pas de soulignement, retour discret à l'accueil */
a.wordmark { text-decoration: none; display: inline-block; }
a.wordmark:hover { opacity: 0.78; }

/* ----------------------------------------------------------------
   4. En-tête de page (pages légales)
   ---------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 22px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* zones symétriques → wordmark réellement centré */
  align-items: center;
  gap: 20px;
}
.site-header .wordmark { font-size: 22px; grid-column: 2; }
.site-header .back-link {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  grid-column: 1;
  justify-self: start;
}
.site-header .back-link:hover { color: var(--ink); }
.site-header .back-link .arrow { font-size: 16px; line-height: 1; }

/* ----------------------------------------------------------------
   5. Bloc de contenu légal — largeur de lecture ~700px
   ---------------------------------------------------------------- */
.legal {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 72px 32px 96px;
}

/* Méta en tête de document (date de mise à jour) */
.legal .doc-meta {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 18px;
}

/* Titres hiérarchisés */
.legal h1 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  text-wrap: balance;
}
.legal .lede {
  font-size: 18px;
  color: var(--ink-2);
  margin: 0 0 8px;
  text-wrap: pretty;
}
.legal h2 {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 56px 0 14px;
  padding-top: 8px;
  scroll-margin-top: 24px;
}
.legal h3 {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 32px 0 10px;
}

/* Corps de texte */
.legal p {
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: pretty;
}
.legal p.muted { color: var(--ink-2); }

/* Liens dans le corps */
.legal a {
  color: var(--sage-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(71, 92, 69, 0.35);
}
.legal a:hover { text-decoration-color: var(--sage-text); }

/* Listes */
.legal ul, .legal ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--ink);
}
.legal li { margin-bottom: 9px; padding-left: 4px; }
.legal li::marker { color: var(--sage); }

/* Premier élément d'une section : pas de marge haute superflue */
.legal h2 + p, .legal h3 + p { margin-top: 0; }

/* Séparateur fin entre grands blocs (optionnel) */
.legal hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* Bloc en surbrillance (note importante) */
.legal .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--ink-2);
}
.legal .callout strong { color: var(--ink); font-weight: 600; }

/* ----------------------------------------------------------------
   6. Tableaux lisibles
   ---------------------------------------------------------------- */
.legal .table-wrap {
  margin: 0 0 24px;
  overflow-x: auto;                 /* défilement horizontal sur mobile */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 460px;                 /* évite l'écrasement des colonnes */
}
.legal thead th {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 14px 18px;
  background: rgba(92, 117, 89, 0.05);
  border-bottom: 1px solid var(--border);
}
.legal tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: top;
}
.legal tbody tr:last-child td { border-bottom: none; }
.legal td .price { font-weight: 600; color: var(--sage-text); }

/* ----------------------------------------------------------------
   7. Pied de page (commun à toutes les pages)
   ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.site-footer .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 40px 32px 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.site-footer nav a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.site-footer nav a:hover { color: var(--sage-text); }
.site-footer nav a.current { color: var(--ink); font-weight: 600; }
.site-footer .meta {
  font-size: 13px;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
}
.site-footer .meta a { color: var(--ink-3); text-decoration: none; }
.site-footer .meta a:hover { color: var(--sage-text); }

/* ----------------------------------------------------------------
   8. Page d'accueil minimale
   ---------------------------------------------------------------- */
.home {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 32px;
  gap: 0;
}

/* Petit badge "Bientôt disponible" */
.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sage-text);
  background: rgba(92, 117, 89, 0.08);
  border: 1px solid rgba(92, 117, 89, 0.18);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 40px;
}
.badge-soon .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

/* Wordmark géant de l'accueil */
.home .wordmark.hero {
  font-size: clamp(56px, 16vw, 132px);
  letter-spacing: -0.03em;
}

/* Accroche */
.home .tagline {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(22px, 4.5vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 16ch;
  margin: 32px 0 0;
  text-wrap: balance;
}
.home .sub {
  font-size: 17px;
  color: var(--ink-2);
  margin: 18px 0 0;
  max-width: 42ch;
  text-wrap: pretty;
}

/* Liens discrets de l'accueil (légal + contact) */
.home .home-links {
  margin: 56px auto 0;
  align-self: center;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 26px;
}
.home .home-links a {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
}
.home .home-links a:hover { color: var(--sage-text); }
.home .home-links .sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
}
.home .home-links a.contact { color: var(--sage-text); }

/* ----------------------------------------------------------------
   9. Responsive (priorité mobile)
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .site-header .inner { padding: 18px 20px; gap: 12px; }
  .site-header .wordmark { font-size: 20px; }
  .site-header .back-link .back-long { display: none; } /* "← Retour" seul sur mobile */

  .legal { padding: 44px 22px 72px; }
  .legal h2 { font-size: 23px; margin-top: 44px; }
  .legal h3 { font-size: 18px; }

  .site-footer .inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 22px 40px;
  }
  .home main { padding: 64px 24px; }
  .home .home-links { gap: 10px 18px; }
}
