/* ==========================================================================
   MokkhTasks — Design System
   Visual identity: Trust + Opportunity + Technology + Professionalism +
   African identity + Simplicity.
   Deep navy as primary, green as a controlled accent, clean neutrals,
   soft shadows, moderate radius, strong hierarchy.
   ========================================================================== */

/* ---------- 1. Design tokens (CSS variables) ----------------------------- */
:root {
  /* Color — brand (navy) */
  --navy-950: #08102b;
  --navy-900: #0c1536;
  --navy-800: #122048;
  --navy-700: #1a2d5e;
  --navy-600: #24407d;
  --navy-500: #33518f;
  --navy-200: #c3cfe8;
  --navy-100: #e3e9f6;
  --navy-50:  #f3f6fc;

  /* Color — accent (green, used sparingly: growth / opportunity) */
  --green-700: #177a45;
  --green-600: #1f9d57;
  --green-500: #27b063;
  --green-100: #d9f3e5;
  --green-50:  #edfaf3;

  /* Color — neutrals */
  --white:     #ffffff;
  --bg:        #ffffff;
  --bg-alt:    #f7f9fd;
  --surface:   #ffffff;
  --border:    #e4e9f3;
  --border-strong: #d3dbea;
  --text:      #182538;
  --text-2:    #43536f;
  --text-3:    #6b7a96;
  --text-disabled: #a2aec4;

  /* Color — semantic */
  --success:       #1f9d57;
  --success-bg:    #e9f7ef;
  --success-border:#bfe6cf;
  --info:          #2f6fed;
  --info-bg:       #eaf1fe;
  --info-border:   #c9d9fb;
  --warning:       #b07a1b;
  --warning-bg:    #fdf4e2;
  --warning-border:#f0dca8;
  --error:         #d2493f;
  --error-bg:      #fdeeed;
  --error-border:  #f5c6c2;
  --accent-purple: #6d5bd0;
  --accent-teal:   #0e9494;
  --accent-rose:   #c2417a;

  /* Typography scale (system stack, offline-safe, professional) */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif;
  --fs-xs:  0.75rem;    /* 12px */
  --fs-sm:  0.875rem;   /* 14px */
  --fs-md:  1rem;       /* 16px */
  --fs-lg:  1.125rem;   /* 18px */
  --fs-xl:  1.3125rem;  /* 21px */
  --fs-2xl: 1.6875rem;  /* 27px */
  --fs-3xl: 2.25rem;    /* 36px */
  --fs-4xl: 3rem;       /* 48px */
  --fs-hero: clamp(2.5rem, 1.6rem + 4.2vw, 3.75rem);

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  --tracking-tight: -0.02em;
  --tracking-wide: 0.04em;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-11: 6rem;

  /* Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(12, 21, 54, 0.06);
  --shadow-sm: 0 1px 3px rgba(12, 21, 54, 0.08), 0 1px 2px rgba(12, 21, 54, 0.04);
  --shadow-md: 0 6px 18px -4px rgba(12, 21, 54, 0.12), 0 2px 6px rgba(12, 21, 54, 0.06);
  --shadow-lg: 0 20px 44px -12px rgba(12, 21, 54, 0.2), 0 6px 14px rgba(12, 21, 54, 0.08);
  --shadow-focus: 0 0 0 4px rgba(31, 157, 87, 0.18);

  /* Transitions */
  --ease: cubic-bezier(0.33, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-med: 260ms;
  --t-slow: 460ms;

  /* Layout */
  --container: 1180px;
  --container-wide: 1320px;
  --container-narrow: 780px;
  --nav-h: 72px;

  /* Z-index scale */
  --z-nav: 60;
  --z-drawer: 70;
  --z-modal: 80;
  --z-toast: 90;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

svg {
  display: block;
}

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

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

a {
  color: var(--navy-700);
  text-decoration: none;
}

a:hover {
  color: var(--navy-600);
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }

p {
  color: var(--text-2);
}

/* ---------- 3. Focus & accessibility -------------------------------------- */
:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius-sm);
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
  top: var(--space-3);
}

::selection {
  background: var(--green-100);
  color: var(--navy-900);
}

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

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

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

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

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

.section--alt {
  background: var(--bg-alt);
}

.section--navy {
  background: var(--navy-900);
}

.section--pattern {
  background-color: var(--navy-900);
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-7);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head .eyebrow {
  margin-bottom: var(--space-3);
}

.section-head p {
  margin-top: var(--space-4);
  font-size: var(--fs-lg);
  color: var(--text-2);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--green-700);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--green-500);
}

.section--navy .eyebrow,
.section--pattern .eyebrow {
  color: #7dd3a8;
}

.section--navy .eyebrow::before,
.section--pattern .eyebrow::before {
  background: #7dd3a8;
}

.section--navy h2,
.section--navy h3,
.section--pattern h2,
.section--pattern h3 {
  color: var(--white);
}

.section--navy p,
.section--pattern p {
  color: #c3cdeb;
}

/* ---------- 5. Grid helpers ----------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

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

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- 6. Radios / checkboxes (custom) -------------------------------- */
.field-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-2);
  position: relative;
}

.field-check input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
  margin: 0;
}

.field-check .check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}

.field-check input:checked ~ .check {
  background: var(--green-600);
  border-color: var(--green-600);
}

.field-check .check svg {
  width: 12px;
  height: 12px;
  color: var(--white);
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--t-fast) var(--ease);
}

.field-check input:checked ~ .check svg {
  opacity: 1;
  transform: scale(1);
}

.field-check input:focus-visible ~ .check {
  box-shadow: var(--shadow-focus);
}

/* ---------- 7. Reveal on scroll -------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 8. Motion (subtle, used sparingly) ------------------------------ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Helpers */
.text-center { text-align: center; }
.text-green { color: var(--green-600); }
.text-navy { color: var(--navy-800); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }