/* NextTavern documentation theme
 * Single stylesheet for the static site: design tokens, shell, article
 * typography, landing sections and the search/lightbox overlays.
 * No external fonts or assets, so the site also renders offline. */

:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-soft: #0c1019;
  --surface: #121828;
  --surface-2: #171f33;
  --surface-3: #1e2739;
  --line: rgba(150, 168, 205, 0.16);
  --line-strong: rgba(150, 168, 205, 0.3);
  --text: #e8edf9;
  --text-strong: #ffffff;
  --muted: #97a3bd;
  --faint: #6b7691;
  --accent: #f0a137;
  --accent-strong: #ffc775;
  --accent-soft: rgba(240, 161, 55, 0.14);
  --accent-line: rgba(240, 161, 55, 0.36);
  --violet: #8f83ff;
  --violet-soft: rgba(143, 131, 255, 0.16);
  --ok: #52c98a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px -14px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 34px 70px -34px rgba(0, 0, 0, 0.85);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --topbar-h: 62px;
  --sidebar-w: 268px;
  --toc-w: 224px;
  --content-w: 812px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas,
    "Liberation Mono", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-soft: #fffdf9;
  --surface: #ffffff;
  --surface-2: #fbf8f1;
  --surface-3: #f3eee3;
  --line: rgba(38, 45, 63, 0.12);
  --line-strong: rgba(38, 45, 63, 0.22);
  --text: #1a1f2b;
  --text-strong: #0a0d14;
  --muted: #5a6478;
  --faint: #7d879c;
  --accent: #b26a05;
  --accent-strong: #8a5200;
  --accent-soft: rgba(178, 106, 5, 0.12);
  --accent-line: rgba(178, 106, 5, 0.3);
  --violet: #5a4bd6;
  --violet-soft: rgba(90, 75, 214, 0.12);
  --ok: #1c8b58;
  --shadow-sm: 0 1px 2px rgba(24, 30, 45, 0.08);
  --shadow-md: 0 14px 30px -18px rgba(24, 30, 45, 0.35);
  --shadow-lg: 0 34px 64px -36px rgba(24, 30, 45, 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

::selection {
  background: var(--accent-soft);
  color: var(--text-strong);
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #1b1206;
  font-weight: 600;
  transition: top 0.18s var(--ease);
}

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

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--topbar-h);
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text-strong);
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 34px;
  height: 34px;
  /* The plate is baked into the image; the radius only shapes the shadow. */
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(58, 33, 8, 0.3), 0 8px 16px -12px rgba(58, 33, 8, 0.75);
}

.brand-mark img,
.brand-word img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-word {
  display: block;
  width: 122px;
  height: 30px;
  flex: none;
  filter: drop-shadow(0 2px 4px rgba(58, 33, 8, 0.28));
}

.brand small {
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.topbar .spacer {
  flex: 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.chip b {
  color: var(--text);
  font-weight: 650;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  min-width: 190px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--faint);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), background 0.16s var(--ease);
}

.search-button:hover {
  border-color: var(--line-strong);
  color: var(--muted);
  background: var(--surface-2);
}

.search-button svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.search-button kbd {
  margin-left: auto;
}

kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), background 0.16s var(--ease);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

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

.theme-toggle .moon,
:root[data-theme="light"] .theme-toggle .sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle .moon {
  display: block;
}

.menu-toggle {
  display: none;
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
  gap: 40px;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 30px;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding: 26px 6px 40px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.sidebar-title {
  margin: 0 10px 12px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 4px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.nav-group-label:hover {
  color: var(--text);
}

.nav-group-label .chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.2s var(--ease);
}

.nav-group[data-collapsed="true"] .nav-group-label .chevron {
  transform: rotate(-90deg);
}

.nav-group[data-collapsed="true"] .nav-links {
  display: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}

.nav-links a {
  position: relative;
  padding: 6px 10px 6px 18px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.14s var(--ease), background 0.14s var(--ease);
}

.nav-links a::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.14s var(--ease), box-shadow 0.14s var(--ease);
}

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

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

