/* Reset, typography, layout primitives, buttons, forms. */

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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The UA's own `[hidden] { display: none }` loses to any class that sets a
   display — .btn-text, .btn--block and half the components do. Without this,
   setting el.hidden on one of them changes nothing at all. */
[hidden] { display: none !important; }

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: var(--lh-heading);
  /* Copy is authored in caps where caps are wanted; nothing is transformed. */
  text-transform: none;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--c-fg);
  outline-offset: 2px;
}
.on-invert :focus-visible { outline-color: var(--c-fg-invert); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; top: 0; left: 0; z-index: var(--z-modal);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg); color: var(--c-fg);
  transform: translateY(-110%);
}
.skip-link:focus { transform: none; }

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

/* Full-bleed: sections escape the wrap and run edge to edge. */
.bleed { width: 100%; }

.section { padding-block: var(--section-pad); }
.section--tight { padding-block: var(--section-pad-tight); }
.section--flush { padding-block: 0; }
.section--alt { background: var(--c-bg-alt); }
.section--invert {
  background: var(--c-bg-invert);
  color: var(--c-fg-invert);
}

/* A narrow centred block — the right thing inside a centred .richtext
   section and the wrong thing on a left-aligned page, where it pulls the
   prose away from the heading above it. Use .column there. */
.measure {
  max-width: var(--measure);
  margin-inline: auto;
}

/* Narrow, but flush left so it lines up with the page heading. */
.column { max-width: var(--measure); }

.stack > * + * { margin-top: var(--flow, var(--sp-4)); }

/* --- Type utilities ------------------------------------------------------ */

.display { font-family: var(--font-heading); font-size: var(--fs-display); line-height: var(--lh-heading); }
.heading-2 { font-family: var(--font-heading); font-size: var(--fs-h2); }
.lede { font-size: var(--fs-body); color: var(--c-fg-muted); }
.section--invert .lede { color: var(--c-fg-invert-muted); }

.label {
  font-family: var(--font-heading);
  font-size: var(--fs-body-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

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

/* --- Buttons -------------------------------------------------------------
   Exactly two CTA weights exist in this system:
     .btn       solid black rectangle (primary)
     .btn-text  underlined text link (secondary)
   Anything else is a deviation, not a variant.
   ------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.9rem 1.6rem;
  background: var(--c-btn);
  color: var(--c-btn-fg);
  font-family: var(--font-heading);
  font-size: var(--fs-body-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-align: center;
  border: 1px solid var(--c-btn);
  border-radius: 0;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--c-btn-hover); border-color: var(--c-btn-hover); }

/* On black: outlined, inverting on hover. */
.btn--outline {
  background: transparent;
  color: var(--c-fg-invert);
  border-color: var(--c-fg-invert);
}
.btn--outline:hover {
  background: var(--c-fg-invert);
  color: var(--c-fg);
  border-color: var(--c-fg-invert);
}

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

.btn-text {
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid currentColor;
  font-family: var(--font-heading);
  font-size: var(--fs-body-sm);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.btn-row--center { justify-content: center; }

/* --- Forms --------------------------------------------------------------- */

.field {
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--c-bg);
  color: var(--c-fg);
  font: inherit;
  border: 1px solid var(--c-line);
  border-radius: 0;
}
.field::placeholder { color: var(--c-fg-muted); }
.field:focus-visible { outline-offset: -2px; }

/* --- Motion --------------------------------------------------------------
   Scroll reveal. Elements start shifted and fade in when observed.
   ------------------------------------------------------------------------- */

/* Hidden only once JS has claimed responsibility for revealing it, so a failed
   or blocked main.js leaves the content visible rather than blank. */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal-ready [data-reveal].is-revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready [data-reveal] { opacity: 1; transform: none; }
}
