@font-face {
  font-family: "Studio Han Serif";
  src: url("fonts/source-han-serif-sc.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #fafafa;
  --ink: #181818;
  --muted: #5b5b5b;
  --line: #dcdcdc;
  --surface: #f1f1f1;
  --hover: #e8e8e8;
  font-family: "PingFang SC", system-ui, "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161616;
    --ink: #f1f1f1;
    --muted: #aeaeae;
    --line: #3b3b3b;
    --surface: #222;
    --hover: #303030;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.6; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
a:hover { text-decoration: underline; text-underline-offset: .22em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
[id] { scroll-margin-top: 1rem; }

.wrap { width: min(calc(100% - 3rem), 46rem); margin-inline: auto; }
.site-header, .footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  color: var(--muted);
  font-size: .875rem;
}
.site-header { align-items: center; padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.site-header nav, .footer div { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.15rem; }
.site-header a { text-decoration: none; }
.site-header a:hover { text-decoration: underline; }
.brand, .repo-link, .stars:not([hidden]) { display: inline-flex; align-items: center; gap: .35rem; }
.brand { color: var(--ink); font-weight: 700; gap: .5rem; }
.brand img { display: block; }
.icon { width: 1rem; height: 1rem; fill: currentColor; flex: none; }
.stars { margin-inline-start: .18rem; font-variant-numeric: tabular-nums; }
.stars .icon { width: .8rem; height: .8rem; }

.language {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.language:hover { text-decoration: underline; text-underline-offset: .22em; }

.hero { padding-block: clamp(3rem, 8vw, 5.5rem) clamp(1.75rem, 5vw, 2.75rem); }
h1, h2, h3 { font-family: "Source Serif 4", "Studio Han Serif", "Songti SC", Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.18; letter-spacing: -.025em; text-wrap: balance; }
.lead { margin-top: .9rem; color: var(--muted); }
.install-option { margin-top: 1rem; }
.install-option h3 { font-size: 1rem; }
.command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-top: .55rem;
  padding: .55rem .65rem .55rem .95rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.command code { min-width: 0; overflow-wrap: anywhere; font: .875rem/1.6 "JetBrains Mono", ui-monospace, monospace; }
.command button {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
}
.command button:not([hidden]) { display: grid; place-items: center; }
.command button:hover { background: var(--hover); }
.requirements { margin-top: .2rem; color: var(--muted); font-size: .875rem; }

.install, .demo, .examples { padding-block: 1.35rem 1.75rem; border-top: 1px solid var(--line); }
.install h2, .demo h2, .examples h2 { font-size: 1.15rem; }
.demo-player { display: block; width: 100%; aspect-ratio: 16 / 9; margin-block: .9rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.demo a { color: var(--muted); font-size: .875rem; }
.example-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 2rem;
  margin-top: .9rem;
}
.examples h3 { font-size: 1rem; color: var(--muted); }
.examples ul { padding: 0; margin: .25rem 0 0; list-style: none; }
.examples a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding-block: .4rem;
  text-decoration: none;
}
.examples a:hover { text-decoration: underline; }
.examples [aria-hidden] { color: var(--muted); }

.footer { border-top: 1px solid var(--line); padding-block: 1.1rem 2rem; font-size: .8rem; }
.footer a { text-underline-offset: .2em; }
.skip-link { position: absolute; inset: .5rem auto auto .5rem; padding: .5rem 1rem; background: var(--paper); }
.skip-link:not(:focus), .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 480px) {
  .wrap { width: calc(100% - 2rem); }
  .site-header nav { gap: .4rem .65rem; }
  .example-groups { grid-template-columns: 1fr; }
}