.nav-links a[aria-current="page"]::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sidebar-footer {
  margin: 26px 10px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-footer a {
  color: var(--muted);
}

.sidebar-scrim {
  display: none;
}

main {
  min-width: 0;
  padding: 34px 0 80px;
}

.article {
  max-width: var(--content-w);
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--faint);
  font-size: 12.5px;
}

.breadcrumbs a {
  color: var(--faint);
}

.breadcrumbs a:hover {
  color: var(--muted);
}

/* ---------------------------------------------------------------- article */

.article > h1 {
  margin: 0 0 14px;
  color: var(--text-strong);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.24;
}

.article h2 {
  margin: 46px 0 14px;
  padding-top: 6px;
  color: var(--text-strong);
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.article h3 {
  margin: 32px 0 10px;
  color: var(--text-strong);
  font-size: 18.5px;
  font-weight: 650;
  line-height: 1.4;
}

.article h4 {
  margin: 26px 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}

.article h2,
.article h3,
.article h4 {
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

.article h2:hover .anchor::after,
.article h3:hover .anchor::after,
.article h4:hover .anchor::after {
  opacity: 1;
}

.anchor {
  position: relative;
}

.anchor::after {
  content: "#";
  position: absolute;
  left: -0.62em;
  top: 0;
  color: var(--accent);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.14s var(--ease);
}

.article p {
  margin: 0 0 16px;
}

.article strong {
  color: var(--text-strong);
  font-weight: 650;
}

.article ul,
.article ol {
  margin: 0 0 18px;
  padding-left: 1.3em;
}

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

.article li > ul,
.article li > ol {
  margin: 8px 0 6px;
}

.article li::marker {
  color: var(--accent);
}

.article hr {
  height: 1px;
  margin: 40px 0;
  border: 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

.article blockquote {
  position: relative;
  margin: 0 0 20px;
  padding: 14px 18px 14px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  color: var(--text);
}

.article blockquote > :last-child {
  margin-bottom: 0;
}

.article blockquote strong {
  color: var(--accent-strong);
}

.article a {
  border-bottom: 1px solid transparent;
}

.article a:hover {
  border-bottom-color: currentColor;
  text-decoration: none;
}

.article a.external::after {
  content: "↗";
  display: inline-block;
  margin-left: 3px;
  font-size: 0.78em;
  color: var(--faint);
}

.article img {
  display: block;
  max-width: 100%;
  margin: 22px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
}

.article code {
  padding: 0.14em 0.42em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.code-block {
  position: relative;
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-block code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.66;
  white-space: pre;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease);
}

.copy-button:hover {
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.copy-button.done {
  color: var(--ok);
  border-color: var(--ok);
}

.mermaid-figure {
  background: linear-gradient(160deg, var(--violet-soft), transparent 60%), var(--bg-soft);
}

.mermaid-figure figcaption {
  padding: 10px 18px 12px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
  text-align: left;
}

.table-wrap {
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  scrollbar-width: thin;
}

.article table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.article thead th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}

.article tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

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

.article tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.article details {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article details[open] {
  background: var(--surface-2);
}

.article summary {
  color: var(--text-strong);
  font-weight: 600;
  cursor: pointer;
}

.article details > :last-child {
  margin-bottom: 0;
}

.article figure {
  margin: 24px 0;
}

.article figcaption {
  margin-top: 10px;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.article .lede {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 17px;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 26px;
}

/* -------------------------------------------------------------------- toc */

.toc {
  position: sticky;
  top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h));
  padding: 42px 0 32px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.toc-label {
  margin: 0 0 10px 12px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toc nav {
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 5px 10px 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.14s var(--ease), border-color 0.14s var(--ease);
}

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

.toc a[data-depth="3"] {
  padding-left: 26px;
  font-size: 12.5px;
}

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

.toc .back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 22px 0 0 12px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.toc .back-top:hover {
  border-color: var(--line-strong);
  color: var(--text);
  text-decoration: none;
}

/* ----------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 56px 0 0;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease), background 0.16s var(--ease);
}

.pager a:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-2px);
  text-decoration: none;
}

.pager span {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.pager b {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 620;
}

.pager .next {
  text-align: right;
}

/* ---------------------------------------------------------------- landing */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 420px at 12% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 460px at 88% 4%, var(--violet-soft), transparent 62%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(760px 360px at 50% 0%, black, transparent 78%);
  opacity: 0.5;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 46px;
  align-items: center;
  max-width: 1320px;
  margin: 0 auto;
  padding: 74px 30px 66px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 13px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.hero h1 {
  /* The greeting types itself out, and the lines are not the same length: a
     short one occupies a single line while a long one wraps to two. Reserving
     two lines keeps the lead, the buttons and the facts below from jumping on
     every cycle; `heroTitleLines` is re-checked by the build. */
  min-height: calc(var(--hero-title-lines, 2) * 1.14em);
  margin: 0 0 20px;
  color: var(--text-strong);
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.14;
  white-space: pre-line;
}

/* The skin's greeting typewriter. The gradient spans the typed element, so it
   rescales with the line instead of shifting colour mid-word. */
.hero-typed {
  background: linear-gradient(96deg, var(--accent-strong), var(--accent) 45%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-caret {
  display: inline-block;
  width: 3px;
  height: 0.92em;
  margin-left: 8px;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--violet));
  animation: hero-caret 1.05s steps(1, end) infinite;
}

@keyframes hero-caret {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.hero .lead {
  max-width: 34em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 650;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

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

.button.primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #211404;
  box-shadow: 0 16px 34px -18px var(--accent);
}

.button.primary:hover {
  box-shadow: 0 22px 40px -18px var(--accent);
}

.button.ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button.ghost:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.hero-facts div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-facts span {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-facts b {
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 650;
}

.hero-shot {
  position: relative;
}

.hero-shot::before {
  content: "";
  position: absolute;
  inset: 8% 6% -6%;
  background: linear-gradient(120deg, var(--accent), var(--violet));
  filter: blur(52px);
  opacity: 0.28;
}

.hero-art {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

/* Stacked frames crossfading in place: every picture shares one 16:9 box, so
   the rotation never shifts the hero. */
.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 900ms ease;
}

.hero-art img.is-active {
  opacity: 1;
}

.hero-shot figcaption {
  position: relative;
  margin-top: 12px;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 74px 30px;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
}

.section-head h2 {
  margin: 0 0 8px;
  color: var(--text-strong);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.section-head p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
}

.section-head a {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.install-panel {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.install-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.install-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.install-tabs button:hover {
  background: var(--surface);
  color: var(--text);
}

.install-tabs button[aria-selected="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-strong);
}

.install-tabs svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.install-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 24px;
}

.install-body[hidden] {
  display: none;
}

.install-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.install-body .code-block {
  margin: 0;
}

.install-body .link {
  font-size: 14px;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.feature-card::after {
  content: "";
  position: absolute;
  inset: -1px -1px auto;
  height: 78px;
  background: radial-gradient(180px 78px at 32px 0, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  pointer-events: none;
}

.feature-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-card:hover h3 a {
  color: var(--accent-strong);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 2px;
  border: 1px solid var(--accent-line);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

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

.feature-card h3 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 660;
}

.feature-card h3 a {
  color: var(--text-strong);
}

.feature-card h3 a:hover {
  text-decoration: none;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.feature-card code {
  padding: 0.1em 0.34em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.shot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: zoom-in;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.shot:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.shot figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.shot b {
  color: var(--text-strong);
  font-size: 14.5px;
  font-weight: 620;
}

.shot span {
  color: var(--faint);
  font-size: 12.5px;
  text-align: right;
}

.doc-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.doc-map section {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.doc-map h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 660;
}

.doc-map h3 .index {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11.5px;
  font-weight: 700;
}

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

.doc-map li + li {
  border-top: 1px solid var(--line);
}

.doc-map a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
}

.doc-map a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.doc-map a::after {
  content: "→";
  color: var(--faint);
  font-size: 13px;
}

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 24px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--surface);
}

.notice svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 3px;
  color: var(--accent-strong);
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.notice b {
  color: var(--text-strong);
}

/* --------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 34px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 30px 34px;
}

.footer-brand {
  max-width: 40ch;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.72;
}

.footer-note {
  color: var(--faint);
  font-size: 12.5px;
}

.site-footer h4 {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

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

.site-footer li + li {
  margin-top: 8px;
}

.site-footer li a {
  color: var(--muted);
  font-size: 13.5px;
}

.site-footer li a:hover {
  color: var(--accent-strong);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 30px 28px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12.5px;
}

.footer-base a {
  color: var(--muted);
}

/* --------------------------------------------------------------- search */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding: 10vh 20px 20px;
  background: color-mix(in srgb, #05070c 68%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s var(--ease);
}

.overlay[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.search-panel {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: 74vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(-10px) scale(0.985);
  transition: transform 0.2s var(--ease);
}

.overlay[data-open="true"] .search-panel {
  transform: none;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.search-field svg {
  width: 18px;
  height: 18px;
  color: var(--faint);
  flex: none;
}

.search-field input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  outline: none;
}

.search-field input::placeholder {
  color: var(--faint);
}

.search-results {
  flex: 1;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  list-style: none;
}

.search-results li + li {
  margin-top: 2px;
}

.search-results a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text);
}

.search-results a:hover,
.search-results a.active {
  background: var(--accent-soft);
  text-decoration: none;
}

.search-results .page {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-results .hit {
  font-size: 14.5px;
  font-weight: 600;
}

.search-results .snippet {
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-results mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.search-empty {
  padding: 26px 18px;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

.search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--faint);
  font-size: 12px;
}

.search-hints span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: color-mix(in srgb, #04060a 88%, transparent);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s var(--ease), visibility 0.18s var(--ease);
}

.lightbox[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(1440px, 96vw);
  max-height: 82vh;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.lightbox figcaption {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  color: #cbd3e4;
  font-size: 13.5px;
  text-align: center;
}

.lightbox button {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(12, 16, 26, 0.7);
  color: #e8edf9;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 32px;
  }

  .toc {
    display: none;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-top: 58px;
  }

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

  .install-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 940px) {
  .layout {
    display: block;
    padding: 0 20px;
  }

  .menu-toggle {
    display: grid;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    z-index: 60;
    width: min(320px, 84vw);
    height: calc(100vh - var(--topbar-h));
    padding: 22px 16px 40px;
    border-right: 1px solid var(--line);
    background: var(--bg-soft);
    transform: translateX(-102%);
    transition: transform 0.22s var(--ease);
  }

  body[data-nav="open"] .sidebar {
    transform: none;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-scrim {
    position: fixed;
    inset: var(--topbar-h) 0 0;
    z-index: 50;
    display: block;
    background: rgba(4, 6, 11, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
  }

  body[data-nav="open"] .sidebar-scrim {
    opacity: 1;
    visibility: visible;
  }

  main {
    padding-top: 26px;
  }

  .search-button {
    min-width: 0;
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .search-button span,
  .search-button kbd {
    display: none;
  }

  .topbar .chip.hide-md {
    display: none;
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-h: 56px;
  }

  body {
    font-size: 15.5px;
  }

  .topbar {
    gap: 10px;
    padding: 0 14px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand-word {
    width: 100px;
    height: 25px;
  }

  .section {
    padding: 54px 20px;
  }

  .hero-inner {
    padding: 44px 20px 48px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 44px 20px 26px;
  }

  .footer-base {
    padding: 16px 20px 26px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
