/* What every page shares: the reset, type, links, buttons, the top bar and the footer. Built on tokens.css. */

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

html {
  /* The scrollbar's space is kept on every page, so nothing shifts between a long page and a short one. */
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

/* Read by screen readers, not shown */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Layout */
.wrap {
  max-width: var(--width-page);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-end);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.kicker {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-accent);
}

/* A light/dark image or icon pair: one shows, by theme */
.when-light,
.l {
  display: var(--show-light);
}

.when-dark,
.d {
  display: var(--show-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-line));
}

.btn.primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: transparent;
}

.btn.small {
  height: 36px;
  min-width: 36px;
  padding: 0 var(--space-3);
  border-radius: 10px;
  font-size: var(--text-sm);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.chip {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 550;
  white-space: nowrap;
}

.chip.done {
  background: var(--color-ok-soft);
  color: var(--color-ok);
}

.chip.now {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.chip.next {
  background: var(--color-surface-2);
  color: var(--color-muted);
}

/* Top bar */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--color-bg) 84%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
}

/* The top bar and the footer have the same width on every page, so moving between pages only moves the
   current-page highlight. */
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: var(--width-docs);
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
}

.site-nav {
  display: flex;
  gap: var(--space-1);
  margin-inline-start: auto;
  font-size: var(--text-sm);
}

.site-nav a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  text-decoration: none;
}

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

.site-nav a[aria-current="page"] {
  color: var(--color-ink);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
}

.site-actions {
  display: flex;
  gap: var(--space-2);
}

@media (max-width: 860px) {
  .site-nav {
    display: none;
  }

  .site-actions {
    margin-inline-start: auto;
  }
}

/* On a phone the top bar's links keep only their icons, so the bar fits the screen */
@media (max-width: 480px) {
  .site-actions .label {
    display: none;
  }

  .site-actions .btn {
    width: 36px;
    padding: 0;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-8);
  max-width: var(--width-docs);
  padding-block: var(--space-8);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-inline-start: auto;
}

.site-footer a {
  text-decoration: none;
}

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

/* Questions and answers (the landing page's FAQ and the FAQ page) */
.qa {
  margin: 0 0 10px;
  padding: 0 var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: 14px;
  background: var(--color-surface);
}

.qa summary {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: "+";
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1;
  color: var(--color-muted);
}

.qa[open] summary::after {
  content: "−";
}

.qa p {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--color-muted);
}

.qa a {
  color: var(--color-accent);
}
