/* "limestone": cool limestone paper and near-black ink, Newsreader set light
   for display and Schibsted Grotesk for text (the core's own faces: needs no
   fonts file beyond the core's). The accent is the ink, so actions read as
   ink on stone; the photos carry the colour. A spaced, thin wordmark with an
   optional tracked sub-label under it:
     <a href="/" class="nav__brand">Name<small>Second line</small></a>
   Light mode sets the paper outright (#ebe9e3, ink #1b1c1a, muted #5c5d57,
   5.5:1 on the paper); dark mode keeps the base's derived roles on the
   stone's cool tint. Pairs well with the pairs layout and the swatch board
   (dist/fluid-layout-pairs.min.css, dist/fluid-swatches.min.css). */
@layer reset, tokens, base, layouts, components, themes, utilities;

@layer themes {
  :root {
    --accent: oklch(22.5% 0.004 129);         /* the ink; white on it ≈ 17:1 */
    --neutral-tint: oklch(50% 0.009 100);     /* cool limestone */
    --weight-display: 300;
    --weight-heading: 350;
    --tracking-display: -0.02em;
  }

  /* The paper in light mode, on the page and on a light bar. Dark mode and
     the dark bands keep the base's derived roles. Behind the same test as
     the base's legacy floor: a browser without relative colour keeps it. */
  @supports (color: oklch(from red min(l, 0.5) c h)) {
    :root,
    .nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"] {
      --color-background: light-dark(oklch(93.4% 0.008 92), oklch(from var(--neutral-tint) 0.145 calc(c * 1.5) h));
      --color-surface: light-dark(oklch(90.6% 0.009 92), oklch(from var(--neutral-tint) 0.19 calc(c * 1.5) h));
      --color-surface-raised: light-dark(oklch(96.2% 0.006 92), oklch(from var(--neutral-tint) 0.22 calc(c * 1.5) h));
      --color-text: light-dark(oklch(22.5% 0.004 129), oklch(from var(--neutral-tint) 0.93 c h));
      --color-text-muted: light-dark(oklch(47.5% 0.0095 114), oklch(from var(--neutral-tint) 0.74 c h));
      --color-border: light-dark(oklch(84% 0.009 100), oklch(from var(--neutral-tint) 0.30 calc(c * 1.75) h));
      --color-border-subtle: light-dark(oklch(88.5% 0.008 100), oklch(from var(--neutral-tint) 0.22 calc(c * 1.5) h));
    }
    @media (prefers-contrast: more) {
      :root,
      .nav:not([data-bg="plain"], [data-variant="transparent"]), .nav[data-bg="inverse"] {
        --color-border: var(--color-border-strong);
        --color-text-muted: var(--color-text);
      }
    }
  }

  /* The wordmark: thin and spaced; a sub-label sits under it, small,
     tracked and in capitals. The trailing space of the tracking is
     taken back so the mark lines up with the page edge. */
  .nav__brand {
    font-weight: calc(200 + var(--_dark-weight));
    letter-spacing: 0.42em;
    margin-inline-end: -0.42em;
    text-transform: uppercase;
    line-height: 1;
  }
  .nav__brand:has(> small) { display: inline-grid; justify-items: start; gap: 5px; }
  .nav__brand > small {
    font-family: var(--font-body);
    font-weight: calc(500 + var(--_dark-weight));
    font-size: 0.56rem;
    letter-spacing: 0.5em;
    opacity: 0.85;
  }

  /* Labels and form marks in the ink, not a colour. */
  .eyebrow { color: var(--color-text-muted); }
  input:is([type="radio"], [type="checkbox"]) { accent-color: var(--color-text); }
}
