/* ============================================================
   MBACHI TRADING LIMITED — MAIN.CSS
   Global Design System: Variables, Reset, Typography, Utilities
   ============================================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* Brand Colours — MBACHI Red */
  --color-primary:        #E8312A;
  --color-primary-dark:   #B91F19;
  --color-primary-light:  #FF6B65;
  --color-primary-pale:   #FEF0EF;

  /* Neutral Palette */
  --color-dark:           #1C1A18;
  --color-dark-2:         #2D2B27;
  --color-dark-3:         #3D3B36;
  --color-text:           #1C1A18;
  --color-text-muted:     #6B6560;
  --color-text-light:     #9A9590;

  /* Surface Colours */
  --color-surface:        #F7F5F0;
  --color-surface-2:      #EDEBE4;
  --color-white:          #FFFFFF;
  --color-border:         #E0DDD5;
  --color-border-dark:    #C8C5BC;

  /* Typography */
  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:  'Playfair Display', Georgia, serif;

  /* Font Sizes (fluid scale) */
  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   2rem;       /* 32px */
  --text-3xl:   2.5rem;     /* 40px */
  --text-4xl:   3rem;       /* 48px */
  --text-5xl:   3.75rem;    /* 60px */
  --text-6xl:   4.5rem;     /* 72px */

  /* 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;

  /* Border Radius */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.10);

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

  /* Layout */
  --container-max:   1280px;
  --container-pad:   clamp(1.25rem, 4vw, 2.5rem);

  /* Header height (used for offset calculations) */
  --header-height: 76px;
}

/* ============================================================
   RESET & BASE STYLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

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

.section--lg {
  padding: var(--space-32) 0;
}

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

/* Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-dark);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }

p {
  color: var(--color-text-muted);
  line-height: 1.75;
}

/* Accent word in headings */
.text-accent {
  color: var(--color-primary);
}

.text-muted {
  color: var(--color-text-muted);
}

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

.label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.label::before {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 122, 42, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-dark);
  border-color: var(--color-border-dark);
}

.btn-outline:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline-white {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.5);
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--color-white);
}

.btn-dark {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
}

.btn-dark:hover {
  background: var(--color-dark-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* Arrow icon for buttons */
.btn .arrow {
  display: inline-block;
  transition: transform var(--transition-fast);
}

.btn:hover .arrow {
  transform: translateX(4px);
}

/* ============================================================
   SECTION LABELS & HEADINGS
   ============================================================ */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

.section-title {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-md);
  color: var(--color-text-muted);
  max-width: 600px;
}

/* ============================================================
   ANIMATION HELPERS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.stagger.visible > *:nth-child(1) { opacity: 1; transform: none; transition-delay: 0ms; }
.stagger.visible > *:nth-child(2) { opacity: 1; transform: none; transition-delay: 80ms; }
.stagger.visible > *:nth-child(3) { opacity: 1; transform: none; transition-delay: 160ms; }
.stagger.visible > *:nth-child(4) { opacity: 1; transform: none; transition-delay: 240ms; }
.stagger.visible > *:nth-child(5) { opacity: 1; transform: none; transition-delay: 320ms; }
.stagger.visible > *:nth-child(6) { opacity: 1; transform: none; transition-delay: 400ms; }

/* ============================================================
   DIVIDERS
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-16) 0;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

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

  .section--lg {
    padding: var(--space-20) 0;
  }
}
