/* =============================================================================
   KALDWIN TECH — base.css
   Layer 1/4: self-hosted webfont, design tokens, reset, typography, layout
   primitives, a11y.

   FONT: Inter 400/500/600/700, latin subset only, self-hosted as woff2 under
   assets/fonts/ (SIL Open Font License). No third-party font CDN host is
   referenced from any stylesheet or page, so the site renders identically on
   networks where such a host is slow or blocked. font-display:swap keeps the
   first paint immediate and falls back to the stack below.
   ============================================================================= */

/* --- Self-hosted Inter (latin subset) ------------------------------------ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand palette (handover site §A5) — the ONLY source of colour values. */
  --brand-forest: #0B3B2E;   /* primary mark, headings, 2px baseline rule   */
  --brand-deep:   #082B21;   /* footer, dark hero, OG card                   */
  --brand-leaf:   #146B52;   /* links + UI accent (NOT ochre)                */
  --brand-teal:   #2EC4B6;   /* small accent only, <=4%, never carries text  */
  --brand-ochre:  #A9683A;   /* origin sub-line only, <1%, never UI emphasis */
  --brand-paper:  #FAFBF9;   /* page background — never flat #fff           */
  --brand-soft:   #F1F5F1;   /* tinted section background                    */
  --brand-line:   #DFE7E0;   /* every divider: 1px, no shadow                */
  --brand-ink:    #12241C;   /* headings and body text                       */
  --brand-mute:   #71857A;   /* decorative / >=24px only (3.8:1 on paper)    */

  --brand-en: "Inter", "Helvetica Neue", "Segoe UI", Arial, sans-serif;

  --grid: 8px;
  --r-card: 10px;
  --r-panel: 14px;
  --r-btn: 8px;
  --r-tag: 4px;
  --rule: 1px solid var(--brand-line);
  --baseline: 2px solid var(--brand-forest);

  /* --- Legacy alias layer -------------------------------------------------
     The older token names stay valid so the 4 stylesheets do not need a
     find-and-replace. Every alias resolves to a brand token above, except
     --c-danger, which stays an out-of-palette functional error colour
     (a red is required for field validation and is not a brand decision). */
  --c-primary:        var(--brand-forest);
  --c-primary-dark:   var(--brand-deep);
  --c-primary-soft:   var(--brand-soft);
  --c-accent:         var(--brand-leaf);   /* leaf, never ochre */
  --c-ink:            var(--brand-ink);
  --c-body:           var(--brand-ink);
  /* --c-muted is 3.8:1 on paper: AA fails for body text. Use it ONLY at
     >=24px or for non-text decoration; every <24px usage in this stylesheet
     family has been switched to --c-body. */
  --c-muted:          var(--brand-mute);
  --c-bg:             var(--brand-paper);
  --c-bg-soft:        var(--brand-soft);
  --c-bg-tint:        var(--brand-soft);
  --c-border:         var(--brand-line);
  --c-border-strong:  var(--brand-forest);
  --c-white:          #FFFFFF;             /* cards / inputs only, never page bg */
  --c-danger:         #A3332B;             /* functional error colour (exception) */
  --c-danger-soft:    #FDF0EE;

  /* Typography */
  --font-sans: var(--brand-en);
  --font-serif: Georgia, "Times New Roman", serif;
  --fs-xs:   0.75rem;                                   /* 12px */
  --fs-sm:   0.875rem;
  --fs-base: 1rem;                                      /* 16px */
  --fs-md:   1.125rem;
  --fs-lg:   1.25rem;                                   /* 20px */
  --fs-xl:   1.75rem;                                   /* 28px */
  --fs-2xl:  clamp(2rem, 4.2vw, 2.5rem);                /* 40px cap */
  --lh-tight: 1.2;
  --lh-body:  1.85;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;

  --radius:    var(--r-card);
  --radius-sm: var(--r-btn);
  --radius-lg: var(--r-panel);
  /* One soft shadow for floating UI only; cards stay flat (1px rule). */
  --shadow-sm: none;
  --shadow-md: 0 8px 28px rgba(8, 43, 33, .12);
  --maxw: 1200px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-body);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3);
  color: var(--c-ink);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.015em;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p  { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25rem; }
li { margin-bottom: var(--sp-2); }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); text-decoration: underline; }
strong { color: var(--c-ink); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--sp-6) 0; }

/* Visible focus state (§9.4 / §10.1-E) */
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
a:focus-visible, button:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
.section { padding-block: var(--sp-7); }
.section--tight { padding-block: var(--sp-6); }
.section--muted { background: var(--c-bg-soft); }
.section--tint { background: var(--c-bg-tint); }
.section--dark { background: var(--c-primary-dark); color: var(--brand-soft); }
.section--dark h2, .section--dark h3 { color: var(--c-white); }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

.section-head { max-width: 740px; margin-bottom: var(--sp-6); }
.section-lead { font-size: var(--fs-md); color: var(--c-body); }
.eyebrow {
  display: inline-block;
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-white);
  color: var(--c-primary-dark);
  font-weight: 700;
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-4); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.text-muted { color: var(--c-body); }
.text-small { font-size: var(--fs-sm); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }

/* Responsive grid + spacing (mobile-first; §10.1-C) */
@media (min-width: 480px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  :root { --header-h: 80px; }
  .container { padding-inline: var(--sp-6); }
  .section { padding-block: var(--sp-8); }
  .grid--2, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .container { padding-inline: var(--sp-5); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
