/* ==========================================================================
   VALLEY CRAFT — base
   Reset, element defaults, motion system, accessibility primitives.
   ========================================================================== */

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  min-height: 100svh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Letterpress grain — subtle, fixed, decorative, never intercepts input. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/img/texture.svg");
  background-repeat: repeat;
  background-size: 160px 160px;
}

#top { position: relative; z-index: 1; }

img, svg { display: block; max-width: 100%; }
img:not([width]) { height: auto; }

/* Inline UI glyphs. Sets a sane 1em box so an unsized icon can never inflate
   to its container's full width. More specific rules (.btn svg, .check-list
   svg, .frame__media svg) still override this where a different size applies. */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-weight: 600; }

p { text-wrap: pretty; }

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

a {
  color: var(--barn);
  text-decoration: none;
}
a:not([class]) {
  background-image: linear-gradient(var(--barn-deep), var(--barn-deep));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size var(--dur-link) ease, color var(--dur-link) ease;
  padding-bottom: 0.05em;
}
a:not([class]):hover,
a:not([class]):focus-visible {
  background-size: 100% 2px;
  color: var(--barn-deep);
}
.on-dark a:not([class]) {
  color: var(--sky-link);
  background-image: linear-gradient(var(--brass-light), var(--brass-light));
}
.on-dark a:not([class]):hover,
.on-dark a:not([class]):focus-visible {
  color: var(--paper);
}

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

button { cursor: pointer; }

fieldset { border: none; padding: 0; }

/* ---- selection ---- */
::selection { background: var(--barn); color: var(--paper); }

/* ---- focus ---- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--barn);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: var(--brass-light); }

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -60px;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75em 1.25em;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  z-index: 1000;
  transition: top var(--dur-link) ease;
}
.skip-link:focus {
  top: var(--space-sm);
}

/* ---- visually hidden but available to AT ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- eyebrow label ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: var(--text-eyebrow);
  color: var(--brass-ink);
}
.on-dark .eyebrow { color: var(--brass-light); }

.eyebrow::before {
  content: "";
  width: 1.4em;
  height: 2px;
  background: currentColor;
  display: inline-block;
  border-radius: 2px;
}

/* ---- oldstyle numerals for display numbers/phone/prices ---- */
.numerals {
  font-family: var(--font-display);
  font-variant-numeric: oldstyle-nums;
}

/* ==========================================================================
   Motion system
   Content is fully visible by default. Only when html.js is present (set
   inline, synchronously, before paint) do [data-reveal] elements start
   hidden and animate in via reveal.js + IntersectionObserver. If JS never
   runs, nothing is ever hidden.
   ========================================================================== */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-reveal) var(--ease-page),
              transform var(--dur-reveal) var(--ease-page);
  transition-delay: calc(var(--reveal-i, 0) * var(--stagger-step));
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stroke-draw path {
  stroke-dasharray: var(--len, 500);
  stroke-dashoffset: var(--len, 500);
  transition: stroke-dashoffset var(--dur-stroke) var(--ease-page);
}
html.js [data-reveal].is-visible .stroke-draw path,
html:not(.js) .stroke-draw path {
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    transform: none;
    transition: opacity var(--dur-reveal) linear;
    transition-delay: 0ms;
  }
  .stroke-draw path {
    transition: none;
    stroke-dashoffset: 0;
  }
  html { scroll-behavior: auto; }
}

/* ---- content-visibility for long lists (perf) ---- */
.cv-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 480px;
}
