/* ==========================================================
   BASE: reset, default text, layout helpers, scroll animation
   ========================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);   /* so the fixed nav never covers a section title */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-line);
  color: var(--text-light-body);
  background: var(--background-surface);
  padding-top: var(--nav-height);          /* space for the fixed nav */
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;                        /* stops page scrolling behind the mobile menu */
}

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

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

ul {
  list-style: none;
}

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

/* Keyboard focus ring (shows only when using the Tab key) */
:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* On dark backgrounds a dark ring is invisible, so use white */
.on-dark :focus-visible {
  outline-color: #FFFFFF;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--side-padding);
}

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

.text-red {
  color: var(--brand-primary);
}

/* Hidden visually, still read by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Scroll animation (soft fade up) ----------
   Add class="reveal" to any element to animate it.
   It only runs when JavaScript is on, and is switched off
   for people who set "reduce motion" on their device. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-reveal) var(--ease),
    transform var(--duration-reveal) var(--ease);
  transition-delay: var(--delay, 0s);
}

.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 {
    transition-duration: 0.01ms !important;
  }
}
