/*
 * Radial docs
 * Follows the site's type rule (see privacy.html): one style — 16px, regular
 * weight, no bold. Hierarchy comes from spacing and ink opacity, never size
 * or weight. Cream (--cream) is the only accent, used for the active nav item.
 */

:root {
  --ink: #17191d;
  --cream: #f3e8dc;
  --ink-72: rgba(23, 25, 29, 0.72);
  --ink-50: rgba(23, 25, 29, 0.5);
  --ink-30: rgba(23, 25, 29, 0.3);
  --hairline: rgba(23, 25, 29, 0.08);
  --font: 'ABC Camera Plain Variable', 'ABCCameraPlainVariable-Regular',
    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  --header-h: 57px;
}

* {
  box-sizing: border-box;
}

/* Cross-document view transition: docs-to-docs navigation crossfades instead
   of flashing white (Chrome 126+, Safari 18.2+; others just navigate). */
@media not (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: auto;
  }
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.docs-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}

.docs-header .brand img {
  width: 24px;
  height: 24px;
  display: block;
}

.docs-header .crumb-sep {
  color: var(--ink-30);
}

.docs-header .crumb {
  color: var(--ink-50);
  text-decoration: none;
  transition: color 0.15s ease;
}

.docs-header .crumb:hover {
  color: var(--ink);
}

.docs-header .spacer {
  flex: 1;
}

.docs-header .header-link {
  color: var(--ink-50);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 9999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.docs-header .header-link:hover {
  color: var(--ink);
  background: rgba(23, 25, 29, 0.04);
}

.menu-btn,
.menu-btn[hidden] {
  display: none;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 4px 12px;
  border-radius: 9999px;
  cursor: pointer;
}

/* ── Shell ───────────────────────────────────────────────────────────── */

.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.docs-nav {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 40px 0 96px;
}

.docs-nav .nav-section {
  margin: 0 0 28px;
}

.docs-nav .nav-title {
  margin: 0 0 6px;
  padding: 0 10px;
  color: var(--ink-50);
}

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav li + li {
  margin-top: 2px;
}

.docs-nav li a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--ink-72);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.docs-nav li a:hover {
  color: var(--ink);
  background: rgba(23, 25, 29, 0.04);
}

.docs-nav li a[aria-current='page'] {
  color: var(--ink);
  background: rgba(23, 25, 29, 0.04);
}

/* ── Content ─────────────────────────────────────────────────────────── */

.docs-main {
  max-width: 720px;
  min-width: 0;
  padding: 40px 0 96px;
}

/* One type style: 16px, regular weight, everywhere. */
.docs-main * {
  font-size: inherit;
  font-weight: 400;
}

.docs-main .kicker {
  margin: 0 0 6px;
  color: var(--ink-50);
}

.docs-main h1 {
  margin: 0 0 6px;
  color: var(--ink);
}

.docs-main .lede {
  margin: 0 0 32px;
  color: var(--ink);
}

.docs-main h2 {
  margin: 44px 0 10px;
  color: var(--ink);
}

.docs-main h3 {
  margin: 28px 0 8px;
  color: var(--ink);
}

.docs-main p,
.docs-main li {
  color: var(--ink-72);
  margin: 12px 0;
}

.docs-main li {
  margin: 6px 0;
}

.docs-main ul,
.docs-main ol {
  padding-left: 20px;
  margin: 12px 0;
}

.docs-main strong {
  color: var(--ink);
}

.docs-main a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--ink-30);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease;
}

.docs-main a:hover {
  text-decoration-color: var(--ink);
}

.docs-main code {
  font-family: var(--mono);
  font-size: 14px;
  background: rgba(23, 25, 29, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

.docs-main pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--ink-72);
}

.docs-main pre code {
  background: none;
  padding: 0;
}

.docs-main kbd {
  /* Text font, not mono: SF Mono/Menlo lack the ⇧/↑/↓ glyphs, so they'd
     fall back to a mismatched symbol font inside key chips. */
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(23, 25, 29, 0.18);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

.docs-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.docs-main th {
  text-align: left;
  color: var(--ink-50);
}

.docs-main th,
.docs-main td {
  padding: 8px 16px 8px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-72);
  vertical-align: top;
}

.docs-main td:first-child {
  white-space: nowrap;
}

/* Cream callout */
.docs-main .note {
  background: rgba(243, 232, 220, 0.5);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 20px 0;
}

.docs-main .note p {
  margin: 0;
}

/* Docs-home cards */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.card {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px;
}

.card h2 {
  margin: 0 0 6px;
}

.card > p {
  margin: 0 0 14px;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card li {
  margin: 4px 0;
}

.card a {
  text-decoration: none;
  color: var(--ink-72);
  transition: color 0.15s ease;
}

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

/* Prev / next footer */
.pn {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.pn a {
  color: var(--ink-50);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.pn .pn-next {
  margin-left: auto;
  text-align: right;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .menu-btn:not([hidden]) {
    display: inline-block;
  }

  .docs-nav {
    display: none;
  }

  body.nav-open .docs-nav {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: #fff;
    padding: 24px;
    max-height: none;
    /* The base align-self: start (for sticky) would shrink this fixed box
       to its content instead of filling to bottom: 0. */
    align-self: stretch;
  }

  body.nav-open {
    overflow: hidden;
  }

  .docs-main {
    padding-top: 32px;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Keep the header to brand + menu on small screens; both links are
     reachable from the docs themselves. */
  .docs-header .header-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
