/* ==========================================================================
   British Built Power — Base
   Reset, typography defaults and layout primitives. Consumes tokens.css.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

/* Lenis (index.html's smooth-scroll block) drives the scrolling itself
   and the CSS smooth scroll would fight it: Lenis's own recommended
   rules, applied only while it runs (it puts these classes on <html>) */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

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

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

/* --------------------------------------------------------------------
   Type — all caps feels strong: display levels are capitalised
   -------------------------------------------------------------------- */

h1,
h2,
h3,
.display-xl,
.display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-text);
  text-wrap: balance;
}

.display-xl { font-size: clamp(2.5rem, 6vw, var(--text-display-xl)); }
.display    { font-size: clamp(2rem, 4.5vw, var(--text-display)); }
h1          { font-size: clamp(1.75rem, 4vw, var(--text-h1)); }
h2          { font-size: clamp(1.5rem, 3vw, var(--text-h2)); }
h3          { font-size: var(--text-h3); font-weight: var(--weight-bold); }

p {
  max-width: 65ch;
}

.lead {
  font-size: var(--text-body-lg);
  color: var(--color-text-muted);
}

.small {
  font-size: var(--text-small);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-700);
}

::selection {
  background: var(--gold-300);
  color: var(--ink-700);
}

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

/* --------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------- */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.section {
  padding-block: var(--section-pad);
}

/* Dark + brand surfaces: flip text colours in one move */
.surface-dark,
.surface-teal,
.surface-oxblood {
  color: var(--color-text-on-dark);
}

.surface-dark    { background: var(--grad-ink); }
.surface-teal    { background: var(--grad-teal); }
.surface-oxblood { background: var(--grad-oxblood); }
.surface-gold    { background: var(--grad-gold); color: var(--ink-700); }

.surface-dark :is(h1, h2, h3, .display, .display-xl),
.surface-teal :is(h1, h2, h3, .display, .display-xl),
.surface-oxblood :is(h1, h2, h3, .display, .display-xl) {
  color: var(--color-text-on-dark);
}

.surface-dark .lead,
.surface-teal .lead,
.surface-oxblood .lead {
  color: rgba(245, 242, 236, 0.78);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
