@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap&subset=vietnamese');

:root {
  --paper: #f4efe3;
  --paper-raised: #fbf8f1;
  --paper-soft: #ebe3d3;
  --paper-code: #151515;
  --ink: #181715;
  --ink-soft: #3e3a34;
  --ink-muted: #716b60;
  --ink-faint: #a29a8c;
  --line: #24211d;
  --line-soft: rgba(36, 33, 29, 0.17);
  --line-faint: rgba(36, 33, 29, 0.08);
  --orange: #ff5a36;
  --orange-dark: #c93b20;
  --orange-soft: #ffe1d7;
  --green: #2e7150;
  --green-soft: #dcebdc;
  --yellow: #fff19a;
  --blue: #276b85;
  --blue-soft: #dcebf1;
  --red: #a6332a;
  --red-soft: #f5dcd8;
  --shadow: 5px 5px 0 var(--line);
  --header-height: 60px;
  --sidebar-width: 296px;
  --content-width: 980px;
  --radius: 5px;
  --font-sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'DM Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

html[data-theme='dark'] {
  --paper: #11110f;
  --paper-raised: #181816;
  --paper-soft: #23211d;
  --paper-code: #090909;
  --ink: #eee9de;
  --ink-soft: #c8c0b4;
  --ink-muted: #9f978a;
  --ink-faint: #686258;
  --line: #eee9de;
  --line-soft: rgba(238, 233, 222, 0.18);
  --line-faint: rgba(238, 233, 222, 0.08);
  --orange: #ff6c4e;
  --orange-dark: #ff9b84;
  --orange-soft: #482319;
  --green: #79bd91;
  --green-soft: #183324;
  --yellow: #4e481e;
  --blue: #82bfd3;
  --blue-soft: #173440;
  --red: #f08d80;
  --red-soft: #40201d;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme='system'] {
    --paper: #11110f;
    --paper-raised: #181816;
    --paper-soft: #23211d;
    --paper-code: #090909;
    --ink: #eee9de;
    --ink-soft: #c8c0b4;
    --ink-muted: #9f978a;
    --ink-faint: #686258;
    --line: #eee9de;
    --line-soft: rgba(238, 233, 222, 0.18);
    --line-faint: rgba(238, 233, 222, 0.08);
    --orange: #ff6c4e;
    --orange-dark: #ff9b84;
    --orange-soft: #482319;
    --green: #79bd91;
    --green-soft: #183324;
    --yellow: #4e481e;
    --blue: #82bfd3;
    --blue-soft: #173440;
    --red: #f08d80;
    --red-soft: #40201d;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 26px);
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, var(--line-faint) 1px, transparent 0) 0 0 / 26px 26px,
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[lang='vi'] .en {
  display: none !important;
}

html[lang='en'] .vi {
  display: none !important;
}

::selection {
  color: #111;
  background: var(--yellow);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--paper-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-muted);
  border: 2px solid var(--paper-soft);
  border-radius: 10px;
}

a {
  color: var(--orange-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--orange);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 3000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  z-index: 2001;
  inset: 0 0 auto 0;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange);
  transition: width 80ms linear;
}

.header {
  position: fixed;
  z-index: 1200;
  inset: 0 0 auto 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
}

.header__menu-btn {
  display: none;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.header__logo:hover {
  color: var(--ink);
}

.header__logo-mark {
  padding: 2px 6px;
  color: #fff;
  background: var(--orange);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-style: normal;
  letter-spacing: 0.06em;
}

.header__crumb {
  padding-left: 16px;
  border-left: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.status-pill > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: 130ms ease;
}

.btn-mini:hover {
  color: var(--paper);
  background: var(--ink);
}

.btn-mini--accent {
  color: #fff;
  border-color: var(--orange);
  background: var(--orange);
}

.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}

.sidebar {
  position: fixed;
  z-index: 1000;
  inset: var(--header-height) auto 0 0;
  width: var(--sidebar-width);
  padding: 18px 14px 28px;
  overflow-y: auto;
  border-right: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  transition: transform 180ms ease;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  z-index: 900;
  inset: var(--header-height) 0 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(3px);
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.search-bar__icon {
  position: absolute;
  left: 11px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 1rem;
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  height: 39px;
  padding: 0 70px 0 34px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper-raised);
  font-size: 0.82rem;
}

