/* ========== Root & Base ========== */
:root{
  /* Theme */
  --bg: #000000;
  --text: #ffffff;
  --muted: #cfcfcf;

  /* Content area */
  --content-max: 880px;
  --content-pad: 16px;

  /* Content links */
  --link: #60a5fa;
}

/* Base */
html, body { height: 100%; }
html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ===== Header Hero ===== */
.docs-hero--single {
  margin-top: 0px;
  margin-bottom: 20px;
}

.docs-title {
  margin: 0 0 10px 0;
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.1;
  letter-spacing: .2px;
}

/* ========== Table of contents ========== */
.toc-callout {
  margin: 30px 0 20px;
  padding: clamp(16px, 3vw, 24px);
  border-radius: 16px;
  background: #1c2230;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 1px 2px rgba(0,0,0,.35) inset,
              0 0 0 1px rgba(0,0,0,.2);
}

.toc-callout__title {
  margin: 0 0 12px 0;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.25;
  letter-spacing: .2px;
}

.toc-callout__list {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
  list-style: disc;
}

.toc-callout__list a {
  text-decoration: none;
  color: var(--link);
}
.toc-callout__list a:hover,
.toc-callout__list a:focus-visible { text-decoration: underline; }

/* ========== Page content ========== */
main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: var(--content-pad);
  padding-block: 16px 32px;
  padding-top: calc(env(safe-area-inset-top) + var(--appbar-h) + 12px);
}

/* Section titles */
.section-title {
  font-weight: 700;
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.3;
  margin: 2rem 0 0.5rem;
  letter-spacing: 0.2px;
  color: #3478F6;
  scroll-margin-top: calc(env(safe-area-inset-top) + var(--appbar-h) + 12px);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Subheadings inside sections */
.section-subtitle {
  font-weight: 700;
  font-size: clamp(20px, 5vw, 26px);
  line-height: 1.35;
  margin: 1.25rem 0 0.4rem;
  letter-spacing: 0.2px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Sub-subheadings inside sections */
.section-subsubtitle {
  font-weight: 700;
  font-size: clamp(17px, 4.2vw, 22px);
  line-height: 1.35;
  margin: 1rem 0 0.35rem;
  letter-spacing: 0.15px;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Invisible anchor that sits above the heading to account for header height */
.anchor-offset {
  display: block;
  position: relative;
  top: calc(-1 * (env(safe-area-inset-top) + var(--appbar-h) + 12px));
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Kill any focus/target ring on the invisible anchor */
.anchor-offset:focus,
.anchor-offset:focus-visible,
.anchor-offset:target {
  outline: none !important;
}

/* Paragraphs */
p { color: var(--text); }

/* ========== Back to top ========== */
.back-to-top{
  position: fixed;
  right: clamp(12px, 3vw, 24px);
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #000000; 
  background: #e5e5e5;   
  border: 1px solid rgba(0,0,0,0.25); 
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  text-decoration: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 50;
}
.back-to-top svg{ width: 22px; height: 22px; }
.back-to-top:focus-visible{ outline: 2px solid var(--link); outline-offset: 3px; }

/* visible state */
.back-to-top.is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* hide when [hidden] is present (initially) */
.back-to-top[hidden]{ display:none; }
