/* ==========================================================================
   Base — reset, typography, layout primitives, section header, buttons
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Safari's scroll anchoring holds onto the pinned film and keeps pushing the page down by itself */
html, body { overflow-anchor: none; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 300 15px/1.6 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;     /* clip, not hidden: hidden stops the pinned film from staying in place in Safari */
}

img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(34px, 7vw, 68px); line-height: 1.02; }
h2 { font-size: clamp(26px, 4.2vw, 44px); line-height: 1.1; }
h3 { font-size: clamp(20px, 2.6vw, 26px); line-height: 1.2; }

:focus-visible { outline: 2px solid var(--areca); outline-offset: 3px; }
.band--forest :focus-visible, .band--bark :focus-visible,
.loom :focus-visible, .ftr :focus-visible { outline-color: var(--brass-l); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: fixed; left: var(--gut); top: -80px; z-index: 100;
  background: var(--areca); color: var(--mist); padding: 12px 18px;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }

/* ---------- layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

.band { padding-block: var(--band-y); }
.band--tight  { padding-block: var(--band-y-tight); }
.band--well   { background: var(--mist-2); }
.band--forest { background: var(--forest); color: var(--mist); }
.band--bark   { background: var(--bark);   color: var(--mist); }

/* warp threads hanging behind a dark band */
.warp { position: relative; isolation: isolate; }
.warp::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg, transparent 0 23px, var(--line-light) 23px 24px);
  mask-image: linear-gradient(to bottom, transparent, var(--ink) 30%, var(--ink) 70%, transparent);
}

.nb { white-space: nowrap; }

.stack > * + * { margin-top: var(--stack, 16px); }
.row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- the one section-header pattern ---------- */
.eyebrow {
  font: 400 11px/1.4 var(--f-sans); letter-spacing: .26em; text-transform: uppercase;
  color: var(--brass-d);
}
.gloss  { font: 300 15px/1.5 var(--f-sans); color: var(--stone); }
.kn     { font: 400 13px/1.6 var(--f-kn); color: var(--bark); }
.kn-sub { font: 400 clamp(17px, 2.4vw, 22px)/1.5 var(--f-kn-serif); color: var(--bark); }
.lede   { font: 300 15px/1.75 var(--f-sans); max-width: 52ch; }

.band--forest .eyebrow, .band--bark .eyebrow, .loom .eyebrow, .ftr .eyebrow,
.band--forest .kn, .band--bark .kn, .loom .kn, .ftr .kn,
.band--forest .kn-sub, .band--bark .kn-sub { color: var(--brass-l); }
.band--forest .gloss, .band--bark .gloss { color: var(--mist); opacity: .82; }

.sechead > * + * { margin-top: 12px; }
.sechead .lede { margin-top: 18px; }
.sechead--center { text-align: center; }
.sechead--center .lede { margin-inline: auto; }

/* ---------- buttons: a woven selvedge, weft fills on hover ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 28px;
  font: 400 11px/1 var(--f-sans); letter-spacing: .2em; text-transform: uppercase;
  background: var(--areca); color: var(--mist);
}
.btn::before {            /* the weft passing through */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--terra);
  transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.btn::after {             /* running stitch along the edge */
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px dashed var(--brass-l); opacity: .55;
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }

.btn--ghost { background: transparent; color: var(--areca); box-shadow: inset 0 0 0 1px var(--areca); }
.btn--ghost::before { background: var(--areca); }
.btn--ghost::after { border-color: var(--brass-d); }
.btn--ghost:hover, .btn--ghost:focus-visible { color: var(--mist); }
.btn--ghost:hover::after, .btn--ghost:focus-visible::after { border-color: var(--brass-l); }

.band--forest .btn--ghost, .band--bark .btn--ghost, .loom .btn--ghost {
  color: var(--mist); box-shadow: inset 0 0 0 1px var(--line-light);
}
.band--forest .btn--ghost::after, .band--bark .btn--ghost::after, .loom .btn--ghost::after { border-color: var(--brass-l); }

.icon-btn {
  display: inline-grid; place-items: center; position: relative;
  min-width: 44px; height: 44px;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.note {
  border-left: 2px solid var(--areca); padding: 4px 0 4px 16px;
  color: var(--stone); font-size: 14px; max-width: 60ch;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .announce span:first-child { opacity: 1; }
  .ticker__run { flex-wrap: wrap; width: auto; justify-content: center; }
  .family li:first-child::before { opacity: 1; }
}
