:root {
    --ink: #1d2733;
    --ink-soft: #4a5868;
    --muted: #6b7785;
    --line: #dde3ea;
    --bg: #ffffff;
    --bg-soft: #f4f7fa;
    --brand: #0b5fa5;
    --brand-dark: #08467a;
    --accent: #f28c28;
    --accent-dark: #d4730f;
    --header: #16212c;
    --warn-bg: #fff6e6;
    --warn-line: #f2b45a;
    --radius: 6px;
    --wrap: 1140px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 17px/1.65 var(--font); color: var(--ink); background: var(--bg); }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .6em; color: var(--ink); }
h1 { font-size: 2.1rem; margin-top: .4em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }
h2 a, h3 a { text-decoration: none; }
p, ul, ol, table, pre, figure { margin: 0 0 1.1em; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 3px; }
pre { font-family: var(--mono); font-size: .88rem; background: #0f1720; color: #e6edf3; padding: 1em 1.2em; border-radius: var(--radius); overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
blockquote { margin: 0 0 1.1em; padding: .6em 1.2em; border-left: 4px solid var(--brand); background: var(--bg-soft); color: var(--ink-soft); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5em 1em; z-index: 100; }
.skip:focus { left: 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }

/* Header */
.site-header { background: var(--header); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.brand:hover { color: #fff; }
.brand-name { font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; }
.brand-tag { font-size: .78rem; color: #9fb0c2; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; align-items: center; gap: .2rem; }
.site-nav a { color: #d6dee7; text-decoration: none; padding: .5rem .7rem; border-radius: 4px; display: block; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover, .site-nav a.active { color: #fff; background: rgba(255,255,255,.08); }
.site-nav .has-sub { position: relative; }
.site-nav .has-sub > ul { display: none; position: absolute; top: 100%; left: 0; background: var(--header); min-width: 210px; padding: .4rem; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.site-nav .has-sub:hover > ul, .site-nav .has-sub:focus-within > ul { display: block; }
.site-nav .nav-cta { margin-left: .4rem; color: #fff; }
.nav-toggle, .nav-toggle-label { display: none; }

/* Buttons */
.btn { display: inline-block; padding: .65em 1.3em; border-radius: var(--radius); border: 2px solid var(--brand); color: var(--brand); background: #fff; text-decoration: none; font-weight: 600; line-height: 1.2; }
.btn:hover { background: var(--brand); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.site-nav a.btn-primary { background: var(--accent); }
.site-nav a.btn-primary:hover { background: var(--accent-dark); }

/* Content */
main { min-height: 60vh; padding-bottom: 3rem; }
.content { padding-top: 1.5rem; }
.content img { border-radius: 4px; }
.content > p > img:only-child { display: block; margin: 0 auto; box-shadow: 0 2px 12px rgba(16,30,45,.12); }
.content table { border-collapse: collapse; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: .5em .75em; text-align: left; vertical-align: top; }
.content th { background: var(--bg-soft); }
.entry-header .meta, .post-list .meta { color: var(--muted); font-size: .9rem; margin-top: -.3em; }
.tag { display: inline-block; margin-left: .5em; padding: .05em .6em; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; text-decoration: none; }

.callout { background: var(--bg-soft); border-left: 4px solid var(--brand); padding: 1em 1.25em; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1.25em; }
.callout > :last-child { margin-bottom: 0; }
.callout.warning { background: var(--warn-bg); border-left-color: var(--warn-line); }

.figure { margin: 0 0 1.5em; text-align: center; }
.figure figcaption, .figure .caption { color: var(--muted); font-size: .9rem; margin-top: .4em; }

.video { position: relative; aspect-ratio: 16 / 9; margin: 0 0 1.5em; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem 2rem; margin: 0 0 1.5em; }
.columns > * > :first-child { margin-top: 0; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 1.5em 0 2em; }
.feature { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.feature h3 { margin-top: 0; color: var(--brand); }
.feature > :last-child { margin-bottom: 0; }

/* Landing */
.landing.content { padding-top: 0; }
.landing > :not(.hero) { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-left: 1.25rem; padding-right: 1.25rem; }
.landing > h2, .landing > h3 { text-align: center; }
.landing > p > img:only-child { max-width: min(100%, 1000px); }
.hero { position: relative; color: #fff; text-align: center; padding: 5rem 1.25rem 4.5rem; overflow: hidden; background: var(--header); margin-bottom: 2rem; }
.hero .hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; border-radius: 0; }
.hero > :not(.hero-image) { position: relative; max-width: 860px; margin-left: auto; margin-right: auto; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.5vw, 3rem); margin: 0 auto .4em; }
.hero .lead { font-size: 1.3rem; color: #e3ebf3; }
.hero .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.6rem; }
.hero .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.hero .btn:not(.btn-primary):hover { background: #fff; color: var(--header); }
.lead { font-size: 1.2rem; color: var(--ink-soft); }

/* Docs */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.5rem; }
.doc-nav { position: sticky; top: 80px; align-self: start; padding-top: 2rem; max-height: calc(100vh - 90px); overflow-y: auto; font-size: .93rem; }
.doc-nav h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .5em; }
.doc-nav ul { list-style: none; padding: 0; margin: 0 0 1.6em; }
.doc-nav a { display: block; padding: .3em .7em; color: var(--ink-soft); text-decoration: none; border-left: 2px solid var(--line); }
.doc-nav a:hover { color: var(--brand); border-left-color: var(--brand); }
.doc-nav a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.doc-nav .toc-l3 a { padding-left: 1.5em; font-size: .88rem; }

/* Blog */
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 1.3em 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.post-list li > div:only-child { grid-column: 1 / -1; }
.post-thumb img { display: block; width: 200px; aspect-ratio: 720 / 380; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
@media (max-width: 600px) {
    .post-list li { grid-template-columns: 1fr; }
    .post-thumb img { width: 100%; }
}
.post-list h2 { margin: 0 0 .3em; font-size: 1.35rem; }
.post-list h2 a { text-decoration: none; }

.post-banner { display: block; width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin: 0 0 1.5em; }
.article-raw { max-width: 920px; padding-top: 1.5rem; }
.article-raw .post-banner { max-width: 880px; margin: 0 auto 1.5em; }
.comments { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.comment-list, .comment-children { list-style: none; margin: 0; padding: 0; }
.comment-children { margin-left: 1.5rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.comment > article { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment:target > article { background: var(--bg-soft); }
.comment-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: .9rem; }
.comment-date { color: var(--muted); font-size: .85rem; text-decoration: none; }
.comment-body > :last-child { margin-bottom: .3rem; }
.comment-body pre { overflow-x: auto; }
.comment-respond { margin-top: 2rem; }
@media (max-width: 600px) { .comment-children { margin-left: .5rem; padding-left: .6rem; } }

/* Forms, account and checkout */
.form { margin: 0 0 1.5rem; }
.narrow-form { max-width: 480px; }
.form-row { display: flex; flex-direction: column; gap: .3rem; margin: 0 0 1rem; }
.form-row.check { flex-direction: row; align-items: center; gap: .5rem; }
.form label { font-weight: 600; }
.form-row.check label { font-weight: normal; }
.form input[type="text"], .form input[type="email"], .form input[type="number"], .form input:not([type]), .form textarea {
    font: inherit; padding: .55em .7em; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); width: 100%; box-sizing: border-box;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form button { cursor: pointer; font: inherit; }
.small { font-size: .85rem; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0 0 1.5rem; background: #fff; }
.panel > h2:first-child { margin-top: 0; }
.buy-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; background: var(--bg-soft); max-width: 480px; }
.price { font-size: 2rem; font-weight: 700; color: var(--ink); margin: 0 0 .5rem; }
.buy-form { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.buy-form .form-row { margin: 0; max-width: 8rem; }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.footer-inner p { margin: 0; }

@media (max-width: 960px) {
    .nav-toggle-label { display: block; width: 40px; height: 40px; cursor: pointer; position: relative; }
    .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after { position: absolute; left: 9px; width: 22px; height: 2px; background: #fff; content: ""; }
    .nav-toggle-label span { top: 19px; }
    .nav-toggle-label span::before { top: -7px; left: 0; }
    .nav-toggle-label span::after { top: 7px; left: 0; }
    .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--header); padding: .5rem 1.25rem 1rem; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
    .nav-toggle:checked ~ .site-nav { display: block; }
    .site-nav > ul { flex-direction: column; align-items: stretch; }
    .site-nav .has-sub > ul { display: block; position: static; box-shadow: none; padding: 0 0 0 1rem; }
    .site-nav .nav-cta { margin: .5rem 0 0; text-align: center; }
    .doc-layout { grid-template-columns: 1fr; gap: 0; }
    .doc-nav { position: static; max-height: none; padding-top: 1rem; border-bottom: 1px solid var(--line); }
    .doc-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1rem; }
    .doc-nav a { border-left: 0; border-bottom: 2px solid transparent; }
    .doc-nav a.active { border-bottom-color: var(--brand); }
    .doc-nav .toc-title, .doc-nav .toc { display: none; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .hero { padding: 3.5rem 1rem 3rem; }
}
