/* TerraKool — Design tokens
   ----------------------------------------------------------------
   V1 — Mai 2026
   Toutes les valeurs sont validées contre le brief :
   - Vert minéral profond, jamais saturé
   - Blanc cassé (jamais #FFFFFF)
   - Bleu acier réservé aux data/température
   - Échelle 8pt, hiérarchie typographique contrastée
   ---------------------------------------------------------------- */

:root {
  /* ─── Couleurs ─────────────────────────────────────────── */
  --tk-green:        #1F3D2E;   /* dominante — vert sapin sourd */
  --tk-green-deep:   #15291F;   /* hover, ombres */
  --tk-green-soft:   #2D4F3A;   /* aplat secondaire */
  --tk-green-line:   #2A4636;   /* bordures sur fond clair */

  --tk-bone:         #F5F2EC;   /* fond principal — blanc cassé */
  --tk-bone-warm:    #EDE9E0;   /* alt, séparateurs très doux */
  --tk-paper:        #FAF8F3;   /* cartes posées sur fond bone */

  --tk-ink:          #1A1D1B;   /* corps, titres */
  --tk-graphite:     #3A3F3C;   /* sous-titres */
  --tk-stone:        #6B716D;   /* méta, légendes */
  --tk-fog:          #B5B7B3;   /* placeholders, désactivé */
  --tk-rule:         #D9D5CB;   /* filets sur fond clair */

  --tk-steel:        #2E5A7A;   /* bleu acier — data ΔT uniquement */
  --tk-steel-soft:   #6B8FAA;   /* axes graphiques */

  --tk-alert:        #B23A2A;   /* erreurs formulaire uniquement */

  /* ─── Typographie ──────────────────────────────────────── */
  --tk-font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --tk-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Échelle modulaire — ratio ~1.25, hiérarchie lourde */
  --tk-fs-12: 12px;
  --tk-fs-13: 13px;
  --tk-fs-14: 14px;
  --tk-fs-15: 15px;
  --tk-fs-17: 17px;
  --tk-fs-20: 20px;
  --tk-fs-24: 24px;
  --tk-fs-32: 32px;
  --tk-fs-44: 44px;
  --tk-fs-64: 64px;
  --tk-fs-88: 88px;
  --tk-fs-120: 120px;

  --tk-lh-tight: 1.05;
  --tk-lh-snug:  1.2;
  --tk-lh-base:  1.5;
  --tk-lh-loose: 1.65;

  --tk-tracking-wide: 0.08em;   /* étiquettes, eyebrows */
  --tk-tracking-mid:  0.02em;
  --tk-tracking-tight: -0.01em; /* gros titres */

  /* ─── Espacements (échelle 8pt) ────────────────────────── */
  --tk-s-1: 4px;
  --tk-s-2: 8px;
  --tk-s-3: 12px;
  --tk-s-4: 16px;
  --tk-s-5: 24px;
  --tk-s-6: 32px;
  --tk-s-7: 48px;
  --tk-s-8: 64px;
  --tk-s-9: 96px;
  --tk-s-10: 128px;
  --tk-s-11: 160px;

  /* ─── Layout ───────────────────────────────────────────── */
  --tk-container: 1280px;
  --tk-gutter:    24px;
  --tk-radius-sm: 2px;
  --tk-radius:    4px;        /* boutons — coins légèrement adoucis */
  --tk-radius-md: 6px;

  /* ─── Élévation (très sobre) ───────────────────────────── */
  --tk-shadow-1: 0 1px 0 rgba(26,29,27,0.04), 0 1px 2px rgba(26,29,27,0.04);
  --tk-shadow-2: 0 2px 4px rgba(26,29,27,0.06), 0 8px 24px rgba(26,29,27,0.06);

  /* ─── Transitions ──────────────────────────────────────── */
  --tk-ease: cubic-bezier(0.2, 0, 0, 1);
  --tk-dur:  180ms;
}

/* ─── Reset ciblé ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--tk-bone);
  color: var(--tk-ink);
  font-family: var(--tk-font-sans);
  font-size: var(--tk-fs-17);
  line-height: var(--tk-lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--tk-rule); margin: 0; }

/* ─── Type primitives ────────────────────────────────────── */
.tk-eyebrow {
  font-family: var(--tk-font-mono);
  font-size: var(--tk-fs-12);
  letter-spacing: var(--tk-tracking-wide);
  text-transform: uppercase;
  color: var(--tk-stone);
  font-weight: 500;
}
.tk-display {
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--tk-ink);
  margin: 0;
}
.tk-h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1.05; letter-spacing: -0.015em; font-weight: 500; margin: 0; }
.tk-h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.01em; font-weight: 500; margin: 0; }
.tk-h3 { font-size: var(--tk-fs-24); line-height: 1.2; font-weight: 500; margin: 0; }
.tk-h4 { font-size: var(--tk-fs-20); line-height: 1.25; font-weight: 500; margin: 0; }
.tk-body  { font-size: var(--tk-fs-17); line-height: 1.55; color: var(--tk-graphite); }
.tk-small { font-size: var(--tk-fs-14); line-height: 1.5;  color: var(--tk-stone); }
.tk-mono  { font-family: var(--tk-font-mono); }

