/* ============================================================
   Farmers Imports — Reset, typography scale, layout primitives
   Reference: design-system.md §1, §6, §12
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  /* iOS inflates body copy in landscape unless this is pinned, which breaks
     every measure set in ch and every clamp() tuned on the design. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg-base);
  color: var(--fg-1);
  font-family: var(--fb);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: rgba(28, 66, 53, .12); }
button { -webkit-tap-highlight-color: rgba(28, 66, 53, .12); }
button { font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--li); color: var(--vo); }

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

/* ── FOCUS ──────────────────────────────────────────
   design-system.md §14 lists missing focus states as an
   accessibility blocker. Resolved here, globally.
   ─────────────────────────────────────────────────── */
:focus { outline: none; }

:focus-visible {
  outline: 2px solid var(--fi-teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.on-dark :focus-visible,
.phero :focus-visible,
.footer :focus-visible {
  outline-color: var(--li);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--bg-dark);
  color: var(--fg-on-dark-1);
  font-family: var(--fd);
  font-weight: 600;
  font-size: .9rem;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-card-s) 0;
}
.skip-link:focus { left: 0; }

/* Available to screen readers, removed from the visual layout. */
.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;
}

/* ── TYPOGRAPHY SCALE ───────────────────────────────
   design-system.md §1. Body is ALWAYS Outfit 300.
   ─────────────────────────────────────────────────── */

.t-hero {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  line-height: 1; letter-spacing: -.025em;
}

.t-product {
  font-family: var(--fd); font-weight: 800;
  font-size: clamp(4.5rem, 9vw, 8rem);
  line-height: .9; letter-spacing: -.04em;
}

.t-section {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05; letter-spacing: -.015em;
}

/* Self-contained, not a modifier — it is used on its own throughout. */
.t-section--sm {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.04; letter-spacing: -.02em;
}

.t-cta {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1; letter-spacing: -.025em;
}

/* Emphasis inside headings is NOT italic — it is an accent color.
   design-system.md §1. Must list every heading class, including modifiers. */
.t-hero em, .t-product em, .t-section em, .t-section--sm em, .t-cta em {
  font-style: normal;
  color: var(--vm);
}
.on-dark .t-hero em,
.on-dark .t-section em,
.on-dark .t-section--sm em,
.on-dark .t-cta em { color: var(--li); }

.t-lede  { font-size: 1.02rem; line-height: 1.7;  color: var(--fg-3); }
.t-body  { font-size: 1rem;    line-height: 1.75; color: var(--fg-3); }
.t-small { font-size: .89rem;  line-height: 1.65; color: var(--fg-3); }

.t-meta {
  font-family: var(--fb); font-weight: 500; font-size: 11.5px;
  letter-spacing: .04em; color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}

/* ── LAYOUT ─────────────────────────────────────────── */

.wrap   { max-width: var(--wrap);   margin: 0 auto; padding: 0 var(--pad-x); }
.wrap-l { max-width: var(--wrap-l); margin: 0 auto; padding: 0 var(--pad-x); }
.wrap-s { max-width: var(--wrap-s); margin: 0 auto; padding: 0 var(--pad-x); }

.section    { padding: 120px 0 140px; }
.section--c { padding: 100px 0 80px; }

@media (max-width: 720px) {
  .section    { padding: 60px 0 70px; }
  .section--c { padding: 50px 0 40px; }
}

/* ── MOBILE TYPE ────────────────────────────────────────────
   The scale above is tuned for a 60–70ch desktop measure. On a
   ~320px column the same leading turns every paragraph into a
   loose grey slab, so the running text tightens up. Sizes are
   untouched — only the leading and the display letter-spacing.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  body     { line-height: 1.65; }
  .t-lede  { line-height: 1.6; }
  .t-body  { line-height: 1.62; }
  .t-small { line-height: 1.55; }
  .t-meta  { font-size: 11.5px; letter-spacing: .06em; }

  /* Big display type needs less negative tracking at small optical
     sizes or the letterforms start to collide. */
  .t-hero, .t-cta { letter-spacing: -.015em; }
  .t-product      { font-size: clamp(3rem, 13vw, 4.5rem); letter-spacing: -.03em; }

  .section    { padding: 52px 0 58px; }
  .section--c { padding: 42px 0 34px; }
}

/* Dark surfaces flip every text token at once. */
.on-dark {
  background: var(--bg-dark);
  color: var(--fg-on-dark-1);
}
.on-dark .t-lede,
.on-dark .t-body,
.on-dark .t-small { color: var(--fg-on-dark-2); }
.on-dark .t-meta  { color: var(--fg-on-dark-3); }

.u-tint { background: var(--bg-tint); }
.u-sage { background: var(--bg-sage); color: var(--vo); }

/* ── LENIS SMOOTH SCROLL ────────────────────────────
   Required styles for the Lenis smooth-scroll runtime
   (loaded from CDN + initialised in scripts/layout.js).
   ─────────────────────────────────────────────────── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }
