/* ============================================================
   IMPACT Learning Hub — Design system
   ------------------------------------------------------------
   Register: institutional. IMPACT is a registered consulting
   and training firm (RC 8093427) that takes real payments and
   issues certificates, so the page should read closer to a
   university prospectus than to a startup landing page.

   What that means in practice:
   - Fraunces for display, Inter for everything functional.
     Kept from the previous system; it was the right call.
   - One warm paper background, one true white surface. No
     gradient fills, no shadow-card kit.
   - Hairline rules and a visible grid do the structural work
     that drop shadows were doing before.
   - Motion plays once and stops. Nothing loops.

   Fonts are loaded from the document <head> (preconnect +
   stylesheet), not an @import here — an @import inside CSS
   blocks rendering until it resolves, which on a slow mobile
   connection is the single worst thing on the page.

   Load order matters: style.css (tokens) -> layout.css ->
   page css -> media.css (last, it owns the image layer).
   ============================================================ */

:root{
  /* --- Core palette --- */
  --ink:        #0F1B3C;   /* primary text, headings */
  --ink-mid:    #2C3A62;   /* sub-headings, strong body */
  --ink-soft:   #4A5578;   /* secondary text — 6.9:1 on paper */
  --ink-faint:  #6B7596;   /* captions, meta — use at 14px+ only */
  --paper:      #F7F5F0;   /* page background, warm not white */
  --paper-deep: #EFEBE1;   /* alternating band, subtle fills */
  --surface:    #FFFFFF;   /* panels sitting on paper */

  --blue:       #1855D6;   /* IMPACT brand blue, from the logo */
  --blue-deep:  #103E9E;   /* hover/active */
  --blue-wash:  #EAF0FD;   /* selected states, callout fills */
  --amber:      #E8871E;   /* fieldwork accent — CTAs, highlights */
  --amber-deep: #C66E0F;
  --green:      #1F7A5C;   /* success */
  --red:        #B3261E;   /* errors, destructive */

  --stone:      #D9D3C4;   /* borders — warm, not cold grey */
  --stone-soft: #EAE6DA;   /* subtle fills, dividers */
  --stone-deep: #BDB5A2;   /* emphasised borders */

  /* --- Division colors (accents and rules only) --- */
  --div-data:   #3454D1;
  --div-tech:   #1855D6;
  --div-lab:    #0E8A7D;
  --div-agri:   #4C8C1F;
  --div-lang:   #A6472E;
  --div-hub:    #E8871E;

  /* --- Type --- */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  /* --- Fluid scale. Tighter than before: the old 3.6rem h1
         overpowered everything under it on a phone. --- */
  --step--2: 0.78rem;
  --step--1: 0.875rem;
  --step-0:  1rem;
  --step-1:  1.125rem;
  --step-2:  clamp(1.3rem,  1.1rem + 0.9vw,  1.55rem);
  --step-3:  clamp(1.6rem,  1.3rem + 1.5vw,  2.1rem);
  --step-4:  clamp(2rem,    1.5rem + 2.4vw,  2.7rem);
  --step-5:  clamp(2.3rem,  1.7rem + 3.2vw,  3.4rem);

  /* --- Layout --- */
  --rail: 20px;
  --rail-lg: 48px;
  --content-max: 1200px;
  --measure: 68ch;            /* readable paragraph width */
  --radius: 3px;              /* deliberately small */
  --radius-lg: 5px;
  --border: 1px solid var(--stone);
  --hairline: 1px solid var(--stone-soft);

  /* --- Elevation. Used sparingly: menus and overlays only. --- */
  --lift-1: 0 1px 2px rgba(15,27,60,.06);
  --lift-2: 0 8px 24px -8px rgba(15,27,60,.18);
  --lift-3: 0 20px 50px -12px rgba(15,27,60,.28);

  --ease: cubic-bezier(.2,.7,.2,1);
}

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

