/*
  Robayer WealthLab — Base
  Reset + element-level defaults + accessibility foundation.
  Depends on: tokens.css (must be loaded first)
*/

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  color: var(--color-text-heading);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-display); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--text-h4);
}

p {
  max-width: 75ch; /* enforce the 65–75 character measure from the type system */
}

/* Eyebrow / label text pattern — applied via .eyebrow utility class in components.css */

/* ---------- Numeric / financial data ---------- */
.numeric,
[data-numeric] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-mono);
}

/* ---------- Accessibility: focus ---------- */
:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- Accessibility: skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: var(--z-skip-link);
  padding: var(--space-2) var(--space-4);
  background: var(--color-ink-navy);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: var(--text-small);
  transition: top var(--duration-base) var(--ease-standard);
}

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

/* ---------- Accessibility: visually hidden (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;
}

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

/* ---------- Selection ---------- */
::selection {
  background-color: var(--color-sika-gold);
  color: var(--color-ink-navy);
}
