/* modernsheet.app: one stylesheet, light and dark, no external resources */
:root {
  --blue: #0066cc;
  --blue-deep: #004f9e;
  --cream: #f6f1e6;
  --orange: #ef6c00;
  --ink: #1c2230;
  --muted: #5b6475;
  --line: #e2e5ec;
  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --card: #ffffff;
  --code-bg: #1e2128;
  --code-ink: #e6e9ef;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 6px 24px rgba(20, 30, 50, .08);
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf2;
    --muted: #a4acbb;
    --line: #2c3240;
    --bg: #12151c;
    --bg-soft: #181c25;
    --card: #1b2029;
    --blue: #4f9bf0;
    --blue-deep: #7ab3f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
       backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink);
         text-decoration: none; margin-right: auto; }
.brand img { border-radius: 9px; }
.menu { display: flex; align-items: center; gap: 4px; }
.menu a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.menu a:hover { background: var(--bg-soft); }
.menu a[aria-current="page"] { color: var(--blue); font-weight: 600; }
.menu .lang { color: var(--muted); }
.menu .gh { border: 1px solid var(--line); }
.nav-toggle, .nav-button { display: none; }
@media (max-width: 760px) {
  .nav-button { display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: 10px; }
  .nav-button span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
  .menu { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
          align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav-toggle:checked ~ .menu { display: flex; }
}

/* content */
main { padding: 32px 20px 64px; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 2.3rem; margin: .4em 0 .5em; }
h2 { font-size: 1.55rem; margin-top: 2.2em; padding-top: .2em; }
h3 { font-size: 1.2rem; margin-top: 1.8em; }
.headerlink { opacity: 0; margin-left: .3em; text-decoration: none; color: var(--muted); }
h2:hover .headerlink, h3:hover .headerlink { opacity: 1; }
.doc main { max-width: 860px; }
p, li { max-width: 72ch; }
code { font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--bg-soft);
       border: 1px solid var(--line); padding: .1em .35em; border-radius: 6px; }
pre { background: var(--code-bg); color: var(--code-ink); padding: 16px 18px; border-radius: 12px; overflow-x: auto;
      font-size: 14.5px; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 15.5px; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; }
blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 4px solid var(--blue); background: var(--bg-soft);
             border-radius: 0 10px 10px 0; color: var(--ink); }
.shot { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
figure { margin: 1.6em 0; }
figure p, .band p, .hero p:has(img) { max-width: none; }
figure img { display: block; width: 100%; }
figcaption { color: var(--muted); font-size: 14.5px; margin-top: 8px; text-align: center; }

/* home */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin: 0 0 .3em; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero img { border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 6px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 12px; font-weight: 600; text-decoration: none;
       border: 1px solid var(--line); color: var(--ink); background: var(--card); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); color: #fff; }
.tag { display: inline-block; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 18px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
        box-shadow: var(--shadow); }
.doc .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card .btn { margin-top: 12px; }
.card h3 { margin: 0 0 .4em; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .ico { font-size: 22px; display: block; margin-bottom: 6px; }
.band { background: var(--cream); color: #1c2230; border-radius: 22px; padding: 28px; margin: 40px 0; }
.band pre { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.hero > *, .two > *, .grid > * { min-width: 0; }   /* long code lines scroll inside, never widen the page */
.toc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; margin: 1.2em 0 1.6em; font-size: 15.5px; }
.toc ul { margin: .2em 0; padding-left: 1.1em; }
@media (max-width: 860px) {
  .hero, .two { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
}

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; padding: 18px 0 28px; }

/* "Beta" ribbon: diagonal in the top-right corner on wide screens (in the empty margin, over nothing),
   a small red tag next to the name on narrower ones (where the corner holds the menu) */
.beta-ribbon { position: fixed; top: 0; right: 0; width: 150px; height: 150px; overflow: hidden; z-index: 20;
               pointer-events: none; }
.beta-ribbon span { position: absolute; top: 34px; right: -42px; width: 190px; padding: 7px 0; transform: rotate(45deg);
                    background: #d32f2f; color: #fff; text-align: center; font-weight: 700; font-size: 14px;
                    letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
                    pointer-events: auto; }
.beta-tag { display: none; margin-left: 8px; padding: 2px 9px 2px 7px; background: #d32f2f; color: #fff; font-size: 11px;
            font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.6;
            clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%); }
@media (max-width: 1360px) {
  .beta-ribbon { display: none; }
  .beta-tag { display: inline-block; }
}
