/*
  layout.css
  Shared layout pieces: the page container, section spacing, section headers,
  and the scroll-reveal animation used by js/reveal.js.
*/

/* Centres content and adds side padding */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Section header: headline with a short paragraph stacked below it */
.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-8);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.section-lead {
  margin-top: var(--space-4);
  max-width: 60ch;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

/* ---------- Scroll reveal ----------
   Elements with .reveal start slightly lower and transparent, then js/reveal.js adds
   .is-visible when they scroll into view. Only runs when JS is on (html.js) and the
   visitor hasn't asked for reduced motion, so content is never stuck invisible. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
      opacity var(--duration-slow) var(--ease-out),
      transform var(--duration-slow) var(--ease-out);
    transition-delay: calc(var(--reveal-index, 0) * 80ms);
  }

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