@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #f6f7fa;
  --surface-2: #eef0f5;
  --text: #0b1020;
  --text-2: #2a3245;
  --muted: #5d6679;
  --border: #e5e8ef;
  --border-strong: #d5dae4;
  --accent: #1a5cff;
  --accent-2: #7a3cf0;
  --accent-soft: rgba(26, 92, 255, 0.08);
  --accent-text: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.78);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(16, 24, 40, 0.25), 0 8px 20px -8px rgba(16, 24, 40, 0.12);
  --glow-1: rgba(26, 92, 255, 0.16);
  --glow-2: rgba(122, 60, 240, 0.12);
  --callout-bg: #f2f6ff;
  --callout-border: #cddcff;
  --warn-bg: #fff8e6;
  --warn-border: #f2d78b;
  --warn-text: #5c4500;
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0d14;
    --bg-elev: #10141e;
    --surface: #121722;
    --surface-2: #192030;
    --text: #edf0f6;
    --text-2: #cfd5e1;
    --muted: #97a1b4;
    --border: #1f2635;
    --border-strong: #2b3446;
    --accent: #7aa2ff;
    --accent-2: #b08cff;
    --accent-soft: rgba(122, 162, 255, 0.12);
    --accent-text: #0a0d14;
    --header-bg: rgba(10, 13, 20, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 8px 20px -8px rgba(0, 0, 0, 0.5);
    --glow-1: rgba(90, 130, 255, 0.22);
    --glow-2: rgba(160, 100, 255, 0.16);
    --callout-bg: rgba(122, 162, 255, 0.08);
    --callout-border: rgba(122, 162, 255, 0.28);
    --warn-bg: rgba(242, 200, 90, 0.08);
    --warn-border: rgba(242, 200, 90, 0.3);
    --warn-text: #f1d98a;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0d14;
  --bg-elev: #10141e;
  --surface: #121722;
  --surface-2: #192030;
  --text: #edf0f6;
  --text-2: #cfd5e1;
  --muted: #97a1b4;
  --border: #1f2635;
  --border-strong: #2b3446;
  --accent: #7aa2ff;
  --accent-2: #b08cff;
  --accent-soft: rgba(122, 162, 255, 0.12);
  --accent-text: #0a0d14;
  --header-bg: rgba(10, 13, 20, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.75), 0 8px 20px -8px rgba(0, 0, 0, 0.5);
  --glow-1: rgba(90, 130, 255, 0.22);
  --glow-2: rgba(160, 100, 255, 0.16);
  --callout-bg: rgba(122, 162, 255, 0.08);
  --callout-border: rgba(122, 162, 255, 0.28);
  --warn-bg: rgba(242, 200, 90, 0.08);
  --warn-border: rgba(242, 200, 90, 0.3);
  --warn-text: #f1d98a;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

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

svg {
  flex: none;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  font-family: var(--font);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  color: var(--text-2);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.45em;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand .pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 9px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-actions a,
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
}

.header-actions a svg {
  width: 16px;
  height: 16px;
}

.header-actions a:hover,
.icon-button:hover {
  color: var(--text);
  background: var(--surface);
}

.icon-button[hidden] {
  display: none;
}

.icon-button {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.mobile-nav {
  display: none;
}

.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 200px;
  gap: 56px;
  overflow-x: clip;
}

.sidebar,
.toc {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 0;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px 12px;
}

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

.nav-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-list a svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.nav-list a:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-list a[aria-current="page"] svg {
  color: var(--accent);
}

.toc-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc a:hover {
  color: var(--text);
}

.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.content:focus {
  outline: none;
}

.content {
  min-width: 0;
  max-width: 740px;
  padding: 44px 0 72px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.content h1 {
  font-size: clamp(32px, 4.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 750;
  margin: 0 0 14px;
}

.lead {
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 32px;
}

.content h2 {
  position: relative;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 56px 0 14px;
  padding-top: 8px;
}

.content h3 {
  font-size: 18px;
  letter-spacing: -0.01em;
  font-weight: 650;
  margin: 32px 0 10px;
}

.content p,
.content li {
  color: var(--text-2);
}

.content strong {
  color: var(--text);
  font-weight: 600;
}

.content ul {
  padding-left: 22px;
}

.content li {
  margin: 0 0 8px;
}

.content li::marker {
  color: var(--muted);
}

.anchor {
  position: absolute;
  left: -1.1em;
  padding-right: 0.3em;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

h2:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 18px 0 24px;
}

.steps > li {
  position: relative;
  counter-increment: step;
  padding: 0 0 18px 46px;
  margin: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--callout-border);
  font-size: 13px;
  font-weight: 700;
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 4px;
  width: 1px;
  background: var(--border-strong);
}

.callout {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  color: var(--text-2);
}

.callout svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--accent);
}

