/* Single-purpose helpers used across components. Anything that belongs
   to one component lives in components/ instead. */

/* Same-origin navigations cross-fade instead of flashing white.
   Browsers that do not support it simply navigate. Must sit outside
   the layer block. */
@view-transition {
  navigation: auto;
}

@layer utilities {
  /* The label. Archivo pulled in to 82% width, small, uppercase and
     widely tracked, so it reads as something printed on a sticker
     rather than as a shrunken heading. This is the one typographic
     tic that repeats across the site. */
  .label {
    display: block;
    margin: 0;
    max-inline-size: none;
    font-family: var(--font-display);
    font-size: var(--step--1);
    font-weight: 600;
    font-stretch: var(--width-label);
    letter-spacing: var(--tracking-label);
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--color-muted);
  }

  /* The full stop that closes a heading, in coral. Cheap, and it ties
     every heading on the page to the same hand. */
  .dot {
    color: var(--color-accent);
  }

  .icon {
    inline-size: 2rem;
    block-size: 2rem;
    color: var(--color-accent);
  }

  /* One link treatment for the whole site: the arrow moves, the rule
     under the text extends. Focus gets the same thing as hover. */
  .link-arrow {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-3xs);
    font-weight: 500;
    text-decoration: none;
    border-block-end: 1px solid currentColor;
    padding-block-end: 2px;
    transition: gap var(--motion), color var(--motion);
  }

  .link-arrow:hover,
  .link-arrow:focus-visible {
    gap: var(--space-2xs);
    color: var(--color-accent);
  }

  .visually-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* The one scroll-driven moment on the site: the chain steps arrive
     from below, in reading order, as the rail comes into view. The
     resting state is the visible one -- nothing here can strand an
     element at opacity 0, and a browser without animation-timeline
     never sees the rule at all. */
  @keyframes reveal {
    from {
      opacity: 0;
      translate: 0 1.25rem;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 5% cover 30%;
      }
    }
  }
}
