/* ==========================================================================
   LITTLE DOVES — RESET, TYPOGRAPHY & PRIMITIVES
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;                 /* native — no scrollIntoView() */
  scroll-padding-top: calc(var(--header-h) + var(--s-6));
}

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

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

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

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

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

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

/* Control labels should never become an accidental text selection on tap. */
button,
.btn,
.seg,
.radio,
.switch,
.nav-toggle { -webkit-user-select: none; user-select: none; }

button { background: none; border: 0; cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

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

/* --------------------------------------------------------------------------
   FOCUS — never removed, always visible against its ground
   -------------------------------------------------------------------------- */
:focus { outline: none; }

:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}

.on-dark :focus-visible,
.ld-footer :focus-visible,
.cta-band :focus-visible,
.section--dark :focus-visible {
  outline-color: var(--focus-ring-dark);
}

/* --------------------------------------------------------------------------
   SKIP LINK
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 200;
  transform: translateY(calc(-100% - var(--s-8)));
  background: var(--surface-blue);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-mono);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

.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;
}

/* --------------------------------------------------------------------------
   TYPOGRAPHY PRIMITIVES
   -------------------------------------------------------------------------- */
.display,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink-blue);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
}

.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-display);
}

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
}

.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
}

.h4 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.005em;
  color: var(--ink-strong);
}

.display em,
.h1 em,
.h2 em {
  font-style: italic;
  color: var(--ink-sage);
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--ink-strong);
  font-weight: 400;
  max-width: var(--measure);
  text-wrap: pretty;
}

.prose p {
  max-width: var(--measure);
  text-wrap: pretty;
}

.prose p + p { margin-top: var(--s-5); }

.prose--wide p { max-width: var(--measure-wide); }

.muted { color: var(--ink-muted); }

.small { font-size: var(--fs-small); line-height: 1.58; }

.micro {
  font-size: var(--fs-micro);
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Mono eyebrow — the recurring structural signal of the whole system */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-sage);
  margin: 0;
}

.eyebrow::before {
  content: "";
  width: var(--s-6);
  height: 1px;
  background: var(--brand-orange);
  flex: none;
}

.eyebrow--plain::before { display: none; }

.eyebrow--blue { color: var(--ink-blue); }
.eyebrow--blue::before { background: var(--brand-pale-blue); }

/* Every dark ground in the system, so an eyebrow can never inherit the
   light-ground sage (which measures 1.58:1 on brand blue). */
.on-dark .eyebrow,
.cta-band .eyebrow,
.section--dark .eyebrow,
.ld-footer .eyebrow { color: var(--brand-pale-green); }

.on-dark .eyebrow::before,
.cta-band .eyebrow::before,
.section--dark .eyebrow::before,
.ld-footer .eyebrow::before { background: var(--brand-pale-green); }

/* Mono index numeral used to number sequences */
.index-num {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  color: var(--ink-sage);
  font-variant-numeric: tabular-nums;
}

.figure-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

/* --------------------------------------------------------------------------
   LINKS
   -------------------------------------------------------------------------- */
a { color: var(--ink-blue); }

/* :not(.btn) matters — these selectors carry higher specificity than the
   button colour rules and would otherwise repaint a button's label to match
   its own background. */
.prose a:not(.btn),
.link-inline {
  color: var(--ink-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(0, 75, 119, 0.38);
  transition: text-decoration-color var(--dur-fast) var(--ease-out);
}

.prose a:not(.btn):hover,
.link-inline:hover { text-decoration-color: currentColor; }

.on-dark a:not(.btn),
.on-dark .link-inline { color: var(--brand-pale-green); }

/* --------------------------------------------------------------------------
   BUTTONS — pill geometry (warmth) on precise type (rigour)
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease-out),
    border-color     var(--dur-base) var(--ease-out),
    color            var(--dur-base) var(--ease-out),
    transform        var(--dur-fast) var(--ease-out);
}

.btn:active { transform: translateY(1px); }

/* Primary — white on deep brand blue = 9.24:1 */
.btn--primary {
  background: var(--surface-blue-mid);
  color: #fff;
}
.btn--primary:hover { background: var(--surface-blue); }

/* Secondary — brand blue ink on white, hairline bound = 9.24:1 */
.btn--secondary {
  background: var(--surface-raised);
  color: var(--ink-blue);
  border-color: rgba(0, 75, 119, 0.32);
}
.btn--secondary:hover {
  border-color: var(--ink-blue);
  background: var(--surface-blue-tint);
}

/* Sage — brand primary accent as a fill, carrying dark ink = 5.44:1 */
.btn--sage {
  background: var(--brand-sage);
  color: var(--ink-strong);
}
.btn--sage:hover { background: var(--brand-pale-green); }

/* On dark grounds */
.btn--ghost-light {
  background: transparent;
  color: #fff;
  border-color: var(--line-on-dark-ctl);
}
.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: #fff;
}

.btn--light {
  background: #fff;
  color: var(--ink-blue);
}
.btn--light:hover { background: var(--brand-pale-green); color: var(--ink-strong); }

.btn--lg {
  min-height: var(--control-h);
  padding: var(--s-4) var(--s-7);
  font-size: var(--fs-body);
}

.btn--block { width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
}

/* Text link with a moving rule beneath — used for tertiary actions */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-blue);
  text-decoration: none;
  padding-block: var(--s-2);
}

.link-arrow .rule {
  display: block;
  width: var(--s-7);
  height: 1px;
  background: currentColor;
  transition: width var(--dur-base) var(--ease-out);
}

.link-arrow:hover .rule { width: var(--s-9); }

/* --------------------------------------------------------------------------
   BADGES / TAGS — monospace data language
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-1) var(--s-3);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  color: var(--ink-strong);
  background: var(--surface-raised);
  white-space: nowrap;
}

.tag--sage   { background: var(--surface-sage-tint); border-color: var(--line-sage); color: var(--ink-sage); }
.tag--blue   { background: var(--surface-blue-tint); border-color: rgba(0,75,119,0.22); color: var(--ink-blue); }
.tag--solid  { background: var(--brand-pale-green);  border-color: transparent; color: var(--ink-strong); }

/* --------------------------------------------------------------------------
   SCROLL REVEAL — IntersectionObserver driven, never scroll-jacking
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(var(--s-5));
  transition:
    opacity   var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* If JS never runs, content must still be visible. */
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
  .ld-header, .ld-footer, .nav-toggle, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}