/* ─── Container ──────────────────────────────────────────── */
.tk-wrap {
  max-width: var(--tk-container);
  margin: 0 auto;
  padding: 0 var(--tk-gutter);
}
@media (min-width: 768px) {
  .tk-wrap { padding: 0 40px; }
}

/* ─── Boutons ────────────────────────────────────────────── */
.tk-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--tk-s-3);
  padding: 14px 22px;
  font-size: var(--tk-fs-15);
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--tk-radius);
  transition: background var(--tk-dur) var(--tk-ease), color var(--tk-dur) var(--tk-ease), border-color var(--tk-dur) var(--tk-ease);
  cursor: pointer;
  white-space: nowrap;
}
.tk-btn--primary {
  background: var(--tk-green);
  color: var(--tk-bone);
}
.tk-btn--primary:hover { background: var(--tk-green-deep); }
.tk-btn--ghost {
  background: transparent;
  color: var(--tk-ink);
  border: 1px solid var(--tk-ink);
}
.tk-btn--ghost:hover { background: var(--tk-ink); color: var(--tk-bone); }
.tk-btn--ghost-light {
  background: transparent;
  color: var(--tk-bone);
  border: 1px solid rgba(245,242,236,0.4);
}
.tk-btn--ghost-light:hover { background: var(--tk-bone); color: var(--tk-green); border-color: var(--tk-bone); }
.tk-btn--link {
  padding: 0;
  background: transparent;
  color: var(--tk-ink);
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding-bottom: 2px;
}

/* ─── Form ───────────────────────────────────────────────── */
.tk-field { display: flex; flex-direction: column; gap: var(--tk-s-2); }
.tk-label {
  font-family: var(--tk-font-mono);
  font-size: var(--tk-fs-12);
  letter-spacing: var(--tk-tracking-wide);
  text-transform: uppercase;
  color: var(--tk-graphite);
}
.tk-input, .tk-textarea, .tk-select {
  background: var(--tk-paper);
  border: 1px solid var(--tk-rule);
  border-radius: var(--tk-radius-sm);
  padding: 14px 16px;
  font-size: var(--tk-fs-15);
  color: var(--tk-ink);
  transition: border-color var(--tk-dur) var(--tk-ease), background var(--tk-dur) var(--tk-ease);
  width: 100%;
}
.tk-input:focus, .tk-textarea:focus, .tk-select:focus {
  outline: none;
  border-color: var(--tk-green);
  background: #fff;
}
.tk-input::placeholder, .tk-textarea::placeholder { color: var(--tk-fog); }
.tk-textarea { min-height: 140px; resize: vertical; }

/* ─── Image placeholder (rayé monospace) ────────────────── */
.tk-img-ph {
  position: relative;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(26,29,27,0.05) 0 1px,
      transparent 1px 14px
    ),
    var(--tk-bone-warm);
  border: 1px solid var(--tk-rule);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}
.tk-img-ph--dark {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(245,242,236,0.05) 0 1px,
      transparent 1px 14px
    ),
    var(--tk-green-deep);
  border-color: rgba(245,242,236,0.08);
}
.tk-img-ph__label {
  font-family: var(--tk-font-mono);
  font-size: var(--tk-fs-12);
  color: var(--tk-stone);
  padding: var(--tk-s-3) var(--tk-s-4);
  letter-spacing: 0.04em;
}
.tk-img-ph--dark .tk-img-ph__label { color: rgba(245,242,236,0.55); }

/* ─── Filets de section ─────────────────────────────────── */
.tk-section { padding: var(--tk-s-9) 0; }
@media (min-width: 768px) { .tk-section { padding: var(--tk-s-10) 0; } }
.tk-section--tight { padding: var(--tk-s-8) 0; }

.tk-rule-top    { border-top:    1px solid var(--tk-rule); }
.tk-rule-bottom { border-bottom: 1px solid var(--tk-rule); }

/* ─── Utilitaires ───────────────────────────────────────── */
.tk-bg-bone   { background: var(--tk-bone); }
.tk-bg-paper  { background: var(--tk-paper); }
.tk-bg-warm   { background: var(--tk-bone-warm); }
.tk-bg-green  { background: var(--tk-green);    color: var(--tk-bone); }
.tk-bg-deep   { background: var(--tk-green-deep); color: var(--tk-bone); }
.tk-bg-ink    { background: var(--tk-ink);     color: var(--tk-bone); }