html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;   /* sticky header clearance for #anchors */
}

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5{
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;         /* stops orphan words in headings */
}
h1{ font-size: var(--step-5); font-weight: 700; letter-spacing: -0.025em; }
h2{ font-size: var(--step-3); }
h3{ font-size: var(--step-2); }
h4{ font-size: var(--step-1); font-family: var(--font-body); font-weight: 700; letter-spacing: -0.005em; }
h5{ font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }

p{ margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
p:last-child{ margin-bottom: 0; }

a{ color: var(--blue); text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 2px; }

strong, b{ font-weight: 700; }
small{ font-size: var(--step--1); }

img, svg, video{ max-width: 100%; display: block; }
ul, ol{ margin: 0; padding: 0; list-style: none; }
button{ font-family: inherit; color: inherit; }
table{ border-collapse: collapse; width: 100%; }

/* Prose lists — for body copy that genuinely needs bullets */
.prose ul{ list-style: disc; padding-left: 1.25em; margin-bottom: 1em; }
.prose ol{ list-style: decimal; padding-left: 1.4em; margin-bottom: 1em; }
.prose li{ margin-bottom: 0.4em; max-width: var(--measure); }

/* Visible keyboard focus, always. Two-tone so it reads on both
   paper and dark surfaces. */
:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-dark :focus-visible,
.hero-full :focus-visible{ outline-color: #fff; }

::selection{ background: var(--blue); color: #fff; }

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

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--rail);
}
@media (min-width: 720px){ .wrap{ padding: 0 32px; } }
@media (min-width: 1040px){ .wrap{ padding: 0 var(--rail-lg); } }

.wrap-narrow{ max-width: 760px; margin: 0 auto; }

.section{ padding-block: clamp(48px, 7vw, 88px); }
.section-tight{ padding-block: clamp(28px, 4vw, 48px); }

/* Alternating band — gives long pages structure without
   needing a card for every block. */
.band{ background: var(--paper-deep); border-block: var(--hairline); }
.band-surface{ background: var(--surface); border-block: var(--hairline); }
.band-ink{ background: var(--ink); color: #DCE1F0; }
.band-ink h1, .band-ink h2, .band-ink h3, .band-ink h4{ color: #fff; }
.band-ink a{ color: #fff; }

/* Horizontal rule that reads as structure, not decoration */
.rule{ border: 0; border-top: var(--border); margin-block: 32px; }
.rule-tight{ margin-block: 20px; }

/* ============================================================
   Eyebrow — small tracked label above a heading. This single
   element does most of the work of making a page read as
   official rather than promotional.
   ============================================================ */
.eyebrow{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}
.eyebrow::after{
  content: "";
  flex: 1;
  height: 1px;
  background: var(--stone);
}
.eyebrow.plain::after{ display: none; }

/* Legacy alias — .section-label was the old eyebrow */
.section-label{
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.section-head{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  margin-bottom: 28px;
}
.section-head h2{ margin-bottom: 4px; }
.section-head p{ margin: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.005em;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease),
              color .15s var(--ease), transform .12s var(--ease);
}
.btn:hover{
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: #fff;
  text-decoration: none;
}
.btn:active{ transform: translateY(1px); }

.btn.primary{
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}
.btn.primary:hover{ background: var(--amber-deep); border-color: var(--amber-deep); color: var(--ink); }

.btn.ghost{ background: transparent; color: var(--ink); }
.btn.ghost:hover{ background: var(--stone-soft); border-color: var(--ink); color: var(--ink); }

.btn.quiet{ background: transparent; border-color: var(--stone-deep); color: var(--ink-mid); font-weight: 600; }
.btn.quiet:hover{ background: var(--stone-soft); border-color: var(--ink-soft); color: var(--ink); }

.btn.danger{ background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover{ background: #8E1E17; border-color: #8E1E17; }

.btn.lg{ min-height: 54px; padding: 14px 30px; font-size: var(--step-0); }
.btn.small{ min-height: 38px; padding: 7px 15px; font-size: var(--step--1); }
.btn.block{ width: 100%; }
.btn:disabled, .btn[aria-disabled="true"]{ opacity: .5; cursor: not-allowed; transform: none; }

/* Text link that behaves like an action */
.link-action{
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: var(--step--1);
  border-bottom: 1.5px solid currentColor; padding-bottom: 1px;
}
.link-action:hover{ text-decoration: none; color: var(--blue-deep); }

/* ============================================================
   Panels — flat, hairline border, division rule on top.
   ============================================================ */
.panel{
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
}
.panel.pad-tight{ padding: 16px; }
.panel.raised{ box-shadow: var(--lift-1); }
.panel.rule-data{ border-top: 3px solid var(--div-data); }
.panel.rule-tech{ border-top: 3px solid var(--div-tech); }
.panel.rule-lab{  border-top: 3px solid var(--div-lab); }
.panel.rule-agri{ border-top: 3px solid var(--div-agri); }
.panel.rule-lang{ border-top: 3px solid var(--div-lang); }
.panel.rule-hub{  border-top: 3px solid var(--div-hub); }

/* ============================================================
   Trust strip — registration, address, credentials. A
   consulting firm's credibility markers belong in the layout,
   not buried in the footer.
   ============================================================ */
.trust-strip{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  padding: 18px 0;
  border-block: var(--hairline);
}
.trust-item{
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.trust-item b{
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Stat row — numbers with labels under them */
.stat-row{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--stone);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-row > div{
  background: var(--surface);
  padding: 20px 18px;
}
.stat-row b{
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-row span{
  display: block;
  margin-top: 6px;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* ============================================================
   Forms
   ============================================================ */
.field{ display: grid; gap: 6px; margin-bottom: 18px; }
.field label{ font-weight: 600; font-size: var(--step--1); color: var(--ink-mid); }
/* Was scoped to .field, so a hint anywhere else on a form — under
   a button or a status line — inherited nothing and rendered as
   body copy. */
.hint{ font-size: var(--step--1); color: var(--ink-faint); line-height: 1.5; }
.field .hint{ font-size: var(--step--1); color: var(--ink-faint); }

input, select, textarea{
  font-family: var(--font-body);
  font-size: var(--step-0);
  min-height: 46px;
  padding: 11px 14px;
  border: 1.5px solid var(--stone-deep);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder, textarea::placeholder{ color: var(--ink-faint); }
textarea{ min-height: 120px; resize: vertical; line-height: 1.6; }

select{
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%234A5578' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Tick boxes and radios keep their natural size — the rule
   above would otherwise blow them up to 46px. */
input[type=checkbox], input[type=radio]{
  width: 20px; height: 20px; min-height: 0;
  padding: 0; margin: 0; flex: none;
  accent-color: var(--blue);
}
input[type=file]{ padding: 9px 12px; min-height: 44px; }

input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,85,214,.14);
}
input:disabled, select:disabled, textarea:disabled{
  background: var(--stone-soft); color: var(--ink-faint); cursor: not-allowed;
}
input[aria-invalid="true"], textarea[aria-invalid="true"]{ border-color: var(--red); }

.form-status{ font-size: var(--step--1); margin: 10px 0 0; min-height: 1.4em; color: var(--ink-soft); }
.form-status.ok{ color: var(--green); font-weight: 600; }
.form-status.bad{ color: var(--red); font-weight: 600; }

/* ============================================================
   Badges — sentence case, not tracked-out caps
   ============================================================ */
.badge{
  display: inline-block;
  padding: 3px 11px;
  border-radius: 99px;
  font-size: var(--step--1);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge.ok{ background: #DCEFD5; color: #175209; }
.badge.wait{ background: #FBE7C6; color: #6F4200; }
.badge.bad{ background: #F8DAD3; color: #78200F; }
.badge.neutral{ background: var(--stone-soft); color: var(--ink-soft); }
.badge.info{ background: var(--blue-wash); color: var(--blue-deep); }

/* ============================================================
   Tables — institutional, hairline, readable on mobile
   ============================================================ */
.table-wrap{
  overflow-x: auto;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table-wrap table{ min-width: 560px; }
th, td{ padding: 12px 14px; text-align: left; vertical-align: middle; }
thead th{
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--paper-deep);
  border-bottom: var(--border);
  white-space: nowrap;
}
tbody tr + tr td{ border-top: var(--hairline); }
tbody tr:hover td{ background: #FCFBF8; }

/* ============================================================
   Utility
   ============================================================ */
.muted{ color: var(--ink-soft); }
.faint{ color: var(--ink-faint); }
.center{ text-align: center; }
.mt-0{ margin-top: 0; }
.mb-0{ margin-bottom: 0; }
.nowrap{ white-space: nowrap; }
.full-measure{ max-width: none; }
.stack > * + *{ margin-top: 16px; }
.row{ display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-end{ margin-left: auto; }

.sr-only{
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Skip link — first thing in the tab order on every page */
.skip-link{
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, -120%);
  z-index: 100;
  background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 0 0 var(--radius) var(--radius);
  font-size: var(--step--1); font-weight: 600;
}
.skip-link:focus{ transform: translate(-50%, 0); text-decoration: none; }

/* ============================================================
   Notices
   ============================================================ */
.app-only-note,
.notice{
  border: var(--border);
  border-left: 3px solid var(--div-hub);
  background: var(--surface);
  padding: 14px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.app-only-note b, .notice b{ display: block; margin-bottom: 3px; }
.app-only-note p, .notice p{ margin: 0; color: var(--ink-soft); font-size: var(--step--1); }
.notice.info{ border-left-color: var(--blue); }
.notice.warn{ border-left-color: var(--amber); }
.notice.bad{ border-left-color: var(--red); }

/* Empty state */
.empty-state{
  text-align: center;
  padding: clamp(32px, 6vw, 56px) 20px;
  border: 1px dashed var(--stone-deep);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty-state h3{ font-size: var(--step-2); margin-bottom: 6px; }
.empty-state p{ margin: 0 auto 18px; color: var(--ink-soft); max-width: 46ch; }

/* ============================================================
   Currency toggle (Naira / US dollars)
   ============================================================ */
.cur-toggle{
  display: flex;
  gap: 0;
  margin: 12px 0;
  border: 1.5px solid var(--stone-deep);
  border-radius: var(--radius);
  overflow: hidden;
}
.cur-toggle button{
  flex: 1;
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  padding: 10px 8px;
  border: 0;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 44px;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.cur-toggle button + button{ border-left: 1.5px solid var(--stone-deep); }
.cur-toggle button:hover{ background: var(--paper-deep); }
.cur-toggle button.on{ background: var(--blue-wash); color: var(--blue-deep); }

/* ============================================================
   Skeleton loading — replaces "Loading courses…" text, which
   reads as a broken page on a slow connection.
   ============================================================ */
.skeleton{
  position: relative;
  overflow: hidden;
  background: var(--stone-soft);
  border-radius: var(--radius);
  color: transparent !important;
  user-select: none;
}
.skeleton::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-100%);
  animation: sk 1.4s var(--ease) infinite;
}
@keyframes sk{ to{ transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce){ .skeleton::after{ animation: none; } }

/* ============================================================
   Print — receipts and certificates are printed for real
   ============================================================ */
@media print{
  :root{ --paper: #fff; }
  body{ background: #fff; font-size: 11pt; }
  .site-head, .ft, .skip-link, .menu-toggle, .no-print{ display: none !important; }
  .panel, .table-wrap{ border-color: #999; box-shadow: none; }
  a{ color: #000; text-decoration: none; }
  .section{ padding-block: 12px; }
}
