/* ==========================================================================
   Sufficiently Advanced Solutions — base
   Reset, element defaults, typography, accessibility.
   Depends on brand/tokens.css. Never hard-code a colour or size here that
   tokens.css already names.

   NOTE ON THEMING: this site does not follow the OS colour scheme. Cream and
   black are both brand surfaces chosen per section (§09) — cream is the
   approachable customer-facing ground, black is a deliberate branded moment.
   Auto-inverting would flip that meaning. Sections opt into black explicitly
   via .band--ink; there is no prefers-color-scheme block anywhere.
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings carry the brand's weight; tracking tightens as size grows. */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  text-wrap: balance;
}
h1 { font-size: var(--step-6); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h2 { font-size: var(--step-4); letter-spacing: var(--ls-display); }
h3 { font-size: var(--step-2); letter-spacing: -0.01em; }
h4 { font-size: var(--step-1); letter-spacing: -0.005em; }

p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--accent-text); }

/* On black, the darkened gold used for small type on cream is too dim —
   the full accent already clears AA against the ink ground at 8.8:1. */
.band--ink a:hover { color: var(--accent); }

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

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

hr {
  border: 0;
  border-top: var(--border-hair) solid var(--line);
  margin: 0;
}

::selection { background: var(--accent); color: var(--accent-contrast); }

/* One visible focus treatment everywhere. Gold reads on cream and on black. */
:focus-visible {
  outline: 3px solid var(--sas-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Keyboard users land here first; it stays hidden until focused. */
.skip-link {
  position: absolute;
  top: 0; left: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: var(--fw-bold);
  text-decoration: none;
  transform: translateY(-110%);
  transition: transform var(--dur-base) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); color: var(--accent-contrast); }

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