/* ==========================================================================
   BASE — reset, elements, layout primitives, background field
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Offset anchor targets so neither sticky bar covers a heading. */
  scroll-padding-top: calc(var(--h-utilitybar) + var(--h-header) + var(--s-5));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100svh;
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text-soft);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

/* An inline SVG with no width/height fills its container, which turns a small
   icon inside a paragraph into a full-width graphic. Default icons to the
   surrounding text size; components (buttons, stars, nav) override this with
   their own class-based rules, which load later and win on specificity. */
:is(p, li, span, a, td, th, figcaption) > svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  flex: none;
}

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

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

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

/* ---- Headings ------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--c-text);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }

p { text-wrap: pretty; }

/* Consecutive paragraphs inside prose blocks need air between them. The
   global `* { margin: 0 }` reset removes it, so it is restored explicitly
   rather than sprinkled as inline styles. */
.split__content p + p,
.modal__body p + p,
.pagehead p + p,
.prose p + p { margin-top: var(--s-4); }

/* ---- Links --------------------------------------------------------------- */
a { color: var(--c-amber-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--c-text); }

/* ---- Focus: visible, consistent, never removed --------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ---- Selection ----------------------------------------------------------- */
::selection { background: var(--a-amber-35); color: var(--c-text); }

/* ---- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--s-3) var(--s-5);
  background: var(--c-amber);
  color: var(--c-on-amber);
  font-weight: 700;
  border-radius: var(--r-md);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { top: var(--s-4); }

/* ---- Screen-reader only -------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   LAYOUT PRIMITIVES
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }

.section__head {
  max-width: var(--measure);
  margin-bottom: var(--s-7);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

/* Eyebrow — small technical label above a heading */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--c-amber-text);
  margin-bottom: var(--s-4);
}

/* The small machined tick that precedes an eyebrow */
.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.lead {
  font-size: var(--fs-lead);
  color: var(--c-text-soft);
  max-width: var(--measure);
}

/* ==========================================================================
   BACKGROUND FIELD
   Layered planes: noise texture -> blueprint grid -> radial shop light.
   All decorative, all pointer-events:none, all behind content.
   ========================================================================== */

.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Blueprint grid — hairline CAD space */
.bg-field__grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(to right,  var(--a-ink-04) 1px, transparent 1px),
    linear-gradient(to bottom, var(--a-ink-04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
}

/* Radial "shop light" pools */
.bg-field__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--field-glow-opacity);
}
.bg-field__glow--amber {
  width: 60vw; height: 60vw;
  max-width: 780px; max-height: 780px;
  top: -18vw; right: -12vw;
  background: radial-gradient(circle, var(--field-glow-amber) 0%, transparent 68%);
}
.bg-field__glow--cyan {
  width: 46vw; height: 46vw;
  max-width: 620px; max-height: 620px;
  bottom: 6vh; left: -14vw;
  background: radial-gradient(circle, var(--field-glow-cyan) 0%, transparent 70%);
}

/* Brushed-metal grain — stops a large flat field from looking dead */
.bg-field__noise {
  position: absolute;
  inset: 0;
  opacity: var(--field-noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Content sits above the field */
.page-shell { position: relative; z-index: var(--z-base); }

/* ==========================================================================
   HAIRLINE RULE — the recurring "machined edge" divider
   ========================================================================== */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--a-ink-12) 18%, var(--a-ink-12) 82%, transparent);
}

/* ==========================================================================
   SCROLL PROGRESS
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  z-index: var(--z-sticky);
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--c-amber-deep), var(--c-amber), var(--c-cyan));
  pointer-events: none;
}
