/* ==========================================================================
   base.css — reset, typography, body, links
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  padding: 0;
  background: var(--bf-paper);
  color: var(--bf-ink);
  font-family: var(--bf-font-ui);
  font-size: var(--bf-size-body);
  line-height: var(--bf-lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* Prevents horizontal scrolling */
  min-height: 100vh;
}

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

/* Headings — Crimson Pro, slight tuning */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--bf-font-head);
  font-weight: 400;
  line-height: var(--bf-lh-tight);
  color: var(--bf-ink);
  margin: 0 0 var(--bf-s3);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--bf-size-h1); }
h2 { font-size: var(--bf-size-h2); line-height: var(--bf-lh-snug); }
h3 { font-size: var(--bf-size-h3); line-height: var(--bf-lh-snug); }

/* Italic headings — signature display treatment */
h1 em, h1 i,
h2 em, h2 i,
h3 em, h3 i,
.is-italic {
  font-style: italic;
  font-weight: 400;
}

p {
  font-family: var(--bf-font-head);
  margin: 0 0 var(--bf-s3);
  max-width: 65ch;
}

/* Lede paragraph — mirrors .hero__sub so body intros feel consistent
   across sections. Responsive 18px mobile → 22px desktop. */
p.lede,
.lede {
  font-family: var(--bf-font-head);
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--bf-ink-soft);
  margin: 0 0 var(--bf-s4);
  max-width: 44ch;
}

@media (min-width: 720px) {
  p.lede,
  .lede { font-size: 1.375rem; }
}

a {
  color: var(--bf-teal);
  text-decoration: none;
  transition: color var(--bf-dur-fast) var(--bf-ease);
}

a:hover { color: var(--bf-terra); }

hr {
  border: 0;
  border-top: var(--bf-line-soft);
  margin: var(--bf-s5) 0;
}

small, .t-small { font-size: var(--bf-size-small); }
.t-micro { font-size: var(--bf-size-micro); }

/* Eyebrow — micro, uppercase, tracked */
.eyebrow {
  font-family: var(--bf-font-ui);
  font-size: var(--bf-size-micro);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bf-ink-mute);
  font-weight: 500;
  margin: 0 0 var(--bf-s2);
  display: inline-block;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--bf-teal);
  outline-offset: 3px;
  border-radius: var(--bf-r-sm);
}

::selection {
  background: var(--bf-honey);
  color: var(--bf-ink);
}

/* Layout primitives */
.container {
  width: 100%;
  max-width: var(--bf-container);
  margin: 0 auto;
  padding: 0 var(--bf-s3);
}

.container--narrow { max-width: var(--bf-container-narrow); }

.section {
  padding: var(--bf-s6) 0;
}

.section--tight { padding: var(--bf-s5) 0; }
.section--loose { padding: var(--bf-s7) 0; }

@media (min-width: 720px) {
  .container { padding: 0 var(--bf-s4); }
  :root {
    --bf-size-display: 4.25rem;
    --bf-size-h1: 3rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --bf-size-display: 5rem;
    --bf-size-h1: 3.5rem;
    --bf-size-h2: 2.25rem;
  }
}

/* Utility — 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;
}
