:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --fg: #1d1a16;
  --muted: #6f675c;
  --accent: #8d5a2b;
  --line: #e3d9c8;
  --surface: rgba(250, 248, 243, 0.72);
  --font: "Iowan Old Style", Palatino, "Palatino Linotype", "Liberation Serif", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --ui: system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --fg: #ededed;
  --muted: #8d8d8d;
  --accent: #c4a574;
  --line: #2a2a2a;
  --surface: rgba(28, 28, 28, 0.72);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

html[lang="zh"] [lang="en"],
html[lang="en"] [lang="zh"] { display: none; }

body {
  margin: 0;
  color: var(--fg);
  background: transparent;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.7;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#texture {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.nav, main, .colophon { position: relative; z-index: 1; }

a { color: inherit; }

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.4rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
}

.nav-mark {
  display: flex;
  color: var(--accent);
  line-height: 0;
}

.nav-mark svg { width: 1.35rem; height: 1.35rem; }

.nav nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

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

.nav nav a:hover,
.nav nav a:focus-visible { color: var(--fg); }

.nav-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.seg { display: flex; gap: 0.55rem; }

button {
  font: inherit;
  letter-spacing: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button[aria-pressed="true"] { color: var(--accent); }

button:hover,
button:focus-visible { color: var(--fg); }

button:focus-visible,
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

main {
  width: min(46rem, calc(100% - 2.5rem));
  margin: 0 auto;
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6.5rem 0 4.5rem;
}

.kicker {
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: Baskerville, "Iowan Old Style", Palatino, "Times New Roman", "Liberation Serif", serif;
  font-weight: 400;
  font-size: clamp(4.6rem, 14vw, 7.4rem);
  line-height: 0.85;
  letter-spacing: 0;
}

.brand .o {
  width: 0.78em;
  height: 0.78em;
  margin: 0 0.02em 0.04em;
  color: var(--accent);
  overflow: visible;
}

.brand .cus { letter-spacing: 0.045em; margin-right: -0.045em; }

.epigraph {
  margin: 2.4rem 0 0;
  padding: 0;
  border: 0;
  font-size: 1.35rem;
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
  max-width: 22em;
}

.epigraph p { margin: 0; }

.gloss {
  margin-top: 0.85rem !important;
  font-style: normal;
  font-size: 1.02rem;
  color: var(--muted);
}

.lead {
  margin: 1.8rem 0 0;
  max-width: 34rem;
  text-wrap: pretty;
}

.lead .keep { white-space: nowrap; }

.aside {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  margin: 1.8rem 0 0;
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.hero-links a {
  color: var(--accent);
  text-decoration: none;
}

.hero-links a:hover { color: var(--fg); }

.steps.stack div { grid-template-columns: 1fr; gap: 0.3rem; }

.steps.stack dt { color: var(--fg); }

section {
  padding: 4.5rem 0 0.5rem;
  scroll-margin-top: 4.75rem;
}

h2 {
  margin: 0 0 1.4rem;
  font-weight: 400;
  font-size: 1.05rem;
}

h2 .idx {
  margin-right: 0.75rem;
  color: var(--accent);
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

h3 {
  margin: 0 0 0.45rem;
  font-weight: 400;
  font-size: 1.15rem;
}

.section-lead { margin: 0 0 1.6rem; max-width: 38rem; }

.install-list p,
.note,
.steps dd {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  text-wrap: pretty;
}

.path {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 26rem;
}

.path li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

.path li:first-child { border-top: 1px solid var(--line); }

.note { margin-top: 1.25rem; max-width: 38rem; }

.steps { margin: 0; }

.steps div {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.steps div:first-child { border-top: 1px solid var(--line); }

.steps dt { font-weight: 400; }

.install-list { display: grid; gap: 2rem; }

.install-list h3 { color: var(--fg); }

pre {
  margin: 0.7rem 0 0.55rem;
  padding: 0 0 0.65rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

code {
  font-family: ui-monospace, "IBM Plex Mono", "Source Code Pro", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
}

.bounds {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 26rem;
}

.bounds li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.bounds li:first-child { border-top: 1px solid var(--line); }

.colophon {
  width: min(46rem, calc(100% - 2.5rem));
  margin: 5.5rem auto 0;
  padding: 0 0 3rem;
}

.mark-note {
  display: flex;
  justify-content: center;
  margin: 0;
}

.mark-note svg {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--accent);
}

.footline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  column-gap: 1rem;
  margin: 2rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.footline > :first-child { justify-self: start; }
.footline > :nth-child(2) {
  justify-self: center;
  margin-inline-end: -0.12em;
}
.footline > :last-child { justify-self: end; }

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

@media (max-width: 760px) {
  .nav { flex-wrap: wrap; padding: 0.75rem 1rem; }
  .nav nav { order: 3; width: 100%; }
  .steps div { grid-template-columns: 4.75rem 1fr; gap: 0.75rem; }
  .hero {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 7.25rem;
    padding-bottom: 2.5rem;
  }
  .epigraph { font-size: 1.15rem; }
}

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

@media print {
  #texture, .nav-tools { display: none; }
  .nav { position: static; background: none; }
  body { background: #fff; color: #111; }
}
