/**
 * Base: reset, elements, typography, links, forms, utilities.
 */

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

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* Source Serif 4 carries an optical-size axis; letting the browser drive it
   keeps the small sizes this scale mostly uses from looking spindly. At 400
   the face is a text weight, so headings take 600 to hold their own against
   Lato's body copy at only a few pixels' difference in size. */
h1, h2, h3, h4, .u-display {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--fg);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5, h6 {
  font-family: var(--font-body);
  font-size: var(--fs-3xs);
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 var(--s-3);
}

p, ul, ol, dl, blockquote, table, figure { margin: 0 0 var(--s-5); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--c-slate-800); }

strong, b { font-weight: 700; }
em, i { font-style: italic; }
small { font-size: var(--fs-xs); }

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--s-8) 0;
}

blockquote {
  margin-inline: 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-style: italic;
  color: var(--fg-muted);
}

code, kbd, samp, pre {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* ---- Tables (price lists are a real page type here) -------------------- */
.text-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.text-content th {
  text-align: left;
  font-size: var(--fs-3xs);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 700;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border-strong);
}
.text-content td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-rule-2);
  vertical-align: top;
}
.text-content td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Long-form body copy ---------------------------------------------- */
.text-content { max-width: var(--measure); }
.text-content > * + * { margin-top: var(--s-5); }
.text-content h2 { font-size: var(--fs-xl); margin-top: var(--s-8); }
.text-content h3 { font-size: var(--fs-lg); margin-top: var(--s-7); }
.text-content ul, .text-content ol { padding-left: var(--s-5); }
.text-content li + li { margin-top: var(--s-2); }
.text-content li::marker { color: var(--accent); }
.text-content > .table-wrap { max-width: none; overflow-x: auto; }

/* ---- Forms ------------------------------------------------------------- */
label { display: block; font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s-2); }
.form-required { color: var(--c-slate-600); }

input[type='text'], input[type='email'], input[type='tel'], input[type='url'],
input[type='password'], input[type='search'], input[type='date'], textarea, select {
  width: 100%;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(89 116 138 / 0.16);
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); opacity: 1; }
.description { font-size: var(--fs-xs); color: var(--fg-faint); margin-top: var(--s-2); }

/* ---- Focus ------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--c-slate-600);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---- Accessibility helpers -------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -110%);
  z-index: var(--z-overlay);
  background: var(--c-slate-800);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* ---- Motion ------------------------------------------------------------ */
@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;
  }
}

/* Scroll reveal. Elements rest VISIBLE; the hidden state is only applied
   once JS confirms an observer is running and motion is allowed. */
.js-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.js-reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; }
