/* Service Air base layer: reset, element defaults, typography and layout primitives.
 * Depends on tokens.css. Component classes live in components.css.
 */

/* ------------------------------------------------------------------------- reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sa-surface);
  color: var(--sa-text);
  font-family: var(--sa-font-sans);
  font-size: var(--sa-text-base);
  line-height: var(--sa-leading-normal);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  margin: 0;
  padding: 0;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* -------------------------------------------------------------------- typography */

h1,
h2,
h3,
h4 {
  font-weight: var(--sa-weight-bold);
  line-height: var(--sa-leading-tight);
  letter-spacing: var(--sa-tracking-heading);
  text-wrap: balance;
  color: var(--sa-text);
}

h1 {
  font-size: var(--sa-text-3xl);
  letter-spacing: var(--sa-tracking-display);
}

h2 {
  font-size: var(--sa-text-2xl);
}

h3 {
  font-size: var(--sa-text-xl);
  font-weight: var(--sa-weight-semibold);
  line-height: var(--sa-leading-snug);
}

h4 {
  font-size: var(--sa-text-lg);
  font-weight: var(--sa-weight-semibold);
  line-height: var(--sa-leading-snug);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--sa-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--sa-teal-800);
}

strong,
b {
  font-weight: var(--sa-weight-semibold);
}

small {
  font-size: var(--sa-text-sm);
}

code,
kbd,
samp {
  font-family: var(--sa-font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--sa-border);
  margin: var(--sa-space-6) 0;
}

/* Numbers are the subject matter here - specifications, prices, registrations, dates.
   Tabular figures keep them in vertical register the way an instrument readout does. */
.sa-numeric,
table,
time,
output,
.sa-price,
.sa-spec-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ------------------------------------------------------------------------- focus */

/* Keyboard users get a visible ring everywhere. :focus-visible keeps it off mouse
   clicks, but the ring is never removed outright. */
:focus-visible {
  outline: 2px solid var(--sa-teal-700);
  outline-offset: 2px;
  border-radius: var(--sa-radius-sm);
}

/* Programmatic focus targets: the <main> landmark that the skip link jumps to, and the
   heading that FocusOnNavigate moves focus to after a navigation. Neither is reachable with
   Tab, so a ring on them tells a sighted user nothing and reads as a rendering fault. Screen
   reader users still get what matters, which is that focus moved there. */
main[tabindex="-1"]:focus,
main[tabindex="-1"]:focus-visible,
h1[tabindex="-1"]:focus,
h1[tabindex="-1"]:focus-visible {
  outline: none;
}

.sa-surface-inverse :focus-visible,
.sa-footer :focus-visible,
.sa-header--transparent :focus-visible {
  outline-color: var(--sa-teal-300);
}

/* Skip link: visually hidden until focused, then pinned to the top-left. */
.sa-skip-link {
  position: absolute;
  left: var(--sa-space-4);
  top: var(--sa-space-4);
  z-index: var(--sa-z-modal);
  transform: translateY(calc(-100% - var(--sa-space-6)));
  background: var(--sa-surface);
  color: var(--sa-accent);
  padding: var(--sa-space-3) var(--sa-space-4);
  border-radius: var(--sa-radius-md);
  box-shadow: var(--sa-shadow-md);
  font-weight: var(--sa-weight-semibold);
  text-decoration: none;
  transition: transform var(--sa-duration) var(--sa-ease);
}

.sa-skip-link:focus {
  transform: translateY(0);
}

.sa-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------------ layout */

.sa-container {
  width: 100%;
  max-width: var(--sa-container);
  margin-inline: auto;
  padding-inline: var(--sa-gutter);
}

.sa-container--wide {
  max-width: var(--sa-container-wide);
}

.sa-container--prose {
  max-width: calc(var(--sa-measure) + 2 * var(--sa-gutter));
}

.sa-section {
  padding-block: var(--sa-section-y);
}

.sa-section--lg {
  padding-block: var(--sa-section-y-lg);
}

.sa-section--sunken {
  background: var(--sa-surface-sunken);
}

.sa-section--inverse {
  background: var(--sa-surface-inverse);
  color: var(--sa-text-inverse);
}

.sa-section--inverse h1,
.sa-section--inverse h2,
.sa-section--inverse h3,
.sa-section--inverse h4 {
  color: var(--sa-text-inverse);
}

.sa-section--inverse a {
  color: var(--sa-accent-on-dark);
}

.sa-prose {
  max-width: var(--sa-measure);
  font-size: var(--sa-text-md);
  color: var(--sa-text-secondary);
}

.sa-prose > * + * {
  margin-top: var(--sa-space-4);
}

.sa-prose h2,
.sa-prose h3 {
  margin-top: var(--sa-space-6);
  color: var(--sa-text);
}

.sa-prose ul,
.sa-prose ol {
  padding-left: 1.25em;
}

.sa-prose li + li {
  margin-top: var(--sa-space-2);
}

.sa-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sa-space-4);
}

.sa-stack--tight {
  gap: var(--sa-space-2);
}

.sa-stack--loose {
  gap: var(--sa-space-6);
}

.sa-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sa-space-3);
}

.sa-grid {
  display: grid;
  gap: var(--sa-space-5);
}

@media (min-width: 40rem) {
  .sa-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 60rem) {
  .sa-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .sa-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .sa-grid--sidebar {
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: var(--sa-space-7);
    align-items: start;
  }
}

@media (min-width: 40rem) and (max-width: 59.99rem) {
  .sa-grid--3,
  .sa-grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------------ section datum */

/* Borrowed from the dimension/datum lines on an engineering drawing: a hairline with a
   tick at the left margin marks where a section begins. It encodes structure rather
   than decorating it, which is why it replaces the usual all-caps eyebrow label. */
.sa-datum {
  display: block;
  border: 0;
  border-top: 1px solid var(--sa-border-strong);
  margin: 0 0 var(--sa-space-5);
  position: relative;
}

.sa-datum::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: var(--sa-space-6);
  border-top: 3px solid var(--sa-teal-600);
}

.sa-section--inverse .sa-datum {
  border-top-color: var(--sa-border-inverse);
}

.sa-section--inverse .sa-datum::before {
  border-top-color: var(--sa-teal-400);
}

.sa-section-head {
  margin-bottom: var(--sa-space-6);
}

.sa-section-head p {
  margin-top: var(--sa-space-3);
  max-width: var(--sa-measure);
  color: var(--sa-text-secondary);
  font-size: var(--sa-text-md);
}

.sa-section--inverse .sa-section-head p {
  color: var(--sa-text-inverse-secondary);
}

/* ------------------------------------------------------------------ print basics */

@media print {
  .sa-no-print {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
}
