/* ==========================================================================
   AfriQ-Emerald — Core Theme
   Design tokens, base, layout, and shared components.
   Per-service and per-component styles live in their own files.
   SoW refs: §4.1 breakpoints, §4.2 perf, §4.4 a11y (contrast >= 4.5:1)
   ========================================================================== */

/* ------------------------------------------------------------------ Tokens */
:root {
  /* Brand — emerald (accent, not everything) */
  --aq-emerald:        #0e9f52;   /* primary */
  --aq-emerald-600:    #0b8544;   /* hover / active */
  --aq-emerald-700:    #096b37;
  --aq-emerald-bright: #21c063;   /* accents, highlights */
  --aq-forest:         #0b3d2e;   /* deep green — footer, kept for brand */
  --aq-forest-900:     #072a20;

  /* Tech dark — the new backbone for dark sections (reduces green dominance) */
  --aq-navy:      #0b1220;   /* hero / dark section base */
  --aq-navy-800:  #111b30;
  --aq-navy-700:  #17233d;
  --aq-navy-line: rgba(255,255,255,.08);

  /* Secondary accent — cyan/teal, pairs with emerald for a tech feel */
  --aq-cyan:      #22d3c5;
  --aq-cyan-600:  #14b8ab;

  /* Neutrals — cool gray, no green tint */
  --aq-ink:      #16202e;   /* body text */
  --aq-muted:    #5a6675;   /* secondary text */
  --aq-line:     #e4e9f0;   /* borders */
  --aq-surface:  #f5f8fb;   /* section background (cool neutral) */
  --aq-surface-2:#eaf0f7;
  --aq-white:    #ffffff;
  --aq-card:     #ffffff;   /* card surface (themable) */
  --aq-heading:  #0b1220;   /* heading text (themable) */

  /* Feedback */
  --aq-warn:  #d97706;
  --aq-error: #dc2626;
  --aq-info:  #0284c7;

  /* Typography */
  --aq-font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --aq-fs-xs:   0.8125rem;   /* 13px */
  --aq-fs-sm:   0.9375rem;   /* 15px */
  --aq-fs-base: 1rem;        /* 16px */
  --aq-fs-lg:   1.125rem;
  --aq-fs-xl:   1.375rem;
  --aq-fs-2xl:  1.75rem;
  --aq-fs-3xl:  2.25rem;
  --aq-fs-4xl:  3rem;
  --aq-lh-tight: 1.2;
  --aq-lh-base:  1.65;

  /* Spacing scale (4px base) */
  --aq-sp-1: 0.25rem;  --aq-sp-2: 0.5rem;  --aq-sp-3: 0.75rem;
  --aq-sp-4: 1rem;     --aq-sp-5: 1.5rem;  --aq-sp-6: 2rem;
  --aq-sp-7: 3rem;     --aq-sp-8: 4rem;    --aq-sp-9: 6rem;

  /* Radii / shadow / motion */
  --aq-radius:    10px;
  --aq-radius-lg: 16px;
  --aq-shadow-sm: 0 1px 3px rgba(11,61,46,.08);
  --aq-shadow:    0 6px 20px rgba(11,61,46,.10);
  --aq-shadow-lg: 0 16px 40px rgba(11,61,46,.16);
  --aq-ease: cubic-bezier(.4,0,.2,1);
  --aq-header-h: 88px;

  --aq-container: 1200px;
}

/* Dark theme — token overrides. Header/footer keep their own dark styling;
   the sticky header stays light so the colour logo remains legible. */
