/* ============================================================
   Wasatch Supply Co. — Design tokens & base styles
   Direction: "Field Catalog Americana" — heritage general-store
   catalog. Bone paper, ink, vermillion stamp red, hairline rules.
   ============================================================ */

:root {
  /* Palette */
  --paper: #f3eee3;
  --paper-raised: #faf7ef;
  --paper-deep: #e7dfcc;
  --ink: #201b13;
  --ink-soft: #574f3d;
  --ink-faint: #8b826d;
  --rule: #d6ccb4;
  --rule-strong: #b3a582;
  --accent: #b23a1c;
  --accent-deep: #8c2c14;
  --pine: #33523f;
  --brass: #96742e;
  --cream: #fffdf6;

  /* Typography */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --text-h2: clamp(2.25rem, 1.6rem + 2.6vw, 3.75rem);
  --text-hero: clamp(3.25rem, 1.75rem + 6.5vw, 7.75rem);

  /* Layout */
  --max-width: 1280px;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --space-section: clamp(4rem, 3rem + 4vw, 7rem);

  /* Motion */
  --duration-fast: 160ms;
  --duration: 340ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.6px);
  background-size: 5px 5px;
  opacity: 0.035;
}

body > * {
  position: relative;
  z-index: 1;
}

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

[hidden] {
  display: none !important;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

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

/* ---------- Type primitives ---------- */
h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.95;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.label--accent {
  color: var(--accent);
}

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.rule-top {
  border-top: 1px solid var(--rule);
}

.rule-bottom {
  border-bottom: 1px solid var(--rule);
}

/* ---------- Motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
