/*
  Base: a light reset, element defaults, focus and selection, the type roles
  from the Type board as classes, and small helpers.
*/

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

  body {
    background: var(--color-background);
    color: var(--color-ink);
    font-family: var(--font-sans);
    font-size: var(--type-body-size);
    line-height: var(--type-body-line);
    margin: 0;
    min-block-size: 100vh;
  }

  h1,
  h2,
  h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 0;
  }

  h1 {
    font-size: var(--type-page-title-size);
    letter-spacing: var(--type-page-title-tracking);
    line-height: 1.15;
  }

  h2 {
    font-size: var(--type-panel-title-size);
  }

  h3 {
    font-size: var(--type-beat-title-size);
  }

  a {
    color: var(--color-link);
  }

  a:hover {
    color: var(--color-ink);
  }

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

  ::selection {
    background: var(--color-pressed);
    color: var(--color-ink);
  }

  input[type="checkbox"] {
    accent-color: var(--color-focus);
  }

  /* ---------- Type roles ---------- */

  .type-display {
    font-family: var(--font-serif);
    font-size: var(--type-display-size);
    font-weight: var(--type-display-weight);
    letter-spacing: var(--type-display-tracking);
    line-height: var(--type-display-line);
  }

  .type-section-title {
    font-family: var(--font-serif);
    font-size: var(--type-section-title-size);
    font-weight: 500;
    letter-spacing: var(--type-section-title-tracking);
  }

  .type-lead {
    color: var(--color-ink-tertiary);
    font-size: var(--type-lead-size);
    line-height: var(--type-lead-line);
  }

  .type-meta {
    color: var(--color-muted);
    font-size: var(--type-meta-size);
  }

  .type-label {
    color: var(--color-muted);
    font-size: var(--type-label-size);
    font-weight: var(--type-label-weight);
    letter-spacing: var(--type-label-tracking);
    text-transform: uppercase;
  }

  .type-timecode {
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: var(--type-timecode-size);
  }

  /* The hand-drawn eyebrow: one per screen at most, above a Literata title. */
  .eyebrow {
    color: var(--color-hand);
    display: inline-block;
    font-family: var(--font-hand);
    font-size: var(--type-eyebrow-size);
    font-weight: 400;
    line-height: 1;
    transform: rotate(var(--type-eyebrow-tilt));
    transform-origin: left bottom;
  }

  /* Hand-drawn words for empty states, like "good ones, no home yet". */
  .hand {
    font-family: var(--font-hand);
    font-weight: 400;
    line-height: 1;
    transform: rotate(var(--type-eyebrow-tilt));
  }

  /* ---------- Helpers ---------- */

  .icon {
    flex: none;
    vertical-align: middle;
  }

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

  .muted {
    color: var(--color-muted);
    font-size: var(--type-caption-size);
  }

  .hint {
    color: var(--color-muted);
    font-size: var(--type-small-size);
    margin: 0;
  }

  .empty {
    color: var(--color-muted);
  }

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