/* ==========================================================================
   SmSt Africa — base layer
   Design tokens, reset, typography and utilities.
   One accent (brand blue), one neutral family (cool slate), one dark surface.
   ========================================================================== */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: "Figtree";
  src: url("https://static.smartstock.africa/font/figtree.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("https://static.smartstock.africa/font/jost.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "BonaNova";
  src: url("https://static.smartstock.africa/font/BonaNova-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Inconsolata";
  src: url("https://static.smartstock.africa/font/inconsolata.ttf") format("truetype");
  font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  /* brand — a single blue, desaturated so it sits with the neutrals */
  --brand-900: #0d1c30;
  --brand-800: #13294a;
  --brand-700: #1b3d6b;
  --brand-600: #24508f;
  --brand-500: #3a6cad;
  --brand-400: #6a93c4;
  --brand-200: #c3d5ea;
  --brand-100: #e2ecf7;
  --brand-050: #f0f5fb;

  /* dark surface — warm-free, never pure black */
  --ink: #0e1218;
  --ink-2: #141a23;
  --ink-3: #1c232e;

  /* light surfaces — one cool neutral family */
  --paper: #ffffff;
  --surface-1: #f6f8fa;
  --surface-2: #edf1f6;
  --surface-3: #e3e8f0;
  --line: #dfe4ec;
  --line-strong: #c6cfdd;

  /* text */
  --text: #141a22;
  --text-2: #4c5766;
  --text-3: #6e7a8a;
  --on-dark: #e9eef5;
  --on-dark-2: #9dadbf;

  /* semantic */
  --ok: #1f6f47;
  --ok-bg: #e4f2ea;
  --warn: #8a5a12;
  --warn-bg: #f8eed9;
  --err: #a33232;
  --err-bg: #f9e8e8;

  /* type */
  --font-display: "Jost", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: "BonaNova", Georgia, "Times New Roman", serif;
  --font-mono: "Inconsolata", ui-monospace, "SFMono-Regular", monospace;

  --step--2: clamp(0.72rem, 0.71rem + 0.06vw, 0.76rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.16vw, 1.03rem);
  --step-1: clamp(1.08rem, 1.02rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.28rem, 1.17rem + 0.5vw, 1.6rem);
  --step-3: clamp(1.52rem, 1.32rem + 0.85vw, 2.05rem);
  --step-4: clamp(1.8rem, 1.48rem + 1.3vw, 2.7rem);
  --step-5: clamp(2.1rem, 1.6rem + 2vw, 3.5rem);
  --step-6: clamp(2.4rem, 1.66rem + 3vw, 4.6rem);

  /* space */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  --space-3xl: 7.5rem;
  --section-y: clamp(3.5rem, 7vw, 6.5rem);
  --gutter: clamp(1.25rem, 4vw, 2.75rem);
  --shell: 1240px;

  /* radius — varied on purpose */
  --r-xs: 3px;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* shadows carry the brand hue instead of pure black */
  --shadow-1: 0 1px 2px rgba(13, 28, 48, 0.05), 0 1px 3px rgba(13, 28, 48, 0.04);
  --shadow-2: 0 2px 6px rgba(13, 28, 48, 0.05), 0 14px 28px -12px rgba(13, 28, 48, 0.16);
  --shadow-3: 0 4px 12px rgba(13, 28, 48, 0.07), 0 32px 64px -20px rgba(13, 28, 48, 0.24);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --ring: 0 0 0 3px rgba(58, 108, 173, 0.35);

  --ease: cubic-bezier(0.22, 0.72, 0.28, 1);
  --dur: 220ms;

  --z-base: 1;
  --z-raised: 10;
  --z-header: 100;
  --z-drawer: 200;
  --z-banner: 300;
}

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

* {
  margin: 0;
}

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

body {
  min-height: 100dvh;
  background: var(--surface-1);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-dark :focus-visible,
.has-dark-hero .site-header :focus-visible {
  outline-color: var(--brand-400);
}

/* ------------------------------------------------------------- typography */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
}
h2 {
  font-size: var(--step-4);
}
h3 {
  font-size: var(--step-2);
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* ------------------------------------------------------------- utilities */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: calc(var(--z-banner) + 10);
  transform: translateY(-160%);
  background: var(--brand-700);
  color: var(--paper);
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-s);
  font-size: var(--step--1);
  font-weight: 600;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* grain: one fixed overlay keeps flat surfaces from feeling sterile */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-banner);
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* --------------------------------------------------------------- reveals */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
