/* ==========================================================================
   Reset and base elements
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

/* --- Headings ------------------------------------------------------------ */

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}

h2 {
  font-size: var(--step-3);
}

h3 {
  font-size: var(--step-1);
  font-weight: 700;
  line-height: var(--leading-snug);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--brand-700);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent-700);
}

/* --- Focus --------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.section--dark :focus-visible {
  outline-color: var(--on-dark);
}

/* ==========================================================================
   Layout utilities
   ========================================================================== */

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

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

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-7);
  }
}

.section--sand {
  background-color: var(--surface-2);
}

.section--dark {
  background-color: var(--brand-900);
  color: var(--on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--on-dark);
}

.section--dark a {
  color: var(--on-dark);
}

/* Sticky-header offset for in-page anchors */
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-2));
}

.eyebrow {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.section--dark .eyebrow {
  color: var(--on-dark-muted);
}

.lede {
  font-size: var(--step-1);
  color: var(--ink-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  z-index: 200;
  padding: var(--space-1) var(--space-2);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
  transition: transform var(--dur-fast) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ==========================================================================
   Motion preference
   ========================================================================== */

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

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

/* ==========================================================================
   Long-form page content

   The design covers no inner pages, so this is deliberately plain —
   measure, rhythm, and nothing else.
   ========================================================================== */

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-block-start: var(--space-3);
}

.prose h2 {
  margin-block-start: var(--space-5);
}

.prose h3 {
  margin-block-start: var(--space-4);
}

.prose ul,
.prose ol {
  padding-inline-start: var(--space-3);
}

.prose li + li {
  margin-block-start: var(--space-1);
}

.prose img {
  max-width: 100%;
  height: auto;
}
