/* Reset, element defaults and shared primitives. */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  /* Anchors must clear the fixed header. */
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Must come after the display rules above: an author `display` declaration
   otherwise beats the user-agent rule for [hidden]. */
[hidden] {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--c-yellow);
  outline-offset: 3px;
}

h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
}

/* --- layout primitives ---------------------------------------------------- */

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

.section {
  position: relative;
  padding-block: var(--space-section);
}

.section--muted {
  background: hsl(var(--muted) / 0.5);
}

.section--muted-soft {
  background: hsl(var(--muted) / 0.3);
}

/* The source site separates bands with a slanted edge rather than a rule. */
.section--skew-bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3vw), 0 100%);
}

.section--skew-top {
  clip-path: polygon(0 3vw, 100% 0, 100% 100%, 0 100%);
}

.section__heading {
  font-size: var(--text-section);
  text-align: center;
  margin-bottom: 0.75rem;
}

.section__subtitle {
  text-align: center;
  color: var(--c-muted-fg);
  max-width: 46ch;
  margin: 0 auto 3.5rem;
}

.section__heading + .grid,
.section__heading + .stack {
  margin-top: 3.5rem;
}

/* Accent helpers used by headings and rules. */
.t-yellow { color: var(--c-yellow); }
.t-pink   { color: var(--c-pink); }
.t-green  { color: var(--c-green); }

.rule {
  width: 5rem;
  height: 4px;
  margin: 0 auto 3.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-yellow), var(--c-pink), var(--c-green));
}

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

/* --- scroll reveal -------------------------------------------------------- */

/* Scoped to `.js`: without JavaScript nothing is ever hidden. */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
