/* =========================================================================
 * Brand North — Base reset + typography
 * Modern CSS reset (Andy Bell / Josh Comeau adapted) + brand typography.
 * ========================================================================= */

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

* { margin: 0; }

html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11', 'kern';
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  color: var(--bn-text-primary);
  background-color: var(--bn-bg);
  overflow-x: clip;
  text-wrap: pretty;
  transition: background-color var(--dur-base) var(--ease-in-out),
              color var(--dur-base) var(--ease-in-out);
}

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

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

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

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

p, li, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

#root, #__next, #main {
  isolation: isolate;
}

/* ---------- Type roles ---------------------------------------------------- */

.bn-display-xl,
.bn-display-l,
.bn-display-m,
.bn-h1,
.bn-h2,
.bn-h3,
.bn-h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
  text-wrap: balance;
  color: var(--bn-text-primary);
}

.bn-display-xl {
  font-size: var(--fs-display-xl);
  line-height: var(--lh-display-xl);
  letter-spacing: var(--tracking-tight);
}

.bn-display-l {
  font-size: var(--fs-display-l);
  line-height: var(--lh-display-l);
}

.bn-display-m {
  font-size: var(--fs-display-m);
  line-height: var(--lh-display-m);
}

.bn-h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
.bn-h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.bn-h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
.bn-h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: var(--fw-medium); letter-spacing: -0.005em; }

.bn-body-l {
  font-size: var(--fs-body-l);
  line-height: var(--lh-body-l);
  letter-spacing: -0.005em;
}

.bn-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.bn-body-s { font-size: var(--fs-body-s); line-height: var(--lh-body-s); }
.bn-caption {
  font-size: var(--fs-caption);
  line-height: 1.54;
  letter-spacing: 0.005em;
  font-weight: var(--fw-medium);
  color: var(--bn-text-tertiary);
}

.bn-mono,
.bn-mono-label,
.bn-mono-body,
.bn-mono-micro {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'zero', 'ss01';
}

.bn-mono-label {
  font-size: var(--fs-mono-label);
  line-height: 1.33;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--bn-text-mono-label);
}

.bn-mono-body {
  font-size: var(--fs-mono-body);
  line-height: 1.57;
  color: var(--bn-text-secondary);
}

.bn-mono-micro {
  font-size: var(--fs-mono-micro);
  line-height: 1.45;
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--bn-text-mono-label);
}

/* ---------- Italic accent — the One italic Word per Section --------------- */
.bn-italic {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.01em;
  /* small optical-tightening: italic glyphs are wider than Geist's grotesque */
  margin-right: 0.02em;
}

/* ---------- Numerals — always tabular ------------------------------------- */
.bn-num,
.bn-counter,
.bn-mono,
[data-bn-counter] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum', 'cv11';
}

/* ---------- Text helpers -------------------------------------------------- */
.bn-text-primary    { color: var(--bn-text-primary); }
.bn-text-secondary  { color: var(--bn-text-secondary); }
.bn-text-tertiary   { color: var(--bn-text-tertiary); }
.bn-text-accent     { color: var(--bn-accent); }
.bn-text-live       { color: var(--bn-live); }
.bn-text-positive   { color: var(--bn-positive); }
.bn-text-danger     { color: var(--bn-danger); }

/* ---------- Selection ----------------------------------------------------- */
::selection {
  background: var(--bn-accent);
  color: var(--bn-bone);
}

/* ---------- Focus --------------------------------------------------------- */
:focus-visible {
  outline: none;
  box-shadow: var(--bn-focus-ring);
  border-radius: var(--radius-sm);
}

/* ---------- Skip link ----------------------------------------------------- */
.bn-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--bn-ember);
  color: var(--bn-bone);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transition: top var(--dur-fast) var(--ease-out-quart);
}

.bn-skip-link:focus {
  top: 16px;
}

/* ---------- Document-level transitions ------------------------------------ */
[data-theme] {
  transition: background-color var(--dur-base) var(--ease-in-out);
}
