/* ============================================================
   Wolf in the Woods — Base layer
   Reset, typography defaults, layout containers, a11y helpers.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor scroll offset so sticky header never covers targets */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--witw-paper);
  color: var(--witw-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Prevent body scroll when a modal form is open */
body.is-locked { overflow: hidden; }

img, picture, video, svg { display: block; max-width: 100%; height: auto; }
img { background: var(--witw-paper-2); }   /* gentle placeholder tone while loading */

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

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

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

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--witw-ink);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-regular); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: var(--fw-semi); }

/* Editorial serif emphasis inside body copy */
.serif { font-family: var(--font-display); font-weight: var(--fw-regular); }
.italic { font-style: italic; }

/* ---------- Layout containers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--text { max-width: var(--container-text); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--paper-2 { background: var(--witw-paper-2); }
.section--white  { background: var(--witw-white); }
.section--dark {
  background: var(--witw-ink-2);
  color: var(--witw-on-dark);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--witw-on-dark); }

/* ---------- Signature: shop-drawing spec line ----------
   A hairline rule with a small tracked material label, echoing
   an architect's material schedule / cabinet shop drawing.     */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--witw-bronze);
  margin: 0 0 var(--sp-4);
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--witw-bronze);
  opacity: 0.7;
}
.section--dark .eyebrow { color: var(--witw-bronze-soft); }

/* Spec index number (used only where content is a real sequence) */
.spec-index {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  color: var(--witw-bronze);
  font-variant-numeric: tabular-nums;
}

/* Thin schedule rule used to separate editorial blocks */
.rule { height: 1px; background: var(--witw-line); border: 0; }
.rule--bronze { background: var(--witw-bronze); opacity: 0.4; }

/* Section heading cluster */
.section-head { max-width: 46rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .lead {
  font-size: var(--fs-lead);
  color: var(--witw-gray);
  line-height: var(--lh-relaxed);
  margin-top: var(--sp-4);
}

/* ---------- Accessibility helpers ---------- */
.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;
}

.skip-link {
  position: absolute;
  left: var(--sp-4); top: -60px;
  z-index: calc(var(--z-modal) + 10);
  background: var(--witw-ink);
  color: var(--witw-on-dark);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--witw-bronze);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Don't show the ring on mouse click for elements we style ourselves */
:focus:not(:focus-visible) { outline: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Utility text helpers */
.text-muted { color: var(--witw-gray); }
.text-center { text-align: center; }
.fine-print { font-size: var(--fs-caption); color: var(--witw-gray-2); line-height: var(--lh-normal); }
.nowrap { white-space: nowrap; }

/* ---------- Scroll reveal (paired with animations.js) ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
