/* ==========================================================================
   EXPRESSCREDIT — DESIGN SYSTEM
   02. RESET, BASE & TYPOGRAPHY
   ========================================================================== */

*, *::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: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink-primary);
  margin: 0 0 var(--sp-3);
  letter-spacing: var(--tracking-tight);
}
h1, .t-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); }
h2, .t-h2      { font-size: var(--fs-h2);      line-height: var(--lh-h2);      font-weight: var(--fw-semibold); }
h3, .t-h3      { font-size: var(--fs-h3);      line-height: var(--lh-h3);      font-weight: var(--fw-semibold); }
h4, .t-h4      { font-size: var(--fs-h4);      line-height: var(--lh-h4);      font-weight: var(--fw-semibold); }

.t-hero {
  font-family: var(--font-display);
  font-size: var(--fs-display); line-height: var(--lh-display);
  font-weight: var(--fw-bold); letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--sp-4);
}
@media (min-width: 1024px) {
  .t-hero { font-size: var(--fs-hero); line-height: var(--lh-hero); }
}

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

.t-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); }
.t-body    { font-size: var(--fs-body);    line-height: var(--lh-body); }
.t-small   { font-size: var(--fs-small);   line-height: var(--lh-small); }

.t-lead {
  font-size: var(--fs-body-lg); line-height: 1.65;
  color: var(--ink-secondary);
}
@media (min-width: 768px) { .t-lead { font-size: 1.0625rem; } }

.t-eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small); line-height: var(--lh-small);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-brand);
  margin: 0 0 var(--sp-3);
}

.t-muted    { color: var(--ink-muted); }
.t-secondary{ color: var(--ink-secondary); }
.t-brand    { color: var(--ink-brand); }
.t-semibold { font-weight: var(--fw-semibold); }
.t-bold     { font-weight: var(--fw-bold); }
.t-center   { text-align: center; }
.t-right    { text-align: right; }
.t-nowrap   { white-space: nowrap; }

/* Money. Tabular figures so columns of rands line up. */
.money {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: var(--tracking-tight);
  color: var(--ink-primary);
}
.money--xl { font-size: var(--fs-money-xl); line-height: var(--lh-money-xl); font-weight: var(--fw-bold); }
.money--lg { font-size: var(--fs-money-lg); line-height: var(--lh-money-lg); font-weight: var(--fw-bold); }
.money--md { font-size: var(--fs-money-md); line-height: var(--lh-money-md); }
.money--sm { font-size: var(--fs-body-lg);  line-height: var(--lh-body-lg); }

a {
  color: var(--ink-brand);
  text-decoration-color: color-mix(in srgb, var(--ink-brand) 40%, transparent);
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--teal-800); text-decoration-color: currentColor; }

/* ---------------------------------------------------------------------
   FOCUS — visible, consistent, never removed
   --------------------------------------------------------------------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.on-dark :focus-visible { outline-color: var(--teal-200); }

/* Skip link */
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  z-index: var(--z-toast);
  background: var(--navy-700); color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-btn); font-weight: var(--fw-semibold);
  text-decoration: none;
}
.skip-link:focus { top: var(--sp-4); color: var(--white); }

/* Screen-reader only */
.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: 0;
}

/* ---------------------------------------------------------------------
   LAYOUT PRIMITIVES
   --------------------------------------------------------------------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--text { max-width: var(--container-text); }

.section       { padding-block: var(--sp-12); }
.section--lg   { padding-block: var(--sp-16); }
.section--tight{ padding-block: var(--sp-8); }
@media (min-width: 768px) {
  .section     { padding-block: var(--sp-16); }
  .section--lg { padding-block: var(--sp-24); }
}

.section--alt     { background: var(--bg-surface-alt); }
.section--surface { background: var(--bg-surface); }
.section--navy    { background: var(--navy-700); color: var(--ink-inverse); }
.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4 { color: var(--ink-inverse); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid { display: grid; gap: var(--sp-5); }
@media (min-width: 640px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); }
                             .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.section-head { max-width: 680px; margin-bottom: var(--sp-8); }
.section-head--center { margin-inline: auto; text-align: center; }

/* ---------------------------------------------------------------------
   NALA GEOMETRY — the abstracted logo arc, used as background texture.
   Derived from the swoosh in the N mark. Never literal, never "African
   clip art": these are quiet architectural arcs and a fine grid.
   --------------------------------------------------------------------- */
.has-arc { position: relative; overflow: hidden; isolation: isolate; }
.has-arc > * { position: relative; z-index: 1; }

.arc-field::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 90% at 88% -20%, rgba(0,140,168,.16) 0%, rgba(0,140,168,0) 60%),
    radial-gradient(100% 80% at -10% 110%, rgba(53,180,203,.14) 0%, rgba(53,180,203,0) 62%);
  pointer-events: none;
}

/* Fine geometric mesh — 1px lines at very low opacity, textile-inspired */
.mesh::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(8,35,77,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(8,35,77,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 0%, #000 0%, transparent 78%);
          mask-image: radial-gradient(80% 70% at 50% 0%, #000 0%, transparent 78%);
}
.section--navy .mesh::after {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
}

.divider {
  height: 1px; border: 0; margin: 0;
  background: var(--border-subtle);
}
.divider--arc {
  height: 4px; border: 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--teal-500), var(--green-300));
  width: 56px;
}
