/* Aleota Finance: base styles (reset, typography, layout primitives).
   Requires tokens/tokens.css to be loaded first. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

.display { font-size: var(--text-display); font-weight: var(--font-weight-extrabold); }
h1, .h1 { font-size: var(--text-h1); }
h2, .h2 { font-size: var(--text-h2); }
h3, .h3 { font-size: var(--text-h3); line-height: var(--leading-snug); }

p { text-wrap: pretty; }

.lead { font-size: var(--text-lg); color: var(--color-text-secondary); }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }

/* Numbers that line up (rates, repayments, calculator output) */
.num { font-variant-numeric: tabular-nums; }

/* Small uppercase label above headings */
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent-text);
}

/* Highlighted word inside a headline */
.mark {
  background: linear-gradient(transparent 62%, var(--color-accent-soft) 62%);
  padding: 0 0.1em;
}
.on-dark .mark {
  background: none;
  color: var(--color-highlight-on-dark);
  padding: 0;
}

a { color: inherit; text-underline-offset: 3px; }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-dark :focus-visible { outline-color: var(--color-highlight-on-dark); }

/* ---------- Layout primitives ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-pad); }
.section--alt { background: var(--color-bg-alt); }
.section--dark,
.on-dark {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}
.on-dark .muted, .on-dark .lead { color: var(--color-text-muted-on-dark); }
.on-dark .eyebrow { color: var(--color-highlight-on-dark); }

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-7);
  display: grid;
  gap: var(--space-3);
}
.section-head--center { margin-inline: auto; text-align: center; }

.stack { display: grid; gap: var(--space-4); }

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Preview pages (foundations/ and components/) */
.ds-preview {
  padding: var(--space-6) var(--gutter);
  display: grid;
  gap: var(--space-6);
}
.ds-preview > header { display: grid; gap: var(--space-2); }
.ds-label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.ds-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
