/* tokens.css is enqueued separately by the theme (see inc/enqueue.php). */

/* ==========================================================================
   Reset
   ========================================================================== */

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

* {
  margin: 0;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: inherit;
  font-size: inherit;
}

/* ==========================================================================
   Base typography helpers
   ========================================================================== */

.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-display);
  text-transform: uppercase;
  letter-spacing: 0.005em;
}

.label {
  font-family: var(--font-label);
  font-weight: 700;
  font-size: var(--label);
  letter-spacing: var(--tracking-label);
  line-height: 1;
  text-transform: uppercase;
}

.archive-label {
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--body-sm);
  letter-spacing: var(--tracking-label);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-muted);
}

.body-lg {
  font-size: var(--body-lg);
  line-height: var(--leading-body);
}

.body-sm {
  font-size: var(--body-sm);
  font-weight: 500;
  line-height: 1.45;
}

.muted {
  color: var(--text-muted);
}

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

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

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

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

/* Section masthead: label + title + optional trailing link */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section-head__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--display-lg);
  line-height: 0.88;
  text-transform: uppercase;
}

.section-head__sub {
  margin-top: var(--space-2);
  color: var(--text-muted);
  max-width: 46ch;
}

.section-head__eyebrow {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--text-muted);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

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

/* Dark surfaces need a focus ring that is actually visible against ink */
.on-ink :focus-visible {
  outline-color: var(--color-white);
}

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-cream);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  transform: translateY(-200%);
}

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

/* ==========================================================================
   Texture, background only, never carries information (3-8% opacity)
   ========================================================================== */

.texture-paper {
  position: relative;
  isolation: isolate;
}

.texture-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0 3px,
      currentColor 3px 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 3px,
      currentColor 3px 4px
    );
  background-size: 4px 4px;
}

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

@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;
  }
}
