/*
 * Base: reset, typography, layout primitives, buttons and the shared
 * entrance animations. Everything here is used on more than one page.
 */

/* ---------- Reset ---------- */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--forest);
  color: var(--starch);
  font-family: var(--body);
  font-size: var(--fs-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure, blockquote {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
}

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

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection {
  background: var(--ochre);
  color: var(--forest);
}

/* ---------- Typography ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ochre);
}

.eyebrow::before {
  content: "";
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
  transform-origin: 0 50%;
  transition: transform 1s var(--ease) .15s;
}

.display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: .98;
  text-wrap: balance;
}

h2.display {
  font-size: var(--fs-h2);
}

h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: -.015em;
  line-height: 1.15;
}

.lede {
  font-size: clamp(1.08rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  max-width: 58ch;
  color: var(--mist);
}

.accent {
  color: var(--ochre);
}

.fine-print {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: var(--fs-small);
  letter-spacing: .02em;
  color: var(--mist);
}

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

.container {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-inline: clamp(16px, 4.2vw, 44px);
}

/* A full-width section. Slabs round their top corners and overlap the band above. */
.band {
  position: relative;
  z-index: 1;
  padding-block: clamp(72px, 11vw, 150px);
}

.band--slab {
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: calc(var(--radius) * -1);
}

.band--green {
  background: var(--green);
}

.band--forest {
  background: var(--forest);
}

.band--pale {
  background: var(--starch);
  color: var(--ink);
}

.band--pale .eyebrow {
  color: var(--ochre-deep);
}

.band--pale .lede {
  color: var(--slate);
}

.band--pale .accent {
  color: var(--ochre-deep);
}

.section-head {
  display: grid;
  gap: 22px;
  margin-bottom: clamp(36px, 6vw, 72px);
}

.section-head--flush {
  margin-bottom: 0;
}

/* ---------- Icons and SVG artwork ---------- */

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--check {
  stroke-width: 2.6;
}

.stroke-green {
  stroke: var(--green);
}

.stroke-ochre {
  stroke: var(--ochre);
}

.stroke-starch {
  stroke: var(--starch);
}

.stroke-mint {
  stroke: var(--mint);
}

.stroke-sand {
  stroke: var(--sand);
}

.fill-green {
  fill: var(--green);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .35s var(--ease), background-color .25s, color .25s, box-shadow .35s;
}

.btn .icon {
  transition: transform .35s var(--ease);
}

.btn:hover .icon {
  transform: translateX(4px);
}

.btn--solid {
  background: var(--ochre);
  color: var(--forest);
}

.btn--solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(214, 143, 52, .7);
}

.btn--ghost {
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--starch);
}

.btn--ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--ochre);
  color: var(--ochre);
}

.band--pale .btn--ghost {
  box-shadow: inset 0 0 0 1.5px var(--line-ink);
  color: var(--ink);
}

.band--pale .btn--ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--ochre-deep);
  color: var(--ochre-deep);
}

/* ---------- Entrance animations ----------
 * reveal.js adds .is-visible when an element scrolls into view.
 *   .reveal        slides up into place
 *   [data-split]   split-text.js wraps each word so they rise one by one
 */

/* Declared after .btn on purpose: a revealed button takes this transition. */
.reveal {
  transition: transform 1s var(--ease) var(--delay, 0ms);
}

/* Stagger steps for neighbouring .reveal elements. */
.delay-1 { --delay: 80ms; }
.delay-2 { --delay: 120ms; }
.delay-3 { --delay: 160ms; }
.delay-4 { --delay: 200ms; }
.delay-5 { --delay: 240ms; }

.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

/* Words sit below their clipping box until the heading becomes visible. */
.word__inner {
  display: inline-block;
  transform: translateY(112%) rotate(5deg);
  will-change: transform;
}

.is-visible .word__inner {
  animation: rise 1s var(--ease) both;
  animation-delay: calc(var(--index, 0) * 42ms);
}

@keyframes rise {
  from { transform: translateY(112%) rotate(5deg); }
  to { transform: none; }
}

/* Start states only apply when scripts can run, so nothing stays hidden without them. */
@media (scripting: enabled) {
  .reveal:not(.is-visible) {
    transform: translateY(30px);
  }

  .eyebrow.reveal:not(.is-visible) {
    transform: none;
  }

  .eyebrow.reveal:not(.is-visible)::before {
    transform: scaleX(0);
  }

  /* Hold headings back until their words are wrapped, so they don't flash in
     place before rising. If the script never arrives they appear after 2s. */
  [data-split]:not(.is-split) {
    animation: show-unsplit 0s 2s both;
  }
}

@keyframes show-unsplit {
  from { visibility: hidden; }
}

/* ---------- Reduced motion ---------- */

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

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal:not(.is-visible),
  .eyebrow.reveal:not(.is-visible)::before,
  .word__inner {
    transform: none;
  }
}
