/**
 * CarFin — Base Styles
 * Reset, typography defaults, body, links, headings.
 * No component CSS here — see components.css.
 */

/* ============================================================
   RESET
   ============================================================ */

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

/* Ensure [hidden] always wins over component display rules (e.g. .btn { display: inline-flex }) */
[hidden] {
  display: none !important;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY — HEADINGS
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--navy);
}

h1 {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
}

h2 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl));
  font-weight: var(--weight-semibold);
}

h3 {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-xl));
  font-weight: var(--weight-semibold);
}

h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

h5, h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   TYPOGRAPHY — BODY & INLINE
   ============================================================ */

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

p + p {
  margin-top: 1.25em;
}

strong {
  font-weight: var(--weight-semibold);
}

small {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   LINKS
   ============================================================ */

a.text-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition-fast);
}

a.text-link:hover {
  text-decoration-color: currentColor;
}

/* ============================================================
   SECTION LABEL (sits above H2s)
   ============================================================ */

.section-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

/* On dark (navy) sections */
.section--dark .section-label {
  color: var(--sky-blue);
}

/* ============================================================
   PROSE WRAPPER (long-form text blocks)
   ============================================================ */

.prose {
  max-width: 660px;
  line-height: var(--leading-loose);
}

.prose--light {
  color: rgba(255, 255, 255, 0.85);
}

.prose h2,
.prose h3 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose p {
  margin-bottom: 1em;
}

.prose ul,
.prose ol {
  list-style: initial;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose li {
  margin-bottom: 0.4em;
}

/* ============================================================
   ACCESSIBILITY UTILITIES
   ============================================================ */

.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 {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--color-primary);
  color: var(--white);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  z-index: var(--z-modal);
  transition: top var(--transition-fast);
}

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

/* ============================================================
   FOCUS STYLES
   ============================================================ */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   DARK SECTION OVERRIDES
   ============================================================ */

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--white);
}

.section--dark p,
.section--dark li {
  color: rgba(255, 255, 255, 0.8);
}
