@layer base, components;

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

  html {
    color-scheme: dark light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html[data-theme="dark"] {
    color-scheme: dark;
  }

  html[data-theme="light"] {
    color-scheme: light;
  }

  body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font: 400 14px/1.5 var(--font-ui);
    -webkit-font-smoothing: antialiased;
  }

  button {
    font: inherit;
    color: inherit;
  }

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

  [hidden] {
    display: none !important;
  }
}

@layer components {
  .skip {
    position: fixed;
    left: 16px;
    top: 8px;
    z-index: 4;
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);
  }

  .skip:focus-visible {
    transform: none;
  }

  .top {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 8px 8px 16px;
    min-height: 56px;
  }

  .wordmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--ink);
    text-decoration: none;
  }

  .wordmark-mark {
    color: var(--accent);
    flex: none;
  }

  .wordmark-text {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-transform: lowercase;
    line-height: 1;
  }

  .top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }

  .icon-btn[aria-pressed="true"] {
    color: var(--accent);
  }

  #theme .mode-light,
  #theme .mode-dark {
    display: none;
  }

  #theme[data-mode="light"] .mode-auto,
  #theme[data-mode="dark"] .mode-auto {
    display: none;
  }

  #theme[data-mode="light"] .mode-light,
  #theme[data-mode="dark"] .mode-dark {
    display: inline;
  }

  .foot {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    padding: 0 16px 4px;
    background: var(--bg);
  }

  .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .footer-link {
    display: inline-block;
    padding: 8px 4px;
    color: var(--muted);
    font-family: var(--font-num);
    font-size: 12px;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
  }
}
