/* ================================================================
   VECTEUR LABS — main.css
   Foundation layer: design tokens, reset, typography, layout, utils
   ================================================================ */

/* ============================================================
   1. CSS Custom Properties — Brand Design Tokens
   All colors, typography, spacing, radii, shadows, and transitions
   are defined here for consistent use across the entire site.
   ============================================================ */
:root {
  /* ---- Colors ---- */
  --color-primary: #1A1F5E;
  --color-primary-rgb: 26, 31, 94;
  --color-accent: #4F6EF7;
  --color-accent-rgb: 79, 110, 247;
  --color-accent-dark: #3b5ce5;
  --color-highlight: #00D2A0;
  --color-highlight-rgb: 0, 210, 160;
  --color-neutral-light: #F5F7FF;
  --color-neutral-dark: #1C1C2E;
  --color-muted: #8892B0;
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-error: #e53e3e;
  --color-success: #38a169;
  --color-warning: #dd6b20;

  /* ---- Font Families ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas',
    monospace;

  /* ---- Font Sizes (modular scale) ---- */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */

  /* ---- Font Weights ---- */
  --font-normal: 400;
  --font-medium: 500;
  --font-bold: 700;
  --font-extrabold: 800;

  /* ---- Spacing Scale (4px base) ---- */
  --space-0: 0;
  --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-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* ---- Border Radius ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ---- Shadows ---- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
               0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
               0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
               0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08),
                 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 40px rgba(0, 0, 0, 0.12);

  /* ---- Breakpoints (reference only — used in @media queries) ---- */
  --bp-sm: 640px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;
  --bp-2xl: 1536px;

  /* ---- Transitions ---- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ---- Shorthand Aliases (used in components.css) ---- */
  --color-dark: var(--color-neutral-dark);
  --color-light: var(--color-neutral-light);
  --font-primary: var(--font-sans);
}


/* ============================================================
   2. CSS Reset
   Modern, opinionated reset for consistent cross-browser
   rendering. Based on Josh Comeau's custom CSS reset and
   modern best practices.
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ol,
ul {
  list-style: none;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

/* Remove default fieldset and legend styling */
fieldset {
  border: none;
}

/* Remove spinner from number inputs (WebKit/Blink) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Remove search input decoration (WebKit) */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}


/* ============================================================
   3. Base Typography
   Sets foundational type styles. Headings use Inter at 700/800
   weights with a carefully tuned size scale.
   ============================================================ */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-neutral-dark);
  background-color: var(--color-white);
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-neutral-dark);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
}

h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
}

/* Responsive heading scale-up on large screens */
@media (min-width: 1024px) {
  h1 {
    font-size: var(--text-5xl);
  }

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

  h3 {
    font-size: var(--text-3xl);
  }
}

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

p:last-child {
  margin-bottom: 0;
}

/* --- Small / Caption text --- */
small {
  font-size: var(--text-sm);
}

/* --- Code (inline) --- */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--color-neutral-light);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

/* --- Preformatted blocks --- */
pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background-color: var(--color-neutral-dark);
  color: var(--color-neutral-light);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: 1.7;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* --- Blockquote --- */
blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  color: var(--color-muted);
  font-style: italic;
}

/* --- Horizontal rule --- */
hr {
  border: none;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.08);
  margin: var(--space-8) 0;
}

/* --- Strong / Bold --- */
strong,
b {
  font-weight: var(--font-bold);
}

/* --- Emphasis --- */
em,
i {
  font-style: italic;
}


/* ============================================================
   4. Link Styles
   Accent-colored links with smooth hover transitions.
   ============================================================ */
a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-dark);
}


/* ============================================================
   5. Layout Utilities — Containers
   Centered, max-width constrained layout wrappers.
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container-wide {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}


/* ============================================================
   6. Responsive Grid System
   Mobile-first CSS Grid layouts with automatic responsive
   column breakpoints. All grids default to 1 column on mobile.
   ============================================================ */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

/* md (768px): 3-col and 4-col grids gain a second column */
@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* lg (1024px): 2-col grid activates; 3-col grid reaches full width */
@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* xl (1280px): 4-col grid reaches full width */
@media (min-width: 1280px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}


/* ============================================================
   7. Skip-to-Content Link
   Accessible bypass link hidden off-screen until focused.
   Positioned fixed at the top-left of the viewport.
   ============================================================ */
.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-accent);
  color: var(--color-white);
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--transition-fast);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-highlight);
  outline-offset: 2px;
}


/* ============================================================
   8. Focus Styles
   Visible focus ring using :focus-visible for keyboard users.
   3px accent-colored outline with 2px offset for clarity.
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Remove outline for mouse-click focus (non-keyboard) */
:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   9. Selection Styles
   Brand-colored text selection for visual consistency.
   ============================================================ */
::selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}


/* ============================================================
   10. Utility Classes
   Common layout and typographic helpers.
   ============================================================ */

/* Center-align text */
.text-center {
  text-align: center;
}

/* Muted/secondary text color */
.text-muted {
  color: var(--color-muted);
}

/* Screen-reader only: visually hidden but accessible to
   assistive technology. Uses the modern clip-path approach. */
.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-width: 0;
}

/* Flex centering utility */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section vertical spacing */
.section {
  padding: var(--space-16) 0;
}

@media (min-width: 1024px) {
  .section {
    padding: var(--space-24) 0;
  }
}
