/* ============================================================================
   AMANAH — Base styles

   Fonts are self-hosted (assets/fonts/) rather than pulled from Google
   Fonts — this is a "private by default" product, and a CDN font request
   sends every visitor's IP to Google on every page load regardless of
   whether they ever touch a Google service otherwise. OFL license files
   are alongside the font files.
   ============================================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-italic.ttf') format('truetype');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../assets/fonts/ibmplexsans.ttf') format('truetype');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibmplexmono-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibmplexmono-medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
  color: var(--ink);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 600; }
h4 { font-size: var(--text-md); font-weight: 600; }

p {
  margin: 0 0 var(--space-4);
  color: var(--ink-soft);
}

a {
  color: var(--emerald);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
}

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

/* ---- Ledger numerals ----------------------------------------------------
   Any element carrying this class renders amounts the way a paper ledger
   would: tabular figures, right-aligned, monospaced. */
.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-feature-settings: "tnum" 1;
}

/* ---- Focus -----------------------------------------------------------
   Always visible — never suppressed, only restyled. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Screen-reader only ------------------------------------------------- */
.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 ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-3);
  /* --charcoal-deep/--ink-on-dark (fixed across both themes), not
     --ink/--ink-on-dark — same bug as the toast in components.css: --ink
     flips to near-white in dark mode, which would make this render as
     white-on-white right when a keyboard user tabs to it. */
  background: var(--charcoal-deep);
  color: var(--ink-on-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--duration-base) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-3);
}
