/*
 * ============================================================
 * K CONTRACTING 2017 LTD — GLOBAL BRAND TYPOGRAPHY SYSTEM
 * Industrial B2B Identity | Version 1.0
 * ============================================================
 *
 * Design tokens:
 *   --kc-font-primary   : Inter, system-ui, sans-serif
 *   --kc-color-charcoal : #202522  (body text on light bg)
 *   --kc-color-offwhite : #F5F3EC  (body text on dark bg)
 *
 * Cascade contract:
 *   Any heading tag (h1–h4) used inside a new component
 *   automatically inherits heavy industrial weight, uppercase
 *   transforms, and tight tracking without extra classes.
 * ============================================================
 */

/* ── 0. CSS Custom Properties ─────────────────────────────── */
:root {
  --kc-font-primary: "Inter", system-ui, -apple-system, sans-serif;

  /* Typography scale */
  --kc-weight-black:      900;
  --kc-weight-extrabold:  800;
  --kc-weight-bold:       700;
  --kc-weight-medium:     500;
  --kc-weight-regular:    400;

  /* Colors */
  --kc-color-charcoal:  #202522;
  --kc-color-offwhite:  #F5F3EC;

  /* Letter-spacing tokens */
  --kc-tracking-tight:  -0.02em;
  --kc-tracking-normal: 0em;
  --kc-tracking-wide:   0.05em;

  /* Line-height tokens */
  --kc-lh-headline:  1.1;
  --kc-lh-subhead:   1.3;
  --kc-lh-body:      1.6;
  --kc-lh-button:    1.0;
}

/* ── 1. Base Reset & Global Font Family ───────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--kc-font-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-regular);
  line-height: var(--kc-lh-body);
  color: var(--kc-color-charcoal);
}

/* ── 2. H1 & H2 — Impact Headlines (Extra Bold / Black) ──── */
h1,
h2 {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-extrabold);  /* 800 */
  text-transform: uppercase;
  letter-spacing: var(--kc-tracking-tight); /* -0.02em */
  line-height: var(--kc-lh-headline);       /* 1.1 */
  color: inherit;                           /* respects parent context (light or dark) */
  margin-top: 0;
}

/* Bump primary hero titles to full Black weight */
h1 {
  font-weight: var(--kc-weight-black);      /* 900 */
}

/* ── 3. H3 & H4 — Section Subheadings ────────────────────── */
h3,
h4 {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-bold);       /* 700 */
  text-transform: uppercase;
  letter-spacing: var(--kc-tracking-normal);/* 0em */
  line-height: var(--kc-lh-subhead);        /* 1.3 */
  color: inherit;
  margin-top: 0;
}

/* ── 4. Body Paragraphs ───────────────────────────────────── */
p {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-regular);    /* 400 */
  letter-spacing: var(--kc-tracking-normal);
  line-height: var(--kc-lh-body);           /* 1.6 */
  color: var(--kc-color-charcoal);
  margin-top: 0;
}

/* Lead-in paragraphs — Medium weight for introductory sentences */
p.lead,
.kc-lead {
  font-weight: var(--kc-weight-medium);     /* 500 */
}

/* Body text sitting on dark (primary / primary-container) backgrounds */
.bg-primary p,
.bg-primary-container p,
[class*="bg-primary"] p,
.kc-dark-bg p {
  color: var(--kc-color-offwhite);          /* #F5F3EC */
}

/* ── 5. Buttons ───────────────────────────────────────────── */
button,
a[class*="bg-"],        /* CTA anchor tags styled as buttons     */
.kc-btn {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-bold);       /* 700 */
  text-transform: uppercase;
  letter-spacing: var(--kc-tracking-wide);  /* 0.05em */
  line-height: var(--kc-lh-button);         /* 1.0 */
}

/* ── 6. Navigation Links ──────────────────────────────────── */
nav a,
header a {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-bold);       /* 700 */
  text-transform: uppercase;
  letter-spacing: var(--kc-tracking-wide);  /* 0.05em */
  line-height: var(--kc-lh-button);         /* 1.0 */
}

/* ── 7. Labels, Badges, Tags ──────────────────────────────── */
label,
.kc-label,
.kc-badge {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-bold);       /* 700 */
  text-transform: uppercase;
  letter-spacing: var(--kc-tracking-wide);  /* 0.05em */
  line-height: var(--kc-lh-button);
}

/* ── 8. Utility Overrides (for dark section contexts) ─────── */
/* Sections with dark brand backgrounds get warm off-white body text */
section.bg-primary,
section[class*="bg-primary"] {
  color: var(--kc-color-offwhite);
}

section.bg-primary p,
section[class*="bg-primary"] p {
  color: var(--kc-color-offwhite);
}

/* Trust badge text and small labels in dark sections */
section.bg-primary small,
section[class*="bg-primary"] small,
section.bg-primary span,
section[class*="bg-primary"] span {
  color: var(--kc-color-offwhite);
  opacity: 0.85;
}

/* ── 9. Form Elements – inherit brand typography ─────────── */
input,
select,
textarea {
  font-family: var(--kc-font-primary);
  font-weight: var(--kc-weight-regular);
  letter-spacing: var(--kc-tracking-normal);
  line-height: var(--kc-lh-body);
}

/* Placeholder text is slightly lighter */
::placeholder {
  font-weight: var(--kc-weight-regular);
  opacity: 0.6;
}
