/* ==========================================================================
   Nexsage base — reset, typography, layout primitives, accessibility
   ========================================================================== */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--nx-font-sans);
  font-size: var(--nx-body);
  line-height: var(--nx-lh-body);
  color: var(--nx-ink);
  background: var(--nx-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; padding: 0; }
a { color: var(--nx-blue); text-decoration: none; transition: color var(--nx-dur-fast) var(--nx-ease); }
a:hover { color: var(--nx-blue-700); }

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-sans);
  color: var(--nx-navy-ink);
  line-height: var(--nx-lh-tight);
  font-weight: var(--nx-fw-x);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: var(--nx-h1); }
h2 { font-size: var(--nx-h2); font-weight: var(--nx-fw-bold); }
h3 { font-size: var(--nx-h3); font-weight: var(--nx-fw-bold); letter-spacing: -0.01em; }
h4 { font-size: var(--nx-h4); font-weight: var(--nx-fw-bold); letter-spacing: -0.01em; }
p { max-width: 68ch; }

strong, b { font-weight: var(--nx-fw-bold); }
code, pre, kbd { font-family: var(--nx-font-mono); font-size: 0.92em; }

/* ---- Layout primitives ---- */
.nx-container { width: 100%; max-width: var(--nx-container); margin-inline: auto; padding-inline: var(--nx-gutter); }
.nx-container--wide { max-width: var(--nx-container-wide); }
.nx-container--narrow { max-width: 760px; }
.nx-section { padding-block: var(--nx-section-y); }
.nx-section--dark { background: var(--nx-grad-dark); color: var(--nx-on-dark); }
.nx-section--mist { background: var(--nx-mist); }
.nx-section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.nx-section--dark :is(h1,h2,h3,h4) { color: var(--nx-white); }
.nx-section--dark p { color: var(--nx-on-dark); }
.nx-section--dark a { color: var(--nx-teal); }

.nx-grid { display: grid; gap: var(--nx-s-4); }
.nx-grid--2 { grid-template-columns: repeat(2, 1fr); }
.nx-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nx-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .nx-grid--3, .nx-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .nx-grid--2, .nx-grid--3, .nx-grid--4 { grid-template-columns: 1fr; } }

.nx-flow > * + * { margin-top: var(--nx-s-3); }
.nx-stack { display: flex; flex-direction: column; gap: var(--nx-s-3); }
.nx-cluster { display: flex; flex-wrap: wrap; gap: var(--nx-s-3); align-items: center; }

/* ---- Accessibility ---- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 3px solid var(--nx-blue);
  outline-offset: 2px;
  border-radius: var(--nx-r-sm);
}
.nx-skip-link {
  position: absolute; left: -999px; top: 0; z-index: var(--nx-z-popup);
  background: var(--nx-blue); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--nx-r-sm) 0;
}
.nx-skip-link:focus { left: 0; color: #fff; }
.screen-reader-text, .nx-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Utility ---- */
.nx-eyebrow {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-eyebrow);
  font-weight: var(--nx-fw-med);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nx-blue);
  display: inline-block;
}
.nx-section--dark .nx-eyebrow { color: var(--nx-teal); }
.nx-lead { font-size: 1.18rem; color: var(--nx-slate); line-height: 1.55; }
.nx-section--dark .nx-lead { color: var(--nx-on-dark); }
.nx-text-center { text-align: center; }
.nx-mt-0 { margin-top: 0; } .nx-mb-0 { margin-bottom: 0; }
.nx-accent { color: var(--nx-teal); }
.nx-accent-blue { color: var(--nx-blue); }
.nx-hidden { display: none !important; }
.nx-gradient-text {
  background: var(--nx-grad-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
