/* ═══════════════════════════════════════════════════════════════════════════
   BASE — reset, document defaults, shared type, utilities
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--sans);
  font-weight: var(--fw-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Visible focus is the accessibility floor, not a preference. */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Skip link — first tab stop, invisible until focused. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 14px 22px;
  font-size: var(--fs-nav);
  font-weight: var(--fw-label);
  letter-spacing: var(--tr-nav);
  text-transform: uppercase;
}
.skip:focus {
  left: 0;
}

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

/* ── layout ──────────────────────────────────────────────────────────────── */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.sec {
  position: relative;
  padding: var(--sec-y) 0;
}
.sec--tight {
  padding: var(--sec-y-tight) 0;
}
.sec--frost {
  background: var(--frost);
}
.sec--dark {
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}

.sec__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(44px, 6vw, 80px);
}
.sec__head--single {
  grid-template-columns: 1fr;
}

@media (max-width: 840px) {
  .sec__head {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* ── shared type ─────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-label);
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 22px;
}
.eyebrow--bronze {
  color: var(--bronze);
}
.eyebrow--navy {
  color: var(--navy);
  opacity: 0.5;
}

.display {
  font-weight: var(--fw-display);
  line-height: var(--lh-hero);
  letter-spacing: var(--tr-display);
  margin: 0;
}

.h2 {
  font-weight: var(--fw-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--tr-display);
  margin: 0 0 34px;
}

.h3 {
  font-weight: var(--fw-body);
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: var(--tr-display);
  margin: 0 0 18px;
}

.lede {
  font-size: var(--fs-lede);
  line-height: var(--lh-lede);
  color: var(--muted);
  max-width: var(--maxw-text);
  margin: 0;
}

.small {
  font-size: var(--fs-small);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: var(--fw-label);
}

.prose {
  max-width: 68ch;
}
.prose p {
  margin: 0 0 1.15em;
  line-height: var(--lh-lede);
  color: var(--muted);
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose strong {
  font-weight: var(--fw-medium);
  color: var(--navy);
}

/* On dark fields the same classes flip. Modifiers come after the base classes
   in source order and rely on that rather than on !important. */
.sec--dark .h2,
.sec--dark .h3,
.sec--dark .display {
  color: #fff;
}
.sec--dark .lede,
.sec--dark .prose p {
  color: var(--muted-d);
}
.sec--dark .prose strong {
  color: #fff;
}

/* ── the cross ───────────────────────────────────────────────────────────────
   The link back to KM Clinic. It appears sparingly and always as an anchor —
   list markers on hover, dividers in the stat strip, above the pull-quote.
   Using it more often makes it decoration instead of signal. */

.xmark {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
}
.xmark rect {
  fill: var(--blue);
}

/* ── reveal ──────────────────────────────────────────────────────────────── */

.rv {
  opacity: 0;
  transform: translateY(var(--reveal-y));
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
}
.rv.in {
  opacity: 1;
  transform: none;
}

/* ── reduced motion ──────────────────────────────────────────────────────────
   Must disable ALL of the above, including the filament draw and smooth
   scrolling — not just the obvious transitions. */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .fil path {
    stroke-dashoffset: 0;
    animation: none;
  }
  .gal img,
  .card img {
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
