/* ============================================================================
   SMART SUITE — BASE / RESET / TYPOGRAPHY PRIMITIVES
   Load order (must not change): tokens.css → base.css → animations.css →
   components.css → (optional) page-specific <style> block.
   ----------------------------------------------------------------------------
   New pages should not need to modify this file. If a global element behaves
   wrongly across pages, fix it here rather than patching it per page.
   ============================================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--t-body);
  background: var(--c-void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--text-strong, var(--t-strong));
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-heading);
  margin: 0 0 var(--sp-4);
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent, var(--c-pulse-deep));
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--d-fast) var(--ease);
}

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.25rem; }

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

/* Visible, branded focus ring — never remove. */
:focus-visible {
  outline: 2px solid var(--c-pulse);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--c-signal); color: var(--c-deep); }

/* ----------------------------------------------------------------------------
   LAYOUT PRIMITIVES — use these instead of writing new wrappers.
   ---------------------------------------------------------------------------- */

/* Standard page container.
   Padding-based rather than `width: min(100% - …)` on purpose: a percentage
   width inside an auto-sized grid track resolves cyclically and blows past the
   viewport on mobile. Keep the padding pattern for any new container. */
.wrap {
  width: 100%;
  max-width: calc(var(--max-w) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Narrow container for prose-heavy pages (policy, articles, docs). */
.wrap-narrow {
  width: 100%;
  max-width: calc(var(--max-w-narrow) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Every full-width band on every page uses .section + a surface class:
   <section class="section on-light"> … </section> */
.section {
  position: relative;
  padding-block: var(--section-y);
  overflow: hidden;               /* contains animated background layers */
  isolation: isolate;             /* keeps bg layers behind content */
}

.section > .wrap,
.section > .wrap-narrow { position: relative; z-index: 2; }

/* Utility: stack children with consistent rhythm. */
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

/* Screen-reader-only text. */
.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;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-top);
  background: var(--c-signal); color: var(--c-deep);
  padding: var(--sp-3) var(--sp-4); border-radius: 0 0 var(--r-sm) 0;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; }