.callout p {
  margin: 0;
}

.callout.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.callout.warn,
.callout.warn p,
.callout.warn strong {
  color: var(--warn-text);
}

.callout.warn svg {
  color: var(--warn-text);
}

figure {
  margin: 28px 0 36px;
}

.frame {
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.frame-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}

.frame-bar span:nth-child(1) {
  background: #ff5f57;
}

.frame-bar span:nth-child(2) {
  background: #febc2e;
}

.frame-bar span:nth-child(3) {
  background: #28c840;
}

.popover-shot {
  max-width: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: #ffffff;
}

.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.table {
  margin: 20px 0 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  background: var(--bg-elev);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}

td:first-child {
  font-weight: 550;
  color: var(--text);
}

.home-hero {
  position: relative;
  isolation: isolate;
  padding: 24px 0 8px;
}

.home-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -80px -120px auto -120px;
  height: 520px;
  background:
    radial-gradient(40% 55% at 22% 30%, var(--glow-1), transparent 70%),
    radial-gradient(35% 50% at 78% 20%, var(--glow-2), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

.home-hero h1 {
  font-size: clamp(36px, 5.6vw, 56px);
  letter-spacing: -0.035em;
}

.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 6px 18px -6px var(--accent);
}

.button-secondary {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.guides {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guides li {
  margin: 0;
}

.guide-card {
  position: relative;
  display: flex;
  gap: 14px;
  height: 100%;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.guide-card:hover {
  border-color: var(--callout-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.guide-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.guide-icon svg {
  width: 19px;
  height: 19px;
}

.guide-card strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text);
}

.guide-card strong svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.guide-card:hover strong svg {
  transform: translateX(3px);
  color: var(--accent);
}

.guide-card span {
  display: block;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin-top: 2px;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 64px;
}

.pager a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pager a:hover {
  border-color: var(--callout-border);
  background: var(--surface);
}

.pager small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pager strong {
  font-size: 15.5px;
  color: var(--text);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer .inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

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

.site-footer a:hover {
  color: var(--text);
}

.lightbox {
  width: fit-content;
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(5, 8, 15, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox img {
  width: auto;
  height: auto;
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 14px;
  cursor: zoom-out;
}

@media (prefers-reduced-motion: no-preference) {
  .content > * {
    animation: rise 0.45s ease both;
  }

  .lightbox[open] img {
    animation: pop 0.2s ease both;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 48px;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: block;
    position: sticky;
    top: 64px;
    z-index: 40;
    background: var(--header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
  }

  .mobile-nav summary {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 16px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
  }

  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav summary svg {
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .mobile-nav[open] summary svg {
    transform: rotate(90deg);
  }

  .mobile-nav summary .current {
    color: var(--muted);
    font-weight: 500;
  }

  .mobile-nav .panel {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 4px 8px 16px;
  }

  .mobile-nav .nav-list a {
    padding: 10px 12px;
  }

  html {
    scroll-padding-top: 124px;
  }

  .content {
    padding-top: 28px;
  }

  .anchor {
    display: none;
  }

  .home-hero::before {
    inset: -60px -16px auto -16px;
    height: 420px;
  }
}

@media (max-width: 600px) {
  .brand .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .header-actions .label {
    display: none;
  }

  .header-actions a {
    min-width: 36px;
    justify-content: center;
  }

  .site-footer nav a {
    display: inline-block;
    padding: 10px 0;
  }

  .guides,
  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager .next {
    grid-column: 1;
  }

  .steps > li {
    padding-left: 42px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}
