/* Content pages (legal, /learn hub and articles): calm, highly readable, light by default with a dark variant. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f7fb;
  --text: #14161b;
  --muted: #5d6472;
  --border: #e3e7ef;
  --brand: #1e5eff;
  --brand-ink: #ffffff;
  --measure: 72ch;
  /* Category pills: text colours chosen for ≥4.5:1 on their tinted backgrounds. */
  --pill-guide: #1a52e0;
  --pill-tutorial: #5a3fd9;
  --pill-help: #09694f;
  --pill-news: #8a4c10;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e9ecf2;
    --muted: #a3aab8;
    --border: #2a2f3a;
    --brand: #6f97ff;
    --brand-ink: #0f1115;
    --pill-guide: #8aaaff;
    --pill-tutorial: #b3a3ff;
    --pill-help: #4fd1a8;
    --pill-news: #f0a35e;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 12px;
  background: var(--bg);
  padding: 8px 12px;
  z-index: 10;
}

/* Header / footer */
.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header__inner,
.site-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__logo img {
  display: block;
  height: 34px;
  width: auto;
}

.site-header__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.site-header__nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current='page'] {
  background: var(--surface);
}

.button {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 8px;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer__inner {
  flex-direction: column;
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 40px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.site-footer p {
  margin: 0;
}

/* Document */
.doc {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.doc__article {
  max-width: var(--measure);
}

.doc__header h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.doc__meta {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 40px;
  font-size: 15px;
}

.toc__title {
  margin: 0 0 8px;
  font-weight: 600;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2 220px;
}

/* Prose */
.prose h2 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 48px 0 12px;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}

.prose h3 {
  font-size: 1.15rem;
  margin: 32px 0 8px;
  scroll-margin-top: 24px;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 6px;
}

.prose strong {
  font-weight: 650;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--surface);
  font-weight: 600;
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--brand);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.anchor {
  float: left;
  margin-left: -1.1em;
  width: 1em;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Article extras */
.breadcrumbs {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pill-guide) 12%, transparent);
  color: var(--pill-guide);
  vertical-align: 1px;
}

.pill--help {
  background: color-mix(in srgb, #12a37c 14%, transparent);
  color: var(--pill-help);
}

.pill--news {
  background: color-mix(in srgb, #d9822b 16%, transparent);
  color: var(--pill-news);
}

.prose code {
  font-size: 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
}

.prose kbd {
  font: 600 0.85em/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  background: var(--surface);
}

.prose h3 {
  scroll-margin-top: 24px;
}

.cta {
  margin: 48px 0 0;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--bg)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
}

.cta__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.cta p {
  margin: 0 0 16px;
}

.related {
  margin-top: 48px;
}

.related h2 {
  font-size: 1.3rem;
  margin: 0 0 16px;
}

/* Cards (hub and related articles) */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card[hidden] {
  display: none;
}

.card__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.card__link:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--brand) 40%, transparent);
}

.card__meta {
  font-size: 13px;
  color: var(--muted);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card__description,
.card__snippet {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.card__snippet {
  border-left: 3px solid var(--border);
  padding-left: 10px;
}

mark {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* Tool pages: the main call to action, right under the title */
.tool-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 8px 0 32px;
}

.tool-cta span {
  color: var(--muted);
  font-size: 14px;
}

.button--lg {
  font-size: 17px;
  padding: 13px 22px;
  border-radius: 10px;
}

/* Screenshots */
.shot {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 8px auto 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 32px -18px rgba(10, 14, 30, 0.45);
}

.shot img {
  display: block;
  max-width: 100%;
  height: auto;
}

.shot__caption {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px;
  text-align: center;
}

.prose p:has(> .shot) {
  margin-bottom: 24px;
}

/* User guide pager */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}

.pager__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  line-height: 1.35;
}

.pager__link:hover {
  border-color: var(--brand);
}

.pager__link span {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.pager__link span::before {
  content: '← ';
}

.pager__link--next {
  text-align: right;
  grid-column: 2;
}

.pager__link--next span::before {
  content: '';
}

.pager__link--next span::after {
  content: ' →';
}

.pill--tutorial {
  background: color-mix(in srgb, #7c5cff 15%, transparent);
  color: var(--pill-tutorial);
}

/* Hub sections */
.hub__section {
  margin-top: 40px;
}

.hub__section[hidden] {
  display: none;
}

.hub__section h2 {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
  scroll-margin-top: 24px;
}

.hub__intro {
  color: var(--muted);
  margin: 0 0 16px;
}

/* Hub */
.hub__header {
  max-width: 760px;
  margin-bottom: 24px;
}

.hub__header h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

.hub__lead {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 24px;
}

.search__input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--surface) no-repeat 16px center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a92a3' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 14px 44px;
}

.search__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.chip[aria-pressed='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.hub__status {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}

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

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .doc {
    padding-top: 32px;
  }
  .site-header__logo img {
    height: 28px;
  }
  .site-header__inner {
    gap: 8px;
  }
  .site-header__nav a {
    padding: 6px 8px;
    font-size: 14px;
  }
  .site-header .button {
    padding: 7px 10px;
    font-size: 14px;
    white-space: nowrap;
  }
  .site-header__inner,
  .site-footer__inner,
  .doc {
    padding-left: 16px;
    padding-right: 16px;
  }
  .anchor {
    display: none;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager__link--next {
    grid-column: 1;
  }
}

@media (max-width: 400px) {
  .site-header__logo img {
    height: 24px;
  }
  .site-header__nav a {
    padding: 6px;
  }
}
