/* =============================================================
   Type and marks.

   Two typefaces, both variable, both self-hosted — 85KB for the pair,
   which is less than the stylesheet request to Google Fonts used to
   cost, and it means the site has no third party in it at all. The
   single-file build embeds these, so it works with no network.

   **Instrument Sans** for anything that speaks. The site was set in a
   display serif until September, and the client's read was right: it
   looked like a heritage brochure rather than a manufacturer people buy
   from. This is a modern grotesque with slightly humanist proportions,
   so the headlines are current without being cold, and its figures are
   good, which matters on a page whose headline is a year.

   **Inter** for everything that informs. It gets out of the way, holds
   up at ten pixels in wide tracking, and its figures line up in a
   column, which the four numbers need.

   Marks are Font Awesome Free 7.3.1 (icons CC BY 4.0), inlined as a
   sprite rather than loaded as a webfont: five icons instead of two
   thousand, and nothing to fetch.
   ============================================================= */

@font-face {
  font-family: 'InstrumentSans';
  src: url('../fonts/instrument-sans.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'InterVar';
  src: url('../fonts/inter.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --display: 'InstrumentSans', 'Inter', system-ui, -apple-system, sans-serif;
  --sans: 'InterVar', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- headings ----
   A sans needs weight where a serif carried itself on contrast, so these
   are set at 600 and tracked in slightly: at display sizes a grotesque
   set at its default spacing reads loose. */
h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.024em;
  line-height: 1.06;
  /* keeps a two-line heading from leaving one word on the second line */
  text-wrap: balance;
}

/* ---- the kicker ----
   Small, wide, and carrying the house mark: an eight-pointed diamond,
   which is the shape at the centre of almost every rug on the site. */
.kicker {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}
/* The mark flows with the words rather than sitting in a flex row beside
   them. A flex row looks identical until the kicker wraps to two lines,
   at which point the text takes the whole row and leaves the mark
   stranded out at the margin. Inline, it simply travels with the text
   and follows whatever alignment the copy already has. */
.kicker::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 0.9em;
  background: currentColor;
  transform: rotate(45deg);
  vertical-align: middle;
}

/* ---- body ----
   380 against the heavier headings: the lede sits in a muted ink and
   still has to hold its own under a 600-weight line above it. */
body { font-family: var(--sans); }
.lede, .body, p { font-weight: 420; }

/* ---- figures ----
   The four numbers count while you scroll, so they must not reflow as
   the digits change. */
.num b, [data-years], .tabular {
  font-family: var(--display);
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.01em;
}

/* ---- marks ---- */
.ico {
  width: 1em; height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.125em;
  flex: 0 0 auto;
}

/* the scroll cue under the hero */
.scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-top: clamp(22px, 3.4vh, 40px);
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.scroll-cue .ico {
  width: 0.8em; height: 0.8em;
  animation: cue 2.4s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes cue {
  0%, 62%, 100% { transform: translateY(0); opacity: 0.55; }
  30% { transform: translateY(4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue .ico { animation: none; opacity: 0.8; }
}

/* ---- what the crawler and the screen reader get ----
   The carpets on this site are WebGL textures, so there is no <img> and no
   alt attribute anywhere. To a search engine and to a screen reader the
   page is text on an empty canvas. Each section therefore carries one
   sentence describing the rug it is showing, placed where the copy is and
   hidden from sight rather than from the accessibility tree. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
