/* =========================================================
   HCMS — Base: reset, elements, layout primitives, motion
   ========================================================= */

/* ---- Modern reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-400);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
img { font-style: italic; background-repeat: no-repeat; background-size: cover; }

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

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

p, li { text-wrap: pretty; }

/* ---- Typography ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  font-optical-sizing: auto;
  text-wrap: balance;
}
h1 { font-size: var(--fs-800); line-height: var(--lh-tight); font-variation-settings: "SOFT" 30, "WONK" 0; }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); }
h4 { font-size: var(--fs-500); font-weight: 600; }

a { color: var(--text-link); text-decoration-color: color-mix(in srgb, var(--evergreen) 35%, transparent); text-underline-offset: 0.18em; transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--text-link-hover); text-decoration-color: currentColor; }

strong, b { font-weight: 600; }

::selection { background: var(--clay-soft); color: var(--evergreen-darker); }

/* ---- Focus ---- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: var(--z-skip);
  background: var(--evergreen);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--evergreen-tint); }
.section--sage { background: linear-gradient(180deg, var(--sage) 0%, color-mix(in srgb, var(--sage) 55%, var(--ivory)) 100%); }
.section--cream { background: var(--cream); }
.section--dark { background: var(--evergreen-deep); color: color-mix(in srgb, #fff 88%, var(--evergreen)); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--flow, 1rem); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, 1rem); align-items: center; }

.grid { display: grid; gap: var(--grid-gap, clamp(1.25rem, 0.6rem + 2vw, 2rem)); }
.measure { max-width: 62ch; }
.measure-sm { max-width: 48ch; }

/* ---- Shared section heading ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--fs-200);
  font-weight: 650;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--clay-text);
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 2px; border-radius: 2px;
  background: currentColor; opacity: 0.6;
}
.eyebrow--center::before { display: none; }

.section-head { max-width: 64ch; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head > * + * { margin-top: 0.85rem; }
.section-head h2 + .lead { margin-top: 1rem; }

.lead { font-size: var(--fs-500); line-height: 1.5; color: var(--ink-soft); }

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }

/* ---- Visually hidden ---- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Scroll-reveal (progressive: only hidden when JS is active) ---- */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
  will-change: opacity, transform;
}
.js .reveal--left  { transform: translateX(-26px); }
.js .reveal--right { transform: translateX(26px); }
.js .reveal--scale { transform: scale(0.96); }
/* Release the compositor hint once revealed so idle elements don't hold layers */
.js .reveal.is-visible { opacity: 1; transform: none; will-change: auto; }

/* ---- Reduced motion: respect user preference ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
