/*
 * Stylesheet entrypoint. Order matters:
 *   1. fonts    — @font-face must register before anything references the family
 *   2. tokens   — design tokens become available to every downstream rule
 *   3. reset    — element-level normalisation, references tokens
 *   4. bricks   — wall + brick layout system (sections downstream may override)
 *   5. buttons  — chamfered button primitive
 *   6. chrome   — frame, logo, nav (sit above all sections)
 *   7. sections — one file per partial, in render order
 *
 * Per the CSS spec, every @import statement must precede any other rule
 * (apart from @charset / @layer). Keep all the imports stacked at the top of
 * this file — anything below the first non-import rule is silently dropped
 * by the browser, which previously broke the entire chrome and section pass.
 */

@import "fonts.css";
@import "tokens.css";
@import "reset.css";

/* Wall + brick layout system. Imported before chrome and sections so any
   per-section CSS file can override brick defaults if needed. */
@import "bricks.css";

@import "buttons.css";

/* Chrome */
@import "frame.css";
@import "logo.css";
@import "nav.css";

/* Sections — render order */
@import "hero.css";
@import "stats-wall.css";
@import "services.css";
@import "about.css";
@import "process.css";
@import "what-is-aba.css";
@import "insurance.css";
@import "careers.css";
@import "apply-form.css";
@import "team.css";
@import "service-area.css";
@import "contact.css";
@import "footer.css";

/* --- Document base ------------------------------------------------------- *
 *
 * The body owns the page surface: it paints --stone (which the .page--*
 * presets in frame.css rebind per audience) and hosts the page-level noise
 * on a fixed pseudo so the grain stays put as the user scrolls. min-height
 * 100vh ensures short pages still cover the viewport. Walls are kept
 * transparent so this textured surface shows through continuously across
 * walls and the chrome between them.                                          */

html {
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--leading-normal);
  color: var(--site-fg, var(--fg-page));
  background: var(--stone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--stone);
  color: var(--site-fg, var(--fg-page));
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
}

/* Page grain — a single fixed pseudo on the body. Multiply on light fills
   darkens; lighter fills under a multiply tile read as paper grain. The
   paper presets dial --noise-page-opacity down so cream pages stay airy. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--noise-tile);
  background-size: var(--noise-page-scale);
  mix-blend-mode: var(--noise-page-blend);
  opacity: var(--noise-page-opacity);
}

/* Real content sits above the grain. Frame chrome (z-index: var(--z-frame))
   and nav (--z-nav) are already above this zero-index pseudo. */
body > * {
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--red);
  color: var(--paper);
}

/* Container helper used by sections that opt into a centred max-width. */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(var(--space-md), 5vw, var(--space-2xl));
}

.main {
  display: block;
}