.search-bar__input::placeholder {
  color: var(--ink-muted);
}

.search-bar__kbd {
  position: absolute;
  right: 7px;
  padding: 2px 5px;
  border: 1px solid var(--line-soft);
  color: var(--ink-muted);
  background: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.search-results {
  margin: -8px 0 16px;
  padding: 6px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.search-results__empty {
  padding: 9px;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.search-results a {
  display: block;
  padding: 8px 9px;
  color: var(--ink);
  font-size: 0.78rem;
  text-decoration: none;
}

.search-results a:hover,
.search-results a[aria-selected='true'] {
  color: #fff;
  background: var(--orange);
}

.search-results a strong,
.search-results a span {
  display: block;
}

.search-results a span {
  margin-top: 2px;
  overflow: hidden;
  color: inherit;
  opacity: 0.72;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__section {
  margin-bottom: 21px;
}

.sidebar__title {
  padding: 0 10px;
  margin-bottom: 5px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-decoration: none;
  transition: 100ms ease;
}

.sidebar__link-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: color 100ms ease, transform 100ms ease;
}

.sidebar__link:hover {
  color: var(--ink);
  background: var(--line-faint);
}

.sidebar__link.active {
  border-left-color: var(--orange);
  color: var(--ink);
  background: var(--orange-soft);
  font-weight: 600;
}

.sidebar__link:hover .sidebar__link-icon {
  color: var(--ink);
  transform: translateX(1px);
}

.sidebar__link.active .sidebar__link-icon {
  color: var(--orange-dark);
}

.sidebar__footer {
  display: grid;
  gap: 7px;
  padding: 15px 10px 0;
  border-top: 1px solid var(--line-soft);
}

.sidebar__footer a {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-decoration: none;
}

.sidebar__footer a:hover {
  color: var(--orange);
}

.main {
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  margin-left: var(--sidebar-width);
}

.content {
  width: min(calc(100% - 56px), var(--content-width));
  margin: 0 auto;
  padding: 54px 0 110px;
}

.doc-section {
  position: relative;
  padding: 68px 0 18px;
  border-top: 1.5px solid var(--line);
}

.doc-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.hero {
  padding: 18px 0 40px;
  margin-bottom: 40px;
  border-top: 0;
  border-bottom: 1.5px solid var(--line);
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero__meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.hero__meta-sep {
  width: 18px;
  height: 1px;
  background: var(--line-soft);
}

.hero__title {
  max-width: 850px;
  margin: 0 0 20px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.hero__title em {
  display: inline;
  padding: 0;
  color: var(--orange);
  background: transparent;
  font-style: italic;
  font-weight: 500;
}

.hero__title .hero__title-mark {
  display: inline-block;
  padding: 0 8px;
  background: var(--yellow);
  font-style: italic;
}

.hero__subtitle {
  max-width: 620px;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.hero__actions .btn {
  min-height: 48px;
  min-width: 120px;
  gap: 8px;
  padding: 11px 20px;
  font-size: 0.82rem;
}

.hero__actions .btn i {
  display: inline-flex;
  width: 1.05em;
  height: 1.05em;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: 130ms ease;
}

.btn:hover {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
  transform: translate(-2px, -2px);
}

.btn--primary {
  color: #fff;
  border-color: var(--orange);
  background: var(--orange);
}

.release-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.release-strip > div {
  min-width: 0;
  padding: 17px;
  border-right: 1px solid var(--line-soft);
}

.release-strip > div:last-child {
  border-right: 0;
}

.release-strip strong,
.release-strip span {
  display: block;
}

.release-strip strong {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.release-strip span {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 0.77rem;
  line-height: 1.45;
}

.star-progress {
  position: relative;
  max-width: 520px;
  padding: 14px 16px;
  margin-top: 4px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: 4px 4px 0 var(--line);
}

.star-progress__head,
.star-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.star-progress__head {
  margin-bottom: 10px;
}

.star-progress__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.star-progress__label i {
  color: #c48c13;
}

.star-progress__percent {
  padding: 2px 8px;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.star-progress__track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.star-progress__track::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: '';
  background: linear-gradient(90deg, transparent 0%, var(--line-faint) 40%, var(--line-soft) 50%, var(--line-faint) 60%, transparent 100%);
  background-size: 200% 100%;
  animation: star-track-shimmer 2.2s linear infinite;
  pointer-events: none;
}

.star-progress__fill {
  position: relative;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 6px, var(--orange-dark) 6px 12px);
  background-size: 24px 24px;
  animation: star-stripes-move 1.4s linear infinite;
  transition: width 1200ms cubic-bezier(.22, 1, .36, 1);
  will-change: width, background-position;
}

.star-progress__fill::before {
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 100%;
  content: '';
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  animation: star-fill-sweep 2.6s ease-in-out infinite;
}

.star-progress__meta {
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.star-progress__meta strong {
  color: var(--ink);
}

.star-progress--updated .star-progress__percent {
  animation: star-percent-pop 520ms cubic-bezier(.34, 1.56, .64, 1);
}

.star-progress--offline .star-progress__fill {
  opacity: 0.55;
  background: repeating-linear-gradient(-45deg, var(--ink-muted) 0 6px, var(--ink-soft) 6px 12px);
}

.star-progress--offline .star-progress__percent {
  color: var(--ink-muted);
}

@keyframes star-stripes-move {
  from { background-position: 0 0; }
  to { background-position: 24px 0; }
}

@keyframes star-track-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes star-fill-sweep {
  0% { left: -60%; }
  60%, 100% { left: 110%; }
}

@keyframes star-percent-pop {
  0%, 100% { transform: scale(1); background: var(--ink); }
  40% { transform: scale(1.18); background: var(--orange); }
}

#overview > h2 {
  position: relative;
  margin: 48px 0 10px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

#overview > h2 .heading-anchor {
  position: absolute;
  margin-left: 8px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.55em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

#overview > h2:hover .heading-anchor,
#overview > h2 .heading-anchor:focus {
  opacity: 1;
}

.alert {
  position: relative;
  padding: 14px 18px;
  margin: 18px 0;
  border: 1.5px solid var(--line);
  border-left-width: 6px;
  border-radius: var(--radius);
  background: var(--paper-raised);
  font-size: 0.92rem;
}

.alert--warning {
  border-left-color: #c48c13;
  background: color-mix(in srgb, var(--yellow) 45%, var(--paper-raised));
}

.alert--success {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.alert__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert__body {
  color: var(--ink-soft);
  line-height: 1.55;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0;
  margin: 24px 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.feature-card {
  position: relative;
  min-width: 0;
  padding: 22px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  transition: background 130ms ease;
}

.feature-card:hover,
.arch-layer:hover {
  background: var(--paper-soft);
}

.feature-card__num {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  font-size: 1rem;
  transition: transform 160ms ease;
}

.feature-card:hover .feature-card__icon {
  transform: rotate(-6deg);
}

.feature-card__title {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 600;
}

.feature-card__desc {
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.arch-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 24px 0;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.arch-layer {
  position: relative;
  min-width: 0;
  padding: 28px 22px;
  border-right: 1px solid var(--line-soft);
  transition: background 130ms ease;
}

.arch-layer:last-child {
  border-right: 0;
}

.arch-layer__badge {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.arch-layer--accent .arch-layer__badge {
  color: #fff;
  background: var(--orange);
}

.arch-layer__icon {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1.4rem;
}

.arch-layer__name {
  margin-bottom: 6px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

.arch-layer__desc {
  color: var(--ink-muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 28px;
}

.section-heading__eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.section-heading h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.section-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

h3 {
  position: relative;
  margin: 42px 0 13px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.25;
}

h3 .heading-anchor,
.section-heading h2 .heading-anchor {
  position: absolute;
  margin-left: 8px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.7em;
  text-decoration: none;
  opacity: 0;
  transition: opacity 120ms ease;
}

h3:hover .heading-anchor,
.section-heading h2:hover .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

p {
  margin: 0 0 15px;
}

strong {
  font-weight: 700;
}

code {
  padding: 0.1em 0.3em;
  border-radius: 3px;
  color: var(--orange-dark);
  background: var(--orange-soft);
  font-family: var(--font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

pre {
  margin: 16px 0 22px;
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 var(--radius) var(--radius);
  color: #eee8dc;
  background: var(--paper-code);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  tab-size: 4;
  white-space: pre;
}

pre code {
  padding: 0;
  color: inherit;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
}

.code-block {
  margin: 17px 0 23px;
  overflow: hidden;
  border: 1.5px solid #2e2d2b;
  border-radius: var(--radius);
  background: var(--paper-code);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--line) 30%, transparent);
}

.code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.code-block__header {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: #9e998f;
  background: #1c1c1b;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-block__dots {
  display: flex;
  gap: 5px;
  margin-right: 11px;
}

.code-block__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6058;
}

.code-block__dots i:nth-child(2) {
  background: #ffbd2e;
}

.code-block__dots i:nth-child(3) {
  background: #28c840;
}

.code-block__copy {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 3px;
  color: #d7d1c7;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  cursor: pointer;
}

.code-block__copy:hover,
.code-block__copy.copied {
  color: #fff;
  border-color: var(--orange);
  background: var(--orange);
}

.callout {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 20px;
  margin: 28px 0;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-left-width: 6px;
  background: var(--paper-raised);
}

.content > .callout {
  width: min(calc(100% - 56px), var(--content-width));
  margin: 28px auto 0;
}

.callout__label {
  padding-top: 2px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--important {
  border-left-color: var(--orange);
  background: var(--orange-soft);
}

.callout--warning {
  border-left-color: #c48c13;
  background: color-mix(in srgb, var(--yellow) 45%, var(--paper-raised));
}

.callout--danger {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.callout--info {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.flow-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.2fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 30px 0;
}

.flow-node {
  min-height: 122px;
  padding: 16px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.flow-node--accent {
  box-shadow: 4px 4px 0 var(--orange);
}

.flow-node small,
.flow-node strong,
.flow-node span {
  display: block;
}

.flow-node small {
  margin-bottom: 14px;
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.flow-node strong {
  font-size: 0.84rem;
}

.flow-node span {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.flow-stack {
  display: grid;
  gap: 7px;
}

.flow-stack .flow-node {
  min-height: auto;
  padding: 10px 12px;
}

.flow-stack .flow-node small {
  margin-bottom: 4px;
}

.flow-arrow {
  color: var(--orange);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.cards {
  display: grid;
  gap: 14px;
  margin: 25px 0;
}

.cards--2 {
  grid-template-columns: repeat(2, 1fr);
}

.cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

.info-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.info-card__index {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.info-card h3 {
  margin: 10px 0 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.info-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.tabs {
  margin: 24px 0 30px;
}

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1.5px solid var(--line);
}

.tabs__list button {
  padding: 9px 14px;
  border: 1.5px solid transparent;
  border-bottom: 0;
  color: var(--ink-muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  cursor: pointer;
}

.tabs__list button[aria-selected='true'] {
  margin-bottom: -1.5px;
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper-raised);
}

.tabs__panel {
  padding-top: 10px;
}

.tabs__panel[hidden] {
  display: none;
}

.table-wrap {
  max-width: 100%;
  margin: 18px 0 28px;
  overflow-x: auto;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

th,
td {
  padding: 11px 13px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  color: var(--ink);
  background: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--line-faint);
}

.do-dont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 26px 0;
}

.do-dont__item {
  min-width: 0;
  padding: 18px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.do-dont__item > strong {
  display: inline-block;
  padding: 3px 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.do-dont__item--bad > strong {
  background: var(--red);
}

.do-dont__item--good > strong {
  background: var(--green);
}

.do-dont__item p {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.check-list,
.number-list {
  padding: 0;
  margin: 18px 0 26px;
  list-style: none;
}

.check-list li,
.number-list li {
  position: relative;
  padding: 9px 10px 9px 36px;
  border-bottom: 1px solid var(--line-soft);
}

.check-list li::before {
  position: absolute;
  left: 8px;
  color: var(--green);
  content: '✓';
  font-family: var(--font-mono);
  font-weight: 700;
}

.number-list {
  counter-reset: docs-list;
}

.number-list li {
  counter-increment: docs-list;
}

.number-list li::before {
  position: absolute;
  left: 7px;
  color: var(--orange-dark);
  content: counter(docs-list, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
}

.fine-print {
  padding-left: 13px;
  border-left: 3px solid var(--line-soft);
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.step-list {
  display: grid;
  margin: 24px 0 30px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.step {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  padding: 15px;
  border-bottom: 1px solid var(--line-soft);
}

.step:last-child {
  border-bottom: 0;
}

.step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--line);
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.step strong {
  display: block;
  margin-bottom: 3px;
}

.step p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.81rem;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 24px 0 30px;
}

.api-card {
  min-width: 0;
  padding: 17px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.api-card > code {
  display: block;
  padding: 0;
  color: var(--orange-dark);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 500;
}

.api-card p {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) 1fr;
  margin: 18px 0 28px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.command-grid code,
.command-grid span {
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
}

.command-grid code:nth-last-child(-n + 2),
.command-grid span:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.command-grid code {
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: var(--paper-soft);
  font-size: 0.76rem;
}

.command-grid span {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.resource-links,
.next-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 28px 0;
}

.resource-links a,
.next-links a {
  display: block;
  padding: 18px;
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--paper-raised);
  text-decoration: none;
  transition: 130ms ease;
}

.resource-links a:hover,
.next-links a:hover {
  box-shadow: 4px 4px 0 var(--orange);
  transform: translate(-2px, -2px);
}

.resource-links strong,
.resource-links span,
.next-links small,
.next-links strong {
  display: block;
}

.resource-links span {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.next-links {
  grid-template-columns: repeat(3, 1fr);
}

.next-links small {
  margin-bottom: 8px;
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
}

.migration-table {
  margin: 24px 0 30px;
  border: 1.5px solid var(--line);
}

.migration-table > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--line-soft);
}

.migration-table > div:last-child {
  border-bottom: 0;
}

.migration-table__head span {
  padding: 9px 13px;
  background: var(--paper-soft);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
}

.migration-table > div > :first-child {
  border-right: 1px solid var(--line-soft);
}

.migration-table pre,
.migration-table .code-block {
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.migration-table .code-block__header {
  display: none;
}

.accordion {
  margin: 24px 0 30px;
  border-top: 1.5px solid var(--line);
}

.accordion details {
  border-bottom: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.accordion summary {
  position: relative;
  padding: 16px 48px 16px 15px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  position: absolute;
  top: 15px;
  right: 17px;
  color: var(--orange-dark);
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

.accordion details[open] summary::after {
  content: '−';
}

.accordion details > div {
  padding: 0 18px 18px;
  color: var(--ink-soft);
}

.accordion details > div > :last-child {
  margin-bottom: 0;
}

.accordion ol {
  margin: 8px 0 12px;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0 30px;
}

.security-grid article {
  min-width: 0;
  padding: 18px;
  border: 1.5px solid var(--line);
  background: var(--paper-raised);
}

.security-grid article > span {
  color: var(--orange-dark);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.security-grid h3 {
  margin: 10px 0 7px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.security-grid p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px max(28px, calc((100% - var(--content-width)) / 2));
  border-top: 1.5px solid var(--line);
  background: var(--paper-soft);
}

.footer > div {
  display: grid;
  gap: 2px;
}

.footer > div:last-child {
  text-align: right;
}

.footer strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
}

.footer span {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.back-to-top {
  position: fixed;
  z-index: 850;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--orange);
  font-family: var(--font-mono);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 270px;
  }

  .content {
    width: min(calc(100% - 40px), var(--content-width));
  }

  .flow-diagram {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .release-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .release-strip > div:nth-child(2) {
    border-right: 0;
  }

  .release-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 56px;
    --sidebar-width: 286px;
  }

  .header {
    padding: 0 12px;
    gap: 9px;
  }

  .header__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header__crumb,
  .status-pill {
    display: none;
  }

  .header__logo {
    font-size: 1.35rem;
  }

  .header__actions {
    gap: 5px;
  }

  .btn-mini {
    padding: 5px 8px;
    font-size: 0.66rem;
  }

  .sidebar {
    transform: translateX(-102%);
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .content {
    width: min(calc(100% - 32px), var(--content-width));
    padding-top: 38px;
  }

  .doc-section {
    padding-top: 52px;
  }

  .hero {
    padding-top: 10px;
  }

  .hero__title {
    font-size: clamp(2.7rem, 12vw, 4.7rem);
  }

  .cards--3,
  .security-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer {
    padding: 25px 18px;
  }

  .content > .callout {
    width: min(calc(100% - 32px), var(--content-width));
  }
}

@media (max-width: 620px) {
  .hero__meta {
    flex-wrap: wrap;
    gap: 7px 12px;
  }

  .hero__meta-sep {
    display: none;
  }

  .release-strip,
  .features-grid,
  .arch-diagram,
  .cards--2,
  .cards--3,
  .do-dont,
  .api-grid,
  .security-grid,
  .resource-links,
  .next-links {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .arch-layer {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .feature-card:last-child,
  .arch-layer:last-child {
    border-bottom: 0;
  }

  .release-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .release-strip > div:last-child {
    border-bottom: 0;
  }

  .callout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .callout__label {
    color: var(--orange-dark);
  }

  .tabs__list {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .tabs__list button {
    flex: 0 0 auto;
  }

  pre {
    padding: 16px;
    font-size: 0.74rem;
  }

  .migration-table > div {
    grid-template-columns: 1fr;
  }

  .migration-table > div > :first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .migration-table__head {
    display: none !important;
  }

  .command-grid {
    grid-template-columns: 1fr;
  }

  .command-grid code {
    border-right: 0;
  }

  .command-grid span {
    padding-top: 5px;
  }

  .footer {
    flex-direction: column;
  }

  .footer > div:last-child {
    text-align: left;
  }
}

@media (max-width: 440px) {
  .header__logo-mark {
    /* display: none; */
  }

  .header__actions a {
    display: none;
  }

  .content {
    width: calc(100% - 24px);
  }

  .content > .callout {
    width: calc(100% - 24px);
  }

  .hero__title {
    font-size: 2.55rem;
  }

  .hero__title em {
    display: inline;
    padding: 0;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }

  .hero__subtitle {
    font-size: 0.96rem;
  }

  .btn {
    width: 100%;
  }

  .step {
    grid-template-columns: 40px 1fr;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    --paper: #fff;
    --paper-raised: #fff;
    --paper-soft: #f4f4f4;
    --ink: #000;
    --ink-soft: #222;
    --ink-muted: #555;
    --line: #000;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  .header,
  .sidebar,
  .sidebar-overlay,
  .back-to-top,
  .reading-progress,
  .hero__actions,
  .code-block__copy {
    display: none !important;
  }

  .main {
    width: 100%;
    margin: 0;
  }

  .content {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .doc-section {
    break-before: page;
  }

  .hero,
  .doc-section:first-child {
    break-before: auto;
  }

  pre,
  .table-wrap,
  .callout,
  .info-card,
  .api-card {
    break-inside: avoid;
  }

  a {
    color: #000;
  }
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
  margin-top: 2rem;
}

.contributor-item {
  background-color: var(--bg);
  display: flex;
  align-items: center;
  padding: 1rem;
}

.contributor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--bg-hover);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-right: 15px;
  font-family: var(--font-serif);
  font-weight: 500;
  flex-shrink: 0;
}

.contributor-info {
  display: flex;
  flex-direction: column;
}

.contributor-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.contributor-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

@media (max-width: 1024px) {
  .contributors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .contributors-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero__actions {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .hero__actions .btn {
    width: auto;
    min-width: 0;
    flex: 1;
    padding: 11px 8px;
    font-size: 0.72rem;
  }
  .hero__actions .btn i {
    margin-right: 2px;
  }
}

/* Owner boxes */
.owners-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}

.owner-box {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-hover);
  max-width: fit-content;
}

.owner-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.owner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.owner-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}

.owner-sub {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
\n
/* Preloader */
#preloader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}
.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--line) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  color: transparent !important;
  border-radius: 4px;
  user-select: none;
}
.skeleton * {
  visibility: hidden;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
