/* ============================================================
   Base — reset, typography primitives, shared utilities
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The nav is fixed, so an anchor would otherwise land with its
     heading tucked underneath it. JS keeps --nav-h in sync with the
     real nav + draft bar height. */
  scroll-padding-top: var(--nav-h, 5.5rem);
}

@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;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  font-size: var(--t-base);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

::selection {
  background: var(--limewash);
  color: var(--ink);
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 3px;
}

/* --- headings ------------------------------------------------ */

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
  letter-spacing: -0.005em;
}

p { margin: 0; }

/* --- shared type roles --------------------------------------- */

.label {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--t-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.label--on-dark { color: var(--on-dark-soft); }

.amp {
  font-style: italic;
  color: var(--moss);
  padding: 0 0.04em;
}

.lede {
  font-size: var(--t-md);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34ch;
}

.body-text {
  max-width: var(--measure);
  color: var(--ink-soft);
}

.body-text + .body-text { margin-top: 1.1em; }

/* --- layout helpers ------------------------------------------ */

.shell {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-left: var(--pad-l);
  padding-right: var(--pad-r);
}

.shell--narrow { max-width: var(--page-narrow); }

.section {
  padding-block: var(--pad-section);
}

.section--paper2 { background: var(--paper-2); }

.section--forest {
  background: var(--forest);
  color: var(--on-dark);
}

.section--forest h2,
.section--forest h3 { color: var(--on-dark); }

.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xs);
  margin-bottom: var(--gap-lg);
}

.section__head h2 {
  font-size: clamp(1.75rem, 4vw, var(--t-xl));
}

/* --- buttons ------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--t-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 2.4rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.35s var(--ease), color 0.35s var(--ease),
              border-color 0.35s var(--ease);
}

.btn:focus-visible {
  background: var(--walnut);
  border-color: var(--walnut);
  color: var(--paper);
}

.btn--on-dark {
  border-color: var(--rule-on-dark);
  color: var(--on-dark);
}

.btn--on-dark:focus-visible {
  background: var(--on-dark);
  border-color: var(--on-dark);
  color: var(--forest);
}

.btn--solid {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--on-dark);
}

.btn--solid:focus-visible {
  background: var(--walnut);
  border-color: var(--walnut);
  color: var(--paper);
}

/* The filled button for dark grounds (the envelope). */
.btn--solid-light {
  background: var(--limewash-pale);
  border-color: var(--limewash-pale);
  color: var(--forest-deep);
}

.btn--solid-light:focus-visible {
  background: var(--walnut);
  border-color: var(--walnut);
  color: var(--paper);
}

.btn:disabled { opacity: 0.6; cursor: default; }

/* Hover only where a real pointer exists. On a touchscreen a tapped
   button otherwise stays in its hover colour until something else is
   tapped, which reads as a broken state. Focus-visible stays
   unconditional above for keyboard users. */
@media (hover: hover) {
  .btn:hover {
    background: var(--walnut);
    border-color: var(--walnut);
    color: var(--paper);
  }
  .btn--on-dark:hover {
    background: var(--on-dark);
    border-color: var(--on-dark);
    color: var(--forest);
  }
  .btn--solid:hover,
  .btn--solid-light:hover {
    background: var(--walnut);
    border-color: var(--walnut);
    color: var(--paper);
  }
}

/* --- draft placeholders --------------------------------------
   Anything still unconfirmed is wrapped in .tbd so it is trivially
   greppable and visibly flagged until the real value lands.
   Delete the rule (and the wrappers) once content is final.
   -------------------------------------------------------------- */

.tbd {
  border-bottom: 1px dotted var(--walnut-light);
  padding-bottom: 1px;
}

/* --- entrance: visible at rest, animates only if JS marks it --- */

.reveal {
  opacity: 1;
  transform: none;
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Must outrank the display:flex / display:grid set on .field and
   .form, or toggling el.hidden from JS does nothing. */
[hidden] { display: none !important; }

/* Keyboard users land here first — the fixed nav means Tab otherwise
   walks the whole menu before reaching any content. */
.skip {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -120%;
  z-index: 100;
  background: var(--forest);
  color: var(--on-dark);
  font-size: var(--t-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  transition: translate 0.25s var(--ease);
}

.skip:focus { translate: -50% 0; }

/* Page must not scroll behind the open mobile menu. */
body.is-locked { overflow: hidden; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
