/* ==========================================================================
   base.css — Reset, Design Tokens, Typography, Layout Primitives
   ========================================================================== */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--color-primary-dark);
}

ul,
ol {
  list-style: none;
}

/* --- Design Tokens --- */
:root {
  /* Brand Colors — deep forest green is the authoritative anchor.
     Interactive "accent" tokens resolve to the green family (the bright
     fintech green is retired from the UI; it survives only in the logo). */
  --color-primary: #103f2e;        /* deep forest green */
  --color-primary-dark: #0b2c20;
  --color-primary-light: #1c5640;
  --color-accent: #103f2e;         /* links/buttons = deep green */
  --color-accent-dark: #0b2c20;
  --color-accent-light: #2f7a5c;   /* lighter green for use on dark grounds */
  --color-success: #15803d;

  /* Brass / gold — editorial accent, used sparingly (hero & CTA rules only) */
  --color-gold: #a8854a;
  --color-gold-dark: #876a37;

  /* Neutrals — warm ivory "paper" */
  --color-bg: #faf8f2;             /* warm ivory page ground */
  --color-bg-alt: #f3efe4;         /* deeper warm sand panel */
  --color-bg-dark: #0d3325;        /* deep green for dark sections */
  --color-bg-darker: #082015;
  --color-surface: #ffffff;        /* cards sit brighter than the page */
  --color-text: #1f2620;           /* warm charcoal */
  --color-text-light: #ffffff;
  --color-muted: #5c645c;          /* warm grey */
  --color-border: #e7e1d4;         /* warm hairline */
  --color-border-strong: #d6cdbb;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Borders & Shadows — sharper, quieter "paper" feel */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(10, 34, 26, 0.04);
  --shadow-md: 0 6px 20px rgba(10, 34, 26, 0.06);
  --shadow-lg: 0 20px 50px rgba(10, 34, 26, 0.09);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--leading-tight);
  color: var(--color-text);
}

/* Editorial serif for display headings — institutional gravitas */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
}

h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.018em; }
h3 { font-size: var(--text-2xl); letter-spacing: -0.012em; }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
}

.text-muted { color: var(--color-muted); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }

/* Serif numerals for headline statistics */
.num-serif {
  font-family: var(--font-serif);
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

/* --- Layout Primitives --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-24);
}

.section--compact {
  padding-block: var(--space-12);
}

.section {
  position: relative;
}

/* Alt panel: solid warm sand, separated by hairline rules — no texture */
.section--alt {
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Dark section: solid deep green with a very subtle vignette — no grid */
.section--dark {
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
  background-image: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
}

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-light);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.72);
}

.section--dark .eyebrow {
  color: var(--color-gold);
}

.section__header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-16);
}

/* A short rule beneath section titles — editorial section divider.
   Kept deep green; brass is reserved for the hero and CTA band only. */
.section__header h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-primary);
  opacity: 0.85;
  margin: var(--space-5) auto 0;
}

.section--dark .section__header h2::after {
  background: var(--color-gold);
}

/* Center the eyebrow's leading rule within centered headers */
.section__header .eyebrow {
  margin-bottom: var(--space-5);
}

.section__header h2 {
  font-size: var(--text-4xl);
}

.section__header p {
  font-size: var(--text-lg);
  color: var(--color-muted);
  line-height: var(--leading-normal);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-xl); }

  .section {
    padding-block: var(--space-16);
  }

  .container {
    padding-inline: var(--space-4);
  }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}
