@view-transition {
  navigation: auto;
}

:root {
  color-scheme: light;
  --doc-background: 210 20% 98%;
  --doc-foreground: 215 25% 15%;
  --doc-card: 0 0% 100%;
  --doc-muted: 215 16% 42%;
  --doc-border: 214 32% 88%;
  --doc-primary: 217 92% 60%;
  --doc-accent: 192 91% 42%;
  --doc-deep: 222 84% 11%;
  --doc-ring: 217 92% 60%;
  --doc-head-font: Outfit, sans-serif;
  --doc-body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.dark {
  color-scheme: dark;
  --doc-background: 222 47% 11%;
  --doc-foreground: 213 31% 91%;
  --doc-card: 219 43% 14%;
  --doc-muted: 215 24% 72%;
  --doc-border: 217 24% 30%;
  --doc-ring: 217 92% 60%;
}

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

html {
  min-height: 100%;
  background: hsl(var(--doc-background));
  scroll-behavior: smooth;
  scrollbar-color: hsl(var(--doc-primary) / 0.55) hsl(var(--doc-background));
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: hsl(var(--doc-background));
  color: hsl(var(--doc-foreground));
  font-family: var(--doc-body-font);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: hsl(var(--doc-primary) / 0.25);
  color: hsl(var(--doc-foreground));
}

a {
  color: hsl(var(--doc-primary));
  text-underline-offset: 0.18em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid hsl(var(--doc-ring));
  outline-offset: 3px;
}

.doc-command-rail {
  --doc-progress: 0;
  position: fixed;
  inset: 0 0 auto;
  height: 8px;
  z-index: 100;
  pointer-events: none;
  view-transition-name: a14r-rail;
}

.doc-command-rail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: hsl(var(--doc-primary) / 0.2);
}

.doc-command-fill {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(to right, hsl(var(--doc-primary)), hsl(var(--doc-accent)));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s ease-out;
}

.doc-command-signal {
  position: absolute;
  top: 3px;
  left: 0;
  width: 6px;
  height: 6px;
  border: 1px solid hsl(var(--doc-deep));
  border-radius: 50%;
  background: hsl(var(--doc-accent));
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: left 0.1s ease-out, opacity 0.2s ease;
  z-index: 3;
}

.doc-command-rail.is-active .doc-command-signal {
  opacity: 1;
}

.doc-command-node {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 4px;
  border: 1px solid hsl(var(--doc-primary) / 0.58);
  border-radius: 50%;
  background: hsl(var(--doc-deep));
  opacity: 0.55;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-command-node.is-visited {
  border-color: hsl(var(--doc-accent) / 0.8);
  background: hsl(var(--doc-accent));
  opacity: 0.8;
}

.doc-command-node.is-current {
  border-color: hsl(var(--doc-primary));
  background: hsl(var(--doc-primary));
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.7);
}

.doc-shell-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(var(--doc-deep) / 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.doc-shell-header-inner {
  width: min(1200px, 100%);
  min-height: 4.5rem;
  margin-inline: auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.doc-brand {
  color: white;
  font-family: Outfit, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
  view-transition-name: a14r-brand;
}

.doc-shell-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-back {
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.doc-back:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.back svg {
  flex: 0 0 auto;
}

html.doc-shell-ready .back {
  display: none;
}

.doc-theme-toggle {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.doc-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
}

.doc-theme-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
}

.doc-theme-toggle .sun-icon,
html.dark .doc-theme-toggle .moon-icon {
  display: none;
}

html.dark .doc-theme-toggle .sun-icon,
.doc-theme-toggle .moon-icon {
  display: block;
}

main {
  width: min(50rem, 100%);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 7rem) 1.5rem;
}

main article {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: hsl(var(--doc-card));
  border: 1px solid hsl(var(--doc-border));
  border-radius: 0.5rem;
  box-shadow: none;
  view-transition-name: a14r-document;
}

h1,
h2,
h3 {
  color: hsl(var(--doc-foreground));
  font-family: var(--doc-head-font);
  overflow-wrap: break-word;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.875rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p,
li,
dd {
  color: hsl(var(--doc-muted));
}

p {
  margin: 1rem 0;
}

ul,
ol {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.4rem;
}

.updated {
  margin: 0 0 2.5rem;
  color: hsl(var(--doc-muted));
  font-size: 0.875rem;
}

dl {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

dt {
  color: hsl(var(--doc-foreground));
  font-weight: 700;
}

dd {
  margin: 0.2rem 0 0;
}

.doc-footer {
  padding: 2rem 0;
  color: rgba(255, 255, 255, 0.58);
  background: hsl(var(--doc-deep));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8125rem;
  view-transition-name: a14r-footer;
}

.doc-footer-inner {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.doc-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.doc-footer a {
  color: rgba(255, 255, 255, 0.66);
  text-decoration: none;
}


.doc-footer a[aria-current="page"] {
  color: white;
  text-decoration: underline;
  text-decoration-color: hsl(var(--doc-accent));
}

.doc-footer a:hover {
  color: white;
}

::view-transition-group(a14r-brand),
::view-transition-group(a14r-rail),
::view-transition-group(a14r-footer) {
  animation-duration: 0.42s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root) {
  animation: doc-root-exit 0.18s ease-in both;
}

::view-transition-new(root) {
  animation: doc-root-enter 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

::view-transition-new(a14r-document) {
  animation: doc-surface-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes doc-root-exit {
  to { opacity: 0; }
}

@keyframes doc-root-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes doc-surface-enter {
  from {
    opacity: 0;
    clip-path: inset(0 0 14% 0);
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
    transform: none;
  }
}

@media (max-width: 640px) {
  .doc-back span {
    display: none;
  }

  main {
    padding-block: 3.5rem;
  }

  .doc-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .doc-command-fill,
  .doc-command-signal,
  .doc-command-node {
    transition: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
  }
}
