/* ==========================================================================
   GITLEAF DESIGN SYSTEM — 01. TOKENS
   Every colour, type step, space step, radius, shadow and timing used by the
   site is declared here. Nothing downstream should hard-code a value.
   ========================================================================== */

:root {
  /* --- Colour: core palette ---------------------------------------------- */
  --color-bg: #101713;
  --color-bg-secondary: #171f1a;
  --color-accent: #a6e6b9;
  --color-green-dark: #284936;
  --color-text: #f4f7f4;
  --color-text-muted: #929e95;
  --color-border: #29362e;
  --color-card: #1b241e;

  /* --- Colour: derived surfaces ------------------------------------------ */
  /* A step above --color-card for nested panels and hovered cards. */
  --color-card-raised: #212c25;
  --color-border-strong: #36473c;
  /* Accent at low alpha, for glows, rules and tinted fills. */
  --color-accent-02: rgb(166 230 185 / 2%);
  --color-accent-04: rgb(166 230 185 / 4%);
  --color-accent-08: rgb(166 230 185 / 8%);
  --color-accent-16: rgb(166 230 185 / 16%);
  --color-accent-28: rgb(166 230 185 / 28%);
  --color-accent-45: rgb(166 230 185 / 45%);
  /* Text that sits on top of an accent fill. */
  --color-on-accent: #0c1310;

  /* --- Colour: semantic -------------------------------------------------- */
  --color-heading: var(--color-text);
  --color-body: #b9c4bc;
  --color-link: var(--color-accent);
  --color-focus: var(--color-accent);
  --color-success: #7fd79a;
  --color-danger: #e98f8f;
  --color-danger-bg: rgb(233 143 143 / 10%);

  /* --- Gradients and lighting -------------------------------------------- */
  --gradient-accent: linear-gradient(135deg, #c2f0d1 0%, var(--color-accent) 45%, #7fc695 100%);
  --gradient-surface: linear-gradient(170deg, var(--color-card-raised) 0%, var(--color-card) 60%);
  --gradient-deep: linear-gradient(150deg, #1d3528 0%, var(--color-green-dark) 55%, #16271d 100%);
  /* Hairline that fades out, used on the top edge of cards and sections. */
  --gradient-hairline: linear-gradient(90deg, transparent, var(--color-accent-28), transparent);
  --glow-accent: radial-gradient(circle at center, var(--color-accent-16) 0%, transparent 70%);

  /* Fine engineering grid, drawn with gradients so it costs no request. */
  --pattern-grid-size: 64px;
  --pattern-grid: linear-gradient(to right, rgb(255 255 255 / 2.5%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 2.5%) 1px, transparent 1px);
  --pattern-dots: radial-gradient(circle, rgb(166 230 185 / 11%) 1px, transparent 1px);

  /* --- Typography: families ---------------------------------------------- */
  --font-heading: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", monospace;

  /* --- Typography: fluid scale ------------------------------------------- */
  /* Hero display: 40px floor, 76px ceiling (reached at ~1092px viewport). */
  --fs-display: clamp(2.5rem, 1.2rem + 5.2vw, 4.75rem);
  /* Inner-page hero: 34px -> 56px. */
  --fs-hero: clamp(2.125rem, 1.1rem + 3.6vw, 3.5rem);
  /* Section heading: 30px -> 48px. */
  --fs-h2: clamp(1.875rem, 1.1rem + 2.1vw, 3rem);
  /* Sub-section heading: 24px -> 32px. */
  --fs-h3: clamp(1.5rem, 1.25rem + 0.7vw, 2rem);
  /* Card heading: 20px -> 24px. */
  --fs-card: clamp(1.25rem, 1.05rem + 0.5vw, 1.5rem);
  --fs-h5: 1.125rem;
  /* Lead paragraph: 17px -> 21px. */
  --fs-lead: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
  /* Body: 16px -> 18px. */
  --fs-body: clamp(1rem, 0.96rem + 0.15vw, 1.125rem);
  --fs-nav: 0.9375rem;
  --fs-small: 0.875rem;
  --fs-mono: 0.75rem;
  --fs-mono-lg: 0.8125rem;

  /* --- Typography: weight, leading, tracking ----------------------------- */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.04;
  --lh-snug: 1.18;
  --lh-heading: 1.28;
  --lh-body: 1.68;
  --lh-relaxed: 1.78;

  --ls-display: -0.03em;
  --ls-heading: -0.02em;
  --ls-tight: -0.01em;
  --ls-normal: 0;
  --ls-label: 0.16em;
  --ls-wide: 0.08em;

  /* --- Spacing: 4px base ------------------------------------------------- */
  --space-1: 0.25rem;   /*  4px */
  --space-2: 0.5rem;    /*  8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-7: 2rem;      /* 32px */
  --space-8: 2.5rem;    /* 40px */
  --space-9: 3rem;      /* 48px */
  --space-10: 4rem;     /* 64px */
  --space-11: 5rem;     /* 80px */
  --space-12: 6rem;     /* 96px */

  /* Fluid vertical rhythm for section padding and stack gaps. */
  --space-section: clamp(4.5rem, 8.5vw, 8.5rem);
  --space-section-sm: clamp(3rem, 5.5vw, 5rem);
  --space-gap: clamp(1.25rem, 2.2vw, 2rem);
  --space-gap-lg: clamp(2rem, 4vw, 4rem);

  /* --- Layout ------------------------------------------------------------ */
  --container: 1280px;
  --container-narrow: 920px;
  --container-prose: 72ch;
  --container-pad: clamp(1.25rem, 4.2vw, 3rem);
  --header-height: 76px;
  --header-height-scrolled: 66px;

  /* --- Radii ------------------------------------------------------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* --- Shadows ----------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 24%);
  --shadow-md: 0 8px 24px -8px rgb(0 0 0 / 45%);
  --shadow-lg: 0 24px 56px -20px rgb(0 0 0 / 60%);
  --shadow-card-hover: 0 20px 44px -22px rgb(0 0 0 / 70%);
  --shadow-accent: 0 12px 32px -12px rgb(166 230 185 / 26%);
  --shadow-inset-top: inset 0 1px 0 0 rgb(255 255 255 / 5%);
  --ring-focus: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);

  /* --- Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 140ms;
  --duration: 240ms;
  --duration-slow: 420ms;
  --duration-reveal: 720ms;
  --transition-colors: color var(--duration) var(--ease-out),
    background-color var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out);

  /* --- Elevation order --------------------------------------------------- */
  --z-base: 1;
  --z-sticky: 50;
  --z-header: 100;
  --z-drawer: 200;
  --z-skip: 300;
}

/* Breakpoints are documented here for reference. CSS custom properties cannot
   be used in media queries, so these exact values are repeated in the
   @media rules throughout the system.

     --bp-xs:  430px   large phones
     --bp-sm:  640px   phone landscape
     --bp-md:  768px   tablet
     --bp-lg: 1024px   laptop
     --bp-xl: 1280px   desktop
     --bp-2xl: 1536px  wide desktop
*/
