/* Reset, document defaults, and the typography roles.
   Loads after tokens.css and before anything that selects a component. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
}

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

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

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

/* --- Typography roles ----------------------------------------------------
   Every piece of text on the site is one of these. Components reference the
   same tokens rather than these classes, so a role can also be applied
   directly to markup that has no component of its own. */

.type-hero {
  font-family: var(--font-display);
  font-size: var(--step-hero);
  font-weight: var(--weight-regular);
  line-height: var(--leading-hero);
  letter-spacing: var(--track-display);
}

.type-display {
  font-family: var(--font-display);
  font-size: var(--step-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-display);
}

.type-section {
  font-family: var(--font-display);
  font-size: var(--step-section);
  font-weight: var(--weight-regular);
  line-height: var(--leading-hero);
  letter-spacing: var(--track-display);
}

.type-name {
  font-family: var(--font-display);
  font-size: var(--step-name);
  font-weight: var(--weight-regular);
  line-height: var(--leading-title);
}

.type-title {
  font-family: var(--font-display);
  font-size: var(--step-title);
  font-weight: var(--weight-regular);
  line-height: var(--leading-title);
}

.type-lede {
  font-size: var(--step-lede);
  color: var(--ink-soft);
}

.type-body {
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: var(--leading-body);
}

.type-small {
  font-size: var(--step-small);
  line-height: var(--leading-control);
}

/* Mixed-case eyebrow above a block: "On this page", "Ecosystems", "Site" */
.type-eyebrow {
  font-family: var(--font-label);
  font-size: var(--step-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-eyebrow);
}

/* Uppercase mechanical label: field labels, specimen captions, meta keys */
.type-caps {
  font-family: var(--font-label);
  font-size: var(--step-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.type-mono {
  font-family: var(--font-mono);
  font-size: var(--step-ui);
}

/* --- Text colour ---------------------------------------------------------
   Secondary text needs a different value on each band, so the modifier is
   resolved by the band rather than picked at the call site. */

.text-soft {
  color: var(--ink-soft);

  .band--ink & {
    color: var(--ink-soft-on-ink);
  }

  .band--dune & {
    color: var(--ink-soft-on-dune);
  }
}

.text-accent {
  color: var(--orange-deep);

  .band--ink & {
    color: var(--orange-tint);
  }
}

/* The wordmark is a mask so it takes the colour of whatever band it sits in. */
.wordmark {
  display: block;
  aspect-ratio: 505.66 / 91.68;
  background-color: currentcolor;
  mask: url("/stanquette-wordmark-logo-v5.svg?v=9d7e") no-repeat center / contain;
}

/* The mark paints itself in currentcolor, so a link wrapping it must not
   contribute the user agent's link colour. */
a:has(> .wordmark) {
  display: block;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
