/* ==========================================================================
   RESET — modern, minimal baseline
   IMPORTANT: never `overflow: hidden / auto / scroll` on html / body / main.
   Those create a scroll container and silently disable `position: sticky`,
   which the pinned storytelling sections depend on (CLAUDE.md §5).
   Horizontal overflow is prevented at the source (per-section clip layers);
   `main` additionally uses `overflow-x: clip` as a safety net — `clip`
   does NOT create a scroll container, so sticky keeps working.
   ========================================================================== */

/* Safety net against stray horizontal overflow (sticky-safe, see above) */
main {
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Anchor jumps land below the fixed header */
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}

/* Smooth anchor scrolling only for users who accept motion */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-block-size: 100vh;
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-slate);
  background-color: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-inline-size: 100%;
}

img {
  block-size: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* The `hidden` attribute must always win over component display rules
   (e.g. `display: grid` on a form) — JS relies on it to swap states. */
[hidden] {
  display: none !important;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  overflow-wrap: break-word;
  text-wrap: balance;
}

p {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

/* Global, consistent keyboard focus ring.
   Deep teal on light surfaces (≥ 3:1 non-text contrast); brand teal on
   navy surfaces, where deep teal would disappear. */
:focus-visible {
  outline: 2px solid var(--c-deep-teal);
  outline-offset: 3px;
}

.on-dark :focus-visible,
[data-header-theme="dark"] :focus-visible,
.site-header--dark :focus-visible,
.mobile-menu :focus-visible {
  outline-color: var(--c-teal);
}

::selection {
  background: var(--c-teal-a25);
  color: var(--c-ink);
}

/* Reduced motion: neutralise CSS transitions & animations site-wide */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