:root[data-theme="dark"] {
  --aq-white:    #0e1626;
  --aq-surface:  #131f33;
  --aq-surface-2:#182740;
  --aq-card:     #16233a;
  --aq-heading:  #ffffff;
  --aq-ink:      #d6e0ec;
  --aq-muted:    #93a2b5;
  --aq-line:     #26344c;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--aq-font-sans);
  font-size: var(--aq-fs-base);
  line-height: var(--aq-lh-base);
  color: var(--aq-ink);
  background: var(--aq-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0 0 var(--aq-sp-4); line-height: var(--aq-lh-tight); color: var(--aq-heading); font-weight: 700; }
h1 { font-size: var(--aq-fs-4xl); letter-spacing: -.02em; }
h2 { font-size: var(--aq-fs-3xl); letter-spacing: -.015em; }
h3 { font-size: var(--aq-fs-2xl); }
h4 { font-size: var(--aq-fs-xl); }
p  { margin: 0 0 var(--aq-sp-4); }

a { color: var(--aq-emerald-600); text-decoration: none; transition: color .18s var(--aq-ease); }
a:hover { color: var(--aq-emerald-700); }

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

/* Accessibility — visible focus + skip link (SoW §4.4) */
:focus-visible { outline: 3px solid var(--aq-emerald-bright); outline-offset: 2px; border-radius: 4px; }
.aq-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--aq-forest); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--aq-radius) 0;
}
.aq-skip-link:focus { left: 0; color: #fff; }
.aq-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ Layout */
.aq-container { width: 100%; max-width: var(--aq-container); margin: 0 auto; padding: 0 var(--aq-sp-5); }
.aq-section   { padding: var(--aq-sp-9) 0; }
.aq-section--tight { padding: var(--aq-sp-7) 0; }
.aq-section--surface { background: var(--aq-surface); }
.aq-section--forest  { background: var(--aq-forest); color: #dfeee7; }
.aq-section--forest h2, .aq-section--forest h3 { color: #fff; }

/* Tech-dark section — navy with a faint dot grid + emerald/cyan glow */
.aq-section--dark {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 120% at 85% 0%, rgba(34,211,197,.10), transparent 60%),
    radial-gradient(50% 120% at 10% 100%, rgba(14,159,82,.14), transparent 60%),
    var(--aq-navy);
  color: #c3ccda;
}
.aq-section--dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px;
}
.aq-section--dark > * { position: relative; z-index: 1; }
.aq-section--dark h2, .aq-section--dark h3, .aq-section--dark h4 { color: #fff; }

/* Branded CTA band — navy → emerald gradient (one strong green moment) */
.aq-cta {
  position: relative; overflow: hidden; color: #eafff4;
  background: linear-gradient(120deg, var(--aq-navy) 0%, var(--aq-navy-800) 40%, var(--aq-emerald-700) 100%);
}
.aq-cta h2 { color: #fff; }
.aq-cta::after {
  content: ""; position: absolute; right: -8%; top: -40%; width: 45%; height: 180%;
  background: radial-gradient(circle at center, rgba(34,211,197,.25), transparent 60%); pointer-events: none;
}

.aq-section-head { max-width: 720px; margin: 0 auto var(--aq-sp-7); text-align: center; }
.aq-section-head .aq-eyebrow { margin-bottom: var(--aq-sp-2); }
.aq-section-head p { color: var(--aq-muted); font-size: var(--aq-fs-lg); }

.aq-eyebrow {
  display: inline-block; font-size: var(--aq-fs-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--aq-emerald-600);
}

.aq-grid { display: grid; gap: var(--aq-sp-5); }
.aq-grid--2 { grid-template-columns: repeat(2, 1fr); }
.aq-grid--3 { grid-template-columns: repeat(3, 1fr); }
.aq-grid--4 { grid-template-columns: repeat(4, 1fr); }
.aq-grid--5 { grid-template-columns: repeat(5, 1fr); }

/* -------------------------------------------------------------- Buttons/CTA */
.aq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; line-height: 1; cursor: pointer;
  padding: .85rem 1.5rem; border-radius: var(--aq-radius); border: 2px solid transparent;
  transition: background .18s var(--aq-ease), color .18s var(--aq-ease),
              border-color .18s var(--aq-ease), transform .18s var(--aq-ease), box-shadow .18s var(--aq-ease);
  text-align: center;
}
.aq-btn:hover { transform: translateY(-2px); }
.aq-btn:active { transform: translateY(0); }
.aq-btn--primary { background: var(--aq-emerald); color: #fff; box-shadow: var(--aq-shadow-sm); }
.aq-btn--primary:hover { background: var(--aq-emerald-600); color: #fff; box-shadow: var(--aq-shadow); }
.aq-btn--ghost { background: transparent; color: var(--aq-forest); border-color: var(--aq-line); }
.aq-btn--ghost:hover { border-color: var(--aq-emerald); color: var(--aq-emerald-600); }
.aq-btn--on-dark { background: #fff; color: var(--aq-forest); }
.aq-btn--on-dark:hover { background: var(--aq-emerald-bright); color: var(--aq-forest-900); }
.aq-btn--lg { padding: 1.05rem 2rem; font-size: var(--aq-fs-lg); }
.aq-btn--block { display: flex; width: 100%; }

/* ---------------------------------------------------------------- Cards */
.aq-card {
  background: var(--aq-card); border: 1px solid var(--aq-line); border-radius: var(--aq-radius-lg);
  padding: var(--aq-sp-6); box-shadow: var(--aq-shadow-sm);
  transition: transform .2s var(--aq-ease), box-shadow .2s var(--aq-ease), border-color .2s var(--aq-ease);
  height: 100%;
}
.aq-card:hover { transform: translateY(-4px); box-shadow: var(--aq-shadow-lg); border-color: transparent; }

/* Badges / pills */
.aq-badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: var(--aq-fs-xs); font-weight: 700; letter-spacing: .02em;
  background: rgba(14,159,82,.12); color: var(--aq-emerald-700);
}
.aq-badge--accent { background: var(--aq-emerald-bright); color: var(--aq-forest-900); }

/* ------------------------------------------------------------- Breadcrumb */
.aq-breadcrumb { font-size: var(--aq-fs-sm); color: var(--aq-muted); padding: var(--aq-sp-4) 0; }
.aq-breadcrumb a { color: var(--aq-muted); }
.aq-breadcrumb a:hover { color: var(--aq-emerald-600); }
.aq-breadcrumb [aria-current="page"] { color: var(--aq-ink); font-weight: 600; }

/* --------------------------------------------------------- Responsive rules */
/* Desktop-first collapse. Breakpoints per SoW §4.1 */
@media (max-width: 1200px) {
  .aq-grid--5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1023px) {   /* tablet */
  .aq-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .aq-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .aq-grid--5 { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: var(--aq-fs-3xl); }
}
@media (max-width: 767px) {    /* mobile */
  :root { --aq-header-h: 70px; }
  .aq-section { padding: var(--aq-sp-7) 0; }
  .aq-grid--2, .aq-grid--3, .aq-grid--4, .aq-grid--5 { grid-template-columns: 1fr; }
  h1 { font-size: var(--aq-fs-2xl); }
  h2 { font-size: var(--aq-fs-2xl); }
  .aq-btn--block-mobile { display: flex; width: 100%; }
}
