:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: #10151d;
  --ink: #eef3f5;
  --muted: #bcc7ce;
  --line: #364251;
  --accent: #8db4ff;
  --green: #b0dec3;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 40px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #c5d6ff; }
button, input { font: inherit; }
button, a, input { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 5px;
}
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(34px, 4.5vw, 48px); line-height: 1.15; font-weight: 600; margin-bottom: 20px; }
h2 { font-size: 27px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 22px; line-height: 1.3; font-weight: 600; }
p { margin-bottom: 20px; }
li { margin-bottom: 10px; }
.wrap { max-width: 1080px; margin: auto; padding: 0 30px; }
.skip { position: absolute; left: 20px; top: -100px; z-index: 10; background: var(--accent); color: var(--bg); padding: 12px; }
.skip:focus { top: 12px; }
.header { border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 88px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 23px; }
.brand img { width: 220px; height: auto; }
.nav { display: flex; gap: 25px; flex-wrap: wrap; font-size: 17px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav [aria-current=page], .nav a:hover { color: var(--accent); }
.home-intro { padding: 58px 0 38px; max-width: 790px; }
.project-logo { margin: 0 0 24px; }
.project-logo img { display: block; width: min(560px, 100%); height: auto; }
.intro, .lede { color: var(--muted); font-size: 20px; }
.home-intro .intro { font-size: 23px; color: var(--ink); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 24px 0; }
.button { display: inline-flex; justify-content: center; align-items: center; padding: 13px 22px; border: 1px solid var(--accent); border-radius: 3px; background: var(--accent); color: #080e19; text-decoration: none; font-weight: 600; min-height: 54px; }
.button:hover { background: #b8cfff; color: #080e19; }
.button.secondary { background: transparent; color: var(--ink); border-color: #657593; }
.button.secondary:hover { border-color: var(--accent); }
.small { font-size: 16px; color: var(--muted); }
.home-reference { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; border-top: 1px solid var(--line); padding: 32px 0; }
.function-list { margin: 0 0 18px; }
.function-list div { display: grid; grid-template-columns: 95px 1fr; gap: 18px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.function-list dt { font-weight: 600; }
.function-list dd { margin: 0; color: var(--muted); }
.demo { border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.demo-preview { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; color: #fff; cursor: pointer; aspect-ratio: 4/3; }
.demo-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #8db4ff; color: #06070a; box-shadow: 0 0 0 2px #06070a, 0 4px 24px #0009; }
.demo-play svg { width: 38px; height: 38px; fill: currentColor; }
.demo-preview:hover .demo-play { background: #c5d8ff; }
.demo-preview:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.demo-caption { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 5px 12px; background: #06070ae6; color: #fff; font-weight: 600; white-space: nowrap; }
.demo iframe { display: block; width: 100%; aspect-ratio: 4/3; border: 0; }
.demo-link { margin-top: 12px; }
.home-warning { padding: 8px 0 40px; }
.warning { border-left: 3px solid var(--accent); background: var(--panel); padding: 20px 24px; font-size: 17px; }
.warning p { margin: 8px 0 0; }
.footer { border-top: 1px solid var(--line); padding: 28px 0 35px; font-size: 15px; color: var(--muted); }
.footer .wrap { display: flex; gap: 24px; justify-content: space-between; align-items: start; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.page-head { padding: 45px 0 24px; max-width: 830px; }
.patch-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 30px; padding-bottom: 50px; align-items: start; }
.patch-card { border: 1px solid var(--line); background: var(--panel); padding: 28px; }
.step-label { font-weight: 600; font-size: 22px; margin-bottom: 20px; }
.drop { border: 1px dashed #7e91af; padding: 26px 18px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; background: var(--bg); }
.drop.drag { border-color: var(--accent); background: #13213a; }
.drop svg { width: 42px; height: 42px; color: var(--accent); }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.separator { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.ack { display: flex; align-items: start; gap: 13px; font-size: 17px; margin-top: 22px; }
.ack input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 4px; accent-color: var(--accent); }
.patch-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.status { border-top: 1px solid var(--line); padding-top: 23px; margin-top: 28px; }
.status h3 { margin-bottom: 8px; }
.status p { color: var(--muted); }
.status.error h3 { color: #ffb8b0; }
.status.success h3 { color: var(--green); }
progress { width: 100%; height: 12px; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #28374f; }
progress::-webkit-progress-value { background: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.facts strong { font-weight: 500; }
.facts span { color: var(--muted); text-align: right; }
.hash { font: 13px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; color: var(--muted); }
.article { max-width: 850px; padding-bottom: 50px; }
.article h2 { margin-top: 42px; }
.article h3 { margin-top: 28px; }
.article table { border-collapse: collapse; width: 100%; font-size: 17px; }
.article td, .article th { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 14px 12px; }
.article th { color: var(--accent); }
.table-scroll { overflow-x: auto; }
kbd { font: 15px ui-monospace, monospace; border: 1px solid #7e91af; padding: 3px 6px; white-space: nowrap; background: var(--panel); }
[hidden] { display: none !important; }
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 500; font-size: 19px; }
details p { margin: 14px 0 0; color: var(--muted); }
@media (max-width: 820px) {
  .home-reference, .patch-layout { grid-template-columns: 1fr; gap: 26px; }
  .header .wrap { padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
  .nav { gap: 20px; }
  .footer .wrap { flex-direction: column; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  .home-intro { padding-top: 35px; }
  .patch-card { padding: 22px; }
  .actions .button, .patch-buttons .button { width: 100%; }
  .nav { font-size: 16px; gap: 17px; }
  .function-list div { grid-template-columns: 80px 1fr; gap: 12px; }
  .article table { min-width: 540px; }
}
